diff --git a/config/kernel/kernel.config.i586-ipfire b/config/kernel/kernel.config.i586-ipfire index 307e003bf..808c26260 100644 --- a/config/kernel/kernel.config.i586-ipfire +++ b/config/kernel/kernel.config.i586-ipfire @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.27.31 -# Fri Aug 21 16:30:37 2009 +# Linux kernel version: 2.6.27.31-ipfire +# Mon Sep 7 20:55:55 2009 # # CONFIG_64BIT is not set CONFIG_X86_32=y @@ -3173,8 +3173,24 @@ CONFIG_CIFS_XATTR=y # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +CONFIG_EFI_PARTITION=y +# CONFIG_SYSV68_PARTITION is not set CONFIG_NLS=y CONFIG_NLS_DEFAULT="cp850" # CONFIG_NLS_CODEPAGE_437 is not set diff --git a/config/kernel/kernel.config.i586-ipfire-xen b/config/kernel/kernel.config.i586-ipfire-xen index 6a4cfcff9..5ae27c2c4 100644 --- a/config/kernel/kernel.config.i586-ipfire-xen +++ b/config/kernel/kernel.config.i586-ipfire-xen @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.27.25-ipfire-xen -# Sun Aug 9 16:17:27 2009 +# Linux kernel version: 2.6.27.31 +# Mon Sep 7 10:05:41 2009 # # CONFIG_64BIT is not set CONFIG_X86_32=y @@ -252,6 +252,7 @@ CONFIG_RESOURCES_64BIT=y CONFIG_ZONE_DMA_FLAG=1 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_HIGHPTE is not set CONFIG_MTRR=y # CONFIG_X86_PAT is not set @@ -926,7 +927,6 @@ CONFIG_SONY_LAPTOP=m # CONFIG_SONYPI_COMPAT is not set CONFIG_THINKPAD_ACPI=m # CONFIG_THINKPAD_ACPI_DEBUG is not set -CONFIG_THINKPAD_ACPI_BAY=y CONFIG_THINKPAD_ACPI_VIDEO=y CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y CONFIG_INTEL_MENLOW=m @@ -2852,6 +2852,7 @@ CONFIG_XEN_SMPBOOT=y CONFIG_XEN_DEVMEM=y CONFIG_XEN_BALLOON=y CONFIG_XEN_SCRUB_PAGES=y +# CONFIG_STAGING is not set # # Firmware Drivers @@ -3023,8 +3024,24 @@ CONFIG_CIFS_XATTR=y # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +CONFIG_EFI_PARTITION=y +# CONFIG_SYSV68_PARTITION is not set CONFIG_NLS=y CONFIG_NLS_DEFAULT="cp850" # CONFIG_NLS_CODEPAGE_437 is not set diff --git a/config/rootfiles/common/openswan b/config/rootfiles/common/openswan index 8f4f92627..378792a41 100644 --- a/config/rootfiles/common/openswan +++ b/config/rootfiles/common/openswan @@ -5,13 +5,14 @@ etc/ipsec.d/cacerts etc/ipsec.d/certs etc/ipsec.d/crls #etc/ipsec.d/examples -#etc/ipsec.d/examples/l2tp-cert-orgWIN2KXP.conf +#etc/ipsec.d/examples/hub-spoke.conf +#etc/ipsec.d/examples/ipv6.conf #etc/ipsec.d/examples/l2tp-cert.conf -#etc/ipsec.d/examples/l2tp-psk-orgWIN2KXP.conf #etc/ipsec.d/examples/l2tp-psk.conf #etc/ipsec.d/examples/linux-linux.conf -#etc/ipsec.d/examples/no_oe.conf +#etc/ipsec.d/examples/oe-exclude-dns.conf #etc/ipsec.d/examples/sysctl.conf +#etc/ipsec.d/examples/xauth.conf etc/ipsec.d/ocspcerts etc/ipsec.d/policies #etc/ipsec.d/policies/block @@ -43,21 +44,24 @@ usr/lib/ipsec #usr/lib/ipsec/_realsetup #usr/lib/ipsec/_secretcensor #usr/lib/ipsec/_startklips +#usr/lib/ipsec/_startklips.old +#usr/lib/ipsec/_startnetkey #usr/lib/ipsec/_updown -#usr/lib/ipsec/_updown_x509 -#usr/libexec +#usr/lib/ipsec/_updown.klips +#usr/lib/ipsec/_updown.klips.old +#usr/lib/ipsec/_updown.klips~ +#usr/lib/ipsec/_updown.mast +#usr/lib/ipsec/_updown.mast.old +#usr/lib/ipsec/_updown.netkey usr/libexec/ipsec #usr/libexec/ipsec/_pluto_adns +#usr/libexec/ipsec/addconn #usr/libexec/ipsec/auto #usr/libexec/ipsec/barf -#usr/libexec/ipsec/calcgoo #usr/libexec/ipsec/eroute #usr/libexec/ipsec/ikeping #usr/libexec/ipsec/klipsdebug -#usr/libexec/ipsec/livetest #usr/libexec/ipsec/look -#usr/libexec/ipsec/mailkey -#usr/libexec/ipsec/manual #usr/libexec/ipsec/newhostkey #usr/libexec/ipsec/pf_key #usr/libexec/ipsec/pluto @@ -67,6 +71,7 @@ usr/libexec/ipsec #usr/libexec/ipsec/setup #usr/libexec/ipsec/showdefaults #usr/libexec/ipsec/showhostkey +#usr/libexec/ipsec/showpolicy #usr/libexec/ipsec/spi #usr/libexec/ipsec/spigrp #usr/libexec/ipsec/tncfg @@ -89,7 +94,6 @@ usr/libexec/ipsec #usr/man/man3/ipsec_bitstomask.3 #usr/man/man3/ipsec_broadcastof.3 #usr/man/man3/ipsec_copyright_notice.3 -#usr/man/man3/ipsec_datatot.3 #usr/man/man3/ipsec_goodmask.3 #usr/man/man3/ipsec_hostof.3 #usr/man/man3/ipsec_initaddr.3 @@ -128,16 +132,13 @@ usr/libexec/ipsec #usr/man/man3/ipsec_ttosa.3 #usr/man/man3/ipsec_ttosubnet.3 #usr/man/man3/ipsec_ttoul.3 -#usr/man/man3/ipsec_ultoa.3 -#usr/man/man3/ipsec_ultot.3 #usr/man/man3/ipsec_unspecaddr.3 #usr/man/man3/ipsec_version.3 #usr/man/man3/ipsec_version_code.3 #usr/man/man3/ipsec_version_string.3 -#usr/man/man5/ipsec.conf.5 -#usr/man/man5/ipsec.secrets.5 #usr/man/man5/ipsec_eroute.5 #usr/man/man5/ipsec_klipsdebug.5 +#usr/man/man5/ipsec_showpolicy.8 #usr/man/man5/ipsec_spi.5 #usr/man/man5/ipsec_spigrp.5 #usr/man/man5/ipsec_tncfg.5 @@ -146,7 +147,6 @@ usr/libexec/ipsec #usr/man/man5/ipsec_version.5 #usr/man/man5/pf_key.5 #usr/man/man8/ipsec.8 -#usr/man/man8/ipsec__confread.8 #usr/man/man8/ipsec__copyright.8 #usr/man/man8/ipsec__include.8 #usr/man/man8/ipsec__keycensor.8 @@ -155,27 +155,27 @@ usr/libexec/ipsec #usr/man/man8/ipsec__realsetup.8 #usr/man/man8/ipsec__secretcensor.8 #usr/man/man8/ipsec__startklips.8 +#usr/man/man8/ipsec__startnetkey.8 #usr/man/man8/ipsec__updown.8 -#usr/man/man8/ipsec__updown_x509.8 +#usr/man/man8/ipsec__updown.klips.8 +#usr/man/man8/ipsec__updown.mast.8 +#usr/man/man8/ipsec__updown.netkey.8 +#usr/man/man8/ipsec_addconn.8 #usr/man/man8/ipsec_auto.8 #usr/man/man8/ipsec_barf.8 -#usr/man/man8/ipsec_calcgoo.8 #usr/man/man8/ipsec_eroute.8 #usr/man/man8/ipsec_ikeping.8 #usr/man/man8/ipsec_klipsdebug.8 -#usr/man/man8/ipsec_livetest.8 #usr/man/man8/ipsec_look.8 -#usr/man/man8/ipsec_mailkey.8 -#usr/man/man8/ipsec_manual.8 #usr/man/man8/ipsec_newhostkey.8 #usr/man/man8/ipsec_pf_key.8 -#usr/man/man8/ipsec_pluto.8 #usr/man/man8/ipsec_ranbits.8 #usr/man/man8/ipsec_rsasigkey.8 #usr/man/man8/ipsec_secrets.8 #usr/man/man8/ipsec_setup.8 #usr/man/man8/ipsec_showdefaults.8 #usr/man/man8/ipsec_showhostkey.8 +#usr/man/man8/ipsec_showpolicy.8 #usr/man/man8/ipsec_spi.8 #usr/man/man8/ipsec_spigrp.8 #usr/man/man8/ipsec_tncfg.8 @@ -185,7 +185,6 @@ usr/sbin/ipsec #usr/share/doc/openswan/index.html #usr/share/doc/openswan/ipsec.8.html #usr/share/doc/openswan/ipsec.conf-sample -#usr/share/doc/openswan/ipsec.conf.5.html #usr/share/doc/openswan/ipsec.secrets.5.html #usr/share/doc/openswan/ipsec__confread.8.html #usr/share/doc/openswan/ipsec__copyright.8.html @@ -196,8 +195,12 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec__realsetup.8.html #usr/share/doc/openswan/ipsec__secretcensor.8.html #usr/share/doc/openswan/ipsec__startklips.8.html +#usr/share/doc/openswan/ipsec__startnetkey.8.html #usr/share/doc/openswan/ipsec__updown.8.html -#usr/share/doc/openswan/ipsec__updown_x509.8.html +#usr/share/doc/openswan/ipsec__updown.klips.8.html +#usr/share/doc/openswan/ipsec__updown.mast.8.html +#usr/share/doc/openswan/ipsec__updown.netkey.8.html +#usr/share/doc/openswan/ipsec_addconn.8.html #usr/share/doc/openswan/ipsec_addrbytesof.3.html #usr/share/doc/openswan/ipsec_addrbytesptr.3.html #usr/share/doc/openswan/ipsec_addrcmp.3.html @@ -216,9 +219,7 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_barf.8.html #usr/share/doc/openswan/ipsec_bitstomask.3.html #usr/share/doc/openswan/ipsec_broadcastof.3.html -#usr/share/doc/openswan/ipsec_calcgoo.8.html #usr/share/doc/openswan/ipsec_copyright_notice.3.html -#usr/share/doc/openswan/ipsec_datatot.3.html #usr/share/doc/openswan/ipsec_eroute.5.html #usr/share/doc/openswan/ipsec_eroute.8.html #usr/share/doc/openswan/ipsec_goodmask.3.html @@ -256,6 +257,7 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_ranbits.8.html #usr/share/doc/openswan/ipsec_rangetoa.3.html #usr/share/doc/openswan/ipsec_rangetosubnet.3.html +#usr/share/doc/openswan/ipsec_readwriteconf.8.html #usr/share/doc/openswan/ipsec_rsasigkey.8.html #usr/share/doc/openswan/ipsec_sameaddr.3.html #usr/share/doc/openswan/ipsec_sameaddrtype.3.html @@ -264,7 +266,7 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_samesubnettype.3.html #usr/share/doc/openswan/ipsec_satot.3.html #usr/share/doc/openswan/ipsec_secrets.8.html -#usr/share/doc/openswan/ipsec_send-pr.8.html +#usr/share/doc/openswan/ipsec_set_policy.3.html #usr/share/doc/openswan/ipsec_setportof.3.html #usr/share/doc/openswan/ipsec_setup.8.html #usr/share/doc/openswan/ipsec_showdefaults.8.html @@ -276,8 +278,7 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_spi.8.html #usr/share/doc/openswan/ipsec_spigrp.5.html #usr/share/doc/openswan/ipsec_spigrp.8.html -#usr/share/doc/openswan/ipsec_splitkeytoid.3.html -#usr/share/doc/openswan/ipsec_starter.8.html +#usr/share/doc/openswan/ipsec_strerror.3.html #usr/share/doc/openswan/ipsec_subnetinsubnet.3.html #usr/share/doc/openswan/ipsec_subnetishost.3.html #usr/share/doc/openswan/ipsec_subnetof.3.html @@ -294,8 +295,6 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_ttosa.3.html #usr/share/doc/openswan/ipsec_ttosubnet.3.html #usr/share/doc/openswan/ipsec_ttoul.3.html -#usr/share/doc/openswan/ipsec_ultoa.3.html -#usr/share/doc/openswan/ipsec_ultot.3.html #usr/share/doc/openswan/ipsec_unspecaddr.3.html #usr/share/doc/openswan/ipsec_verify.8.html #usr/share/doc/openswan/ipsec_version.3.html @@ -303,34 +302,3 @@ usr/sbin/ipsec #usr/share/doc/openswan/ipsec_version_code.3.html #usr/share/doc/openswan/ipsec_version_string.3.html var/run/pluto -#etc/ipsec.d/examples/xauth.conf -#etc/rc.d/init.d/setup -#usr/lib/ipsec/_startklips.old -#usr/lib/ipsec/_startnetkey -#usr/lib/ipsec/_updown.klips -#usr/lib/ipsec/_updown.klips.old -#usr/lib/ipsec/_updown.klips~ -#usr/lib/ipsec/_updown.mast -#usr/lib/ipsec/_updown.mast.old -#usr/lib/ipsec/_updown.netkey -#usr/libexec/ipsec/addconn -#usr/libexec/ipsec/lwdnsq -#usr/libexec/ipsec/showpolicy -#usr/man/man5/ipsec_showpolicy.8 -#usr/man/man8/ipsec__startnetkey.8 -#usr/man/man8/ipsec__updown.klips.8 -#usr/man/man8/ipsec__updown.mast.8 -#usr/man/man8/ipsec__updown.netkey.8 -#usr/man/man8/ipsec_addconn.8 -#usr/man/man8/ipsec_lwdnsq.8 -#usr/man/man8/ipsec_showpolicy.8 -#usr/share/doc/openswan/ipsec__startnetkey.8.html -#usr/share/doc/openswan/ipsec__updown.bsdkame.8.html -#usr/share/doc/openswan/ipsec__updown.klips.8.html -#usr/share/doc/openswan/ipsec__updown.mast.8.html -#usr/share/doc/openswan/ipsec__updown.netkey.8.html -#usr/share/doc/openswan/ipsec_addconn.8.html -#usr/share/doc/openswan/ipsec_readwriteconf.8.html -#usr/share/doc/openswan/ipsec_set_policy.3.html -#usr/share/doc/openswan/ipsec_strerror.3.html -#etc/ipsec.d/examples/ipv6.conf diff --git a/config/rootfiles/core/31/filelists/files b/config/rootfiles/core/31/filelists/files index 17a477c22..ab5c221b9 100644 --- a/config/rootfiles/core/31/filelists/files +++ b/config/rootfiles/core/31/filelists/files @@ -3,3 +3,8 @@ srv/web/ipfire/cgi-bin/urlfilter.cgi etc/system-release boot/grub/grub.conf etc/ppp/ip-up +srv/web/ipfire/cgi-bin/mac.cgi +srv/web/ipfire/cgi-bin/dns.cgi +var/ipfire/langs/de.pl +var/ipfire/langs/en.pl +srv/web/ipfire/cgi-bin/backup.cgi diff --git a/config/rootfiles/core/31/update.sh b/config/rootfiles/core/31/update.sh index 1c9c9a129..1780a1325 100644 --- a/config/rootfiles/core/31/update.sh +++ b/config/rootfiles/core/31/update.sh @@ -54,7 +54,8 @@ rm -rf /boot/System.map-* rm -rf /boot/config-* rm -rf /boot/ipfirerd-* rm -rf /boot/vmlinuz-* -rm -rf /lib/modules/ +# Don't remove old xen modules. Kernel may stored outside. +rm -rf /lib/modules/*-ipfire # # Backup grub.conf # @@ -115,7 +116,7 @@ grub-install --no-floppy ${ROOT::`expr length $ROOT`-1} --recheck # # Rebuild Language # -#perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" +perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" # # Add some entries to openvpn config # diff --git a/config/rootfiles/packages/linux-xen-disabled b/config/rootfiles/packages/linux-xen similarity index 89% rename from config/rootfiles/packages/linux-xen-disabled rename to config/rootfiles/packages/linux-xen index 05c434206..f4be938f9 100644 --- a/config/rootfiles/packages/linux-xen-disabled +++ b/config/rootfiles/packages/linux-xen @@ -3,75 +3,76 @@ boot/System.map-ipfire-xen boot/config-KVER-ipfire-xen boot/vmlinuz-KVER-ipfire-xen boot/vmlinuz-ipfire-xen -#lib/firmware/atmsar11.fw -#lib/firmware/cpia2 -#lib/firmware/cpia2/stv0672_vp4.bin -#lib/firmware/dabusb -#lib/firmware/dabusb/bitstream.bin -#lib/firmware/dabusb/firmware.fw -#lib/firmware/dsp56k -#lib/firmware/dsp56k/bootstrap.bin -#lib/firmware/edgeport -#lib/firmware/edgeport/boot.fw -#lib/firmware/edgeport/boot2.fw -#lib/firmware/edgeport/down.fw -#lib/firmware/edgeport/down2.fw -#lib/firmware/edgeport/down3.bin -#lib/firmware/emi26 -#lib/firmware/emi26/bitstream.fw -#lib/firmware/emi26/firmware.fw -#lib/firmware/emi26/loader.fw -#lib/firmware/emi62 -#lib/firmware/emi62/bitstream.fw -#lib/firmware/emi62/loader.fw -#lib/firmware/emi62/midi.fw -#lib/firmware/emi62/spdif.fw -#lib/firmware/ess -#lib/firmware/ess/maestro3_assp_kernel.fw -#lib/firmware/ess/maestro3_assp_minisrc.fw -#lib/firmware/intelliport2.bin -#lib/firmware/kaweth -#lib/firmware/kaweth/new_code.bin -#lib/firmware/kaweth/new_code_fix.bin -#lib/firmware/kaweth/trigger_code.bin -#lib/firmware/kaweth/trigger_code_fix.bin -#lib/firmware/keyspan -#lib/firmware/keyspan/mpr.fw -#lib/firmware/keyspan/usa18x.fw -#lib/firmware/keyspan/usa19.fw -#lib/firmware/keyspan/usa19qi.fw -#lib/firmware/keyspan/usa19qw.fw -#lib/firmware/keyspan/usa19w.fw -#lib/firmware/keyspan/usa28.fw -#lib/firmware/keyspan/usa28x.fw -#lib/firmware/keyspan/usa28xa.fw -#lib/firmware/keyspan/usa28xb.fw -#lib/firmware/keyspan/usa49w.fw -#lib/firmware/keyspan/usa49wlc.fw -#lib/firmware/keyspan_pda -#lib/firmware/keyspan_pda/keyspan_pda.fw -#lib/firmware/keyspan_pda/xircom_pgs.fw -#lib/firmware/korg -#lib/firmware/korg/k1212.dsp -#lib/firmware/sb16 -#lib/firmware/sb16/alaw_main.csp -#lib/firmware/sb16/ima_adpcm_capture.csp -#lib/firmware/sb16/ima_adpcm_init.csp -#lib/firmware/sb16/ima_adpcm_playback.csp -#lib/firmware/sb16/mulaw_main.csp -#lib/firmware/ti_3410.fw -#lib/firmware/ti_5052.fw -#lib/firmware/tr_smctr.bin -#lib/firmware/ttusb-budget -#lib/firmware/ttusb-budget/dspbootcode.bin -#lib/firmware/vicam -#lib/firmware/vicam/firmware.fw -#lib/firmware/whiteheat.fw -#lib/firmware/whiteheat_loader.fw -#lib/firmware/yamaha -#lib/firmware/yamaha/ds1_ctrl.fw -#lib/firmware/yamaha/ds1_dsp.fw -#lib/firmware/yamaha/ds1e_ctrl.fw +#lib/firmware/KVER-ipfire-xen +#lib/firmware/KVER-ipfire-xen/atmsar11.fw +#lib/firmware/KVER-ipfire-xen/cpia2 +#lib/firmware/KVER-ipfire-xen/cpia2/stv0672_vp4.bin +#lib/firmware/KVER-ipfire-xen/dabusb +#lib/firmware/KVER-ipfire-xen/dabusb/bitstream.bin +#lib/firmware/KVER-ipfire-xen/dabusb/firmware.fw +#lib/firmware/KVER-ipfire-xen/dsp56k +#lib/firmware/KVER-ipfire-xen/dsp56k/bootstrap.bin +#lib/firmware/KVER-ipfire-xen/edgeport +#lib/firmware/KVER-ipfire-xen/edgeport/boot.fw +#lib/firmware/KVER-ipfire-xen/edgeport/boot2.fw +#lib/firmware/KVER-ipfire-xen/edgeport/down.fw +#lib/firmware/KVER-ipfire-xen/edgeport/down2.fw +#lib/firmware/KVER-ipfire-xen/edgeport/down3.bin +#lib/firmware/KVER-ipfire-xen/emi26 +#lib/firmware/KVER-ipfire-xen/emi26/bitstream.fw +#lib/firmware/KVER-ipfire-xen/emi26/firmware.fw +#lib/firmware/KVER-ipfire-xen/emi26/loader.fw +#lib/firmware/KVER-ipfire-xen/emi62 +#lib/firmware/KVER-ipfire-xen/emi62/bitstream.fw +#lib/firmware/KVER-ipfire-xen/emi62/loader.fw +#lib/firmware/KVER-ipfire-xen/emi62/midi.fw +#lib/firmware/KVER-ipfire-xen/emi62/spdif.fw +#lib/firmware/KVER-ipfire-xen/ess +#lib/firmware/KVER-ipfire-xen/ess/maestro3_assp_kernel.fw +#lib/firmware/KVER-ipfire-xen/ess/maestro3_assp_minisrc.fw +#lib/firmware/KVER-ipfire-xen/intelliport2.bin +#lib/firmware/KVER-ipfire-xen/kaweth +#lib/firmware/KVER-ipfire-xen/kaweth/new_code.bin +#lib/firmware/KVER-ipfire-xen/kaweth/new_code_fix.bin +#lib/firmware/KVER-ipfire-xen/kaweth/trigger_code.bin +#lib/firmware/KVER-ipfire-xen/kaweth/trigger_code_fix.bin +#lib/firmware/KVER-ipfire-xen/keyspan +#lib/firmware/KVER-ipfire-xen/keyspan/mpr.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa18x.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa19.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa19qi.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa19qw.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa19w.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa28.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa28x.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa28xa.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa28xb.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa49w.fw +#lib/firmware/KVER-ipfire-xen/keyspan/usa49wlc.fw +#lib/firmware/KVER-ipfire-xen/keyspan_pda +#lib/firmware/KVER-ipfire-xen/keyspan_pda/keyspan_pda.fw +#lib/firmware/KVER-ipfire-xen/keyspan_pda/xircom_pgs.fw +#lib/firmware/KVER-ipfire-xen/korg +#lib/firmware/KVER-ipfire-xen/korg/k1212.dsp +#lib/firmware/KVER-ipfire-xen/sb16 +#lib/firmware/KVER-ipfire-xen/sb16/alaw_main.csp +#lib/firmware/KVER-ipfire-xen/sb16/ima_adpcm_capture.csp +#lib/firmware/KVER-ipfire-xen/sb16/ima_adpcm_init.csp +#lib/firmware/KVER-ipfire-xen/sb16/ima_adpcm_playback.csp +#lib/firmware/KVER-ipfire-xen/sb16/mulaw_main.csp +#lib/firmware/KVER-ipfire-xen/ti_3410.fw +#lib/firmware/KVER-ipfire-xen/ti_5052.fw +#lib/firmware/KVER-ipfire-xen/tr_smctr.bin +#lib/firmware/KVER-ipfire-xen/ttusb-budget +#lib/firmware/KVER-ipfire-xen/ttusb-budget/dspbootcode.bin +#lib/firmware/KVER-ipfire-xen/vicam +#lib/firmware/KVER-ipfire-xen/vicam/firmware.fw +#lib/firmware/KVER-ipfire-xen/whiteheat.fw +#lib/firmware/KVER-ipfire-xen/whiteheat_loader.fw +#lib/firmware/KVER-ipfire-xen/yamaha +#lib/firmware/KVER-ipfire-xen/yamaha/ds1_ctrl.fw +#lib/firmware/KVER-ipfire-xen/yamaha/ds1_dsp.fw +#lib/firmware/KVER-ipfire-xen/yamaha/ds1e_ctrl.fw #lib/modules lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/build @@ -142,9 +143,9 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/ac.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/asus_acpi.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/battery.ko -#lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/bay.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/button.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/container.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/dock.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/fan.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/pci_slot.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/acpi/processor.ko @@ -158,6 +159,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/ahci.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/ata_generic.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/ata_piix.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ata/libata.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/pata_acpi.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/pata_ali.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ata/pata_amd.ko @@ -265,10 +267,14 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/char/agp/sis-agp.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/agp/sworks-agp.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/agp/via-agp.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/cs5535_gpio.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/hangcheck-timer.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random #lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random/amd-rng.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random/geode-rng.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random/intel-rng.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random/rng-core.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/hw_random/via-rng.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/i8k.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/ipmi #lib/modules/KVER-ipfire-xen/kernel/drivers/char/ipmi/ipmi_devintf.ko @@ -276,11 +282,14 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/char/ipmi/ipmi_poweroff.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/ipmi/ipmi_si.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/ipmi/ipmi_watchdog.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/lp.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/nozomi.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/nvram.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/pcmcia #lib/modules/KVER-ipfire-xen/kernel/drivers/char/pcmcia/ipwireless #lib/modules/KVER-ipfire-xen/kernel/drivers/char/pcmcia/ipwireless/ipwireless.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/pcmcia/synclink_cs.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/char/ppdev.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/char/toshiba.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/clocksource #lib/modules/KVER-ipfire-xen/kernel/drivers/clocksource/scx200_hrt.ko @@ -291,6 +300,15 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/crypto/hifn_795x.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/crypto/padlock-aes.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/crypto/padlock-sha.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/dca +#lib/modules/KVER-ipfire-xen/kernel/drivers/dca/dca.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/dma +#lib/modules/KVER-ipfire-xen/kernel/drivers/dma/dmatest.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/dma/ioatdma.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/firewire +#lib/modules/KVER-ipfire-xen/kernel/drivers/firewire/firewire-core.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/firewire/firewire-ohci.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/firewire/firewire-sbp2.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/firmware #lib/modules/KVER-ipfire-xen/kernel/drivers/firmware/iscsi_ibft.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/gpu @@ -316,6 +334,8 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/gpu/drm/tdfx/tdfx.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/gpu/drm/via #lib/modules/KVER-ipfire-xen/kernel/drivers/gpu/drm/via/via.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/gpu/drm/via_chrome9 +#lib/modules/KVER-ipfire-xen/kernel/drivers/gpu/drm/via_chrome9/via_chrome9.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/hid #lib/modules/KVER-ipfire-xen/kernel/drivers/hid/usbhid #lib/modules/KVER-ipfire-xen/kernel/drivers/hid/usbhid/usbhid.ko @@ -469,6 +489,14 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/ide/pci/triflex.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ide/pci/trm290.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ide/pci/via82cxxx.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394 +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/eth1394.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/ieee1394.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/ohci1394.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/pcilynx.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/raw1394.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/sbp2.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/ieee1394/video1394.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/input #lib/modules/KVER-ipfire-xen/kernel/drivers/input/input-polldev.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/input/keyboard @@ -484,6 +512,25 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/input/misc/keyspan_remote.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/input/misc/powermate.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/input/misc/yealink.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/capi +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/capi/capi.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/capi/kernelcapi.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/avm_cs.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/b1.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/b1dma.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/b1pci.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/c4.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/avm/t1pci.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon/diva_idi.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon/diva_mnt.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon/divacapi.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon/divadidd.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/isdn/hardware/eicon/divas.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/leds #lib/modules/KVER-ipfire-xen/kernel/drivers/leds/led-class.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/leds/leds-clevo-mail.ko @@ -495,11 +542,18 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/md #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-crypt.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-delay.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-least-pending.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-log.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-memcache.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-message.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-mirror.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-mod.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-multipath.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-queue-length.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-raid45.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-regions.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-round-robin.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-service-time.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-snapshot.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/dm-zero.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/linear.ko @@ -509,6 +563,22 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/md/raid1.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/raid10.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/md/raid456.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/media +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/dvb +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/dvb/dvb-core +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/dvb/dvb-core/dvb-core.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/video +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/video/compat_ioctl32.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/video/v4l2-common.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/video/v4l2-int-device.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/media/video/videodev.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/core +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/core/memstick.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/core/mspro_block.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/host +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/host/jmb38x_ms.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/memstick/host/tifm_ms.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/message #lib/modules/KVER-ipfire-xen/kernel/drivers/message/fusion #lib/modules/KVER-ipfire-xen/kernel/drivers/message/fusion/mptbase.ko @@ -576,10 +646,15 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/net/atp.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/b44.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/bnx2.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/bnx2x.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/bonding #lib/modules/KVER-ipfire-xen/kernel/drivers/net/bonding/bonding.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/bsd_comp.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/cassini.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/chelsio +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/chelsio/cxgb.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/cxgb3 +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/cxgb3/cxgb3.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/de600.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/de620.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/dl2k.ko @@ -617,10 +692,19 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/net/irda/via-ircc.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/irda/vlsi_ir.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/irda/w83977af_ir.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/ixgb +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/ixgb/ixgb.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/ixgbe +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/ixgbe/ixgbe.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/macvlan.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/mii.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/myri10ge +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/myri10ge/myri10ge.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/natsemi.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/ne2k-pci.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/netxen +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/netxen/netxen_nic.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/niu.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/ns83820.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/pcmcia #lib/modules/KVER-ipfire-xen/kernel/drivers/net/pcmcia/3c574_cs.ko @@ -656,8 +740,13 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/net/qla3xxx.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/r6040.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/r8169.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/s2io.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sb1000.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sc92031.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/sfc +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/sfc/sfc.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/sfc/sfc_resource +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/sfc/sfc_resource/sfc_resource.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sis190.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sis900.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/skge.ko @@ -669,6 +758,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sungem.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sungem_phy.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/sunhme.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/net/tehuti.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/tg3.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/tlan.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/net/tulip @@ -859,6 +949,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/qla4xxx #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/qla4xxx/qla4xxx.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/qlogicfas408.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/scsi_mod.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/scsi_transport_fc.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/scsi_transport_iscsi.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/scsi_transport_sas.ko @@ -873,6 +964,10 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/sym53c8xx_2 #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/sym53c8xx_2/sym53c8xx.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/scsi/tmscsim.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/serial +#lib/modules/KVER-ipfire-xen/kernel/drivers/serial/jsm +#lib/modules/KVER-ipfire-xen/kernel/drivers/serial/jsm/jsm.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/serial/serial_core.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/ssb #lib/modules/KVER-ipfire-xen/kernel/drivers/ssb/ssb.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/uio @@ -1060,39 +1155,54 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/drivers/xen/scsiback/xen-scsibk.ko #lib/modules/KVER-ipfire-xen/kernel/drivers/xen/scsifront #lib/modules/KVER-ipfire-xen/kernel/drivers/xen/scsifront/xenscsi.ko -#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netfront -#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netfront/sfc_netfront.ko -#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netutil -#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netutil/sfc_netutil.ko +#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netback +#lib/modules/KVER-ipfire-xen/kernel/drivers/xen/sfc_netback/sfc_netback.ko #lib/modules/KVER-ipfire-xen/kernel/fs +#lib/modules/KVER-ipfire-xen/kernel/fs/autofs +#lib/modules/KVER-ipfire-xen/kernel/fs/autofs/autofs.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/autofs4 +#lib/modules/KVER-ipfire-xen/kernel/fs/autofs4/autofs4.ko #lib/modules/KVER-ipfire-xen/kernel/fs/cifs #lib/modules/KVER-ipfire-xen/kernel/fs/cifs/cifs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/ecryptfs #lib/modules/KVER-ipfire-xen/kernel/fs/ecryptfs/ecryptfs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/exportfs #lib/modules/KVER-ipfire-xen/kernel/fs/exportfs/exportfs.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/ext2 +#lib/modules/KVER-ipfire-xen/kernel/fs/ext2/ext2.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/ext3 +#lib/modules/KVER-ipfire-xen/kernel/fs/ext3/ext3.ko #lib/modules/KVER-ipfire-xen/kernel/fs/fat #lib/modules/KVER-ipfire-xen/kernel/fs/fat/fat.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/fuse +#lib/modules/KVER-ipfire-xen/kernel/fs/fuse/fuse.ko #lib/modules/KVER-ipfire-xen/kernel/fs/isofs #lib/modules/KVER-ipfire-xen/kernel/fs/isofs/isofs.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/jbd +#lib/modules/KVER-ipfire-xen/kernel/fs/jbd/jbd.ko #lib/modules/KVER-ipfire-xen/kernel/fs/jffs2 #lib/modules/KVER-ipfire-xen/kernel/fs/jffs2/jffs2.ko #lib/modules/KVER-ipfire-xen/kernel/fs/jfs #lib/modules/KVER-ipfire-xen/kernel/fs/jfs/jfs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/lockd #lib/modules/KVER-ipfire-xen/kernel/fs/lockd/lockd.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/mbcache.ko #lib/modules/KVER-ipfire-xen/kernel/fs/nfs #lib/modules/KVER-ipfire-xen/kernel/fs/nfs/nfs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/nfsd #lib/modules/KVER-ipfire-xen/kernel/fs/nfsd/nfsd.ko -#lib/modules/KVER-ipfire-xen/kernel/fs/reiser4 -#lib/modules/KVER-ipfire-xen/kernel/fs/reiser4/reiser4.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/quota_v1.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/quota_v2.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/reiserfs +#lib/modules/KVER-ipfire-xen/kernel/fs/reiserfs/reiserfs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/smbfs #lib/modules/KVER-ipfire-xen/kernel/fs/smbfs/smbfs.ko #lib/modules/KVER-ipfire-xen/kernel/fs/udf #lib/modules/KVER-ipfire-xen/kernel/fs/udf/udf.ko #lib/modules/KVER-ipfire-xen/kernel/fs/vfat #lib/modules/KVER-ipfire-xen/kernel/fs/vfat/vfat.ko +#lib/modules/KVER-ipfire-xen/kernel/fs/xfs +#lib/modules/KVER-ipfire-xen/kernel/fs/xfs/xfs.ko #lib/modules/KVER-ipfire-xen/kernel/lib #lib/modules/KVER-ipfire-xen/kernel/lib/crc-ccitt.ko #lib/modules/KVER-ipfire-xen/kernel/lib/crc-itu-t.ko @@ -1123,6 +1233,8 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/bluetooth.ko #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/bnep #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/bnep/bnep.ko +#lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/cmtp +#lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/cmtp/cmtp.ko #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/hidp #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/hidp/hidp.ko #lib/modules/KVER-ipfire-xen/kernel/net/bluetooth/l2cap.ko @@ -1186,6 +1298,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_ah.ko #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_ecn.ko #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_ipp2p.ko +#lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_ipv4options.ko #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_recent.ko #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/ipt_ttl.ko #lib/modules/KVER-ipfire-xen/kernel/net/ipv4/netfilter/iptable_filter.ko @@ -1251,6 +1364,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nf_conntrack_proto_udplite.ko #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nf_conntrack_sane.ko #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nf_conntrack_sip.ko +#lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nf_conntrack_slp.ko #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nf_conntrack_tftp.ko #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nfnetlink.ko #lib/modules/KVER-ipfire-xen/kernel/net/netfilter/nfnetlink_log.ko @@ -1332,6 +1446,7 @@ lib/modules/KVER-ipfire-xen #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_hfsc.ko #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_htb.ko #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_ingress.ko +#lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_multiq.ko #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_netem.ko #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_prio.ko #lib/modules/KVER-ipfire-xen/kernel/net/sched/sch_red.ko diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 1f695ad73..9f3f1c11e 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -44,6 +44,7 @@ * as86-0.16.17 * asterisk-1.4.18 * atl2-2.0.5-kmod-2.6.27.31-ipfire +* atl2-2.0.5-kmod-2.6.27.31-ipfire-xen * autoconf-2.59 * automake-1.9.6 * backup-ipfire @@ -69,6 +70,7 @@ * cmake-2.4.8 * collectd-4.5.3 * compat-wireless-2009-06-17-kmod-2.6.27.31-ipfire +* compat-wireless-2009-06-17-kmod-2.6.27.31-ipfire-xen * coreutils-5.96 * cpio-2.6 * cpufrequtils-005 @@ -84,6 +86,7 @@ * dnsmasq-2.47 * dosfstools-2.11 * e1000e-1.0.2.5-kmod-2.6.27.31-ipfire +* e1000e-1.0.2.5-kmod-2.6.27.31-ipfire-xen * e2fsprogs-1.39 * ebtables-v2.0.8-2 * ed-0.2 @@ -130,6 +133,7 @@ * hostapd-0.6.9 * hplip-2.7.10 * hso-1.9-kmod-2.6.27.31-ipfire +* hso-1.9-kmod-2.6.27.31-ipfire-xen * htop-0.8.1 * httpd-2.2.11 * hwdata @@ -154,6 +158,7 @@ * kbd-1.12 * klibc-1.5.14 * kqemu-1.4.0pre1-kmod-2.6.27.31-ipfire +* kqemu-1.4.0pre1-kmod-2.6.27.31-ipfire-xen * kudzu-1.2.64 * l7-protocols-2009-05-10 * lame-3.97 @@ -185,6 +190,7 @@ * libxml2-2.6.26 * libxslt-1.1.17 * linux-2.6.27.31-ipfire +* linux-2.6.27.31-ipfire-xen * linux-atm-2.4.1 * linux-libc-headers-2.6.12.0 * lm_sensors-3.0.3 @@ -195,8 +201,10 @@ * lzo-2.02 * m4-1.4.4 * mISDN.git-9bf7deaa4b8829ab8fbccb34529a17aab2ddea93-kmod-2.6.27.31-ipfire +* mISDN.git-9bf7deaa4b8829ab8fbccb34529a17aab2ddea93-kmod-2.6.27.31-ipfire-xen * mISDNuser.git-54928dec57bc846f2c2186f3640e69a053cd3641 * madwifi-hal-0.10.5.6-r4031-20090529-kmod-2.6.27.31-ipfire +* madwifi-hal-0.10.5.6-r4031-20090529-kmod-2.6.27.31-ipfire-xen * make-3.81 * man-db-2.4.3 * man-pages-2.34 @@ -242,8 +250,9 @@ * openmailadmin-1.0.0 * openssh-5.2p1 * openssl-0.9.8k -* openswan-2.6.22 -* openswan-2.6.22-kmod-2.6.27.31-ipfire +* openswan-2.6.23 +* openswan-2.6.23-kmod-2.6.27.31-ipfire +* openswan-2.6.23-kmod-2.6.27.31-ipfire-xen * openvpn-2.1_rc19 * p7zip_4.65 * pam_mysql-0.7RC1 @@ -319,6 +328,7 @@ * usbutils-0.72 * util-linux-2.12r * v4l-dvb-bff77ec33116-kmod-2.6.27.31-ipfire +* v4l-dvb-bff77ec33116-kmod-2.6.27.31-ipfire-xen * vdr-1.6.0 * vdradmin-am-3.6.4 * vim-7.0 diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi old mode 100644 new mode 100755 index c02056d8b..d160349ff --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -189,18 +189,18 @@ foreach (@backups){ chomp($_); my $Datei = "/var/ipfire/backup/".$_; my @Info = stat($Datei); -my $Size = $Info[7] / 1024; -$Size = sprintf("%02d", $Size); -print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB
"; +my $Size = $Info[7] / 1024 / 1024; +$Size = sprintf("%0.2f", $Size); +print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size MB
"; print "
"; } foreach (@backupisos){ chomp($_); my $Datei = "/var/tmp/backupiso/".$_; my @Info = stat($Datei); -my $Size = $Info[7] / 1024; -$Size = sprintf("%02d", $Size); -print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB
"; +my $Size = $Info[7] / 1024 / 1024; +$Size = sprintf("%0.2f", $Size); +print "$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size MB
"; print "
"; } print </dev/null 2>&1 &"); &Header::openbox('100%', 'left', $Lang::tr{'dns address recon'} ); print "$Lang::tr{'dns address done'}\n"; &Header::closebox(); } +if ($dnssettings{'ACTION'} eq $Lang::tr{'delete'}) { + system("cat /dev/null > ${General::swroot}/dns/settings &"); + &Header::openbox('100%', 'left', $Lang::tr{'dns address deleted'} ); + print "$Lang::tr{'dns address deleted txt'}\n"; + &Header::closebox(); +} + # DPC move error message to top so it is seen! if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); @@ -91,20 +98,75 @@ print < $Lang::tr{'dns new 0'} +END +; +if ($dnssettings{'ACTION'} eq $Lang::tr{'delete'}) { +print < +END +; +} else { +print < +END +; +} +print < $Lang::tr{'dns new 1'} +END +; +if ($dnssettings{'ACTION'} eq $Lang::tr{'delete'}) { +print < +END +; +} else { +print < +END +; +} +print <
+END +; +if ($dnssettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") { +print <      - + +      + +END +; +} elsif ($dnssettings{'ACTION'} eq $Lang::tr{'delete'}) { +print < +      + +END +; +} elsif ($dnssettings{'ACTION'} eq $Lang::tr{'save'}) { +print < +END +; +} else { +print < +      + +END +; +} +print < diff --git a/html/cgi-bin/mac.cgi b/html/cgi-bin/mac.cgi old mode 100644 new mode 100755 index 6261c5914..93767d00d --- a/html/cgi-bin/mac.cgi +++ b/html/cgi-bin/mac.cgi @@ -67,12 +67,26 @@ if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) { $errormessage = $Lang::tr{'mac address error not valid'}; } } -if ($macsettings{'RECONNECT'} eq $Lang::tr{'reconnect'}) { +if ($macsettings{'ACTION'} eq $Lang::tr{'reconnect'}) { system("/usr/local/bin/redctrl restart >/dev/null 2>&1 &"); &Header::openbox('100%', 'left', $Lang::tr{'mac address recon'} ); print "$Lang::tr{'mac address done'}\n"; &Header::closebox(); } +if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) { + system("cat /dev/null > ${General::swroot}/mac/settings &"); + &Header::openbox('100%', 'left', $Lang::tr{'mac address deleted'} ); + print "$Lang::tr{'mac address deleted txt'}\n"; + &Header::closebox(); +} +if ($macsettings{'ACTION'} eq $Lang::tr{'reboot'}) { + &General::log($Lang::tr{'rebooting ipfire'}); + system("/usr/local/bin/ipfirereboot boot"); + &Header::openbox('100%', 'left', $Lang::tr{'rebooting ipfire'} ); + print "  

"; + print ""; + &Header::closebox(); +} # DPC move error message to top so it is seen! if ($errormessage) { @@ -95,23 +109,69 @@ print < $Lang::tr{'mac new'}  +END +; +if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) { +print < +END +; +} else { +print < +END +; +} +print <
+END +; +if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) { +print <      - + +      + +END +; +} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") { +print < +      + +      + +END +; +} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'}) { +print < +END +; +} else { +print < +      + +END +; +} +print < + + + END ; - &Header::closebox(); print "\n"; diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 2851d603b..ee5743967 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -333,7 +333,6 @@ 'alt system' => 'System', 'alt vpn' => 'VPNs', 'and' => 'Und', -'apcupsd' => 'APCUPSD', 'apply' => 'Jetzt anwenden', 'april' => 'April', 'archive not exist' => 'Konfigurationsarchiv existiert nicht', @@ -642,6 +641,8 @@ 'dns header' => 'DNS Server Adressen zuweisen nur mit DHCP an red0', 'dns saved' => 'Erfolgreich gespeichert!', 'dns saved txt' => 'Die beiden eingegebenen DNS Server Adressen wurde erfolgreich gespeichert.
Um die Änderung wirksarm zu machen müssen Sie neustarten oder wiederverbinden!', +'dns address deleted' => 'Erfolgreich gelöscht! ', +'dns address deleted txt' => 'DNS Server Adressen wurden erfolgreich gelöscht. Änderungen werden jedoch erst nach einem Neustart oder einer Wiederverbindung übernommen.', 'dns error 1' => 'Die IP Adresse vom sekundären DNS Server ist nicht gültig, bitte überprüfen Sie Ihre Eingabe!
Die eingegebene primäre DNS Server Adresse ist jedoch gültig.', 'dns error 0' => 'Die IP Adresse vom primären DNS Server ist nicht gültig, bitte überprüfen Sie Ihre Eingabe!
Die eingegebene sekundären DNS Server Adresse ist jedoch gültig.
', 'dns error 01' => 'Die eingegebene IP Adresse des primären wie auch des sekundären DNS Servers sind nicht gültig, bitte überprüfen Sie Ihre Eingaben!', @@ -650,7 +651,7 @@ 'dns new 0' => 'Neue primäre DNS Server IP:', 'dns new 1' => 'Neue sekundäre DNS Server IP:', 'dns address recon' => 'Es wird neu Verbunden!', -'dns address done' => 'Die DNS-Server Adressen werden übernommen.', +'dns address done' => 'Die DNS-Server Adressen Einstellungen werden übernommen.', 'do not log this port list' => 'Verwerfe diese Port-Liste kurz bevor sie protokolliert werden (reduziert Protokollgröße)', 'dod' => 'Dial-on-Demand-Modus', 'dod for dns' => 'Dial-on-Demand für DNS:', @@ -1054,11 +1055,14 @@ 'mac address error not valid' => 'Keine gültige MAC-Adresse!', 'mac address error not 00' => 'MAC-Adresse muss mit 00 beginnen!', 'mac address saved' => 'Erfolgreich gespeichert!', -'mac address saved txt' => 'Die MAC-Adresse wurde erfolgreich gespeichert, Änderungen werden jedoch erst nach einem Neustart oder einer Wiederverbindung übernommen.', +'mac address saved txt' => 'Die MAC-Adresse wurde erfolgreich gespeichert. Änderungen werden jedoch erst nach einem Neustart oder einer Wiederverbindung übernommen.', +'mac address deleted' => 'Erfolgreich gelöscht! ', +'mac address deleted txt' => 'Mac Adresse wurde erfolgreich gelöscht. Änderungen werden jedoch erst nach einem Neustart übernommen.', 'mac address recon' => 'Es wird neu Verbunden!', -'mac address done' => 'Die MAC-Adresse wird übernommen', +'mac address done' => 'Die MAC-Adressen Einstellungen werden übernommen', 'mac desc' => 'Sie können an dieser Stelle die MAC-Adresse von red0 ändern. Die Adresse muss in hexadezimal (0-9,a-f) eingegeben werden, eine gültige Eingaben ist z.B. 00-01-02-0e-b8-d6 oder 00:01:02:0e:b8:d6.', 'mac new' => 'Neue MAC-Adresse:', +'mac new' => 'Neue MAC-Adresse:', 'magic packet send to:' => 'Sende WOL-Paket an', 'mailmethod' => 'Mail Methode', 'mailprogramm' => 'Mail Programm', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index f787f6d94..1fcae040b 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -338,7 +338,6 @@ 'alt vpn' => 'VPNs', 'and' => 'And', 'ansi t1.483' => 'TO BE REMOVED', -'apcupsd' => 'APCUPSD', 'apply' => 'Apply now', 'april' => 'April', 'archive not exist' => 'Configuration archive does not exist', @@ -667,7 +666,9 @@ 'dns title' => 'Domain Name System', 'dns header' => 'assign DNS server addresses only for DHCP on red0', 'dns saved' => 'Successfully saved!', -'dns saved txt' => 'The two entered DNS server addresses has been saved successfully.
You have to reboot or reconnect that the changes have effect!', +'dns saved txt' => 'The two entered DNS server addresses have been saved successfully.
You have to reboot or reconnect that the changes have effect!', +'dns address deleted' => 'Successfully deleted!', +'dns address deleted txt' => 'The DNS-Server addresses have been successfully deleted.
You have to reboot or reconnect that the changes have effect!', 'dns error 1' => 'The IP address of the secondary DNS server is not valid, please check your entries!
The entered primary DNS server address is valid.', 'dns error 0' => 'The IP address of the primary DNS server is not valid, please check your entries!
The entered secondary DNS server address is valid.', 'dns error 01' => 'The entered IP address of the primary and secondary DNS server are not valid, please check your entries!', @@ -676,7 +677,7 @@ 'dns new 0' => 'New primary DNS server IP:', 'dns new 1' => 'New secondary DNS server IP:', 'dns address recon' => 'Trying to reconnect!', -'dns address done' => 'The DNS-Server addresses are going to be saved.', +'dns address done' => 'The DNS-Server address settings are going to be saved.', 'do not log this port list' => 'Drop this port list just before they are logged (reduces log size)', 'dod' => 'Dial on Demand', 'dod for dns' => 'Dial on Demand for DNS:', @@ -1084,9 +1085,11 @@ 'mac address error not valid' => 'MAC addresse not valid!', 'mac address error not 00' => 'MAC addresse has to start with 00!', 'mac address saved' => 'Successfully saved!', -'mac address saved txt' => 'The MAC address has been successfully saved, but changes will take effect after reboot or reconnection.', +'mac address saved txt' => 'The MAC address has been successfully saved, but changes will only take effect after reboot or reconnection.', +'mac address deleted' => 'Successfully deleted!', +'mac address deleted txt' => 'The MAC address has been successfully deleted, but changes will only take effect after reboot.', 'mac address recon' => 'Trying to reconnect!', -'mac address done' => 'The MAC address will be saved.', +'mac address done' => 'The MAC address settings are going to be saved.', 'mac desc' => 'Here you are able to change the MAC address on red0. The address must be entered in hexadecimal (0-9,a-f), a valid entry is
e.g. 00-01-02-0e-b8-d6 or 00:01:02:0e:b8:d6.', 'mac new' => 'new MAC addresse:', 'magic packet send to:' => 'Magic packet send to:', diff --git a/lfs/openswan b/lfs/openswan index 11e35ef44..a72596deb 100644 --- a/lfs/openswan +++ b/lfs/openswan @@ -30,7 +30,7 @@ else VERSUFIX=ipfire endif -VER = 2.6.22 +VER = 2.6.23 THISAPP = openswan-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -51,7 +51,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 9a30009bade8a1b09fba27680c87cf72 +$(DL_FILE)_MD5 = c83053471e639bf3b97e3cf7796b7e83 install : $(TARGET) diff --git a/lfs/xen-image b/lfs/xen-image index 3b2199d53..bd21aac0b 100644 --- a/lfs/xen-image +++ b/lfs/xen-image @@ -79,6 +79,20 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) chroot $(MNThdd) /opt/pakfire/tmp/install.sh rm -rf $(MNThdd)/opt/pakfire/tmp/* + #Create grub menuentry for pygrub + mkdir $(MNThdd)/boot/grub + echo "title IPFire (XEN-Kernel)" > $(MNThdd)/boot/grub/grub.conf + echo " root(hd0,0)" >> $(MNThdd)/boot/grub/grub.conf + echo " kernel /vmlinuz-$(KVER)-ipfire-xen root=/dev/xvda1 rootdelay=10 panic=10 ro" \ + >> $(MNThdd)/boot/grub/grub.conf + echo " initrd /ipfirerd-$(KVER)-xen.img" >> $(MNThdd)/boot/grub/grub.conf + echo " savedefault 1" >> $(MNThdd)/boot/grub/grub.conf + ln -s grub.conf $(MNThdd)/boot/grub/menu.lst + + #Copy the meta-info of linux-xen package + cp -f /install/packages/meta-linux-xen $(MNThdd)/opt/pakfire/db/installed + cp -f /install/packages/meta-linux-xen $(MNThdd)/opt/pakfire/db/meta + #Set default configuration echo "LANGUAGE=en" >> $(MNThdd)/var/ipfire/main/settings echo "HOSTNAME=$(SNAME)" >> $(MNThdd)/var/ipfire/main/settings @@ -105,6 +119,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) chroot $(MNThdd) /sbin/mkinitcpio -g /boot/ipfirerd-$(KVER)-xen.img -k $(KVER)-ipfire-xen cp -f $(MNThdd)/etc/mkinitcpio.conf.org $(MNThdd)/etc/mkinitcpio.conf + # Create a script for rebuild-initrd and setup echo "#!/bin/bash" > $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup echo "/usr/local/sbin/setup /dev/null INSTALL" >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup diff --git a/make.sh b/make.sh index 2f69a4c92..8b6d8ea4d 100755 --- a/make.sh +++ b/make.sh @@ -338,17 +338,17 @@ buildipfire() { ipfiremake pptp ipfiremake unzip ipfiremake which -# ipfiremake linux XEN=1 -# ipfiremake atl2 XEN=1 -# ipfiremake hso XEN=1 -# ipfiremake e1000e XEN=1 -# ipfiremake kqemu XEN=1 -# ipfiremake v4l-dvb XEN=1 -# ipfiremake madwifi XEN=1 -## ipfiremake alsa XEN=1 KMOD=1 -# ipfiremake openswan XEN=1 KMOD=1 -# ipfiremake mISDN XEN=1 -# ipfiremake compat-wireless XEN=1 + ipfiremake linux XEN=1 + ipfiremake atl2 XEN=1 + ipfiremake hso XEN=1 + ipfiremake e1000e XEN=1 + ipfiremake kqemu XEN=1 + ipfiremake v4l-dvb XEN=1 + ipfiremake madwifi XEN=1 +# ipfiremake alsa XEN=1 KMOD=1 + ipfiremake openswan XEN=1 KMOD=1 + ipfiremake mISDN XEN=1 + ipfiremake compat-wireless XEN=1 ipfiremake linux ipfiremake atl2 ipfiremake hso @@ -713,13 +713,15 @@ buildpackages() { ipfirepackages -# # Check if there is a loop device for building in virtual environments -# if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then -# cp -f $BASEDIR/packages/linux-xen-*.ipfire $LFS/install/packages/ -# ipfiremake xen-image ED=$IPFVER -# rm -rf $LFS/install/packages/linux-xen-*.ipfire -# fi -# mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1 + # Check if there is a loop device for building in virtual environments + if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then + cp -f $BASEDIR/packages/linux-xen-*.ipfire $LFS/install/packages/ + cp -f $BASEDIR/packages/meta-linux-xen $LFS/install/packages/ + ipfiremake xen-image ED=$IPFVER + rm -rf $LFS/install/packages/linux-xen-*.ipfire + rm -rf $LFS/install/packages/meta-linux-xen + fi + mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1 # Cleanup stdumount diff --git a/src/misc-progs/smartctrl.c b/src/misc-progs/smartctrl.c index 945c279f5..a7491ee35 100644 --- a/src/misc-progs/smartctrl.c +++ b/src/misc-progs/smartctrl.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) { } - sprintf(command, "/tmp/hddshutdown-%s", argv[1]); + sprintf(command, "/var/run/hddshutdown-%s", argv[1]); FILE *fp = fopen(command,"r"); if( fp ) { fclose(fp); diff --git a/src/paks/linux25/install.sh b/src/paks/linux-xen/install.sh similarity index 79% rename from src/paks/linux25/install.sh rename to src/paks/linux-xen/install.sh index b50bc3392..38daf4027 100644 --- a/src/paks/linux25/install.sh +++ b/src/paks/linux-xen/install.sh @@ -24,7 +24,7 @@ . /opt/pakfire/lib/functions.sh extract_files # -KVER=2.6.25.18 +KVER=2.6.27.31 ROOT=`grep "root=" /boot/grub/grub.conf | cut -d"=" -f2 | cut -d" " -f1 | tail -n 1` MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1` # Nur den letzten Parameter verwenden @@ -37,26 +37,25 @@ let ENTRY=$_+1 # # backup grub.conf # -cp /boot/grub/grub.conf /boot/grub/grub-backup-$KVER.conf +cp /boot/grub/grub.conf /boot/grub/grub-backup-$KVER-xen.conf # # Add new Entry to grub.conf # echo "" >> /boot/grub/grub.conf -echo "title IPFire alternative Kernel:$KVER" >> /boot/grub/grub.conf +echo "title IPFire (XEN-Kernel)" >> /boot/grub/grub.conf echo " root (hd0,0)" >> /boot/grub/grub.conf -echo " kernel /vmlinuz-$KVER-ipfire root=$ROOT rootdelay=10 panic=10 $MOUNT" >> /boot/grub/grub.conf -echo " initrd /ipfirerd-$KVER.img" >> /boot/grub/grub.conf +echo " kernel /vmlinuz-$KVER-ipfire-xen root=$ROOT rootdelay=10 panic=10 $MOUNT" >> /boot/grub/grub.conf +echo " initrd /ipfirerd-$KVER-xen.img" >> /boot/grub/grub.conf echo " savedefault $ENTRY" >> /boot/grub/grub.conf # # Made initramdisk # -mkinitcpio -k $KVER-ipfire -g /boot/ipfirerd-$KVER.img -# -# ReInstall grub -# -grub-install --no-floppy ${ROOT::`expr length $ROOT`-1} +cp -f /etc/mkinitcpio.conf.org /etc/mkinitcpio.conf +sed -i -e "s| autodetect | |g" /etc/mkinitcpio.conf +# Remove Reiser4 (not working with xen) +sed -i -e "s|reiser4 | |g" /etc/mkinitcpio.conf +mkinitcpio -k $KVER-ipfire-xen -g /boot/ipfirerd-$KVER-xen.img # # Create new module depency # -depmod -a $KVER-ipfire - +depmod -a $KVER-ipfire-xen diff --git a/src/paks/linux25/uninstall.sh b/src/paks/linux-xen/uninstall.sh similarity index 96% rename from src/paks/linux25/uninstall.sh rename to src/paks/linux-xen/uninstall.sh index bbe478f9f..6c07f7e12 100644 --- a/src/paks/linux25/uninstall.sh +++ b/src/paks/linux-xen/uninstall.sh @@ -23,4 +23,4 @@ # . /opt/pakfire/lib/functions.sh remove_files -mv -f /boot/grub/grub-backup-2.6.25.*.conf /boot/grub/grub.conf +mv -f /boot/grub/grub-backup-2.6.27.*.-xen.conf /boot/grub/grub.conf diff --git a/src/paks/linux25/update.sh b/src/paks/linux-xen/update.sh similarity index 96% rename from src/paks/linux25/update.sh rename to src/paks/linux-xen/update.sh index 89c40d0d7..abbaf47c3 100644 --- a/src/paks/linux25/update.sh +++ b/src/paks/linux-xen/update.sh @@ -22,5 +22,6 @@ ############################################################################ # . /opt/pakfire/lib/functions.sh -./uninstall.sh +#Don't remove old xen kernel at update +#./uninstall.sh ./install.sh diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_ec_limit_asus_workaround.patch b/src/patches/suse-2.6.27.25/patches.arch/acpi_ec_limit_asus_workaround.patch deleted file mode 100644 index 7949f2206..000000000 --- a/src/patches/suse-2.6.27.25/patches.arch/acpi_ec_limit_asus_workaround.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Alexey Starikovskiy -Subject: ACPI: EC: Limit workaround for ASUS notebooks even more -References: bnc#492658 bnc#496871 and others -Patch-Mainline: yes -Commit-ID: 235c4a59278eb07e61d909f1f0c233733034a8b3 - -Signed-off-by: Thomas Renninger - -References: http://bugzilla.kernel.org/show_bug.cgi?id=11884 - -Signed-off-by: Alexey Starikovskiy -Signed-off-by: Len Brown - ---- - drivers/acpi/ec.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -Index: linux-2.6.27-SLE11_BRANCH/drivers/acpi/ec.c -=================================================================== ---- linux-2.6.27-SLE11_BRANCH.orig/drivers/acpi/ec.c -+++ linux-2.6.27-SLE11_BRANCH/drivers/acpi/ec.c -@@ -1017,7 +1017,8 @@ int __init acpi_ec_ecdt_probe(void) - * which needs it, has fake EC._INI method, so use it as flag. - * Keep boot_ec struct as it will be needed soon. - */ -- if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy))) -+ if (!dmi_name_in_vendors("ASUS") || -+ ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy))) - return -ENODEV; - install: - if (!ec_install_handlers(boot_ec)) { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/add-fwrapv-to-gcc-CFLAGS b/src/patches/suse-2.6.27.25/patches.fixes/add-fwrapv-to-gcc-CFLAGS deleted file mode 100644 index 4279fa636..000000000 --- a/src/patches/suse-2.6.27.25/patches.fixes/add-fwrapv-to-gcc-CFLAGS +++ /dev/null @@ -1,42 +0,0 @@ -From: Linus Torvalds -Date: Thu, 19 Mar 2009 18:10:17 +0000 (-0700) -Subject: Add '-fwrapv' to gcc CFLAGS -Patch-mainline: 2.6.29 -Git-commit: 68df3755e383e6fecf2354a67b08f92f18536594 -References: bko#12597 bnc#487106 - -Add '-fwrapv' to gcc CFLAGS - -This makes sure that gcc doesn't try to optimize away wrapping -arithmetic, which the kernel occasionally uses for overflow testing, ie -things like - - if (ptr + offset < ptr) - -which technically is undefined for non-unsigned types. See - - http://bugzilla.kernel.org/show_bug.cgi?id=12597 - -for details. - -Not all versions of gcc support it, so we need to make it conditional -(it looks like it was introduced in gcc-3.4). - -Reminded-by: Alan Cox -Signed-off-by: Linus Torvalds -Acked-by: Jeff Mahoney ---- - - Makefile | 1 + - 1 file changed, 1 insertion(+) - ---- a/Makefile -+++ b/Makefile -@@ -341,6 +341,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXI - KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common \ - -Werror-implicit-function-declaration -+KBUILD_CFLAGS += $(call cc-option,-fwrapv) - KBUILD_AFLAGS := -D__ASSEMBLY__ - - # Warn about unsupported modules in kernels built inside Autobuild diff --git a/src/patches/suse-2.6.27.25/patches.fixes/usb-ti_usb_3410_5052-fix-duplicate-device-ids.patch b/src/patches/suse-2.6.27.25/patches.fixes/usb-ti_usb_3410_5052-fix-duplicate-device-ids.patch deleted file mode 100644 index 49cf93bb1..000000000 --- a/src/patches/suse-2.6.27.25/patches.fixes/usb-ti_usb_3410_5052-fix-duplicate-device-ids.patch +++ /dev/null @@ -1,27 +0,0 @@ -From foo@baz Fri Jun 26 08:05:20 PDT 2009 -Date: Fri, 26 Jun 2009 08:05:20 -0700 -To: Greg KH -From: Greg Kroah-Hartman -Subject: USB: ti_usb_3410_5052: fix duplicate device ids. -References: bnc#395775 -Patch-mainline: 2.6.31 - -commit 1a1fab513734b3a4fca1bee8229e5ff7e1cb873c accidentally added the -device id to both tables in the driver, which causes problems as this is -only a single port device, not a multiple port device. - -Signed-off-by: Greg Kroah-Hartman ---- - drivers/usb/serial/ti_usb_3410_5052.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/usb/serial/ti_usb_3410_5052.c -+++ b/drivers/usb/serial/ti_usb_3410_5052.c -@@ -240,7 +240,6 @@ static struct usb_device_id ti_id_table_ - { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, - { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, - { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, -- { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) }, - }; - - static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = { diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/patch-2.6.27.25-26 b/src/patches/suse-2.6.27.25/patches.kernel.org/patch-2.6.27.25-26 deleted file mode 100644 index 5fd8cb837..000000000 --- a/src/patches/suse-2.6.27.25/patches.kernel.org/patch-2.6.27.25-26 +++ /dev/null @@ -1,1123 +0,0 @@ -From: Greg Kroah-Hartman -Subject: Upstream 2.6.27.26 release from kernel.org - -Signed-off-by: Greg Kroah-Hartman - -diff --git a/Makefile b/Makefile -index 1314692..90764ee 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - VERSION = 2 - PATCHLEVEL = 6 - SUBLEVEL = 27 --EXTRAVERSION = .25 -+EXTRAVERSION = .26 - NAME = Trembling Tortoise - - # *DOCUMENTATION* -diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c -index dfaa343..1177f10 100644 ---- a/arch/x86/kernel/reboot.c -+++ b/arch/x86/kernel/reboot.c -@@ -169,6 +169,24 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { - DMI_MATCH(DMI_BOARD_NAME, "0KW626"), - }, - }, -+ { /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */ -+ .callback = set_bios_reboot, -+ .ident = "Dell OptiPlex 360", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), -+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"), -+ DMI_MATCH(DMI_BOARD_NAME, "0T656F"), -+ }, -+ }, -+ { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ -+ .callback = set_bios_reboot, -+ .ident = "Dell OptiPlex 330", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), -+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), -+ DMI_MATCH(DMI_BOARD_NAME, "0KP561"), -+ }, -+ }, - { /* Handle problems with rebooting on Dell 2400's */ - .callback = set_bios_reboot, - .ident = "Dell PowerEdge 2400", -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 2781331..f0b164b 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -250,15 +250,13 @@ static inline void copy_edd(void) - - #ifdef CONFIG_BLK_DEV_INITRD - --#ifdef CONFIG_X86_32 -- - #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) - static void __init relocate_initrd(void) - { - - u64 ramdisk_image = boot_params.hdr.ramdisk_image; - u64 ramdisk_size = boot_params.hdr.ramdisk_size; -- u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; -+ u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT; - u64 ramdisk_here; - unsigned long slop, clen, mapaddr; - char *p, *q; -@@ -314,14 +312,13 @@ static void __init relocate_initrd(void) - ramdisk_image, ramdisk_image + ramdisk_size - 1, - ramdisk_here, ramdisk_here + ramdisk_size - 1); - } --#endif - - static void __init reserve_initrd(void) - { - u64 ramdisk_image = boot_params.hdr.ramdisk_image; - u64 ramdisk_size = boot_params.hdr.ramdisk_size; - u64 ramdisk_end = ramdisk_image + ramdisk_size; -- u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; -+ u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT; - - if (!boot_params.hdr.type_of_loader || - !ramdisk_image || !ramdisk_size) -@@ -351,14 +348,8 @@ static void __init reserve_initrd(void) - return; - } - --#ifdef CONFIG_X86_32 - relocate_initrd(); --#else -- printk(KERN_ERR "initrd extends beyond end of memory " -- "(0x%08llx > 0x%08llx)\ndisabling initrd\n", -- ramdisk_end, end_of_lowmem); -- initrd_start = 0; --#endif -+ - free_early(ramdisk_image, ramdisk_end); - } - #else -diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c -index 395f8ea..615fcd3 100644 ---- a/drivers/block/floppy.c -+++ b/drivers/block/floppy.c -@@ -177,6 +177,7 @@ static int print_unex = 1; - #include - #include - #include -+#include - #include /* for invalidate_buffers() */ - #include - -@@ -551,6 +552,8 @@ static void process_fd_request(void); - static void recalibrate_floppy(void); - static void floppy_shutdown(unsigned long); - -+static int floppy_request_regions(int); -+static void floppy_release_regions(int); - static int floppy_grab_irq_and_dma(void); - static void floppy_release_irq_and_dma(void); - -@@ -4273,8 +4276,7 @@ static int __init floppy_init(void) - FDCS->rawcmd = 2; - if (user_reset_fdc(-1, FD_RESET_ALWAYS, 0)) { - /* free ioports reserved by floppy_grab_irq_and_dma() */ -- release_region(FDCS->address + 2, 4); -- release_region(FDCS->address + 7, 1); -+ floppy_release_regions(fdc); - FDCS->address = -1; - FDCS->version = FDC_NONE; - continue; -@@ -4283,8 +4285,7 @@ static int __init floppy_init(void) - FDCS->version = get_fdc_version(); - if (FDCS->version == FDC_NONE) { - /* free ioports reserved by floppy_grab_irq_and_dma() */ -- release_region(FDCS->address + 2, 4); -- release_region(FDCS->address + 7, 1); -+ floppy_release_regions(fdc); - FDCS->address = -1; - continue; - } -@@ -4357,6 +4358,47 @@ out_put_disk: - - static DEFINE_SPINLOCK(floppy_usage_lock); - -+static const struct io_region { -+ int offset; -+ int size; -+} io_regions[] = { -+ { 2, 1 }, -+ /* address + 3 is sometimes reserved by pnp bios for motherboard */ -+ { 4, 2 }, -+ /* address + 6 is reserved, and may be taken by IDE. -+ * Unfortunately, Adaptec doesn't know this :-(, */ -+ { 7, 1 }, -+}; -+ -+static void floppy_release_allocated_regions(int fdc, const struct io_region *p) -+{ -+ while (p != io_regions) { -+ p--; -+ release_region(FDCS->address + p->offset, p->size); -+ } -+} -+ -+#define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)])) -+ -+static int floppy_request_regions(int fdc) -+{ -+ const struct io_region *p; -+ -+ for (p = io_regions; p < ARRAY_END(io_regions); p++) { -+ if (!request_region(FDCS->address + p->offset, p->size, "floppy")) { -+ DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset); -+ floppy_release_allocated_regions(fdc, p); -+ return -EBUSY; -+ } -+ } -+ return 0; -+} -+ -+static void floppy_release_regions(int fdc) -+{ -+ floppy_release_allocated_regions(fdc, ARRAY_END(io_regions)); -+} -+ - static int floppy_grab_irq_and_dma(void) - { - unsigned long flags; -@@ -4398,18 +4440,8 @@ static int floppy_grab_irq_and_dma(void) - - for (fdc = 0; fdc < N_FDC; fdc++) { - if (FDCS->address != -1) { -- if (!request_region(FDCS->address + 2, 4, "floppy")) { -- DPRINT("Floppy io-port 0x%04lx in use\n", -- FDCS->address + 2); -- goto cleanup1; -- } -- if (!request_region(FDCS->address + 7, 1, "floppy DIR")) { -- DPRINT("Floppy io-port 0x%04lx in use\n", -- FDCS->address + 7); -- goto cleanup2; -- } -- /* address + 6 is reserved, and may be taken by IDE. -- * Unfortunately, Adaptec doesn't know this :-(, */ -+ if (floppy_request_regions(fdc)) -+ goto cleanup; - } - } - for (fdc = 0; fdc < N_FDC; fdc++) { -@@ -4431,15 +4463,11 @@ static int floppy_grab_irq_and_dma(void) - fdc = 0; - irqdma_allocated = 1; - return 0; --cleanup2: -- release_region(FDCS->address + 2, 4); --cleanup1: -+cleanup: - fd_free_irq(); - fd_free_dma(); -- while (--fdc >= 0) { -- release_region(FDCS->address + 2, 4); -- release_region(FDCS->address + 7, 1); -- } -+ while (--fdc >= 0) -+ floppy_release_regions(fdc); - spin_lock_irqsave(&floppy_usage_lock, flags); - usage_count--; - spin_unlock_irqrestore(&floppy_usage_lock, flags); -@@ -4500,10 +4528,8 @@ static void floppy_release_irq_and_dma(void) - #endif - old_fdc = fdc; - for (fdc = 0; fdc < N_FDC; fdc++) -- if (FDCS->address != -1) { -- release_region(FDCS->address + 2, 4); -- release_region(FDCS->address + 7, 1); -- } -+ if (FDCS->address != -1) -+ floppy_release_regions(fdc); - fdc = old_fdc; - } - -@@ -4572,6 +4598,13 @@ MODULE_AUTHOR("Alain L. Knaff"); - MODULE_SUPPORTED_DEVICE("fd"); - MODULE_LICENSE("GPL"); - -+/* This doesn't actually get used other than for module information */ -+static const struct pnp_device_id floppy_pnpids[] = { -+ { "PNP0700", 0 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(pnp, floppy_pnpids); -+ - #else - - __setup("floppy=", floppy_setup); -diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c -index d3d7864..729be5e 100644 ---- a/drivers/char/moxa.c -+++ b/drivers/char/moxa.c -@@ -1158,6 +1158,11 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) - return -ENODEV; - } - -+ if (port % MAX_PORTS_PER_BOARD >= brd->numPorts) { -+ retval = -ENODEV; -+ goto out_unlock; -+ } -+ - ch = &brd->ports[port % MAX_PORTS_PER_BOARD]; - ch->port.count++; - tty->driver_data = ch; -@@ -1182,8 +1187,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) - moxa_close_port(ch); - } else - ch->port.flags |= ASYNC_NORMAL_ACTIVE; -+out_unlock: - mutex_unlock(&moxa_openlock); -- - return retval; - } - -diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c -index b638403..ebda9a8 100644 ---- a/drivers/char/mxser.c -+++ b/drivers/char/mxser.c -@@ -2790,7 +2790,7 @@ static int __init mxser_module_init(void) - continue; - - brd = &mxser_boards[m]; -- retval = mxser_get_ISA_conf(!ioaddr[b], brd); -+ retval = mxser_get_ISA_conf(ioaddr[b], brd); - if (retval <= 0) { - brd->info = NULL; - continue; -diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c -index f070ae7..0b255b9 100644 ---- a/drivers/char/pcmcia/cm4000_cs.c -+++ b/drivers/char/pcmcia/cm4000_cs.c -@@ -1575,7 +1575,8 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); - -- return 0; -+ rc = 0; -+ break; - case CM_IOCSPTS: - { - struct ptsreq krnptsreq; -diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c -index 3bf8ee1..a36e9aa 100644 ---- a/drivers/firmware/memmap.c -+++ b/drivers/firmware/memmap.c -@@ -31,8 +31,12 @@ - * information is necessary as for the resource tree. - */ - struct firmware_map_entry { -- resource_size_t start; /* start of the memory range */ -- resource_size_t end; /* end of the memory range (incl.) */ -+ /* -+ * start and end must be u64 rather than resource_size_t, because e820 -+ * resources can lie at addresses above 4G. -+ */ -+ u64 start; /* start of the memory range */ -+ u64 end; /* end of the memory range (incl.) */ - const char *type; /* type of the memory range */ - struct list_head list; /* entry for the linked list */ - struct kobject kobj; /* kobject for each entry */ -@@ -101,7 +105,7 @@ static LIST_HEAD(map_entries); - * Common implementation of firmware_map_add() and firmware_map_add_early() - * which expects a pre-allocated struct firmware_map_entry. - **/ --static int firmware_map_add_entry(resource_size_t start, resource_size_t end, -+static int firmware_map_add_entry(u64 start, u64 end, - const char *type, - struct firmware_map_entry *entry) - { -@@ -132,8 +136,7 @@ static int firmware_map_add_entry(resource_size_t start, resource_size_t end, - * - * Returns 0 on success, or -ENOMEM if no memory could be allocated. - **/ --int firmware_map_add(resource_size_t start, resource_size_t end, -- const char *type) -+int firmware_map_add(u64 start, u64 end, const char *type) - { - struct firmware_map_entry *entry; - -@@ -157,8 +160,7 @@ int firmware_map_add(resource_size_t start, resource_size_t end, - * - * Returns 0 on success, or -ENOMEM if no memory could be allocated. - **/ --int __init firmware_map_add_early(resource_size_t start, resource_size_t end, -- const char *type) -+int __init firmware_map_add_early(u64 start, u64 end, const char *type) - { - struct firmware_map_entry *entry; - -diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c -index 9559248..8c844a1 100644 ---- a/drivers/infiniband/hw/mlx4/qp.c -+++ b/drivers/infiniband/hw/mlx4/qp.c -@@ -1563,12 +1563,16 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, - break; - - case IB_WR_LOCAL_INV: -+ ctrl->srcrb_flags |= -+ cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER); - set_local_inv_seg(wqe, wr->ex.invalidate_rkey); - wqe += sizeof (struct mlx4_wqe_local_inval_seg); - size += sizeof (struct mlx4_wqe_local_inval_seg) / 16; - break; - - case IB_WR_FAST_REG_MR: -+ ctrl->srcrb_flags |= -+ cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER); - set_fmr_seg(wqe, wr); - wqe += sizeof (struct mlx4_wqe_fmr_seg); - size += sizeof (struct mlx4_wqe_fmr_seg) / 16; -diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c -index f126566..3d337d9 100644 ---- a/drivers/isdn/hisax/hfc_pci.c -+++ b/drivers/isdn/hisax/hfc_pci.c -@@ -82,8 +82,9 @@ release_io_hfcpci(struct IsdnCardState *cs) - Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2); - pci_write_config_word(cs->hw.hfcpci.dev, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */ - del_timer(&cs->hw.hfcpci.timer); -- kfree(cs->hw.hfcpci.share_start); -- cs->hw.hfcpci.share_start = NULL; -+ pci_free_consistent(cs->hw.hfcpci.dev, 0x8000, -+ cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma); -+ cs->hw.hfcpci.fifos = NULL; - iounmap((void *)cs->hw.hfcpci.pci_io); - } - -@@ -1663,8 +1664,19 @@ setup_hfcpci(struct IsdnCard *card) - dev_hfcpci); - i++; - if (tmp_hfcpci) { -+ dma_addr_t dma_mask = DMA_BIT_MASK(32) & ~0x7fffUL; - if (pci_enable_device(tmp_hfcpci)) - continue; -+ if (pci_set_dma_mask(tmp_hfcpci, dma_mask)) { -+ printk(KERN_WARNING -+ "HiSax hfc_pci: No suitable DMA available.\n"); -+ continue; -+ } -+ if (pci_set_consistent_dma_mask(tmp_hfcpci, dma_mask)) { -+ printk(KERN_WARNING -+ "HiSax hfc_pci: No suitable consistent DMA available.\n"); -+ continue; -+ } - pci_set_master(tmp_hfcpci); - if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK))) - continue; -@@ -1693,22 +1705,29 @@ setup_hfcpci(struct IsdnCard *card) - printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); - return (0); - } -+ - /* Allocate memory for FIFOS */ -- /* Because the HFC-PCI needs a 32K physical alignment, we */ -- /* need to allocate the double mem and align the address */ -- if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) { -- printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n"); -+ cs->hw.hfcpci.fifos = pci_alloc_consistent(cs->hw.hfcpci.dev, -+ 0x8000, &cs->hw.hfcpci.dma); -+ if (!cs->hw.hfcpci.fifos) { -+ printk(KERN_WARNING "HFC-PCI: Error allocating FIFO memory!\n"); -+ return 0; -+ } -+ if (cs->hw.hfcpci.dma & 0x7fff) { -+ printk(KERN_WARNING -+ "HFC-PCI: Error DMA memory not on 32K boundary (%lx)\n", -+ (u_long)cs->hw.hfcpci.dma); -+ pci_free_consistent(cs->hw.hfcpci.dev, 0x8000, -+ cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma); - return 0; - } -- cs->hw.hfcpci.fifos = (void *) -- (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000; -- pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos)); -+ pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u32)cs->hw.hfcpci.dma); - cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256); - printk(KERN_INFO -- "HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n", -+ "HFC-PCI: defined at mem %p fifo %p(%lx) IRQ %d HZ %d\n", - cs->hw.hfcpci.pci_io, - cs->hw.hfcpci.fifos, -- (u_int) virt_to_bus(cs->hw.hfcpci.fifos), -+ (u_long)cs->hw.hfcpci.dma, - cs->irq, HZ); - - spin_lock_irqsave(&cs->lock, flags); -diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h -index e8d429f..f1a828b 100644 ---- a/drivers/isdn/hisax/hisax.h -+++ b/drivers/isdn/hisax/hisax.h -@@ -694,7 +694,7 @@ struct hfcPCI_hw { - int nt_timer; - struct pci_dev *dev; - unsigned char *pci_io; /* start of PCI IO memory */ -- void *share_start; /* shared memory for Fifos start */ -+ dma_addr_t dma; /* dma handle for Fifos */ - void *fifos; /* FIFO memory */ - int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */ - struct timer_list timer; -diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c -index 61f5753..7830b01 100644 ---- a/drivers/md/dm-mpath.c -+++ b/drivers/md/dm-mpath.c -@@ -540,6 +540,12 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg, - return -EINVAL; - } - -+ if (ps_argc > as->argc) { -+ dm_put_path_selector(pst); -+ ti->error = "not enough arguments for path selector"; -+ return -EINVAL; -+ } -+ - r = pst->create(&pg->ps, ps_argc, as->argv); - if (r) { - dm_put_path_selector(pst); -@@ -684,6 +690,11 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m) - if (!hw_argc) - return 0; - -+ if (hw_argc > as->argc) { -+ ti->error = "not enough arguments for hardware handler"; -+ return -EINVAL; -+ } -+ - m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL); - request_module("scsi_dh_%s", m->hw_handler_name); - if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { -diff --git a/drivers/md/dm.c b/drivers/md/dm.c -index ace998c..925efaf 100644 ---- a/drivers/md/dm.c -+++ b/drivers/md/dm.c -@@ -265,6 +265,10 @@ static int dm_blk_open(struct inode *inode, struct file *file) - goto out; - } - -+ if (test_bit(DMF_FREEING, &md->flags) || -+ test_bit(DMF_DELETING, &md->flags)) -+ return NULL; -+ - dm_get(md); - atomic_inc(&md->open_count); - -diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index 224de02..562ab63 100644 ---- a/drivers/md/raid5.c -+++ b/drivers/md/raid5.c -@@ -3431,6 +3431,7 @@ static int make_request(struct request_queue *q, struct bio * bi) - spin_unlock_irq(&conf->device_lock); - if (must_retry) { - release_stripe(sh); -+ schedule(); - goto retry; - } - } -diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c -index 3bdb473..f164239 100644 ---- a/drivers/net/bonding/bond_sysfs.c -+++ b/drivers/net/bonding/bond_sysfs.c -@@ -1464,6 +1464,7 @@ int bond_create_sysfs(void) - printk(KERN_ERR - "network device named %s already exists in sysfs", - class_attr_bonding_masters.attr.name); -+ ret = 0; - } - - return ret; -diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c -index a98d31a..5952522 100644 ---- a/drivers/net/r8169.c -+++ b/drivers/net/r8169.c -@@ -65,7 +65,6 @@ static const int multicast_filter_limit = 32; - #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ - #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ - #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ --#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ - #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ - #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ - -@@ -1976,10 +1975,10 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr) - return cmd; - } - --static void rtl_set_rx_max_size(void __iomem *ioaddr) -+static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) - { - /* Low hurts. Let's disable the filtering. */ -- RTL_W16(RxMaxSize, 16383); -+ RTL_W16(RxMaxSize, rx_buf_sz); - } - - static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) -@@ -2026,7 +2025,7 @@ static void rtl_hw_start_8169(struct net_device *dev) - - RTL_W8(EarlyTxThres, EarlyTxThld); - -- rtl_set_rx_max_size(ioaddr); -+ rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); - - if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || - (tp->mac_version == RTL_GIGA_MAC_VER_02) || -@@ -2090,7 +2089,7 @@ static void rtl_hw_start_8168(struct net_device *dev) - - RTL_W8(EarlyTxThres, EarlyTxThld); - -- rtl_set_rx_max_size(ioaddr); -+ rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); - - rtl_set_rx_tx_config_registers(tp); - -@@ -2142,7 +2141,7 @@ static void rtl_hw_start_8101(struct net_device *dev) - - RTL_W8(EarlyTxThres, EarlyTxThld); - -- rtl_set_rx_max_size(ioaddr); -+ rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); - - tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; - -diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c -index 8a846ad..7f0c60c 100644 ---- a/drivers/parport/parport_pc.c -+++ b/drivers/parport/parport_pc.c -@@ -1413,11 +1413,13 @@ static void __devinit decode_smsc(int efer, int key, int devid, int devrev) - - static void __devinit winbond_check(int io, int key) - { -- int devid,devrev,oldid,x_devid,x_devrev,x_oldid; -+ int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid; - - if (!request_region(io, 3, __func__)) - return; - -+ origval = inb(io); /* Save original value */ -+ - /* First probe without key */ - outb(0x20,io); - x_devid=inb(io+1); -@@ -1437,6 +1439,8 @@ static void __devinit winbond_check(int io, int key) - oldid=inb(io+1); - outb(0xaa,io); /* Magic Seal */ - -+ outb(origval, io); /* in case we poked some entirely different hardware */ -+ - if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid)) - goto out; /* protection against false positives */ - -@@ -1447,11 +1451,15 @@ out: - - static void __devinit winbond_check2(int io,int key) - { -- int devid,devrev,oldid,x_devid,x_devrev,x_oldid; -+ int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid; - - if (!request_region(io, 3, __func__)) - return; - -+ origval[0] = inb(io); /* Save original values */ -+ origval[1] = inb(io + 1); -+ origval[2] = inb(io + 2); -+ - /* First probe without the key */ - outb(0x20,io+2); - x_devid=inb(io+2); -@@ -1470,6 +1478,10 @@ static void __devinit winbond_check2(int io,int key) - oldid=inb(io+2); - outb(0xaa,io); /* Magic Seal */ - -+ outb(origval[0], io); /* in case we poked some entirely different hardware */ -+ outb(origval[1], io + 1); -+ outb(origval[2], io + 2); -+ - if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid)) - goto out; /* protection against false positives */ - -@@ -1480,11 +1492,13 @@ out: - - static void __devinit smsc_check(int io, int key) - { -- int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev; -+ int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev; - - if (!request_region(io, 3, __func__)) - return; - -+ origval = inb(io); /* Save original value */ -+ - /* First probe without the key */ - outb(0x0d,io); - x_oldid=inb(io+1); -@@ -1508,6 +1522,8 @@ static void __devinit smsc_check(int io, int key) - rev=inb(io+1); - outb(0xaa,io); /* Magic Seal */ - -+ outb(origval, io); /* in case we poked some entirely different hardware */ -+ - if ((x_id == id) && (x_oldrev == oldrev) && - (x_oldid == oldid) && (x_rev == rev)) - goto out; /* protection against false positives */ -@@ -1544,11 +1560,12 @@ static void __devinit detect_and_report_smsc (void) - static void __devinit detect_and_report_it87(void) - { - u16 dev; -- u8 r; -+ u8 origval, r; - if (verbose_probing) - printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n"); -- if (!request_region(0x2e, 1, __func__)) -+ if (!request_region(0x2e, 2, __func__)) - return; -+ origval = inb(0x2e); /* Save original value */ - outb(0x87, 0x2e); - outb(0x01, 0x2e); - outb(0x55, 0x2e); -@@ -1568,8 +1585,10 @@ static void __devinit detect_and_report_it87(void) - outb(r | 8, 0x2F); - outb(0x02, 0x2E); /* Lock */ - outb(0x02, 0x2F); -+ } else { -+ outb(origval, 0x2e); /* Oops, sorry to disturb */ - } -- release_region(0x2e, 1); -+ release_region(0x2e, 2); - } - #endif /* CONFIG_PARPORT_PC_SUPERIO */ - -@@ -2192,6 +2211,9 @@ struct parport *parport_pc_probe_port (unsigned long int base, - if (IS_ERR(pdev)) - return NULL; - dev = &pdev->dev; -+ -+ dev->coherent_dma_mask = DMA_BIT_MASK(24); -+ dev->dma_mask = &dev->coherent_dma_mask; - } - - ops = kmalloc(sizeof (struct parport_operations), GFP_KERNEL); -diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c -index 032db81..f349211 100644 ---- a/drivers/parport/parport_serial.c -+++ b/drivers/parport/parport_serial.c -@@ -30,6 +30,7 @@ enum parport_pc_pci_cards { - titan_210l, - netmos_9xx5_combo, - netmos_9855, -+ netmos_9855_2p, - avlab_1s1p, - avlab_1s2p, - avlab_2s1p, -@@ -62,7 +63,7 @@ struct parport_pc_pci { - struct parport_pc_pci *card, int failed); - }; - --static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma) -+static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma) - { - /* the rule described below doesn't hold for this device */ - if (dev->device == PCI_DEVICE_ID_NETMOS_9835 && -@@ -74,9 +75,17 @@ static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc - * and serial ports. The form is 0x00PS, where

is the number of - * parallel ports and is the number of serial ports. - */ -- card->numports = (dev->subsystem_device & 0xf0) >> 4; -- if (card->numports > ARRAY_SIZE(card->addr)) -- card->numports = ARRAY_SIZE(card->addr); -+ par->numports = (dev->subsystem_device & 0xf0) >> 4; -+ if (par->numports > ARRAY_SIZE(par->addr)) -+ par->numports = ARRAY_SIZE(par->addr); -+ /* -+ * This function is currently only called for cards with up to -+ * one parallel port. -+ * Parallel port BAR is either before or after serial ports BARS; -+ * hence, lo should be either 0 or equal to the number of serial ports. -+ */ -+ if (par->addr[0].lo != 0) -+ par->addr[0].lo = dev->subsystem_device & 0xf; - return 0; - } - -@@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __devinitdata = { - /* titan_110l */ { 1, { { 3, -1 }, } }, - /* titan_210l */ { 1, { { 3, -1 }, } }, - /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init }, -- /* netmos_9855 */ { 1, { { 2, -1 }, }, netmos_parallel_init }, -+ /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init }, -+ /* netmos_9855_2p */ { 2, { { 0, -1 }, { 2, -1 }, } }, - /* avlab_1s1p */ { 1, { { 1, 2}, } }, - /* avlab_1s2p */ { 2, { { 1, 2}, { 3, 4 },} }, - /* avlab_2s1p */ { 1, { { 2, 3}, } }, -@@ -110,6 +120,10 @@ static struct pci_device_id parport_serial_pci_tbl[] = { - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo }, - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855, -+ 0x1000, 0x0020, 0, 0, netmos_9855_2p }, -+ { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855, -+ 0x1000, 0x0022, 0, 0, netmos_9855_2p }, -+ { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 }, - /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/ - { PCI_VENDOR_ID_AFAVLAB, 0x2110, -@@ -192,6 +206,12 @@ static struct pciserial_board pci_parport_serial_boards[] __devinitdata = { - .uart_offset = 8, - }, - [netmos_9855] = { -+ .flags = FL_BASE2 | FL_BASE_BARS, -+ .num_ports = 1, -+ .base_baud = 115200, -+ .uart_offset = 8, -+ }, -+ [netmos_9855_2p] = { - .flags = FL_BASE4 | FL_BASE_BARS, - .num_ports = 1, - .base_baud = 115200, -diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c -index 409e00e..33cc148 100644 ---- a/drivers/pci/pci.c -+++ b/drivers/pci/pci.c -@@ -473,6 +473,8 @@ pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) - pmcsr &= ~PCI_PM_CTRL_STATE_MASK; - pmcsr |= state; - break; -+ case PCI_D3hot: -+ case PCI_D3cold: - case PCI_UNKNOWN: /* Boot-up */ - if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot - && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) -@@ -1184,15 +1186,14 @@ pci_power_t pci_target_state(struct pci_dev *dev) - default: - target_state = state; - } -+ } else if (!dev->pm_cap) { -+ target_state = PCI_D0; - } else if (device_may_wakeup(&dev->dev)) { - /* - * Find the deepest state from which the device can generate - * wake-up events, make it the target state and enable device - * to generate PME#. - */ -- if (!dev->pm_cap) -- return PCI_POWER_ERROR; -- - if (dev->pme_support) { - while (target_state - && !(dev->pme_support & (1 << target_state))) -diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c -index e4df84b..def3398 100644 ---- a/drivers/pci/pcie/aspm.c -+++ b/drivers/pci/pcie/aspm.c -@@ -633,6 +633,10 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev) - if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT && - pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM) - return; -+ /* VIA has a strange chipset, root port is under a bridge */ -+ if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT && -+ pdev->bus->self) -+ return; - down_read(&pci_bus_sem); - if (list_empty(&pdev->subordinate->devices)) - goto out; -diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c -index 75dac57..3105bdc 100644 ---- a/drivers/video/atmel_lcdfb.c -+++ b/drivers/video/atmel_lcdfb.c -@@ -29,14 +29,8 @@ - - /* configurable parameters */ - #define ATMEL_LCDC_CVAL_DEFAULT 0xc8 --#define ATMEL_LCDC_DMA_BURST_LEN 8 -- --#if defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) || \ -- defined(CONFIG_ARCH_AT91SAM9RL) --#define ATMEL_LCDC_FIFO_SIZE 2048 --#else --#define ATMEL_LCDC_FIFO_SIZE 512 --#endif -+#define ATMEL_LCDC_DMA_BURST_LEN 8 /* words */ -+#define ATMEL_LCDC_FIFO_SIZE 512 /* words */ - - #if defined(CONFIG_ARCH_AT91) - #define ATMEL_LCDFB_FBINFO_DEFAULT (FBINFO_DEFAULT \ -diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c -index ae08c05..558088d 100644 ---- a/fs/jbd/commit.c -+++ b/fs/jbd/commit.c -@@ -238,7 +238,7 @@ write_out_data: - spin_lock(&journal->j_list_lock); - } - /* Someone already cleaned up the buffer? */ -- if (!buffer_jbd(bh) -+ if (!buffer_jbd(bh) || bh2jh(bh) != jh - || jh->b_transaction != commit_transaction - || jh->b_jlist != BJ_SyncData) { - jbd_unlock_bh_state(bh); -@@ -463,7 +463,9 @@ void journal_commit_transaction(journal_t *journal) - spin_lock(&journal->j_list_lock); - continue; - } -- if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) { -+ if (buffer_jbd(bh) && bh2jh(bh) == jh && -+ jh->b_transaction == commit_transaction && -+ jh->b_jlist == BJ_Locked) { - __journal_unfile_buffer(jh); - jbd_unlock_bh_state(bh); - journal_remove_journal_head(bh); -diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h -index 6e199c8..67e88a6 100644 ---- a/include/linux/firmware-map.h -+++ b/include/linux/firmware-map.h -@@ -24,21 +24,17 @@ - */ - #ifdef CONFIG_FIRMWARE_MEMMAP - --int firmware_map_add(resource_size_t start, resource_size_t end, -- const char *type); --int firmware_map_add_early(resource_size_t start, resource_size_t end, -- const char *type); -+int firmware_map_add(u64 start, u64 end, const char *type); -+int firmware_map_add_early(u64 start, u64 end, const char *type); - - #else /* CONFIG_FIRMWARE_MEMMAP */ - --static inline int firmware_map_add(resource_size_t start, resource_size_t end, -- const char *type) -+static inline int firmware_map_add(u64 start, u64 end, const char *type) - { - return 0; - } - --static inline int firmware_map_add_early(resource_size_t start, -- resource_size_t end, const char *type) -+static inline int firmware_map_add_early(u64 start, u64 end, const char *type) - { - return 0; - } -diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h -index bf8f119..9f29d86 100644 ---- a/include/linux/mlx4/qp.h -+++ b/include/linux/mlx4/qp.h -@@ -165,6 +165,7 @@ enum { - MLX4_WQE_CTRL_IP_CSUM = 1 << 4, - MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, - MLX4_WQE_CTRL_INS_VLAN = 1 << 6, -+ MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, - }; - - struct mlx4_wqe_ctrl_seg { -diff --git a/kernel/acct.c b/kernel/acct.c -index a272f53..2dac228 100644 ---- a/kernel/acct.c -+++ b/kernel/acct.c -@@ -215,6 +215,7 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file, - static int acct_on(char *name) - { - struct file *file; -+ struct vfsmount *mnt; - int error; - struct pid_namespace *ns; - struct bsd_acct_struct *acct = NULL; -@@ -256,11 +257,12 @@ static int acct_on(char *name) - acct = NULL; - } - -- mnt_pin(file->f_path.mnt); -+ mnt = file->f_path.mnt; -+ mnt_pin(mnt); - acct_file_reopen(ns->bacct, file, ns); - spin_unlock(&acct_lock); - -- mntput(file->f_path.mnt); /* it's pinned, now give up active reference */ -+ mntput(mnt); /* it's pinned, now give up active reference */ - kfree(acct); - - return 0; -diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 0b50481..d3dce7c 100644 ---- a/lib/Kconfig.debug -+++ b/lib/Kconfig.debug -@@ -394,7 +394,7 @@ config LOCKDEP - bool - depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT - select STACKTRACE -- select FRAME_POINTER if !X86 && !MIPS && !PPC -+ select FRAME_POINTER if !MIPS && !PPC - select KALLSYMS - select KALLSYMS_ALL - -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 4205f7f..85799e8 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -2764,7 +2764,7 @@ bad: - if (dzone == zone) - break; - kfree(zone_pcp(dzone, cpu)); -- zone_pcp(dzone, cpu) = NULL; -+ zone_pcp(dzone, cpu) = &boot_pageset[cpu]; - } - return -ENOMEM; - } -@@ -2779,7 +2779,7 @@ static inline void free_zone_pagesets(int cpu) - /* Free per_cpu_pageset if it is slab allocated */ - if (pset != &boot_pageset[cpu]) - kfree(pset); -- zone_pcp(zone, cpu) = NULL; -+ zone_pcp(zone, cpu) = &boot_pageset[cpu]; - } - } - -@@ -4409,6 +4409,8 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, - if (!write || (ret == -EINVAL)) - return ret; - for_each_zone(zone) { -+ if (!populated_zone(zone)) -+ continue; - for_each_online_cpu(cpu) { - unsigned long high; - high = zone->present_pages / percpu_pagelist_fraction; -diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 011478e..0b3c404 100644 ---- a/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c -@@ -1364,6 +1364,10 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, - tcp_mtup_init(newsk); - tcp_sync_mss(newsk, dst_mtu(dst)); - newtp->advmss = dst_metric(dst, RTAX_ADVMSS); -+ if (tcp_sk(sk)->rx_opt.user_mss && -+ tcp_sk(sk)->rx_opt.user_mss < newtp->advmss) -+ newtp->advmss = tcp_sk(sk)->rx_opt.user_mss; -+ - tcp_initialize_rcv_mss(newsk); - - #ifdef CONFIG_TCP_MD5SIG -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index d083f9a..c89cd75 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c -@@ -2252,6 +2252,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, - struct sk_buff *skb; - struct tcp_md5sig_key *md5; - __u8 *md5_hash_location; -+ int mss; - - skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_ATOMIC); - if (skb == NULL) -@@ -2262,13 +2263,17 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, - - skb->dst = dst_clone(dst); - -+ mss = dst_metric(dst, RTAX_ADVMSS); -+ if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < mss) -+ mss = tp->rx_opt.user_mss; -+ - if (req->rcv_wnd == 0) { /* ignored for retransmitted syns */ - __u8 rcv_wscale; - /* Set this up on the first call only */ - req->window_clamp = tp->window_clamp ? : dst_metric(dst, RTAX_WINDOW); - /* tcp_full_space because it is guaranteed to be the first packet */ - tcp_select_initial_window(tcp_full_space(sk), -- dst_metric(dst, RTAX_ADVMSS) - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0), -+ mss - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0), - &req->rcv_wnd, - &req->window_clamp, - ireq->wscale_ok, -@@ -2283,8 +2288,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, - else - #endif - TCP_SKB_CB(skb)->when = tcp_time_stamp; -- tcp_header_size = tcp_synack_options(sk, req, -- dst_metric(dst, RTAX_ADVMSS), -+ tcp_header_size = tcp_synack_options(sk, req, mss, - skb, &opts, &md5) + - sizeof(struct tcphdr); - -@@ -2353,6 +2357,9 @@ static void tcp_connect_init(struct sock *sk) - if (!tp->window_clamp) - tp->window_clamp = dst_metric(dst, RTAX_WINDOW); - tp->advmss = dst_metric(dst, RTAX_ADVMSS); -+ if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < tp->advmss) -+ tp->advmss = tp->rx_opt.user_mss; -+ - tcp_initialize_rcv_mss(sk); - - tcp_select_initial_window(tcp_full_space(sk), -diff --git a/scripts/unifdef.c b/scripts/unifdef.c -index 552025e..05a31a6 100644 ---- a/scripts/unifdef.c -+++ b/scripts/unifdef.c -@@ -206,7 +206,7 @@ static void done(void); - static void error(const char *); - static int findsym(const char *); - static void flushline(bool); --static Linetype getline(void); -+static Linetype get_line(void); - static Linetype ifeval(const char **); - static void ignoreoff(void); - static void ignoreon(void); -@@ -512,7 +512,7 @@ process(void) - - for (;;) { - linenum++; -- lineval = getline(); -+ lineval = get_line(); - trans_table[ifstate[depth]][lineval](); - debug("process %s -> %s depth %d", - linetype_name[lineval], -@@ -526,7 +526,7 @@ process(void) - * help from skipcomment(). - */ - static Linetype --getline(void) -+get_line(void) - { - const char *cp; - int cursym; -diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c -index 8284f17..b5d6ea4 100644 ---- a/sound/core/seq/seq_midi_event.c -+++ b/sound/core/seq/seq_midi_event.c -@@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf, - if (dev->nostat && count < 12) - return -ENOMEM; - cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); -- bytes[0] = ev->data.control.param & 0x007f; -- bytes[1] = (ev->data.control.param & 0x3f80) >> 7; -- bytes[2] = ev->data.control.value & 0x007f; -- bytes[3] = (ev->data.control.value & 0x3f80) >> 7; -+ bytes[0] = (ev->data.control.param & 0x3f80) >> 7; -+ bytes[1] = ev->data.control.param & 0x007f; -+ bytes[2] = (ev->data.control.value & 0x3f80) >> 7; -+ bytes[3] = ev->data.control.value & 0x007f; - if (cmd != dev->lastcmd && !dev->nostat) { - if (count < 9) - return -ENOMEM; -diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c -index 3025ed1..c0f4718 100644 ---- a/sound/pci/ca0106/ca0106_mixer.c -+++ b/sound/pci/ca0106/ca0106_mixer.c -@@ -761,6 +761,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu) - snd_ca0106_master_db_scale); - if (!vmaster) - return -ENOMEM; -+ err = snd_ctl_add(card, vmaster); -+ if (err < 0) -+ return err; - add_slaves(card, vmaster, slave_vols); - - if (emu->details->spi_dac == 1) { -@@ -768,6 +771,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu) - NULL); - if (!vmaster) - return -ENOMEM; -+ err = snd_ctl_add(card, vmaster); -+ if (err < 0) -+ return err; - add_slaves(card, vmaster, slave_sws); - } - return 0; diff --git a/src/patches/suse-2.6.27.25/patches.suse/smtnice-disable b/src/patches/suse-2.6.27.25/patches.suse/smtnice-disable deleted file mode 100644 index d9001d95e..000000000 --- a/src/patches/suse-2.6.27.25/patches.suse/smtnice-disable +++ /dev/null @@ -1,29 +0,0 @@ -From: npiggin@suse.de -Subject: disable smtnice -References: 163880 -Patch-mainline: obsolete - -SLES9 has SMT nice disabled for different reasons, but in -sles10, it creates significant contention on the runq -locks. Any scheduler intensive benchmark is slow with -smt nice enabled. This patch turns it off. - -Acked-by: mason@suse.de -Acked-by: okir@suse.de - ---- - include/linux/topology.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/include/linux/topology.h -+++ b/include/linux/topology.h -@@ -99,8 +99,7 @@ void arch_update_cpu_topology(void); - | SD_BALANCE_FORK \ - | SD_BALANCE_EXEC \ - | SD_WAKE_AFFINE \ -- | SD_WAKE_IDLE \ -- | SD_SHARE_CPUPOWER, \ -+ | SD_WAKE_IDLE, \ - .last_balance = jiffies, \ - .balance_interval = 1, \ - } diff --git a/src/patches/suse-2.6.27.25/arch-symbols b/src/patches/suse-2.6.27.31/arch-symbols similarity index 100% rename from src/patches/suse-2.6.27.25/arch-symbols rename to src/patches/suse-2.6.27.31/arch-symbols diff --git a/src/patches/suse-2.6.27.25/guards b/src/patches/suse-2.6.27.31/guards similarity index 100% rename from src/patches/suse-2.6.27.25/guards rename to src/patches/suse-2.6.27.31/guards diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/add-path_permission.diff b/src/patches/suse-2.6.27.31/patches.apparmor/add-path_permission.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/add-path_permission.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/add-path_permission.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/add-security_path_permission b/src/patches/suse-2.6.27.31/patches.apparmor/add-security_path_permission similarity index 96% rename from src/patches/suse-2.6.27.25/patches.apparmor/add-security_path_permission rename to src/patches/suse-2.6.27.31/patches.apparmor/add-security_path_permission index 1b216f1ba..adaaff8b3 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/add-security_path_permission +++ b/src/patches/suse-2.6.27.31/patches.apparmor/add-security_path_permission @@ -55,7 +55,7 @@ Signed-off-by: Jeff Mahoney int security_task_create(unsigned long clone_flags); int security_task_alloc(struct task_struct *p); void security_task_free(struct task_struct *p); -@@ -2240,6 +2256,11 @@ static inline int security_dentry_open(s +@@ -2242,6 +2258,11 @@ static inline int security_dentry_open(s { return 0; } @@ -91,7 +91,7 @@ Signed-off-by: Jeff Mahoney set_to_cap_if_null(ops, task_free_security); --- a/security/security.c +++ b/security/security.c -@@ -615,6 +615,15 @@ int security_dentry_open(struct file *fi +@@ -612,6 +612,15 @@ int security_dentry_open(struct file *fi return security_ops->dentry_open(file); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-2.6.25.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-2.6.25.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-2.6.25.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-2.6.25.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-audit.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-audit.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-audit.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-audit.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-intree.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-intree.diff similarity index 94% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-intree.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-intree.diff index c50c4f6a2..7c29501d4 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-intree.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-intree.diff @@ -11,7 +11,7 @@ Signed-off-by: Andreas Gruenbacher --- a/security/Kconfig +++ b/security/Kconfig -@@ -117,6 +117,7 @@ config SECURITY_DEFAULT_MMAP_MIN_ADDR +@@ -97,6 +97,7 @@ config SECURITY_ROOTPLUG source security/selinux/Kconfig source security/smack/Kconfig diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-lsm.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-lsm.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-lsm.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-lsm.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-main.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-main.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-main.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-main.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-misc.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-misc.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-misc.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-misc.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-module_interface.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-module_interface.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-module_interface.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-module_interface.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-network.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-network.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-network.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-network.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-path_permission b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-path_permission similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-path_permission rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-path_permission diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-ptrace-2.6.27.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-ptrace-2.6.27.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-ptrace-2.6.27.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-ptrace-2.6.27.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/apparmor-rlimits.diff b/src/patches/suse-2.6.27.31/patches.apparmor/apparmor-rlimits.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/apparmor-rlimits.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/apparmor-rlimits.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path.diff b/src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path.diff similarity index 91% rename from src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path.diff index d5b2dc707..e82cf5e2d 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path.diff @@ -15,10 +15,10 @@ Signed-off-by: John Johansen --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -2299,3 +2299,33 @@ void __put_mnt_ns(struct mnt_namespace * - release_mounts(&umount_list); +@@ -2357,3 +2357,33 @@ void put_mnt_ns(struct mnt_namespace *ns kfree(ns); } + EXPORT_SYMBOL(put_mnt_ns); + +char *d_namespace_path(struct dentry *dentry, struct vfsmount *vfsmnt, + char *buf, int buflen) @@ -51,7 +51,7 @@ Signed-off-by: John Johansen +EXPORT_SYMBOL(d_namespace_path); --- a/include/linux/mount.h +++ b/include/linux/mount.h -@@ -134,4 +134,6 @@ extern void mark_mounts_for_expiry(struc +@@ -137,4 +137,6 @@ extern void mark_mounts_for_expiry(struc extern spinlock_t vfsmount_lock; extern dev_t name_to_dev_t(char *name); diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path_oops_fix.diff b/src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path_oops_fix.diff similarity index 92% rename from src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path_oops_fix.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path_oops_fix.diff index ea3697c2a..f1ae52dc7 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/d_namespace_path_oops_fix.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/d_namespace_path_oops_fix.diff @@ -14,7 +14,7 @@ Signed-off-by: Miklos Szeredi --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -2312,7 +2312,7 @@ char *d_namespace_path(struct dentry *de +@@ -2370,7 +2370,7 @@ char *d_namespace_path(struct dentry *de path_get(¤t->fs->root); read_unlock(¤t->fs->lock); spin_lock(&vfsmount_lock); diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/do_path_lookup-nameidata.diff b/src/patches/suse-2.6.27.31/patches.apparmor/do_path_lookup-nameidata.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/do_path_lookup-nameidata.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/do_path_lookup-nameidata.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/export-security_inode_permission-for-aufs b/src/patches/suse-2.6.27.31/patches.apparmor/export-security_inode_permission-for-aufs similarity index 92% rename from src/patches/suse-2.6.27.25/patches.apparmor/export-security_inode_permission-for-aufs rename to src/patches/suse-2.6.27.31/patches.apparmor/export-security_inode_permission-for-aufs index f628c9ec5..d7a533e55 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/export-security_inode_permission-for-aufs +++ b/src/patches/suse-2.6.27.31/patches.apparmor/export-security_inode_permission-for-aufs @@ -16,7 +16,7 @@ Signed-off-by: Jeff Mahoney --- a/security/security.c +++ b/security/security.c -@@ -415,6 +415,7 @@ int security_inode_mknod(struct inode *d +@@ -412,6 +412,7 @@ int security_inode_mknod(struct inode *d return 0; return security_ops->inode_mknod(dir, dentry, mnt, mode, dev); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/file-handle-ops.diff b/src/patches/suse-2.6.27.31/patches.apparmor/file-handle-ops.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/file-handle-ops.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/file-handle-ops.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fix-complain.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fix-complain.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fix-complain.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fix-complain.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fix-deleted-leak.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fix-deleted-leak.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fix-deleted-leak.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fix-deleted-leak.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fix-security-param.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fix-security-param.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fix-security-param.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fix-security-param.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fix-vfs_rmdir.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fix-vfs_rmdir.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fix-vfs_rmdir.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fix-vfs_rmdir.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fork-tracking.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fork-tracking.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fork-tracking.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fork-tracking.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fsetattr-reintro-ATTR_FILE.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fsetattr-reintro-ATTR_FILE.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fsetattr-reintro-ATTR_FILE.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fsetattr-reintro-ATTR_FILE.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fsetattr-restore-ia_file.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fsetattr-restore-ia_file.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/fsetattr-restore-ia_file.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fsetattr-restore-ia_file.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/fsetattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/fsetattr.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/fsetattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/fsetattr.diff index ecd58fa4b..ba01f3ff7 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/fsetattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/fsetattr.diff @@ -217,7 +217,7 @@ Signed-off-by: John Johansen --- static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry, --- a/fs/fuse/file.c +++ b/fs/fuse/file.c -@@ -1466,6 +1466,11 @@ static loff_t fuse_file_llseek(struct fi +@@ -1467,6 +1467,11 @@ static loff_t fuse_file_llseek(struct fi return retval; } @@ -229,7 +229,7 @@ Signed-off-by: John Johansen --- static const struct file_operations fuse_file_operations = { .llseek = fuse_file_llseek, .read = do_sync_read, -@@ -1479,6 +1484,7 @@ static const struct file_operations fuse +@@ -1480,6 +1485,7 @@ static const struct file_operations fuse .fsync = fuse_fsync, .lock = fuse_file_lock, .flock = fuse_file_flock, @@ -237,7 +237,7 @@ Signed-off-by: John Johansen --- .splice_read = generic_file_splice_read, }; -@@ -1492,6 +1498,7 @@ static const struct file_operations fuse +@@ -1493,6 +1499,7 @@ static const struct file_operations fuse .fsync = fuse_fsync, .lock = fuse_file_lock, .flock = fuse_file_flock, diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/remove_suid.diff b/src/patches/suse-2.6.27.31/patches.apparmor/remove_suid.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/remove_suid.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/remove_suid.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-create.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-create.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-create.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-create.diff index 486d31c48..9d16017bc 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-create.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-create.diff @@ -78,7 +78,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -358,11 +358,12 @@ int security_inode_init_security(struct +@@ -355,11 +355,12 @@ int security_inode_init_security(struct } EXPORT_SYMBOL(security_inode_init_security); diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-getxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-getxattr.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-getxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-getxattr.diff index 6a8663ca2..0e98d57ad 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-getxattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-getxattr.diff @@ -82,7 +82,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -491,11 +491,12 @@ void security_inode_post_setxattr(struct +@@ -488,11 +488,12 @@ void security_inode_post_setxattr(struct flags); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-link.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-link.diff similarity index 96% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-link.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-link.diff index ddc4d888f..b43e1e61b 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-link.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-link.diff @@ -18,7 +18,7 @@ Signed-off-by: John Johansen --- a/fs/namei.c +++ b/fs/namei.c -@@ -2437,7 +2437,8 @@ int vfs_link(struct dentry *old_dentry, +@@ -2437,7 +2437,8 @@ int vfs_link(struct dentry *old_dentry, if (S_ISDIR(inode->i_mode)) return -EPERM; @@ -53,7 +53,7 @@ Signed-off-by: John Johansen int (*inode_unlink) (struct inode *dir, struct dentry *dentry); int (*inode_symlink) (struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, const char *old_name); -@@ -1632,8 +1635,9 @@ int security_inode_init_security(struct +@@ -1632,8 +1635,9 @@ int security_inode_init_security(struct char **name, void **value, size_t *len); int security_inode_create(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, int mode); @@ -94,7 +94,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -366,12 +366,14 @@ int security_inode_create(struct inode * +@@ -363,12 +363,14 @@ int security_inode_create(struct inode * return security_ops->inode_create(dir, dentry, mnt, mode); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-listxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-listxattr.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-listxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-listxattr.diff index b4b5efe66..5c7e1d5b3 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-listxattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-listxattr.diff @@ -78,7 +78,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -499,11 +499,11 @@ int security_inode_getxattr(struct dentr +@@ -496,11 +496,11 @@ int security_inode_getxattr(struct dentr return security_ops->inode_getxattr(dentry, mnt, name); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-mkdir.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-mkdir.diff similarity index 95% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-mkdir.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-mkdir.diff index e9a8cdce8..deed6a020 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-mkdir.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-mkdir.diff @@ -17,7 +17,7 @@ Signed-off-by: John Johansen --- a/fs/namei.c +++ b/fs/namei.c -@@ -2089,7 +2089,7 @@ int vfs_mkdir(struct inode *dir, struct +@@ -2089,7 +2089,7 @@ int vfs_mkdir(struct inode *dir, struct return -EPERM; mode &= (S_IRWXUGO|S_ISVTX); @@ -77,7 +77,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -389,11 +389,12 @@ int security_inode_symlink(struct inode +@@ -386,11 +386,12 @@ int security_inode_symlink(struct inode return security_ops->inode_symlink(dir, dentry, old_name); } @@ -94,7 +94,7 @@ Signed-off-by: John Johansen int security_inode_rmdir(struct inode *dir, struct dentry *dentry) --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c -@@ -2597,7 +2597,8 @@ static int selinux_inode_symlink(struct +@@ -2597,7 +2597,8 @@ static int selinux_inode_symlink(struct return may_create(dir, dentry, SECCLASS_LNK_FILE); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-mknod.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-mknod.diff similarity index 93% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-mknod.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-mknod.diff index 6bcd0fc7f..cc46e2b65 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-mknod.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-mknod.diff @@ -17,7 +17,7 @@ Signed-off-by: John Johansen --- a/fs/namei.c +++ b/fs/namei.c -@@ -1994,7 +1994,7 @@ int vfs_mknod(struct inode *dir, struct +@@ -1994,7 +1994,7 @@ int vfs_mknod(struct inode *dir, struct if (error) return error; @@ -26,7 +26,7 @@ Signed-off-by: John Johansen if (error) return error; -@@ -2056,11 +2056,11 @@ asmlinkage long sys_mknodat(int dfd, con +@@ -2056,11 +2056,11 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const break; case S_IFCHR: case S_IFBLK: error = vfs_mknod(nd.path.dentry->d_inode, dentry, @@ -59,7 +59,7 @@ Signed-off-by: John Johansen int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry); int (*inode_readlink) (struct dentry *dentry); -@@ -1637,7 +1638,8 @@ int security_inode_symlink(struct inode +@@ -1637,7 +1638,8 @@ int security_inode_symlink(struct inode int security_inode_mkdir(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, int mode); int security_inode_rmdir(struct inode *dir, struct dentry *dentry); @@ -79,7 +79,7 @@ Signed-off-by: John Johansen return 0; --- a/security/capability.c +++ b/security/capability.c -@@ -189,7 +189,7 @@ static int cap_inode_rmdir(struct inode +@@ -189,7 +189,7 @@ static int cap_inode_rmdir(struct inode } static int cap_inode_mknod(struct inode *inode, struct dentry *dentry, @@ -90,7 +90,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -404,11 +404,12 @@ int security_inode_rmdir(struct inode *d +@@ -401,11 +401,12 @@ int security_inode_rmdir(struct inode *d return security_ops->inode_rmdir(dir, dentry); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-readlink.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-readlink.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-readlink.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-readlink.diff index d805c07a0..3eab4f511 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-readlink.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-readlink.diff @@ -77,7 +77,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -422,11 +422,11 @@ int security_inode_rename(struct inode * +@@ -419,11 +419,11 @@ int security_inode_rename(struct inode * new_dir, new_dentry); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-removexattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-removexattr.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-removexattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-removexattr.diff index 54ecb70de..ec595272e 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-removexattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-removexattr.diff @@ -86,7 +86,7 @@ Signed-off-by: John Johansen if (!capable(CAP_SETFCAP)) --- a/security/security.c +++ b/security/security.c -@@ -506,11 +506,12 @@ int security_inode_listxattr(struct dent +@@ -503,11 +503,12 @@ int security_inode_listxattr(struct dent return security_ops->inode_listxattr(dentry, mnt); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-rename.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-rename.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-rename.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-rename.diff index b60915c3e..c20634719 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-rename.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-rename.diff @@ -86,7 +86,7 @@ Signed-off-by: John Johansen } --- a/security/capability.c +++ b/security/capability.c -@@ -198,7 +198,8 @@ static int cap_inode_mknod(struct inode +@@ -198,7 +198,8 @@ static int cap_inode_mknod(struct inode } static int cap_inode_rename(struct inode *old_inode, struct dentry *old_dentry, @@ -98,7 +98,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -417,13 +417,14 @@ int security_inode_mknod(struct inode *d +@@ -414,13 +414,14 @@ int security_inode_mknod(struct inode *d } int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-rmdir.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-rmdir.diff similarity index 94% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-rmdir.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-rmdir.diff index 683078fcc..30c8e3033 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-rmdir.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-rmdir.diff @@ -18,7 +18,7 @@ Signed-off-by: John Johansen --- a/fs/namei.c +++ b/fs/namei.c -@@ -2184,7 +2184,7 @@ int vfs_rmdir(struct inode *dir, struct +@@ -2184,7 +2184,7 @@ int vfs_rmdir(struct inode *dir, struct if (d_mountpoint(dentry)) error = -EBUSY; else { @@ -47,7 +47,7 @@ Signed-off-by: John Johansen int (*inode_mknod) (struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, int mode, dev_t dev); int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, -@@ -1643,7 +1645,8 @@ int security_inode_symlink(struct inode +@@ -1643,7 +1645,8 @@ int security_inode_symlink(struct inode struct vfsmount *mnt, const char *old_name); int security_inode_mkdir(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt, int mode); @@ -69,7 +69,7 @@ Signed-off-by: John Johansen } --- a/security/capability.c +++ b/security/capability.c -@@ -184,7 +184,8 @@ static int cap_inode_mkdir(struct inode +@@ -184,7 +184,8 @@ static int cap_inode_mkdir(struct inode return 0; } @@ -81,7 +81,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -399,11 +399,12 @@ int security_inode_mkdir(struct inode *d +@@ -396,11 +396,12 @@ int security_inode_mkdir(struct inode *d return security_ops->inode_mkdir(dir, dentry, mnt, mode); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-setattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-setattr.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-setattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-setattr.diff index 601e9570a..4854ab346 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-setattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-setattr.diff @@ -100,7 +100,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -441,11 +441,12 @@ int security_inode_permission(struct ino +@@ -438,11 +438,12 @@ int security_inode_permission(struct ino return security_ops->inode_permission(inode, mask); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-setxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-setxattr.diff similarity index 99% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-setxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-setxattr.diff index 87db51748..cf2e97c14 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-setxattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-setxattr.diff @@ -150,7 +150,7 @@ Signed-off-by: John Johansen if (!capable(CAP_SETFCAP)) --- a/security/security.c +++ b/security/security.c -@@ -471,20 +471,24 @@ void security_inode_delete(struct inode +@@ -468,20 +468,24 @@ void security_inode_delete(struct inode security_ops->inode_delete(inode); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-symlink.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-symlink.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-symlink.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-symlink.diff index e855eda54..304800b51 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-symlink.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-symlink.diff @@ -77,7 +77,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -382,11 +382,11 @@ int security_inode_unlink(struct inode * +@@ -379,11 +379,11 @@ int security_inode_unlink(struct inode * } int security_inode_symlink(struct inode *dir, struct dentry *dentry, diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-unlink.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-unlink.diff similarity index 97% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-unlink.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-unlink.diff index 71764b467..c4cfa8b81 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-unlink.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-unlink.diff @@ -69,7 +69,7 @@ Signed-off-by: John Johansen } --- a/security/capability.c +++ b/security/capability.c -@@ -167,7 +167,8 @@ static int cap_inode_link(struct dentry +@@ -167,7 +167,8 @@ static int cap_inode_link(struct dentry return 0; } @@ -81,7 +81,7 @@ Signed-off-by: John Johansen } --- a/security/security.c +++ b/security/security.c -@@ -376,11 +376,12 @@ int security_inode_link(struct dentry *o +@@ -373,11 +373,12 @@ int security_inode_link(struct dentry *o new_dentry, new_mnt); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/security-xattr-file.diff b/src/patches/suse-2.6.27.31/patches.apparmor/security-xattr-file.diff similarity index 92% rename from src/patches/suse-2.6.27.25/patches.apparmor/security-xattr-file.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/security-xattr-file.diff index a4fb9c887..2c0c3cccd 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/security-xattr-file.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/security-xattr-file.diff @@ -19,8 +19,10 @@ Signed-off-by: John Johansen security/smack/smack_lsm.c | 14 ++++++---- 8 files changed, 87 insertions(+), 69 deletions(-) ---- a/fs/xattr.c -+++ b/fs/xattr.c +Index: linux-2.6.27/fs/xattr.c +=================================================================== +--- linux-2.6.27.orig/fs/xattr.c ++++ linux-2.6.27/fs/xattr.c @@ -68,7 +68,7 @@ xattr_permission(struct inode *inode, co int @@ -273,8 +275,10 @@ Signed-off-by: John Johansen mnt_drop_write(f->f_path.mnt); } fput(f); ---- a/include/linux/security.h -+++ b/include/linux/security.h +Index: linux-2.6.27/include/linux/security.h +=================================================================== +--- linux-2.6.27.orig/include/linux/security.h ++++ linux-2.6.27/include/linux/security.h @@ -56,9 +56,9 @@ extern void cap_bprm_apply_creds(struct extern int cap_bprm_secureexec(struct linux_binprm *bprm); extern int cap_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, @@ -373,8 +377,10 @@ Signed-off-by: John Johansen } static inline int security_inode_need_killpriv(struct dentry *dentry) ---- a/include/linux/xattr.h -+++ b/include/linux/xattr.h +Index: linux-2.6.27/include/linux/xattr.h +=================================================================== +--- linux-2.6.27.orig/include/linux/xattr.h ++++ linux-2.6.27/include/linux/xattr.h @@ -17,6 +17,7 @@ #include @@ -398,8 +404,10 @@ Signed-off-by: John Johansen ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); ---- a/security/capability.c -+++ b/security/capability.c +Index: linux-2.6.27/security/capability.c +=================================================================== +--- linux-2.6.27.orig/security/capability.c ++++ linux-2.6.27/security/capability.c @@ -242,12 +242,13 @@ static void cap_inode_post_setxattr(stru } @@ -416,8 +424,10 @@ Signed-off-by: John Johansen { return 0; } ---- a/security/commoncap.c -+++ b/security/commoncap.c +Index: linux-2.6.27/security/commoncap.c +=================================================================== +--- linux-2.6.27.orig/security/commoncap.c ++++ linux-2.6.27/security/commoncap.c @@ -416,7 +416,7 @@ int cap_bprm_secureexec (struct linux_bi int cap_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, @@ -436,9 +446,11 @@ Signed-off-by: John Johansen { if (!strcmp(name, XATTR_NAME_CAPS)) { if (!capable(CAP_SETFCAP)) ---- a/security/security.c -+++ b/security/security.c -@@ -473,12 +473,12 @@ void security_inode_delete(struct inode +Index: linux-2.6.27/security/security.c +=================================================================== +--- linux-2.6.27.orig/security/security.c ++++ linux-2.6.27/security/security.c +@@ -470,12 +470,12 @@ void security_inode_delete(struct inode int security_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, const char *name, const void *value, size_t size, @@ -453,7 +465,7 @@ Signed-off-by: John Johansen } void security_inode_post_setxattr(struct dentry *dentry, struct vfsmount *mnt, -@@ -492,26 +492,27 @@ void security_inode_post_setxattr(struct +@@ -489,26 +489,27 @@ void security_inode_post_setxattr(struct } int security_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt, @@ -487,8 +499,10 @@ Signed-off-by: John Johansen } int security_inode_need_killpriv(struct dentry *dentry) ---- a/security/selinux/hooks.c -+++ b/security/selinux/hooks.c +Index: linux-2.6.27/security/selinux/hooks.c +=================================================================== +--- linux-2.6.27.orig/security/selinux/hooks.c ++++ linux-2.6.27/security/selinux/hooks.c @@ -2715,7 +2715,7 @@ static int selinux_inode_setotherxattr(s static int selinux_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, @@ -522,8 +536,10 @@ Signed-off-by: John Johansen { if (strcmp(name, XATTR_NAME_SELINUX)) return selinux_inode_setotherxattr(dentry, name); ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c +Index: linux-2.6.27/security/smack/smack_lsm.c +=================================================================== +--- linux-2.6.27.orig/security/smack/smack_lsm.c ++++ linux-2.6.27/security/smack/smack_lsm.c @@ -600,6 +600,7 @@ static int smack_inode_getattr(struct vf * @value: unused * @size: unused diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/sysctl-pathname.diff b/src/patches/suse-2.6.27.31/patches.apparmor/sysctl-pathname.diff similarity index 97% rename from src/patches/suse-2.6.27.25/patches.apparmor/sysctl-pathname.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/sysctl-pathname.diff index 599c76f1a..33c747c6a 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/sysctl-pathname.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/sysctl-pathname.diff @@ -27,7 +27,7 @@ Reviewed-by: James Morris void __user *newval, size_t newlen); --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -1554,6 +1554,33 @@ void register_sysctl_root(struct ctl_tab +@@ -1552,6 +1552,33 @@ void register_sysctl_root(struct ctl_tab spin_unlock(&sysctl_lock); } diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/unambiguous-__d_path.diff b/src/patches/suse-2.6.27.31/patches.apparmor/unambiguous-__d_path.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/unambiguous-__d_path.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/unambiguous-__d_path.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-getxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-getxattr.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-getxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-getxattr.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-link.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-link.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-link.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-link.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-listxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-listxattr.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-listxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-listxattr.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-mkdir.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-mkdir.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-mkdir.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-mkdir.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-mknod.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-mknod.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-mknod.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-mknod.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-notify_change.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-notify_change.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-notify_change.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-notify_change.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-removexattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-removexattr.diff similarity index 91% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-removexattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-removexattr.diff index a3153f406..18d6fee99 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-removexattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-removexattr.diff @@ -14,6 +14,8 @@ Signed-off-by: John Johansen include/linux/xattr.h | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) +Index: linux-2.6.27/fs/nfsd/vfs.c +=================================================================== --- linux-2.6.27.orig/fs/nfsd/vfs.c +++ linux-2.6.27/fs/nfsd/vfs.c @@ -2095,6 +2095,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i @@ -52,6 +54,8 @@ Signed-off-by: John Johansen getout: kfree(value); +Index: linux-2.6.27/fs/xattr.c +=================================================================== --- linux-2.6.27.orig/fs/xattr.c +++ linux-2.6.27/fs/xattr.c @@ -190,7 +190,7 @@ vfs_listxattr(struct dentry *dentry, str @@ -81,7 +85,7 @@ Signed-off-by: John Johansen } SYSCALL_DEFINE2(removexattr, const char __user *, pathname, -@@ -496,7 +496,7 @@ SYSCALL_DEFINE2(removexattr, const char +@@ -496,7 +496,7 @@ SYSCALL_DEFINE2(removexattr, const char return error; error = mnt_want_write(path.mnt); if (!error) { @@ -108,6 +112,8 @@ Signed-off-by: John Johansen mnt_drop_write(f->f_path.mnt); } fput(f); +Index: linux-2.6.27/include/linux/xattr.h +=================================================================== --- linux-2.6.27.orig/include/linux/xattr.h +++ linux-2.6.27/include/linux/xattr.h @@ -51,7 +51,7 @@ ssize_t xattr_getsecurity(struct inode * diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-rename.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-rename.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-rename.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-rename.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-rmdir.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-rmdir.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-rmdir.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-rmdir.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-setxattr.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-setxattr.diff similarity index 94% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-setxattr.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-setxattr.diff index f95a34640..919a68fff 100644 --- a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-setxattr.diff +++ b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-setxattr.diff @@ -14,6 +14,8 @@ Signed-off-by: John Johansen include/linux/xattr.h | 3 ++- 3 files changed, 21 insertions(+), 14 deletions(-) +Index: linux-2.6.27/fs/nfsd/vfs.c +=================================================================== --- linux-2.6.27.orig/fs/nfsd/vfs.c +++ linux-2.6.27/fs/nfsd/vfs.c @@ -438,7 +438,8 @@ static ssize_t nfsd_getxattr(struct dent @@ -78,6 +80,8 @@ Signed-off-by: John Johansen else { if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT) error = 0; +Index: linux-2.6.27/fs/xattr.c +=================================================================== --- linux-2.6.27.orig/fs/xattr.c +++ linux-2.6.27/fs/xattr.c @@ -67,8 +67,8 @@ xattr_permission(struct inode *inode, co @@ -138,6 +142,8 @@ Signed-off-by: John Johansen mnt_drop_write(f->f_path.mnt); } fput(f); +Index: linux-2.6.27/include/linux/xattr.h +=================================================================== --- linux-2.6.27.orig/include/linux/xattr.h +++ linux-2.6.27/include/linux/xattr.h @@ -16,6 +16,7 @@ diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-symlink.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-symlink.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-symlink.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-symlink.diff diff --git a/src/patches/suse-2.6.27.25/patches.apparmor/vfs-unlink.diff b/src/patches/suse-2.6.27.31/patches.apparmor/vfs-unlink.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.apparmor/vfs-unlink.diff rename to src/patches/suse-2.6.27.31/patches.apparmor/vfs-unlink.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/0000-ACPI-video-Ignore-devices-not-present.patch b/src/patches/suse-2.6.27.31/patches.arch/0000-ACPI-video-Ignore-devices-not-present.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0000-ACPI-video-Ignore-devices-not-present.patch rename to src/patches/suse-2.6.27.31/patches.arch/0000-ACPI-video-Ignore-devices-not-present.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0001-Check-for-ACPI-backlight-support.patch b/src/patches/suse-2.6.27.31/patches.arch/0001-Check-for-ACPI-backlight-support.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0001-Check-for-ACPI-backlight-support.patch rename to src/patches/suse-2.6.27.31/patches.arch/0001-Check-for-ACPI-backlight-support.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0002-Acer-WMI-fingers-off-backlight-video.ko.patch b/src/patches/suse-2.6.27.31/patches.arch/0002-Acer-WMI-fingers-off-backlight-video.ko.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0002-Acer-WMI-fingers-off-backlight-video.ko.patch rename to src/patches/suse-2.6.27.31/patches.arch/0002-Acer-WMI-fingers-off-backlight-video.ko.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0003-Asus-acpi-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0003-Asus-acpi-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0003-Asus-acpi-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0003-Asus-acpi-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0004-Compal-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0004-Compal-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0004-Compal-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0004-Compal-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0005-eeepc-laptop-fingers-off.patch b/src/patches/suse-2.6.27.31/patches.arch/0005-eeepc-laptop-fingers-off.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0005-eeepc-laptop-fingers-off.patch rename to src/patches/suse-2.6.27.31/patches.arch/0005-eeepc-laptop-fingers-off.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0006-fujitsu-laptop-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0006-fujitsu-laptop-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0006-fujitsu-laptop-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0006-fujitsu-laptop-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0007-msi-laptop-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0007-msi-laptop-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0007-msi-laptop-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0007-msi-laptop-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0008-sony-laptop-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0008-sony-laptop-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0008-sony-laptop-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0008-sony-laptop-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/0009-thinkpad_acpi-fingers-off-backlight.patch b/src/patches/suse-2.6.27.31/patches.arch/0009-thinkpad_acpi-fingers-off-backlight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/0009-thinkpad_acpi-fingers-off-backlight.patch rename to src/patches/suse-2.6.27.31/patches.arch/0009-thinkpad_acpi-fingers-off-backlight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-bay-remove-from-makefile b/src/patches/suse-2.6.27.31/patches.arch/acpi-bay-remove-from-makefile similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-bay-remove-from-makefile rename to src/patches/suse-2.6.27.31/patches.arch/acpi-bay-remove-from-makefile diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-bay-remove-useless-code.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-bay-remove-useless-code.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-bay-remove-useless-code.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-bay-remove-useless-code.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-Fix-duplicate-notification-handler-register.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-Fix-duplicate-notification-handler-register.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-Fix-duplicate-notification-handler-register.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-Fix-duplicate-notification-handler-register.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-_LCK-support-for-dock.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-_LCK-support-for-dock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-_LCK-support-for-dock.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-_LCK-support-for-dock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-add-type-sysfs-file-for-dock.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-add-type-sysfs-file-for-dock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-add-type-sysfs-file-for-dock.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-add-type-sysfs-file-for-dock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-don-t-eval-_sta-on-every-show_docked-sysfs-read.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-eject-request-process.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-eject-request-process.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-eject-request-process.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-eject-request-process.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-for-bay-in-a-dock-station.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-for-bay-in-a-dock-station.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-for-bay-in-a-dock-station.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-for-bay-in-a-dock-station.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-hotplug-race.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-hotplug-race.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-fix-hotplug-race.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-fix-hotplug-race.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-introduce-.uevent-for-devices-in-dock.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-introduce-.uevent-for-devices-in-dock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-introduce-.uevent-for-devices-in-dock.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-introduce-.uevent-for-devices-in-dock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-dock-makeing-dock-driver-supports-bay-and-battery-hotplug.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-dock-makeing-dock-driver-supports-bay-and-battery-hotplug.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-dock-makeing-dock-driver-supports-bay-and-battery-hotplug.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-dock-makeing-dock-driver-supports-bay-and-battery-hotplug.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-export-hotplug_execute b/src/patches/suse-2.6.27.31/patches.arch/acpi-export-hotplug_execute similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-export-hotplug_execute rename to src/patches/suse-2.6.27.31/patches.arch/acpi-export-hotplug_execute diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi-libata-hotplug-to-align-with-dock-driver.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi-libata-hotplug-to-align-with-dock-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi-libata-hotplug-to-align-with-dock-driver.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi-libata-hotplug-to-align-with-dock-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_behave_uniquely_based_on_processor_declaration.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_behave_uniquely_based_on_processor_declaration.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_behave_uniquely_based_on_processor_declaration.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_behave_uniquely_based_on_processor_declaration.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_disambiguate_processor_declaration_type.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_disambiguate_processor_declaration_type.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_disambiguate_processor_declaration_type.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_disambiguate_processor_declaration_type.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch similarity index 93% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch index 2dd543b8e..db2d4d69d 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/acpi_ec_provide_non_interrupt_mode_boot_param.patch @@ -18,7 +18,7 @@ Signed-off-by: Alexey Starikovskiy --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -699,6 +699,11 @@ and is between 256 and 4096 characters. +@@ -706,6 +706,11 @@ and is between 256 and 4096 characters. eata= [HW,SCSI] @@ -50,7 +50,7 @@ Signed-off-by: Alexey Starikovskiy acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); status = acpi_install_address_space_handler(ec->handle, -@@ -1094,3 +1098,14 @@ static void __exit acpi_ec_exit(void) +@@ -1095,3 +1099,14 @@ static void __exit acpi_ec_exit(void) return; } #endif /* 0 */ diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_processor_cleanups.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_processor_cleanups.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_processor_cleanups.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_processor_cleanups.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-ia64.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-ia64.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-ia64.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-ia64.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-store.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-store.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-store.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-store.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-x86-64.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-x86-64.patch similarity index 91% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-x86-64.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-x86-64.patch index 6a7f6de5c..53430f270 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/acpi_srat-pxm-rev-x86-64.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/acpi_srat-pxm-rev-x86-64.patch @@ -21,7 +21,7 @@ Signed-off-by: Kurt Garloff --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c -@@ -131,6 +131,8 @@ acpi_numa_processor_affinity_init(struct +@@ -133,6 +133,8 @@ acpi_numa_processor_affinity_init(struct if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) return; pxm = pa->proximity_domain_lo; @@ -30,7 +30,7 @@ Signed-off-by: Kurt Garloff node = setup_node(pxm); if (node < 0) { printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); -@@ -241,6 +243,8 @@ acpi_numa_memory_affinity_init(struct ac +@@ -243,6 +245,8 @@ acpi_numa_memory_affinity_init(struct ac start = ma->base_address; end = start + ma->length; pxm = ma->proximity_domain; diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_thermal_passive_blacklist.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_thermal_passive_blacklist.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_thermal_passive_blacklist.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_thermal_passive_blacklist.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_introduce_acpi_root_table_boot_param.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_introduce_acpica_rsdt_global_variable.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_introduce_acpica_rsdt_global_variable.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_introduce_acpica_rsdt_global_variable.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_introduce_acpica_rsdt_global_variable.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_remove_R40e_c-state_blacklist.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_remove_R40e_c-state_blacklist.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_thinkpad_remove_R40e_c-state_blacklist.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_thinkpad_remove_R40e_c-state_blacklist.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_video_thinkpad_exclude_IGD_devices.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_video_thinkpad_exclude_IGD_devices.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_video_thinkpad_exclude_IGD_devices.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_video_thinkpad_exclude_IGD_devices.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/acpi_x2APIC_madt_enhancements.patch b/src/patches/suse-2.6.27.31/patches.arch/acpi_x2APIC_madt_enhancements.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/acpi_x2APIC_madt_enhancements.patch rename to src/patches/suse-2.6.27.31/patches.arch/acpi_x2APIC_madt_enhancements.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch b/src/patches/suse-2.6.27.31/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch rename to src/patches/suse-2.6.27.31/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch index ccffcba85..2b398303d 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/check-for-acpi-resource-conflicts-in-hwmon-drivers.patch @@ -216,7 +216,7 @@ Signed-off-by: Andrew Morton #include static unsigned short force_id; -@@ -705,6 +706,10 @@ static int __init smsc47m1_device_add(un +@@ -716,6 +717,10 @@ static int __init smsc47m1_device_add(un }; int err; diff --git a/src/patches/suse-2.6.27.25/patches.arch/compat-sys-swapcontext b/src/patches/suse-2.6.27.31/patches.arch/compat-sys-swapcontext similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/compat-sys-swapcontext rename to src/patches/suse-2.6.27.31/patches.arch/compat-sys-swapcontext diff --git a/src/patches/suse-2.6.27.25/patches.arch/disable-apic-error b/src/patches/suse-2.6.27.31/patches.arch/disable-apic-error similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/disable-apic-error rename to src/patches/suse-2.6.27.31/patches.arch/disable-apic-error diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-cpu_disable-fix b/src/patches/suse-2.6.27.31/patches.arch/ia64-cpu_disable-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-cpu_disable-fix rename to src/patches/suse-2.6.27.31/patches.arch/ia64-cpu_disable-fix diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-node_mem_map-node_start_pfn.diff b/src/patches/suse-2.6.27.31/patches.arch/ia64-node_mem_map-node_start_pfn.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-node_mem_map-node_start_pfn.diff rename to src/patches/suse-2.6.27.31/patches.arch/ia64-node_mem_map-node_start_pfn.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-page-migration b/src/patches/suse-2.6.27.31/patches.arch/ia64-page-migration similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-page-migration rename to src/patches/suse-2.6.27.31/patches.arch/ia64-page-migration diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-page-migration.fix b/src/patches/suse-2.6.27.31/patches.arch/ia64-page-migration.fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-page-migration.fix rename to src/patches/suse-2.6.27.31/patches.arch/ia64-page-migration.fix diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-rwlocks-enable-interrupts b/src/patches/suse-2.6.27.31/patches.arch/ia64-rwlocks-enable-interrupts similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-rwlocks-enable-interrupts rename to src/patches/suse-2.6.27.31/patches.arch/ia64-rwlocks-enable-interrupts diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-smp_flush_tlb_mm-IPI-fix b/src/patches/suse-2.6.27.31/patches.arch/ia64-smp_flush_tlb_mm-IPI-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-smp_flush_tlb_mm-IPI-fix rename to src/patches/suse-2.6.27.31/patches.arch/ia64-smp_flush_tlb_mm-IPI-fix diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-sn-BTE_MAX_XFER b/src/patches/suse-2.6.27.31/patches.arch/ia64-sn-BTE_MAX_XFER similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-sn-BTE_MAX_XFER rename to src/patches/suse-2.6.27.31/patches.arch/ia64-sn-BTE_MAX_XFER diff --git a/src/patches/suse-2.6.27.25/patches.arch/ia64-sn-fix-pci-attribute-propagation-bug.patch b/src/patches/suse-2.6.27.31/patches.arch/ia64-sn-fix-pci-attribute-propagation-bug.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ia64-sn-fix-pci-attribute-propagation-bug.patch rename to src/patches/suse-2.6.27.31/patches.arch/ia64-sn-fix-pci-attribute-propagation-bug.patch diff --git a/src/patches/suse-2.6.27.31/patches.arch/ia64-sn-specific-version-of-dma_get_required_mask b/src/patches/suse-2.6.27.31/patches.arch/ia64-sn-specific-version-of-dma_get_required_mask new file mode 100644 index 000000000..f329edaa5 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/ia64-sn-specific-version-of-dma_get_required_mask @@ -0,0 +1,192 @@ +From: John Keller +Date: Mon, 24 Nov 2008 22:47:17 +0000 (-0600) +Subject: [IA64] SN specific version of dma_get_required_mask() +Patch-mainline: 2.6.29-rc2 +Git-commit: 175add1981e53d22caba8f42d5f924a4de507b6c +References: bnc#529369 + +[IA64] SN specific version of dma_get_required_mask() + +Create a platform specific version of dma_get_required_mask() +for ia64 SN Altix. All SN Altix platforms support 64 bit DMA +addressing regardless of the size of system memory. +Create an ia64 machvec for dma_get_required_mask, with the +SN version unconditionally returning DMA_64BIT_MASK. + +Signed-off-by: John Keller +Signed-off-by: Tony Luck +Acked-by: Jeff Mahoney +--- + Documentation/DMA-API.txt | 9 ++++----- + arch/ia64/include/asm/dma-mapping.h | 2 ++ + arch/ia64/include/asm/machvec.h | 7 +++++++ + arch/ia64/include/asm/machvec_init.h | 1 + + arch/ia64/include/asm/machvec_sn2.h | 2 ++ + arch/ia64/pci/pci.c | 27 +++++++++++++++++++++++++++ + arch/ia64/sn/pci/pci_dma.c | 6 ++++++ + 7 files changed, 49 insertions(+), 5 deletions(-) + +--- a/Documentation/DMA-API.txt ++++ b/Documentation/DMA-API.txt +@@ -170,16 +170,15 @@ Returns: 0 if successful and a negative + u64 + dma_get_required_mask(struct device *dev) + +-After setting the mask with dma_set_mask(), this API returns the +-actual mask (within that already set) that the platform actually +-requires to operate efficiently. Usually this means the returned mask ++This API returns the mask that the platform requires to ++operate efficiently. Usually this means the returned mask + is the minimum required to cover all of memory. Examining the + required mask gives drivers with variable descriptor sizes the + opportunity to use smaller descriptors as necessary. + + Requesting the required mask does not alter the current mask. If you +-wish to take advantage of it, you should issue another dma_set_mask() +-call to lower the mask again. ++wish to take advantage of it, you should issue a dma_set_mask() ++call to set the mask to the value returned. + + + Part Id - Streaming DMA mappings +--- a/arch/ia64/include/asm/dma-mapping.h ++++ b/arch/ia64/include/asm/dma-mapping.h +@@ -8,6 +8,8 @@ + #include + #include + ++#define ARCH_HAS_DMA_GET_REQUIRED_MASK ++ + #define dma_alloc_coherent platform_dma_alloc_coherent + /* coherent mem. is cheap */ + static inline void * +--- a/arch/ia64/include/asm/machvec.h ++++ b/arch/ia64/include/asm/machvec.h +@@ -61,6 +61,7 @@ typedef dma_addr_t ia64_mv_dma_map_singl + typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *); + typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); + typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *); ++typedef u64 ia64_mv_dma_get_required_mask (struct device *); + + /* + * WARNING: The legacy I/O space is _architected_. Platforms are +@@ -154,6 +155,7 @@ extern void machvec_tlb_migrate_finish ( + # define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device + # define platform_dma_mapping_error ia64_mv.dma_mapping_error + # define platform_dma_supported ia64_mv.dma_supported ++# define platform_dma_get_required_mask ia64_mv.dma_get_required_mask + # define platform_irq_to_vector ia64_mv.irq_to_vector + # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq + # define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem +@@ -208,6 +210,7 @@ struct ia64_machine_vector { + ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device; + ia64_mv_dma_mapping_error *dma_mapping_error; + ia64_mv_dma_supported *dma_supported; ++ ia64_mv_dma_get_required_mask *dma_get_required_mask; + ia64_mv_irq_to_vector *irq_to_vector; + ia64_mv_local_vector_to_irq *local_vector_to_irq; + ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; +@@ -258,6 +261,7 @@ struct ia64_machine_vector { + platform_dma_sync_sg_for_device, \ + platform_dma_mapping_error, \ + platform_dma_supported, \ ++ platform_dma_get_required_mask, \ + platform_irq_to_vector, \ + platform_local_vector_to_irq, \ + platform_pci_get_legacy_mem, \ +@@ -382,6 +386,9 @@ extern ia64_mv_dma_supported swiotlb_dm + #ifndef platform_dma_supported + # define platform_dma_supported swiotlb_dma_supported + #endif ++#ifndef platform_dma_get_required_mask ++# define platform_dma_get_required_mask ia64_dma_get_required_mask ++#endif + #ifndef platform_irq_to_vector + # define platform_irq_to_vector __ia64_irq_to_vector + #endif +--- a/arch/ia64/include/asm/machvec_init.h ++++ b/arch/ia64/include/asm/machvec_init.h +@@ -2,6 +2,7 @@ + + extern ia64_mv_send_ipi_t ia64_send_ipi; + extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; ++extern ia64_mv_dma_get_required_mask ia64_dma_get_required_mask; + extern ia64_mv_irq_to_vector __ia64_irq_to_vector; + extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; + extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; +--- a/arch/ia64/include/asm/machvec_sn2.h ++++ b/arch/ia64/include/asm/machvec_sn2.h +@@ -67,6 +67,7 @@ extern ia64_mv_dma_sync_single_for_devic + extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; + extern ia64_mv_dma_mapping_error sn_dma_mapping_error; + extern ia64_mv_dma_supported sn_dma_supported; ++extern ia64_mv_dma_get_required_mask sn_dma_get_required_mask; + extern ia64_mv_migrate_t sn_migrate; + extern ia64_mv_kernel_launch_event_t sn_kernel_launch_event; + extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq; +@@ -123,6 +124,7 @@ extern ia64_mv_pci_fixup_bus_t sn_pci_f + #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device + #define platform_dma_mapping_error sn_dma_mapping_error + #define platform_dma_supported sn_dma_supported ++#define platform_dma_get_required_mask sn_dma_get_required_mask + #define platform_migrate sn_migrate + #define platform_kernel_launch_event sn_kernel_launch_event + #ifdef CONFIG_PCI_MSI +--- a/arch/ia64/pci/pci.c ++++ b/arch/ia64/pci/pci.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -743,6 +744,32 @@ static void __init set_pci_cacheline_siz + pci_cache_line_size = (1 << cci.pcci_line_size) / 4; + } + ++u64 ia64_dma_get_required_mask(struct device *dev) ++{ ++ u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT); ++ u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT)); ++ u64 mask; ++ ++ if (!high_totalram) { ++ /* convert to mask just covering totalram */ ++ low_totalram = (1 << (fls(low_totalram) - 1)); ++ low_totalram += low_totalram - 1; ++ mask = low_totalram; ++ } else { ++ high_totalram = (1 << (fls(high_totalram) - 1)); ++ high_totalram += high_totalram - 1; ++ mask = (((u64)high_totalram) << 32) + 0xffffffff; ++ } ++ return mask; ++} ++EXPORT_SYMBOL_GPL(ia64_dma_get_required_mask); ++ ++u64 dma_get_required_mask(struct device *dev) ++{ ++ return platform_dma_get_required_mask(dev); ++} ++EXPORT_SYMBOL_GPL(dma_get_required_mask); ++ + static int __init pcibios_init(void) + { + set_pci_cacheline_size(); +--- a/arch/ia64/sn/pci/pci_dma.c ++++ b/arch/ia64/sn/pci/pci_dma.c +@@ -356,6 +356,12 @@ int sn_dma_mapping_error(struct device * + } + EXPORT_SYMBOL(sn_dma_mapping_error); + ++u64 sn_dma_get_required_mask(struct device *dev) ++{ ++ return DMA_64BIT_MASK; ++} ++EXPORT_SYMBOL_GPL(sn_dma_get_required_mask); ++ + char *sn_pci_get_legacy_mem(struct pci_bus *bus) + { + if (!SN_PCIBUS_BUSSOFT(bus)) diff --git a/src/patches/suse-2.6.27.25/patches.arch/mm-avoid-bad-page-on-lru b/src/patches/suse-2.6.27.31/patches.arch/mm-avoid-bad-page-on-lru similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/mm-avoid-bad-page-on-lru rename to src/patches/suse-2.6.27.31/patches.arch/mm-avoid-bad-page-on-lru diff --git a/src/patches/suse-2.6.27.25/patches.arch/powerpc-pseries-cmo-unused-page-hinting.patch b/src/patches/suse-2.6.27.31/patches.arch/powerpc-pseries-cmo-unused-page-hinting.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/powerpc-pseries-cmo-unused-page-hinting.patch rename to src/patches/suse-2.6.27.31/patches.arch/powerpc-pseries-cmo-unused-page-hinting.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-altivec-VSX-ctxswitch b/src/patches/suse-2.6.27.31/patches.arch/ppc-altivec-VSX-ctxswitch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-altivec-VSX-ctxswitch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-altivec-VSX-ctxswitch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-axon-missing-msi-workaround-5.diff b/src/patches/suse-2.6.27.31/patches.arch/ppc-axon-missing-msi-workaround-5.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-axon-missing-msi-workaround-5.diff rename to src/patches/suse-2.6.27.31/patches.arch/ppc-axon-missing-msi-workaround-5.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-cell-gdb-watchpoints.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-cell-gdb-watchpoints.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-cell-gdb-watchpoints.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-cell-gdb-watchpoints.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-clock_gettime-nanoseconds.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-clock_gettime-nanoseconds.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-clock_gettime-nanoseconds.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-clock_gettime-nanoseconds.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-dynamic-reconfiguration.diff b/src/patches/suse-2.6.27.31/patches.arch/ppc-dynamic-reconfiguration.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-dynamic-reconfiguration.diff rename to src/patches/suse-2.6.27.31/patches.arch/ppc-dynamic-reconfiguration.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-efika-bestcomm-ata-dma.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-efika-bestcomm-ata-dma.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-efika-bestcomm-ata-dma.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-efika-bestcomm-ata-dma.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-efika-mpc52xx-ac97.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-efika-mpc52xx-ac97.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-efika-mpc52xx-ac97.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-efika-mpc52xx-ac97.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-efika-psc-console-autodetection.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-efika-psc-console-autodetection.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-efika-psc-console-autodetection.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-efika-psc-console-autodetection.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-fix-ppc-insn-emulation_mr.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-fix-ppc-insn-emulation_mr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-fix-ppc-insn-emulation_mr.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-fix-ppc-insn-emulation_mr.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ipic-suspend-without-83xx-fix b/src/patches/suse-2.6.27.31/patches.arch/ppc-ipic-suspend-without-83xx-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ipic-suspend-without-83xx-fix rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ipic-suspend-without-83xx-fix diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-memoryless-nodes.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-memoryless-nodes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-memoryless-nodes.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-memoryless-nodes.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-of-irq-map.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-of-irq-map.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-of-irq-map.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-of-irq-map.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-oprofile-spu-mutex-locking.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-oprofile-spu-mutex-locking.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-oprofile-spu-mutex-locking.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-oprofile-spu-mutex-locking.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-oprofile-spu.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-oprofile-spu.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-oprofile-spu.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-oprofile-spu.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-optimize-sync.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-optimize-sync.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-optimize-sync.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-optimize-sync.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pcibios_allocate_bus_resources.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pcibios_allocate_bus_resources.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pcibios_allocate_bus_resources.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pcibios_allocate_bus_resources.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pegasos-console-autodetection.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pegasos-console-autodetection.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pegasos-console-autodetection.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pegasos-console-autodetection.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-powerpc-debug-pci-hotplug.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-powerpc-debug-pci-hotplug.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-powerpc-debug-pci-hotplug.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-powerpc-debug-pci-hotplug.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-powerpc-fix-pci-unmap-io.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-powerpc-fix-pci-unmap-io.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-powerpc-fix-pci-unmap-io.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-powerpc-fix-pci-unmap-io.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-prom-nodisplay.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-prom-nodisplay.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-prom-nodisplay.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-prom-nodisplay.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-passthrough-support-for-non-audio-streams.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-passthrough-support-for-non-audio-streams.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-passthrough-support-for-non-audio-streams.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-passthrough-support-for-non-audio-streams.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-ps3av-audio-mute-analog.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-ps3av-audio-mute-analog.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-ps3av-audio-mute-analog.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-ps3av-audio-mute-analog.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-support-for-SPDIF-HDMI-passthrough.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-support-for-SPDIF-HDMI-passthrough.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-add-support-for-SPDIF-HDMI-passthrough.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-add-support-for-SPDIF-HDMI-passthrough.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-introduce-ps3_gpu_mutex.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-introduce-ps3_gpu_mutex.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-introduce-ps3_gpu_mutex.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-introduce-ps3_gpu_mutex.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-ps3vram-mtd.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-ps3vram-mtd.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-ps3-ps3vram-mtd.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-ps3-ps3vram-mtd.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-bsr-4k.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-bsr-4k.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-bsr-4k.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-bsr-4k.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-bsr-multinode.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-bsr-multinode.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-bsr-multinode.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-bsr-multinode.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-cmm-pagecounter.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-cmm-pagecounter.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-cmm-pagecounter.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-cmm-pagecounter.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-cpu-migrate.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-cpu-migrate.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-cpu-migrate.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-cpu-migrate.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-migration_hang_fix.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-migration_hang_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries-migration_hang_fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries-migration_hang_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries_pfn-mem-rm.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries_pfn-mem-rm.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries_pfn-mem-rm.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries_pfn-mem-rm.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-pseries_remove_lmb-PAGE_SHIFTT.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-pseries_remove_lmb-PAGE_SHIFTT.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-pseries_remove_lmb-PAGE_SHIFTT.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-pseries_remove_lmb-PAGE_SHIFTT.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-select b/src/patches/suse-2.6.27.31/patches.arch/ppc-select similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-select rename to src/patches/suse-2.6.27.31/patches.arch/ppc-select diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-01-use-inc_nlink.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-01-use-inc_nlink.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-01-use-inc_nlink.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-01-use-inc_nlink.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-03-sputrace-Only-enable-logging-on-open.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-03-sputrace-Only-enable-logging-on-open.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-03-sputrace-Only-enable-logging-on-open.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-03-sputrace-Only-enable-logging-on-open.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-05-Use-state_mutex-for-switch_log-lockin.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-05-Use-state_mutex-for-switch_log-lockin.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-05-Use-state_mutex-for-switch_log-lockin.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-05-Use-state_mutex-for-switch_log-lockin.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-06-Don-t-require-full-buffer-in-switch_l.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-06-Don-t-require-full-buffer-in-switch_l.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-06-Don-t-require-full-buffer-in-switch_l.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-06-Don-t-require-full-buffer-in-switch_l.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-07-Don-t-spu_acquire_saved-unnecessarily.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-07-Don-t-spu_acquire_saved-unnecessarily.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-07-Don-t-spu_acquire_saved-unnecessarily.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-07-Don-t-spu_acquire_saved-unnecessarily.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-08-Use-kmalloc-rather-than-kzalloc-for-s.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-08-Use-kmalloc-rather-than-kzalloc-for-s.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-08-Use-kmalloc-rather-than-kzalloc-for-s.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-08-Use-kmalloc-rather-than-kzalloc-for-s.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-09-Improve-search-of-node-for-contexts-w.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-09-Improve-search-of-node-for-contexts-w.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-09-Improve-search-of-node-for-contexts-w.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-09-Improve-search-of-node-for-contexts-w.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-syscall-xer.so.1.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-syscall-xer.so.1.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-syscall-xer.so.1.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-syscall-xer.so.1.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-valid-hugepage-size-hugetlb_get_unmapped_area.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-valid-hugepage-size-hugetlb_get_unmapped_area.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-valid-hugepage-size-hugetlb_get_unmapped_area.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-valid-hugepage-size-hugetlb_get_unmapped_area.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-vio-modalias.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-vio-modalias.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-vio-modalias.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-vio-modalias.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-vmcoreinfo.diff b/src/patches/suse-2.6.27.31/patches.arch/ppc-vmcoreinfo.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-vmcoreinfo.diff rename to src/patches/suse-2.6.27.31/patches.arch/ppc-vmcoreinfo.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc-xics-EOI-unmapped-irqs.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc-xics-EOI-unmapped-irqs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc-xics-EOI-unmapped-irqs.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc-xics-EOI-unmapped-irqs.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc32-fix-ptrace-compat-wrapper-for-fpu-register-access b/src/patches/suse-2.6.27.31/patches.arch/ppc32-fix-ptrace-compat-wrapper-for-fpu-register-access similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc32-fix-ptrace-compat-wrapper-for-fpu-register-access rename to src/patches/suse-2.6.27.31/patches.arch/ppc32-fix-ptrace-compat-wrapper-for-fpu-register-access diff --git a/src/patches/suse-2.6.27.31/patches.arch/ppc64-eeh-msix-irq b/src/patches/suse-2.6.27.31/patches.arch/ppc64-eeh-msix-irq new file mode 100644 index 000000000..0436ab890 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/ppc64-eeh-msix-irq @@ -0,0 +1,145 @@ +From: Mike Mason +Date: Tue, 10 Feb 2009 11:12:21 +0000 (+0000) +Subject: powerpc/eeh: Only disable/enable LSI interrupts in EEH +Patch-mainline: 2.6.30-rc1 +Git-commit: 8535ef05a6904429ce72671c3035dbf05e6d5edf +References: bnc#509497 + +powerpc/eeh: Only disable/enable LSI interrupts in EEH + +The EEH code disables and enables interrupts during the +device recovery process. This is unnecessary for MSI +and MSI-X interrupts because they are effectively disabled +by the DMA Stopped state when an EEH error occurs. The +current code is also incorrect for MSI-X interrupts. It +doesn't take into account that MSI-X interrupts are tracked +in a different way than LSI/MSI interrupts. This patch +ensures only LSI interrupts are disabled/enabled. + +Signed-off-by: Mike Mason +Acked-by: Linas Vepstas +Signed-off-by: Benjamin Herrenschmidt +Acked-by: Jeff Mahoney +--- + + arch/powerpc/platforms/pseries/eeh_driver.c | 68 ++++++++++++++++++---------- + 1 file changed, 45 insertions(+), 23 deletions(-) + +--- a/arch/powerpc/platforms/pseries/eeh_driver.c ++++ b/arch/powerpc/platforms/pseries/eeh_driver.c +@@ -79,6 +79,40 @@ static int irq_in_use(unsigned int irq) + return rc; + } + ++/** ++ * eeh_disable_irq - disable interrupt for the recovering device ++ */ ++static void eeh_disable_irq(struct pci_dev *dev) ++{ ++ struct device_node *dn = pci_device_to_OF_node(dev); ++ ++ /* Don't disable MSI and MSI-X interrupts. They are ++ * effectively disabled by the DMA Stopped state ++ * when an EEH error occurs. ++ */ ++ if (dev->msi_enabled || dev->msix_enabled) ++ return; ++ ++ if (!irq_in_use(dev->irq)) ++ return; ++ ++ PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED; ++ disable_irq_nosync(dev->irq); ++} ++ ++/** ++ * eeh_enable_irq - enable interrupt for the recovering device ++ */ ++static void eeh_enable_irq(struct pci_dev *dev) ++{ ++ struct device_node *dn = pci_device_to_OF_node(dev); ++ ++ if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { ++ PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; ++ enable_irq(dev->irq); ++ } ++} ++ + /* ------------------------------------------------------- */ + /** + * eeh_report_error - report pci error to each device driver +@@ -98,11 +132,8 @@ static void eeh_report_error(struct pci_ + if (!driver) + return; + +- if (irq_in_use (dev->irq)) { +- struct device_node *dn = pci_device_to_OF_node(dev); +- PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED; +- disable_irq_nosync(dev->irq); +- } ++ eeh_disable_irq(dev); ++ + if (!driver->err_handler || + !driver->err_handler->error_detected) + return; +@@ -147,17 +178,14 @@ static void eeh_report_reset(struct pci_ + { + enum pci_ers_result rc, *res = userdata; + struct pci_driver *driver = dev->driver; +- struct device_node *dn = pci_device_to_OF_node(dev); + + if (!driver) + return; + + dev->error_state = pci_channel_io_normal; + +- if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { +- PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; +- enable_irq(dev->irq); +- } ++ eeh_enable_irq(dev); ++ + if (!driver->err_handler || + !driver->err_handler->slot_reset) + return; +@@ -176,17 +204,14 @@ static void eeh_report_reset(struct pci_ + static void eeh_report_resume(struct pci_dev *dev, void *userdata) + { + struct pci_driver *driver = dev->driver; +- struct device_node *dn = pci_device_to_OF_node(dev); + + dev->error_state = pci_channel_io_normal; + + if (!driver) + return; + +- if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { +- PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; +- enable_irq(dev->irq); +- } ++ eeh_enable_irq(dev); ++ + if (!driver->err_handler || + !driver->err_handler->resume) + return; +@@ -210,15 +235,12 @@ static void eeh_report_failure(struct pc + if (!driver) + return; + +- if (irq_in_use (dev->irq)) { +- struct device_node *dn = pci_device_to_OF_node(dev); +- PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED; +- disable_irq_nosync(dev->irq); +- } +- if (!driver->err_handler) +- return; +- if (!driver->err_handler->error_detected) ++ eeh_disable_irq(dev); ++ ++ if (!driver->err_handler || ++ !driver->err_handler->error_detected) + return; ++ + driver->err_handler->error_detected(dev, pci_channel_io_perm_failure); + } + diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch similarity index 84% rename from src/patches/suse-2.6.27.25/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch index 3e7f6adb0..bbb5b8891 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch @@ -19,11 +19,13 @@ Git: 13870b657578bcce167978ee93dc02bf54e3beb0 Signed-off-by: Benjamin Herrenschmidt Acked-by: Nick Piggin -diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c -index 8d5b475..f5bc1b2 100644 +--- + arch/powerpc/mm/hash_utils_64.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c -@@ -516,7 +516,7 @@ static int __init htab_dt_scan_pftsize(unsigned long node, +@@ -514,7 +514,7 @@ static int __init htab_dt_scan_pftsize(u static unsigned long __init htab_get_table_size(void) { @@ -32,7 +34,7 @@ index 8d5b475..f5bc1b2 100644 /* If hash size isn't already provided by the platform, we try to * retrieve it from the device-tree. If it's not there neither, we -@@ -534,7 +534,8 @@ static unsigned long __init htab_get_table_size(void) +@@ -532,7 +532,8 @@ static unsigned long __init htab_get_tab rnd_mem_size <<= 1; /* # pages / 2 */ diff --git a/src/patches/suse-2.6.27.25/patches.arch/ppc64-xmon-dmesg-printing.patch b/src/patches/suse-2.6.27.31/patches.arch/ppc64-xmon-dmesg-printing.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/ppc64-xmon-dmesg-printing.patch rename to src/patches/suse-2.6.27.31/patches.arch/ppc64-xmon-dmesg-printing.patch diff --git a/src/patches/suse-2.6.27.31/patches.arch/pseries-set-error_state-correctly-in-eeh_report_reset b/src/patches/suse-2.6.27.31/patches.arch/pseries-set-error_state-correctly-in-eeh_report_reset new file mode 100644 index 000000000..e4e58652e --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/pseries-set-error_state-correctly-in-eeh_report_reset @@ -0,0 +1,98 @@ +From: Mike Mason +Date: Fri, 10 Apr 2009 08:57:03 +0000 (+0000) +Subject: powerpc/pseries: Set error_state to pci_channel_io_normal in eeh_report_reset() +Patch-mainline: 2.6.30 +Git-commit: c58dc575f3c8bdc69fb868ec51e1c80ee7cae5e7 +References: bnc#509407 + +powerpc/pseries: Set error_state to pci_channel_io_normal in eeh_report_reset() + +While adding native EEH support to Emulex and Qlogic drivers, it was +discovered that dev->error_state was set to pci_io_channel_normal too +late in the recovery process. These drivers rely on error_state to +determine if they can access the device in their slot_reset callback, +thus error_state needs to be set to pci_io_channel_normal in +eeh_report_reset(). Below is a detailed explanation (courtesy of Richard +Lary) as to why this is necessary. + +Background: +PCI MMIO or DMA accesses to a frozen slot generate additional EEH +errors. If the number of additional EEH errors exceeds EEH_MAX_FAILS the +adapter will be shutdown. To avoid triggering excessive EEH errors and +an undesirable adapter shutdown, some drivers use the +pci_channel_offline(dev) wrapper function to return a Boolean value +based on the value of pci_dev->error_state to determine if PCI MMIO or +DMA accesses are safe. If the wrapper returns TRUE, drivers must not +make PCI MMIO or DMA access to their hardware. + +The pci_dev structure member error_state reflects one of three values, +1) pci_channel_io_normal, 2) pci_channel_io_frozen, 3) +pci_channel_io_perm_failure. Function pci_channel_offline(dev) returns +TRUE if error_state is pci_channel_io_frozen or pci_channel_io_perm_failure. + +The EEH driver sets pci_dev->error_state to pci_channel_io_frozen at the +point where the PCI slot is frozen. Currently, the EEH driver restores +dev->error_state to pci_channel_io_normal in eeh_report_resume() before +calling the driver's resume callback. However, when the EEH driver calls +the driver's slot_reset callback() from eeh_report_reset(), it +incorrectly indicates the error state is still pci_channel_io_frozen. + +Waiting until eeh_report_resume() to restore dev->error_state to +pci_channel_io_normal is too late for Emulex and QLogic FC drivers and +any other drivers which are designed to use common code paths in these +two cases: i) those called after the driver's slot_reset callback() and +ii) those called after the PCI slot is frozen but before the driver's +slot_reset callback is called. Case i) all driver paths executed to +reinitialize the hardware after a reset and case ii) all code paths +executed by driver kernel threads that run asynchronous to the main +driver thread, such as interrupt handlers and worker threads to process +driver work queues. + +Emulex and QLogic FC drivers are designed with common code paths which +require that pci_channel_offline(dev) reflect the true state of the +hardware. The state transitions that the hardware takes from Normal +Operations to Slot Frozen to Reset to Normal Operations are documented +in the Power Architecture™ Platform Requirements+ (PAPR+) in Table 75. +PE State Control. + +PAPR defines the following 3 states: + +0 -- Not reset, Not EEH stopped, MMIO load/store allowed, DMA allowed + (Normal Operations) +1 -- Reset, Not EEH stopped, MMIO load/store disabled, DMA disabled +2 -- Not reset, EEH stopped, MMIO load/store disabled, DMA disabled + (Slot Frozen) + +An EEH error places the slot in state 2 (Frozen) and the adapter driver +is notified that an EEH error was detected. If the adapter driver +returns PCI_ERS_RESULT_NEED_RESET, the EEH driver calls +eeh_reset_device() to place the slot into state 1 (Reset) and +eeh_reset_device completes by placing the slot into State 0 (Normal +Operations). Upon return from eeh_reset_device(), the EEH driver calls +eeh_report_reset, which then calls the adapter's slot_reset callback. At +the time the adapter's slot_reset callback is called, the true state of +the hardware is Normal Operations and should be accurately reflected by +setting dev->error_state to pci_channel_io_normal. + +The current implementation of EEH driver does not do so and requires +this change to correct this deficiency. + +Signed-off-by: Mike Mason +Acked-by: Linas Vepstas +Signed-off-by: Paul Mackerras +Acked-by: Jeff Mahoney +--- + arch/powerpc/platforms/pseries/eeh_driver.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/powerpc/platforms/pseries/eeh_driver.c ++++ b/arch/powerpc/platforms/pseries/eeh_driver.c +@@ -152,6 +152,8 @@ static void eeh_report_reset(struct pci_ + if (!driver) + return; + ++ dev->error_state = pci_channel_io_normal; ++ + if ((PCI_DN(dn)->eeh_mode) & EEH_MODE_IRQ_DISABLED) { + PCI_DN(dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED; + enable_irq(dev->irq); diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-02-dcss-64-v2.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-02-dcss-64-v2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-02-dcss-64-v2.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-02-dcss-64-v2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-1.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-1.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-1.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-1.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-2.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-2.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-3-v2.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-3-v2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-3-v2.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-3-v2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-4-v2.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-4-v2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-04-fcpperf-4-v2.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-04-fcpperf-4-v2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-05-kmsg-v3.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-05-kmsg-v3.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-05-kmsg-v3.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-05-kmsg-v3.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-01-06-zfcp-cleanup-v2.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-01-06-zfcp-cleanup-v2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-01-06-zfcp-cleanup-v2.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-01-06-zfcp-cleanup-v2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-01-xpram.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-01-xpram.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-01-xpram.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-01-xpram.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-03-zfcp.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-03-zfcp.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-03-zfcp.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-03-zfcp.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-04-qeth-mac.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-04-qeth-mac.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-04-qeth-mac.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-04-qeth-mac.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-05-qeth-recovery.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-05-qeth-recovery.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-05-qeth-recovery.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-05-qeth-recovery.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-06-qeth-offset.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-06-qeth-offset.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-06-qeth-offset.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-06-qeth-offset.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-07-qeth-ipv6check.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-07-qeth-ipv6check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-07-qeth-ipv6check.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-07-qeth-ipv6check.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-08-qeth-panic.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-08-qeth-panic.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-08-qeth-panic.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-08-qeth-panic.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-09-tape-lock.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-09-tape-lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-09-tape-lock.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-09-tape-lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-02-10-zfcp-scan-online.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-02-10-zfcp-scan-online.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-02-10-zfcp-scan-online.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-02-10-zfcp-scan-online.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-01-stp-init.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-01-stp-init.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-01-stp-init.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-01-stp-init.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-02-setup_memory.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-02-setup_memory.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-02-setup_memory.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-02-setup_memory.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-03-dasd_unsolicited_interrupt.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-03-dasd_unsolicited_interrupt.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-03-dasd_unsolicited_interrupt.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-03-dasd_unsolicited_interrupt.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-04-qdio_multicast_performance.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-04-qdio_multicast_performance.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-04-qdio_multicast_performance.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-04-qdio_multicast_performance.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-05-dasd-block-uevent.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-05-dasd-block-uevent.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-05-dasd-block-uevent.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-05-dasd-block-uevent.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-06-zfcp-hexdump.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-06-zfcp-hexdump.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-06-zfcp-hexdump.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-06-zfcp-hexdump.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-07-qeth_hsi_mcl_string.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-07-qeth_hsi_mcl_string.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-07-qeth_hsi_mcl_string.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-07-qeth_hsi_mcl_string.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-08-zfcp-abort-race.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-08-zfcp-abort-race.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-08-zfcp-abort-race.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-08-zfcp-abort-race.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-03-09-zfcp-oops-during-target-scan.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-03-09-zfcp-oops-during-target-scan.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-03-09-zfcp-oops-during-target-scan.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-03-09-zfcp-oops-during-target-scan.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-01-qdio_prevent_double_shutdown.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-01-qdio_prevent_double_shutdown.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-01-qdio_prevent_double_shutdown.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-01-qdio_prevent_double_shutdown.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-02-qdio-osa-port-count.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-02-qdio-osa-port-count.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-02-qdio-osa-port-count.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-02-qdio-osa-port-count.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-03-kmsg.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-03-kmsg.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-03-kmsg.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-03-kmsg.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-04-dasd_fatal_error_log_sense.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-04-dasd_fatal_error_log_sense.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-04-dasd_fatal_error_log_sense.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-04-dasd_fatal_error_log_sense.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-06-cio-sac-update.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-04-06-cio-sac-update.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-06-cio-sac-update.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-06-cio-sac-update.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-07-als.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-07-als.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-07-als.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-07-als.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-08-cio-ungroup-race-fix.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-08-cio-ungroup-race-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-08-cio-ungroup-race-fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-08-cio-ungroup-race-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-04-09-zfcp-host-busy-count-fix.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-04-09-zfcp-host-busy-count-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-04-09-zfcp-host-busy-count-fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-04-09-zfcp-host-busy-count-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-01-zfcp-message-linebreak.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-01-zfcp-message-linebreak.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-01-zfcp-message-linebreak.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-01-zfcp-message-linebreak.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-02-zfcp-invalid-non-null-return.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-02-zfcp-invalid-non-null-return.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-02-zfcp-invalid-non-null-return.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-02-zfcp-invalid-non-null-return.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-03-zfcp-wka-port.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-03-zfcp-wka-port.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-03-zfcp-wka-port.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-03-zfcp-wka-port.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-04-fix_rport_status_check.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-04-fix_rport_status_check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-04-fix_rport_status_check.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-04-fix_rport_status_check.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-05-stp-etr-stop-machine.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-05-stp-etr-stop-machine.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-05-stp-etr-stop-machine.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-05-stp-etr-stop-machine.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-06-stp-etr-mutex.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-06-stp-etr-mutex.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-06-stp-etr-mutex.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-06-stp-etr-mutex.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-07-generic-ipi.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-07-generic-ipi.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-07-generic-ipi.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-07-generic-ipi.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-08-topology.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-08-topology.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-08-topology.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-08-topology.patch index f876b3266..f08a61afc 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/s390-05-08-topology.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-05-08-topology.patch @@ -20,6 +20,23 @@ Acked-by: John Jolly arch/s390/kernel/topology.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -2201,6 +2201,14 @@ and is between 256 and 4096 characters. + See comment before function dc390_setup() in + drivers/scsi/tmscsim.c. + ++ topology= [S390] ++ Format: {off | on} ++ Specify if the kernel should make use of the cpu ++ topology informations if the hardware supports these. ++ The scheduler will make use of these informations and ++ e.g. base its process migration decisions on it. ++ Default is off. ++ + tp720= [HW,PS2] + + trix= [HW,OSS] MediaTrix AudioTrix Pro --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -59,6 +59,7 @@ struct core_info { @@ -55,20 +72,3 @@ Acked-by: John Jolly static int __init init_topology_update(void) { int rc; ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -2194,6 +2194,14 @@ and is between 256 and 4096 characters. - See comment before function dc390_setup() in - drivers/scsi/tmscsim.c. - -+ topology= [S390] -+ Format: {off | on} -+ Specify if the kernel should make use of the cpu -+ topology informations if the hardware supports these. -+ The scheduler will make use of these informations and -+ e.g. base its process migration decisions on it. -+ Default is off. -+ - tp720= [HW,PS2] - - trix= [HW,OSS] MediaTrix AudioTrix Pro diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-05-09-cleanup-of-portopen-requests.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-05-09-cleanup-of-portopen-requests.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-05-09-cleanup-of-portopen-requests.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-05-09-cleanup-of-portopen-requests.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-01-qeth-ext-src-mac-addr.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-01-qeth-ext-src-mac-addr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-01-qeth-ext-src-mac-addr.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-01-qeth-ext-src-mac-addr.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-02-qeth-layercrash.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-02-qeth-layercrash.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-02-qeth-layercrash.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-02-qeth-layercrash.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-03-dasd_sim_sense_condition.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-03-dasd_sim_sense_condition.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-03-dasd_sim_sense_condition.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-03-dasd_sim_sense_condition.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-04-qdio_ssqd_memcpy.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-04-qdio_ssqd_memcpy.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-04-qdio_ssqd_memcpy.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-04-qdio_ssqd_memcpy.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-05-qdio_s390dbf.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-05-qdio_s390dbf.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-05-qdio_s390dbf.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-05-qdio_s390dbf.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-06-qdio_inbound_ack.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-06-qdio_inbound_ack.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-06-qdio_inbound_ack.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-06-qdio_inbound_ack.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-06-07-cio-attach_detach.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-06-07-cio-attach_detach.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-06-07-cio-attach_detach.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-06-07-cio-attach_detach.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-07-01-zfcp-port-failed-message.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-07-01-zfcp-port-failed-message.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-07-01-zfcp-port-failed-message.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-07-01-zfcp-port-failed-message.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-07-02-zfcp-unchained-fsf.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-07-02-zfcp-unchained-fsf.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-07-02-zfcp-unchained-fsf.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-07-02-zfcp-unchained-fsf.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-07-03-topology-fix.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-07-03-topology-fix.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-07-03-topology-fix.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-07-03-topology-fix.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-07-04-dasd-failfast.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-07-04-dasd-failfast.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-07-04-dasd-failfast.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-07-04-dasd-failfast.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-01-cio-fix-mp-mode.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-08-01-cio-fix-mp-mode.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-01-cio-fix-mp-mode.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-01-cio-fix-mp-mode.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-02-zfcp-gpn-align-fix.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-08-02-zfcp-gpn-align-fix.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-02-zfcp-gpn-align-fix.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-02-zfcp-gpn-align-fix.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-03-iucv-cpu-hotremove.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-08-03-iucv-cpu-hotremove.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-03-iucv-cpu-hotremove.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-03-iucv-cpu-hotremove.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-04-compat-sigaltstack.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-08-04-compat-sigaltstack.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-04-compat-sigaltstack.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-04-compat-sigaltstack.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-05-af_iucv-msgpeek-fix.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-08-05-af_iucv-msgpeek-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-05-af_iucv-msgpeek-fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-05-af_iucv-msgpeek-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-06-personality.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-08-06-personality.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-06-personality.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-06-personality.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-07-compat_wrappers.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-08-07-compat_wrappers.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-07-compat_wrappers.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-07-compat_wrappers.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-08-add_qdio_utilization.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-08-08-add_qdio_utilization.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-08-add_qdio_utilization.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-08-add_qdio_utilization.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-08-09-switch-amode-off.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-08-09-switch-amode-off.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-08-09-switch-amode-off.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-08-09-switch-amode-off.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-09-01-cio_disable_notoper.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-09-01-cio_disable_notoper.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-09-01-cio_disable_notoper.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-09-01-cio_disable_notoper.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-09-02-sclp-handle-empty-evbufs.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-09-02-sclp-handle-empty-evbufs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-09-02-sclp-handle-empty-evbufs.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-09-02-sclp-handle-empty-evbufs.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-09-03-sclp-mem.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-09-03-sclp-mem.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-09-03-sclp-mem.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-09-03-sclp-mem.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-09-04-topology.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-09-04-topology.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-09-04-topology.diff rename to src/patches/suse-2.6.27.31/patches.arch/s390-09-04-topology.diff diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-01-airq_fix_array_boundary.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-01-airq_fix_array_boundary.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-01-airq_fix_array_boundary.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-01-airq_fix_array_boundary.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-02-zfcp_wait_sbal.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-02-zfcp_wait_sbal.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-02-zfcp_wait_sbal.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-02-zfcp_wait_sbal.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-03-zfcp_els_thread_context.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-03-zfcp_els_thread_context.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-03-zfcp_els_thread_context.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-03-zfcp_els_thread_context.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-04-zfcp_change_adisc_processing.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-04-zfcp_change_adisc_processing.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-04-zfcp_change_adisc_processing.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-04-zfcp_change_adisc_processing.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-05-zfcp_remote_port_handling.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-05-zfcp_remote_port_handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-05-zfcp_remote_port_handling.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-05-zfcp_remote_port_handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-06-zfcp_slave_destroy.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-06-zfcp_slave_destroy.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-06-zfcp_slave_destroy.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-06-zfcp_slave_destroy.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-07-zfcp_refc_work_inflight.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-07-zfcp_refc_work_inflight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-07-zfcp_refc_work_inflight.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-07-zfcp_refc_work_inflight.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-08-iucv-2ndparm.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-08-iucv-2ndparm.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-08-iucv-2ndparm.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-08-iucv-2ndparm.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-09-dasd-fix-timer-add.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-09-dasd-fix-timer-add.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-09-dasd-fix-timer-add.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-09-dasd-fix-timer-add.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-10-10-ccwgroup_fix_unbind.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-10-ccwgroup_fix_unbind.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-10-10-ccwgroup_fix_unbind.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-10-10-ccwgroup_fix_unbind.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-01-kernel_ds_pgtable_walk.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-01-kernel_ds_pgtable_walk.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-01-kernel_ds_pgtable_walk.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-01-kernel_ds_pgtable_walk.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-02-kernel_pfn_valid_uaccess.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-02-kernel_pfn_valid_uaccess.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-02-kernel_pfn_valid_uaccess.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-02-kernel_pfn_valid_uaccess.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-03-qeth_recovery_drop_mac.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-03-qeth_recovery_drop_mac.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-03-qeth_recovery_drop_mac.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-03-qeth_recovery_drop_mac.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-04-lcs_hard_sx_rc.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-04-lcs_hard_sx_rc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-04-lcs_hard_sx_rc.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-04-lcs_hard_sx_rc.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-05-qdio_error_reporting_hs.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-05-qdio_error_reporting_hs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-05-qdio_error_reporting_hs.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-05-qdio_error_reporting_hs.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-06-qdio_tiq_list_lock.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-06-qdio_tiq_list_lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-06-qdio_tiq_list_lock.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-06-qdio_tiq_list_lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-07-qdio_kill_tasklets.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-07-qdio_kill_tasklets.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-07-qdio_kill_tasklets.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-07-qdio_kill_tasklets.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-08-qdio_free_shutdown.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-08-qdio_free_shutdown.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-08-qdio_free_shutdown.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-08-qdio_free_shutdown.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-09-qdio_ack_newest_and_seperate_polling.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-09-qdio_ack_newest_and_seperate_polling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-09-qdio_ack_newest_and_seperate_polling.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-09-qdio_ack_newest_and_seperate_polling.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-10-zfcp_nameserver_state_on_adapter_offline.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-10-zfcp_nameserver_state_on_adapter_offline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-10-zfcp_nameserver_state_on_adapter_offline.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-10-zfcp_nameserver_state_on_adapter_offline.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-11-zfcp_req_free.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-11-zfcp_req_free.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-11-zfcp_req_free.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-11-zfcp_req_free.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-12-zfcp_scsi_scan.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-12-zfcp_scsi_scan.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-12-zfcp_scsi_scan.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-12-zfcp_scsi_scan.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-13-zfcp_avoid_semaphore_race.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-13-zfcp_avoid_semaphore_race.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-13-zfcp_avoid_semaphore_race.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-13-zfcp_avoid_semaphore_race.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-14-zfcp_unit_remove.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-14-zfcp_unit_remove.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-14-zfcp_unit_remove.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-14-zfcp_unit_remove.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-15-kernel_task_size.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-15-kernel_task_size.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-15-kernel_task_size.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-15-kernel_task_size.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-11-16-qeth_siga_error_handling.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-11-16-qeth_siga_error_handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-11-16-qeth_siga_error_handling.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-11-16-qeth_siga_error_handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-01-cio-reprobe-deadlock-fix.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-01-cio-reprobe-deadlock-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-01-cio-reprobe-deadlock-fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-01-cio-reprobe-deadlock-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-02-zfcp_scsi_queue_erp_deadlock.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-02-zfcp_scsi_queue_erp_deadlock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-02-zfcp_scsi_queue_erp_deadlock.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-02-zfcp_scsi_queue_erp_deadlock.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-03-zfcp_adjust_test_link_pre_reqs.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-03-zfcp_adjust_test_link_pre_reqs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-03-zfcp_adjust_test_link_pre_reqs.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-03-zfcp_adjust_test_link_pre_reqs.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-04-zfcp_rport_handling_on_error_inject.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-04-zfcp_rport_handling_on_error_inject.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-04-zfcp_rport_handling_on_error_inject.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-04-zfcp_rport_handling_on_error_inject.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-05-cio_introduce_ccw_device_boxed_notify.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-05-cio_introduce_ccw_device_boxed_notify.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-05-cio_introduce_ccw_device_boxed_notify.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-05-cio_introduce_ccw_device_boxed_notify.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-06-zfcp_actcli_error.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-06-zfcp_actcli_error.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-06-zfcp_actcli_error.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-06-zfcp_actcli_error.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-07-ctcm_remove_crash.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-07-ctcm_remove_crash.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-07-ctcm_remove_crash.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-07-ctcm_remove_crash.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-08-kernel_appldata_vtimer.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-08-kernel_appldata_vtimer.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-08-kernel_appldata_vtimer.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-08-kernel_appldata_vtimer.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-09-qeth_lan_offline.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-09-qeth_lan_offline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-09-qeth_lan_offline.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-09-qeth_lan_offline.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-10-kernel_appldata_mutex.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-10-kernel_appldata_mutex.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-10-kernel_appldata_mutex.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-10-kernel_appldata_mutex.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-11-zfcp_fcp_port_handling.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-11-zfcp_fcp_port_handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-11-zfcp_fcp_port_handling.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-11-zfcp_fcp_port_handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-12-zfcp_wka_wait_refcount.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-12-zfcp_wka_wait_refcount.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-12-zfcp_wka_wait_refcount.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-12-zfcp_wka_wait_refcount.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-13-zfcp_deadlock_port_scan_ERP.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-13-zfcp_deadlock_port_scan_ERP.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-13-zfcp_deadlock_port_scan_ERP.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-13-zfcp_deadlock_port_scan_ERP.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-14-zfcp_port_reference_counting.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-14-zfcp_port_reference_counting.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-14-zfcp_port_reference_counting.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-14-zfcp_port_reference_counting.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-15-zfcp_abort_handler_for_completions_in_progress.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-15-zfcp_abort_handler_for_completions_in_progress.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-15-zfcp_abort_handler_for_completions_in_progress.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-15-zfcp_abort_handler_for_completions_in_progress.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-12-16-zfcp_reference_counting_for_cfdc_requests.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-12-16-zfcp_reference_counting_for_cfdc_requests.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-12-16-zfcp_reference_counting_for_cfdc_requests.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-12-16-zfcp_reference_counting_for_cfdc_requests.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-13-01-af_iucv-fix-race-msgpending.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-13-01-af_iucv-fix-race-msgpending.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-13-01-af_iucv-fix-race-msgpending.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-13-01-af_iucv-fix-race-msgpending.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-13-02-zfcp_changed_port_did.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-13-02-zfcp_changed_port_did.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-13-02-zfcp_changed_port_did.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-13-02-zfcp_changed_port_did.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-13-03-qeth_checksum.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-13-03-qeth_checksum.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-13-03-qeth_checksum.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-13-03-qeth_checksum.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-13-04-qeth-port-isolation.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-13-04-qeth-port-isolation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-13-04-qeth-port-isolation.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-13-04-qeth-port-isolation.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-14-01-af_iucv-connect-free-path.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-14-01-af_iucv-connect-free-path.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-14-01-af_iucv-connect-free-path.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-14-01-af_iucv-connect-free-path.patch diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-01-zfcp-erp-escalation.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-01-zfcp-erp-escalation.patch new file mode 100644 index 000000000..39df29a99 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-01-zfcp-erp-escalation.patch @@ -0,0 +1,113 @@ +From: Gerald Schaefer +Subject: zfcp: Fix erp escalation procedure +References: bnc#518291,LTC#54456 + +Symptom: After a failure the zfcp erp gives up. +Problem: When a zfcp erp step fails the zfcp erp might end without + setting the driver internal flags appropriately. +Solution: Fix the erp escalation procedure. If a erp action fails, + retry it until the retry counter exceeds. This ensures + that the erp continues or the failed flag is set + correctly. If for some reason another action is + necessary, this will be triggered from outside the erp, + to avoid global recoveries for single port failures. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_dbf.c | 8 ++---- + drivers/s390/scsi/zfcp_erp.c | 50 ++++++++++++++++++++----------------------- + 2 files changed, 27 insertions(+), 31 deletions(-) + +--- a/drivers/s390/scsi/zfcp_erp.c 2009-06-23 10:45:52.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_erp.c 2009-06-23 14:13:30.000000000 +0200 +@@ -549,40 +549,35 @@ static void _zfcp_erp_unit_reopen_all(st + _zfcp_erp_unit_reopen(unit, clear, id, ref); + } + +-static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act) ++static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act) + { +- struct zfcp_adapter *adapter = act->adapter; +- struct zfcp_port *port = act->port; +- struct zfcp_unit *unit = act->unit; +- u32 status = act->status; +- +- /* initiate follow-up actions depending on success of finished action */ + switch (act->action) { +- + case ZFCP_ERP_ACTION_REOPEN_ADAPTER: +- if (status == ZFCP_ERP_SUCCEEDED) +- _zfcp_erp_port_reopen_all(adapter, 0, 70, NULL); +- else +- _zfcp_erp_adapter_reopen(adapter, 0, 71, NULL); ++ _zfcp_erp_adapter_reopen(act->adapter, 0, 71, NULL); + break; +- + case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: +- if (status == ZFCP_ERP_SUCCEEDED) +- _zfcp_erp_port_reopen(port, 0, 72, NULL); +- else +- _zfcp_erp_adapter_reopen(adapter, 0, 73, NULL); ++ _zfcp_erp_port_forced_reopen(act->port, 0, 73, NULL); + break; +- + case ZFCP_ERP_ACTION_REOPEN_PORT: +- if (status == ZFCP_ERP_SUCCEEDED) +- _zfcp_erp_unit_reopen_all(port, 0, 74, NULL); +- else +- _zfcp_erp_port_forced_reopen(port, 0, 75, NULL); ++ _zfcp_erp_port_reopen(act->port, 0, 75, NULL); + break; +- + case ZFCP_ERP_ACTION_REOPEN_UNIT: +- if (status != ZFCP_ERP_SUCCEEDED) +- _zfcp_erp_port_reopen(unit->port, 0, 76, NULL); ++ _zfcp_erp_unit_reopen(act->unit, 0, 76, NULL); ++ break; ++ } ++} ++ ++static void zfcp_erp_strategy_followup_success(struct zfcp_erp_action *act) ++{ ++ switch (act->action) { ++ case ZFCP_ERP_ACTION_REOPEN_ADAPTER: ++ _zfcp_erp_port_reopen_all(act->adapter, 0, 70, NULL); ++ break; ++ case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: ++ _zfcp_erp_port_reopen(act->port, 0, 72, NULL); ++ break; ++ case ZFCP_ERP_ACTION_REOPEN_PORT: ++ _zfcp_erp_unit_reopen_all(act->port, 0, 74, NULL); + break; + } + } +@@ -1297,7 +1292,10 @@ static int zfcp_erp_strategy(struct zfcp + retval = zfcp_erp_strategy_statechange(erp_action, retval); + if (retval == ZFCP_ERP_EXIT) + goto unlock; +- zfcp_erp_strategy_followup_actions(erp_action); ++ if (retval == ZFCP_ERP_SUCCEEDED) ++ zfcp_erp_strategy_followup_success(erp_action); ++ if (retval == ZFCP_ERP_FAILED) ++ zfcp_erp_strategy_followup_failed(erp_action); + + unlock: + write_unlock(&adapter->erp_lock); +--- a/drivers/s390/scsi/zfcp_dbf.c 2009-06-23 10:45:52.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_dbf.c 2009-06-23 14:20:41.000000000 +0200 +@@ -563,12 +563,10 @@ static const char *zfcp_rec_dbf_ids[] = + [71] = "adapter recovery escalation after failed adapter recovery", + [72] = "port recovery follow-up after successful physical port " + "recovery", +- [73] = "adapter recovery escalation after failed physical port " +- "recovery", ++ [73] = "physical port recovery retry after failure", + [74] = "unit recovery follow-up after successful port recovery", +- [75] = "physical port recovery escalation after failed port " +- "recovery", +- [76] = "port recovery escalation after failed unit recovery", ++ [75] = "port recovery retry after failure", ++ [76] = "unit recovery retry after failure", + [77] = "", + [78] = "duplicate request id", + [79] = "link down", diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-02-phys-port-close.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-02-phys-port-close.patch new file mode 100644 index 000000000..4b7040939 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-02-phys-port-close.patch @@ -0,0 +1,27 @@ +From: Gerald Schaefer +Subject: zfcp: Handle "forced close" correctly in the erp +References: bnc#518291,LTC#54458 + +Symptom: After a remote port problem, the zfcp erp does not + recover from the problem. +Problem: After trying the "forced close" step from the erp the + the check of the flag indicating if the port is still + open is wrong. +Solution: Fix the check of the open flag. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_erp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/s390/scsi/zfcp_erp.c 2009-06-23 14:11:53.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_erp.c 2009-06-23 14:11:57.000000000 +0200 +@@ -796,7 +796,7 @@ static int zfcp_erp_port_forced_strategy + return ZFCP_ERP_FAILED; + + case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: +- if (status & ZFCP_STATUS_PORT_PHYS_OPEN) ++ if (!(status & ZFCP_STATUS_PORT_PHYS_OPEN)) + return ZFCP_ERP_SUCCEEDED; + } + return ZFCP_ERP_FAILED; diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-03-zfcp-recover-stall.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-03-zfcp-recover-stall.patch new file mode 100644 index 000000000..112af1d8c --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-03-zfcp-recover-stall.patch @@ -0,0 +1,46 @@ +From: Gerald Schaefer +Subject: zfcp: Recover from stalled outbound queue +References: bnc#518291,LTC#54460 + +Symptom: In some error scenarious, the channel can stall. To + Linux this looks like a stall in the outbound queue. + Linux has to recover this. +Problem: There is no trigger to recover the queues if the outbound + queue stalls. +Solution: When trying to issue a non-SCSI command, zfcp waits for + 5 seconds to get a free SBAL in the queue. Use this timeout + as a trigger: If after 5 seconds there is no free SBAL, + assume a stalled outbound queue and trigger recovery. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_dbf.c | 2 +- + drivers/s390/scsi/zfcp_fsf.c | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/s390/scsi/zfcp_fsf.c 2009-06-23 14:24:48.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fsf.c 2009-06-23 14:26:00.000000000 +0200 +@@ -668,8 +668,11 @@ static int zfcp_fsf_req_sbal_get(struct + zfcp_fsf_sbal_check(adapter), 5 * HZ); + if (ret > 0) + return 0; +- if (!ret) ++ if (!ret) { + atomic_inc(&adapter->qdio_outb_full); ++ /* assume hanging outbound queue, try queue recovery */ ++ zfcp_erp_adapter_reopen(adapter, 0, 77, NULL); ++ } + + spin_lock_bh(&adapter->req_q_lock); + return -EIO; +--- a/drivers/s390/scsi/zfcp_dbf.c 2009-06-23 14:20:41.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_dbf.c 2009-06-23 14:25:50.000000000 +0200 +@@ -567,7 +567,7 @@ static const char *zfcp_rec_dbf_ids[] = + [74] = "unit recovery follow-up after successful port recovery", + [75] = "port recovery retry after failure", + [76] = "unit recovery retry after failure", +- [77] = "", ++ [77] = "adapter reopen from queue stall", + [78] = "duplicate request id", + [79] = "link down", + [80] = "exclusive read-only unit access unsupported", diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-04-zfcp-unchained-sbals.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-04-zfcp-unchained-sbals.patch new file mode 100644 index 000000000..2b048c3b1 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-04-zfcp-unchained-sbals.patch @@ -0,0 +1,72 @@ +From: Gerald Schaefer +Subject: zfcp: Use only single SBAL commands from recovery +References: bnc#518291,LTC#54462 + +Symptom: Issuing an ELS request might not detect a stalled + outbound queue +Problem: zfcp uses chained SBALs for ELS requests leading to the + situation that the ELS request gets one free SBAL, but + not the following ones. In this situation the ELS request + fails but does not trigger the error handling for the + stalled queue. +Solution: Use unchained SBALs where possible, especially for + commands from the erp. This guarantees that each erp + command will get the required SBAL or trigger queue + recovery. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_fsf.c | 33 +++++++++++++++++++++++++-------- + 1 file changed, 25 insertions(+), 8 deletions(-) + +--- a/drivers/s390/scsi/zfcp_fsf.c 2009-07-01 12:26:28.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fsf.c 2009-07-01 12:28:43.000000000 +0200 +@@ -1012,6 +1012,23 @@ skip_fsfstatus: + send_ct->handler(send_ct->handler_data); + } + ++static void zfcp_fsf_setup_ct_els_unchained(struct qdio_buffer_element *sbale, ++ struct scatterlist *sg_req, ++ struct scatterlist *sg_resp) ++{ ++ sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ; ++ sbale[2].addr = sg_virt(sg_req); ++ sbale[2].length = sg_req->length; ++ sbale[3].addr = sg_virt(sg_resp); ++ sbale[3].length = sg_resp->length; ++ sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY; ++} ++ ++static int zfcp_fsf_one_sbal(struct scatterlist *sg) ++{ ++ return sg_is_last(sg) && sg->length <= PAGE_SIZE; ++} ++ + static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, + struct scatterlist *sg_req, + struct scatterlist *sg_resp, +@@ -1022,16 +1039,16 @@ static int zfcp_fsf_setup_ct_els_sbals(s + int bytes; + + if (!(feat & FSF_FEATURE_ELS_CT_CHAINED_SBALS)) { +- if (sg_req->length > PAGE_SIZE || sg_resp->length > PAGE_SIZE || +- !sg_is_last(sg_req) || !sg_is_last(sg_resp)) ++ if (!zfcp_fsf_one_sbal(sg_req) || !zfcp_fsf_one_sbal(sg_resp)) + return -EOPNOTSUPP; + +- sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ; +- sbale[2].addr = sg_virt(sg_req); +- sbale[2].length = sg_req->length; +- sbale[3].addr = sg_virt(sg_resp); +- sbale[3].length = sg_resp->length; +- sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY; ++ zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp); ++ return 0; ++ } ++ ++ /* use single, unchained SBAL if it can hold the request */ ++ if (zfcp_fsf_one_sbal(sg_req) && zfcp_fsf_one_sbal(sg_resp)) { ++ zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp); + return 0; + } + diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-05-zfcp-erp-notify.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-05-zfcp-erp-notify.patch new file mode 100644 index 000000000..b6d4800c8 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-05-zfcp-erp-notify.patch @@ -0,0 +1,31 @@ +From: Gerald Schaefer +Subject: zfcp: Use correct flags when reporting status to erp +References: bnc#518291,LTC#54463 + +Symptom: The erp might not detect correctly problems from the + gid_pn nameserver requests. +Problem: The wrong status flags have been used to pass updates via + the call to zfcp_erp_notify. +Solution: Use the correct status flags when calling zfcp_erp_notify. + +Acked-by: John Jolly +--- + + drivers/s390/scsi/zfcp_erp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/s390/scsi/zfcp_erp.c 2009-07-01 11:31:02.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_erp.c 2009-07-01 12:44:45.000000000 +0200 +@@ -850,10 +850,10 @@ void zfcp_erp_port_strategy_open_lookup( + + retval = zfcp_fc_ns_gid_pn(&port->erp_action); + if (retval == -ENOMEM) +- zfcp_erp_notify(&port->erp_action, ZFCP_ERP_NOMEM); ++ zfcp_erp_notify(&port->erp_action, ZFCP_STATUS_ERP_LOWMEM); + port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; + if (retval) +- zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); ++ zfcp_erp_notify(&port->erp_action, 0); + zfcp_port_put(port); + } + diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-06-zfcp-recovery-wait.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-06-zfcp-recovery-wait.patch new file mode 100644 index 000000000..b792c5e6b --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-06-zfcp-recovery-wait.patch @@ -0,0 +1,369 @@ +From: Gerald Schaefer +Subject: zfcp: Improve reliability of SCSI eh handlers in zfcp +References: bnc#518291,LTC#54465 + +Symptom: During error recovery scenarious, zfcp and SCSI midlayer + run error recovery and later SCSI devices are flagged as + "offline" in the Linux kernel. +Problem: The SCSI midlayer error recovery issues various requests + to zfcp. If zfcp is recovering internally at the same + time, the SCSI midlayer requests fail immediately and the + SCSI midlayer recovery will run until hitting the final + step where SCSI devices are flagged as "offline". +Solution: Backport the commit 63caf367e1c92e0667a344d9b687c04e6ef054b5. + This commit changes the SCSI midlayer recovery callbacks + in zfcp to wait for the zfcp erp to finish before issuing any + request. If necessary retry the request three times. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_def.h | 3 - + drivers/s390/scsi/zfcp_ext.h | 11 +-- + drivers/s390/scsi/zfcp_fsf.c | 39 ++++--------- + drivers/s390/scsi/zfcp_scsi.c | 122 ++++++++++++++++++++---------------------- + 4 files changed, 77 insertions(+), 98 deletions(-) + +--- a/drivers/s390/scsi/zfcp_def.h 2009-07-01 13:39:47.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_def.h 2009-07-01 13:39:50.000000000 +0200 +@@ -621,9 +621,6 @@ struct zfcp_fsf_req_qtcb { + + /********************** ZFCP SPECIFIC DEFINES ********************************/ + +-#define ZFCP_REQ_AUTO_CLEANUP 0x00000002 +-#define ZFCP_REQ_NO_QTCB 0x00000008 +- + #define ZFCP_SET 0x00000100 + #define ZFCP_CLEAR 0x00000200 + +--- a/drivers/s390/scsi/zfcp_ext.h 2009-07-01 13:39:47.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_ext.h 2009-07-01 13:39:50.000000000 +0200 +@@ -127,16 +127,13 @@ extern int zfcp_status_read_refill(struc + extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *, + struct zfcp_erp_action *); + extern int zfcp_fsf_send_els(struct zfcp_send_els *); +-extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *, +- struct zfcp_unit *, +- struct scsi_cmnd *, int, int); ++extern int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *, ++ struct scsi_cmnd *); + extern void zfcp_fsf_req_complete(struct zfcp_fsf_req *); + extern void zfcp_fsf_req_free(struct zfcp_fsf_req *); +-extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *, +- struct zfcp_unit *, u8, int); ++extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_unit *, u8); + extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long, +- struct zfcp_adapter *, +- struct zfcp_unit *, int); ++ struct zfcp_unit *); + + /* zfcp_qdio.c */ + extern int zfcp_qdio_allocate(struct zfcp_adapter *); +--- a/drivers/s390/scsi/zfcp_fsf.c 2009-07-01 13:39:47.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fsf.c 2009-07-01 13:39:50.000000000 +0200 +@@ -11,6 +11,9 @@ + #include + #include "zfcp_ext.h" + ++#define ZFCP_REQ_AUTO_CLEANUP 0x00000002 ++#define ZFCP_REQ_NO_QTCB 0x00000008 ++ + static void zfcp_fsf_request_timeout_handler(unsigned long data) + { + struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; +@@ -911,27 +914,22 @@ static void zfcp_fsf_abort_fcp_command_h + /** + * zfcp_fsf_abort_fcp_command - abort running SCSI command + * @old_req_id: unsigned long +- * @adapter: pointer to struct zfcp_adapter + * @unit: pointer to struct zfcp_unit +- * @req_flags: integer specifying the request flags + * Returns: pointer to struct zfcp_fsf_req +- * +- * FIXME(design): should be watched by a timeout !!! + */ + + struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id, +- struct zfcp_adapter *adapter, +- struct zfcp_unit *unit, +- int req_flags) ++ struct zfcp_unit *unit) + { + struct qdio_buffer_element *sbale; + struct zfcp_fsf_req *req = NULL; ++ struct zfcp_adapter *adapter = unit->port->adapter; + + spin_lock_bh(&adapter->req_q_lock); + if (zfcp_fsf_req_sbal_get(adapter)) + goto out; + req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, +- req_flags, adapter->pool.fsf_req_abort); ++ 0, adapter->pool.fsf_req_abort); + if (IS_ERR(req)) { + req = NULL; + goto out; +@@ -2334,21 +2332,17 @@ static void zfcp_set_fcp_dl(struct fcp_c + + /** + * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command) +- * @adapter: adapter where scsi command is issued + * @unit: unit where command is sent to + * @scsi_cmnd: scsi command to be sent +- * @timer: timer to be started when request is initiated +- * @req_flags: flags for fsf_request + */ +-int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, +- struct zfcp_unit *unit, +- struct scsi_cmnd *scsi_cmnd, +- int use_timer, int req_flags) ++int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, ++ struct scsi_cmnd *scsi_cmnd) + { + struct zfcp_fsf_req *req; + struct fcp_cmnd_iu *fcp_cmnd_iu; + unsigned int sbtype; + int real_bytes, retval = -EIO; ++ struct zfcp_adapter *adapter = unit->port->adapter; + + if (unlikely(!(atomic_read(&unit->status) & + ZFCP_STATUS_COMMON_UNBLOCKED))) +@@ -2359,7 +2353,8 @@ int zfcp_fsf_send_fcp_command_task(struc + atomic_inc(&adapter->qdio_outb_full); + goto out; + } +- req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, ++ req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, ++ ZFCP_REQ_AUTO_CLEANUP, + adapter->pool.fsf_req_scsi); + if (IS_ERR(req)) { + retval = PTR_ERR(req); +@@ -2441,9 +2436,6 @@ int zfcp_fsf_send_fcp_command_task(struc + + zfcp_set_fcp_dl(fcp_cmnd_iu, real_bytes); + +- if (use_timer) +- zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); +- + retval = zfcp_fsf_req_send(req); + if (unlikely(retval)) + goto failed_scsi_cmnd; +@@ -2461,19 +2453,16 @@ out: + + /** + * zfcp_fsf_send_fcp_ctm - send SCSI task management command +- * @adapter: pointer to struct zfcp-adapter + * @unit: pointer to struct zfcp_unit + * @tm_flags: unsigned byte for task management flags +- * @req_flags: int request flags + * Returns: on success pointer to struct fsf_req, NULL otherwise + */ +-struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter, +- struct zfcp_unit *unit, +- u8 tm_flags, int req_flags) ++struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_unit *unit, u8 tm_flags) + { + struct qdio_buffer_element *sbale; + struct zfcp_fsf_req *req = NULL; + struct fcp_cmnd_iu *fcp_cmnd_iu; ++ struct zfcp_adapter *adapter = unit->port->adapter; + + if (unlikely(!(atomic_read(&unit->status) & + ZFCP_STATUS_COMMON_UNBLOCKED))) +@@ -2482,7 +2471,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c + spin_lock_bh(&adapter->req_q_lock); + if (zfcp_fsf_req_sbal_get(adapter)) + goto out; +- req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, ++ req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, 0, + adapter->pool.fsf_req_scsi); + if (IS_ERR(req)) { + req = NULL; +--- a/drivers/s390/scsi/zfcp_scsi.c 2009-07-01 13:39:47.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_scsi.c 2009-07-01 13:41:23.000000000 +0200 +@@ -94,8 +94,7 @@ static int zfcp_scsi_queuecommand(struct + return 0;; + } + +- ret = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, 0, +- ZFCP_REQ_AUTO_CLEANUP); ++ ret = zfcp_fsf_send_fcp_command_task(unit, scpnt); + if (unlikely(ret == -EBUSY)) + return SCSI_MLQUEUE_DEVICE_BUSY; + else if (unlikely(ret < 0)) +@@ -153,79 +152,91 @@ out: + + static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) + { +- struct Scsi_Host *scsi_host; +- struct zfcp_adapter *adapter; +- struct zfcp_unit *unit; +- struct zfcp_fsf_req *fsf_req; ++ struct Scsi_Host *scsi_host = scpnt->device->host; ++ struct zfcp_adapter *adapter = ++ (struct zfcp_adapter *) scsi_host->hostdata[0]; ++ struct zfcp_unit *unit = scpnt->device->hostdata; ++ struct zfcp_fsf_req *old_req, *abrt_req; + unsigned long flags; + unsigned long old_req_id = (unsigned long) scpnt->host_scribble; + int retval = SUCCESS; +- +- scsi_host = scpnt->device->host; +- adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; +- unit = scpnt->device->hostdata; ++ int retry = 3; + + /* avoid race condition between late normal completion and abort */ + write_lock_irqsave(&adapter->abort_lock, flags); + +- /* Check whether corresponding fsf_req is still pending */ + spin_lock(&adapter->req_list_lock); +- fsf_req = zfcp_reqlist_find(adapter, old_req_id); ++ old_req = zfcp_reqlist_find(adapter, old_req_id); + spin_unlock(&adapter->req_list_lock); +- if (!fsf_req) { ++ if (!old_req) { + write_unlock_irqrestore(&adapter->abort_lock, flags); +- zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, 0); +- return FAILED; /* completion could be in progress */ ++ zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, ++ old_req_id); ++ return SUCCESS; + } +- fsf_req->data = NULL; ++ old_req->data = NULL; + + /* don't access old fsf_req after releasing the abort_lock */ + write_unlock_irqrestore(&adapter->abort_lock, flags); + +- fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0); +- if (!fsf_req) { +- zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, +- old_req_id); +- retval = FAILED; +- return retval; ++ while (retry--) { ++ abrt_req = zfcp_fsf_abort_fcp_command(old_req_id, unit); ++ if (abrt_req) ++ break; ++ ++ zfcp_erp_wait(adapter); ++ if (!(atomic_read(&adapter->status) & ++ ZFCP_STATUS_COMMON_RUNNING)) { ++ zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, ++ old_req_id); ++ return SUCCESS; ++ } + } ++ if (!abrt_req) ++ return FAILED; + +- __wait_event(fsf_req->completion_wq, +- fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); ++ wait_event(abrt_req->completion_wq, ++ abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); + +- if (fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) { +- zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, fsf_req, 0); +- } else if (fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) { +- zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, fsf_req, 0); +- } else { +- zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, fsf_req, 0); ++ if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) ++ zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, abrt_req, 0); ++ else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) ++ zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, abrt_req, 0); ++ else { ++ zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, abrt_req, 0); + retval = FAILED; + } +- zfcp_fsf_req_free(fsf_req); +- ++ zfcp_fsf_req_free(abrt_req); + return retval; + } + +-static int zfcp_task_mgmt_function(struct zfcp_unit *unit, u8 tm_flags, +- struct scsi_cmnd *scpnt) ++static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) + { ++ struct zfcp_unit *unit = scpnt->device->hostdata; + struct zfcp_adapter *adapter = unit->port->adapter; + struct zfcp_fsf_req *fsf_req; + int retval = SUCCESS; ++ int retry = 3; + +- /* issue task management function */ +- fsf_req = zfcp_fsf_send_fcp_ctm(adapter, unit, tm_flags, 0); +- if (!fsf_req) { +- zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt); +- return FAILED; ++ while (retry--) { ++ fsf_req = zfcp_fsf_send_fcp_ctm(unit, tm_flags); ++ if (fsf_req) ++ break; ++ ++ zfcp_erp_wait(adapter); ++ if (!(atomic_read(&adapter->status) & ++ ZFCP_STATUS_COMMON_RUNNING)) { ++ zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, ++ scpnt); ++ return SUCCESS; ++ } + } ++ if (!fsf_req) ++ return FAILED; + +- __wait_event(fsf_req->completion_wq, +- fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); ++ wait_event(fsf_req->completion_wq, ++ fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); + +- /* +- * check completion status of task management function +- */ + if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { + zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt); + retval = FAILED; +@@ -236,39 +247,24 @@ static int zfcp_task_mgmt_function(struc + zfcp_scsi_dbf_event_devreset("okay", tm_flags, unit, scpnt); + + zfcp_fsf_req_free(fsf_req); +- + return retval; + } + + static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) + { +- struct zfcp_unit *unit = scpnt->device->hostdata; +- +- if (!unit) { +- WARN_ON(1); +- return SUCCESS; +- } +- return zfcp_task_mgmt_function(unit, FCP_LOGICAL_UNIT_RESET, scpnt); ++ return zfcp_task_mgmt_function(scpnt, FCP_LOGICAL_UNIT_RESET); + } + + static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt) + { +- struct zfcp_unit *unit = scpnt->device->hostdata; +- +- if (!unit) { +- WARN_ON(1); +- return SUCCESS; +- } +- return zfcp_task_mgmt_function(unit, FCP_TARGET_RESET, scpnt); ++ return zfcp_task_mgmt_function(scpnt, FCP_TARGET_RESET); + } + + static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) + { +- struct zfcp_unit *unit; +- struct zfcp_adapter *adapter; ++ struct zfcp_unit *unit = scpnt->device->hostdata; ++ struct zfcp_adapter *adapter = unit->port->adapter; + +- unit = scpnt->device->hostdata; +- adapter = unit->port->adapter; + zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); + zfcp_erp_wait(adapter); + diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-07-zfcp-fc-rport.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-07-zfcp-fc-rport.patch new file mode 100644 index 000000000..36b28f40a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-07-zfcp-fc-rport.patch @@ -0,0 +1,42 @@ +From: Gerald Schaefer +Subject: zfcp: Don't create multiple sysfs entries for same WWPN +References: bnc#518291,LTC#54468 + +Symptom: The FC transport class creates multiple rport entries in + sysfs for the same WWPN. +Problem: The FC transport class requires that the + fc_remote_port_add and fc_remote_delete functions are + always called in this sequence. It was possible that zfcp + called fc_remote_port_add twice leading to the problem. +Solution: Make sure to only call fc_remote_port_add once before + calling fc_remote_port_delete. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_scsi.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/s390/scsi/zfcp_scsi.c 2009-06-29 14:11:50.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_scsi.c 2009-06-29 14:27:25.000000000 +0200 +@@ -525,6 +525,9 @@ static void zfcp_scsi_rport_register(str + struct fc_rport_identifiers ids; + struct fc_rport *rport; + ++ if (port->rport) ++ return; ++ + ids.node_name = port->wwnn; + ids.port_name = port->wwpn; + ids.port_id = port->d_id; +@@ -548,8 +551,10 @@ static void zfcp_scsi_rport_block(struct + { + struct fc_rport *rport = port->rport; + +- if (rport) ++ if (rport) { + fc_remote_port_delete(rport); ++ port->rport = NULL; ++ } + } + + void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-08-zfcp-fc-wka-opening.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-08-zfcp-fc-wka-opening.patch new file mode 100644 index 000000000..f97a228c8 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-08-zfcp-fc-wka-opening.patch @@ -0,0 +1,52 @@ +From: Gerald Schaefer +Subject: zfcp: fix wka port processing +References: bnc#518291,LTC#54673 + +Symptom: Remote port cannot be opened. +Problem: After an "open port" request for the WKA port did not + return within half a second, the WKA port for the + directory server remains in the state OPENING, + preventing any succeeding request to open the port. +Solution: Make sure to always update the WKA port status from the + corresponding FSF handler and do not rely on the timeout + in zfcp_wka_port_get. + +Acked-by: John Jolly +--- + + drivers/s390/scsi/zfcp_fc.c | 8 +++----- + drivers/s390/scsi/zfcp_fsf.c | 4 ++-- + 2 files changed, 5 insertions(+), 7 deletions(-) + +--- a/drivers/s390/scsi/zfcp_fc.c 2009-07-13 11:07:50.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fc.c 2009-07-13 11:18:09.000000000 +0200 +@@ -56,11 +56,9 @@ static int zfcp_wka_port_get(struct zfcp + + mutex_unlock(&wka_port->mutex); + +- wait_event_timeout( +- wka_port->completion_wq, +- wka_port->status == ZFCP_WKA_PORT_ONLINE || +- wka_port->status == ZFCP_WKA_PORT_OFFLINE, +- HZ >> 1); ++ wait_event(wka_port->completion_wq, ++ wka_port->status == ZFCP_WKA_PORT_ONLINE || ++ wka_port->status == ZFCP_WKA_PORT_OFFLINE); + + if (wka_port->status == ZFCP_WKA_PORT_ONLINE) { + atomic_inc(&wka_port->refcount); +--- a/drivers/s390/scsi/zfcp_fsf.c 2009-07-13 11:07:50.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fsf.c 2009-07-13 11:18:09.000000000 +0200 +@@ -1616,10 +1616,10 @@ static void zfcp_fsf_open_wka_port_handl + case FSF_ACCESS_DENIED: + wka_port->status = ZFCP_WKA_PORT_OFFLINE; + break; +- case FSF_PORT_ALREADY_OPEN: +- break; + case FSF_GOOD: + wka_port->handle = header->port_handle; ++ /* fall through */ ++ case FSF_PORT_ALREADY_OPEN: + wka_port->status = ZFCP_WKA_PORT_ONLINE; + } + out: diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-09-idle-accounting.diff b/src/patches/suse-2.6.27.31/patches.arch/s390-15-09-idle-accounting.diff new file mode 100644 index 000000000..53fe51815 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-09-idle-accounting.diff @@ -0,0 +1,47 @@ +From: Gerald Schaefer +Subject: kernel: fix idle time accounting +References: bnc#518291,LTC#54879 + +Symptom: The idle time reported in /proc/stat is too large +Problem: The time spent with time ticks disabled is accounted twice, + once by the architecture backend and another time by the + generic timer code. +Solution: Stop accounting idle time in the generic timer code if + CONFIG_VIRT_CPU_ACCOUNTING is enabled. + +Acked-by: John Jolly +--- + + kernel/time/tick-sched.c | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: linux-sles11/kernel/time/tick-sched.c +=================================================================== +--- linux-sles11.orig/kernel/time/tick-sched.c ++++ linux-sles11/kernel/time/tick-sched.c +@@ -377,7 +377,9 @@ void tick_nohz_restart_sched_tick(void) + { + int cpu = smp_processor_id(); + struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); ++#ifndef CONFIG_VIRT_CPU_ACCOUNTING + unsigned long ticks; ++#endif + ktime_t now; + + local_irq_disable(); +@@ -399,6 +401,7 @@ void tick_nohz_restart_sched_tick(void) + tick_do_update_jiffies64(now); + cpu_clear(cpu, nohz_cpu_mask); + ++#ifndef CONFIG_VIRT_CPU_ACCOUNTING + /* + * We stopped the tick in idle. Update process times would miss the + * time we slept as update_process_times does only a 1 tick +@@ -414,6 +417,7 @@ void tick_nohz_restart_sched_tick(void) + jiffies_to_cputime(ticks)); + sub_preempt_count(HARDIRQ_OFFSET); + } ++#endif + + touch_softlockup_watchdog(); + /* diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-10-zcrypt-hrtimer-scheduling.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-10-zcrypt-hrtimer-scheduling.patch new file mode 100644 index 000000000..3bc394fbc --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-10-zcrypt-hrtimer-scheduling.patch @@ -0,0 +1,34 @@ +From: Gerald Schaefer +Subject: zcrypt: fix z90crypt kernel modules causes 100% cpu usage +References: bnc#518291,LTC#54925 + +Symptom: 100% cpu usage +Problem: ap_poll_timer expires permanently and is restarts +Solution: Only restart ap_poll_timer when it expires and do it in the + future. + +Acked-by: John Jolly +--- +Index: linux-sles11/drivers/s390/crypto/ap_bus.c +=================================================================== +--- linux-sles11.orig/drivers/s390/crypto/ap_bus.c ++++ linux-sles11/drivers/s390/crypto/ap_bus.c +@@ -930,10 +930,16 @@ ap_config_timeout(unsigned long ptr) + */ + static inline void ap_schedule_poll_timer(void) + { ++ ktime_t hr_time; + if (hrtimer_is_queued(&ap_poll_timer)) + return; +- hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout), +- HRTIMER_MODE_ABS); ++ ++ if (ktime_to_ns(hrtimer_get_remaining(&ap_poll_timer)) <= 0) { ++ hr_time = ktime_set(0, poll_timeout); ++ hrtimer_forward_now(&ap_poll_timer, hr_time); ++ hrtimer_restart(&ap_poll_timer); ++ } ++ return; + } + + /** diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-11-cio-vary-unregister.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-11-cio-vary-unregister.patch new file mode 100644 index 000000000..3cf07f30d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-11-cio-vary-unregister.patch @@ -0,0 +1,48 @@ +From: Gerald Schaefer +Subject: cio: ccw devices are not removed when last path is varied offline +References: bnc#518291,LTC#54951 + +Symptom: When the last CHPID to an offline CCW device is varied offline, + that device remains registered even though it is no longer + accessible. +Problem: The vary command triggers an internal path verification event + which is not handled for devices in the offline state. +Solution: Install a handler for the path verification event in offline state + which will remove the device if it is no longer accessible. + +Acked-by: John Jolly +--- + drivers/s390/cio/device_fsm.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +Index: linux-sles11/drivers/s390/cio/device_fsm.c +=================================================================== +--- linux-sles11.orig/drivers/s390/cio/device_fsm.c ++++ linux-sles11/drivers/s390/cio/device_fsm.c +@@ -739,6 +739,17 @@ static void ccw_device_generic_notoper(s + } + + /* ++ * Handle path verification event in offline state. ++ */ ++static void ccw_device_offline_verify(struct ccw_device *cdev, ++ enum dev_event dev_event) ++{ ++ struct subchannel *sch = to_subchannel(cdev->dev.parent); ++ ++ css_schedule_eval(sch->schid); ++} ++ ++/* + * Handle path verification event. + */ + static void +@@ -1155,7 +1166,7 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES] + [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, + [DEV_EVENT_INTERRUPT] = ccw_device_offline_irq, + [DEV_EVENT_TIMEOUT] = ccw_device_nop, +- [DEV_EVENT_VERIFY] = ccw_device_nop, ++ [DEV_EVENT_VERIFY] = ccw_device_offline_verify, + }, + [DEV_STATE_VERIFY] = { + [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-15-12-zfcp-wka-work.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-15-12-zfcp-wka-work.patch new file mode 100644 index 000000000..eab969090 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-15-12-zfcp-wka-work.patch @@ -0,0 +1,26 @@ +From: Gerald Schaefer +Subject: zfcp: Cancel WKA port work on adapter dequeue +References: bnc#518291,LTC#54988 + +Symptom: Oops when enabling / disabling lots of FCP subchannels + while setting the chpid off / on. +Problem: The delayed_work for the directory server wka port is + being executed after the adapter struct has been removed. +Solution: Before removing the adapter struct make sure that the + delayed_work is not running. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_aux.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/s390/scsi/zfcp_aux.c ++++ b/drivers/s390/scsi/zfcp_aux.c +@@ -552,6 +552,7 @@ void zfcp_adapter_dequeue(struct zfcp_ad + + cancel_work_sync(&adapter->scan_work); + cancel_work_sync(&adapter->stat_work); ++ zfcp_fc_wka_port_force_offline(&adapter->nsp); + zfcp_adapter_scsi_unregister(adapter); + sysfs_remove_group(&adapter->ccw_device->dev.kobj, + &zfcp_sysfs_adapter_attrs); diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-16-01-zfcp-link-test.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-16-01-zfcp-link-test.patch new file mode 100644 index 000000000..fff60457c --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.arch/s390-16-01-zfcp-link-test.patch @@ -0,0 +1,60 @@ +From: Gerald Schaefer +Subject: zfcp: Only issue one test link command per port +References: bnc#529188,LTC#55337 + +Symptom: During error recovery, the SAN trace shows a long series + of els adisc commands being issued to the same remote port. +Problem: When the FCP channel returns a series of failed commands, + a els adisc test link command is issued for each failed + command. +Solution: Introduce a flag to ensure only one els adisc is pending + at one time. This is enough to trigger follow-on actions. + +Acked-by: John Jolly +--- + drivers/s390/scsi/zfcp_def.h | 1 + + drivers/s390/scsi/zfcp_fc.c | 9 +++++++++ + 2 files changed, 10 insertions(+) + +--- a/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:20:57.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:22:20.000000000 +0200 +@@ -260,6 +260,7 @@ struct zfcp_ls_adisc { + #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 + #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 + #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 ++#define ZFCP_STATUS_PORT_LINK_TEST 0x00000040 + + /* well known address (WKA) port status*/ + enum zfcp_wka_status { +--- a/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:20:57.000000000 +0200 ++++ b/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:23:15.000000000 +0200 +@@ -389,6 +389,7 @@ static void zfcp_fc_adisc_handler(unsign + zfcp_scsi_schedule_rport_register(port); + + out: ++ atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); + zfcp_port_put(port); + kfree(adisc); + } +@@ -435,13 +436,21 @@ void zfcp_fc_link_test_work(struct work_ + port->rport_task = RPORT_DEL; + zfcp_scsi_rport_work(&port->rport_work); + ++ /* only issue one test command at one time per port */ ++ if (atomic_read(&port->status) & ZFCP_STATUS_PORT_LINK_TEST) ++ goto out; ++ ++ atomic_set_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); ++ + retval = zfcp_fc_adisc(port); + if (retval == 0) + return; + + /* send of ADISC was not possible */ ++ atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); + zfcp_erp_port_forced_reopen(port, 0, 65, NULL); + ++out: + zfcp_port_put(port); + } + diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-add-FREE_PTE_NR b/src/patches/suse-2.6.27.31/patches.arch/s390-add-FREE_PTE_NR similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-add-FREE_PTE_NR rename to src/patches/suse-2.6.27.31/patches.arch/s390-add-FREE_PTE_NR diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-disable-etr-stp b/src/patches/suse-2.6.27.31/patches.arch/s390-disable-etr-stp similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-disable-etr-stp rename to src/patches/suse-2.6.27.31/patches.arch/s390-disable-etr-stp diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-personality-mask.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-personality-mask.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-personality-mask.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-personality-mask.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-symmetrix-ioctl.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-symmetrix-ioctl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-symmetrix-ioctl.patch rename to src/patches/suse-2.6.27.31/patches.arch/s390-symmetrix-ioctl.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/s390-zfcp-synchronize-scsi-register b/src/patches/suse-2.6.27.31/patches.arch/s390-zfcp-synchronize-scsi-register similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/s390-zfcp-synchronize-scsi-register rename to src/patches/suse-2.6.27.31/patches.arch/s390-zfcp-synchronize-scsi-register diff --git a/src/patches/suse-2.6.27.25/patches.arch/thinkpad_acpi-hotkey-notify-fix b/src/patches/suse-2.6.27.31/patches.arch/thinkpad_acpi-hotkey-notify-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/thinkpad_acpi-hotkey-notify-fix rename to src/patches/suse-2.6.27.31/patches.arch/thinkpad_acpi-hotkey-notify-fix diff --git a/src/patches/suse-2.6.27.25/patches.arch/thinkpad_fingers_off_backlight_igd.patch b/src/patches/suse-2.6.27.31/patches.arch/thinkpad_fingers_off_backlight_igd.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/thinkpad_fingers_off_backlight_igd.patch rename to src/patches/suse-2.6.27.31/patches.arch/thinkpad_fingers_off_backlight_igd.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_01_0f4896665a02b465ddca59a560983b24ec28c64b b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_01_0f4896665a02b465ddca59a560983b24ec28c64b similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_01_0f4896665a02b465ddca59a560983b24ec28c64b rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_01_0f4896665a02b465ddca59a560983b24ec28c64b diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_01_of_41_e61d98d8dad0048619bb138b0ff996422ffae53b b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_01_of_41_e61d98d8dad0048619bb138b0ff996422ffae53b similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_01_of_41_e61d98d8dad0048619bb138b0ff996422ffae53b rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_01_of_41_e61d98d8dad0048619bb138b0ff996422ffae53b diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_02_228324076234ca6a8cd34be89be78022773459f1 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_02_228324076234ca6a8cd34be89be78022773459f1 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_02_228324076234ca6a8cd34be89be78022773459f1 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_02_228324076234ca6a8cd34be89be78022773459f1 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_02_of_41_c42d9f32443397aed2d37d37df161392e6a5862f b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_02_of_41_c42d9f32443397aed2d37d37df161392e6a5862f similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_02_of_41_c42d9f32443397aed2d37d37df161392e6a5862f rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_02_of_41_c42d9f32443397aed2d37d37df161392e6a5862f diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_03_3f1fdb3673bb5638fa94186dc391cbc4879590bc b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_03_3f1fdb3673bb5638fa94186dc391cbc4879590bc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_03_3f1fdb3673bb5638fa94186dc391cbc4879590bc rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_03_3f1fdb3673bb5638fa94186dc391cbc4879590bc diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_03_of_41_1886e8a90a580f3ad343f2065c84c1b9e1dac9ef b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_03_of_41_1886e8a90a580f3ad343f2065c84c1b9e1dac9ef similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_03_of_41_1886e8a90a580f3ad343f2065c84c1b9e1dac9ef rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_03_of_41_1886e8a90a580f3ad343f2065c84c1b9e1dac9ef diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_04_f12c73e7fa7ebf9ad6defee2c4fb2664e743e970 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_04_f12c73e7fa7ebf9ad6defee2c4fb2664e743e970 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_04_f12c73e7fa7ebf9ad6defee2c4fb2664e743e970 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_04_f12c73e7fa7ebf9ad6defee2c4fb2664e743e970 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_04_of_41_aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_04_of_41_aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_04_of_41_aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_04_of_41_aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_05_7be42004065ce4df193aeef5befd26805267d0d9 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_05_7be42004065ce4df193aeef5befd26805267d0d9 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_05_7be42004065ce4df193aeef5befd26805267d0d9 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_05_7be42004065ce4df193aeef5befd26805267d0d9 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_06_caf43bf7c6a55e89b6df5179df434d67e24aa32e b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_06_caf43bf7c6a55e89b6df5179df434d67e24aa32e similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_06_caf43bf7c6a55e89b6df5179df434d67e24aa32e rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_06_caf43bf7c6a55e89b6df5179df434d67e24aa32e diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_06_of_41_ad3ad3f6a2caebf56869b83b69e23eb9fa5e0ab6 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_06_of_41_ad3ad3f6a2caebf56869b83b69e23eb9fa5e0ab6 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_06_of_41_ad3ad3f6a2caebf56869b83b69e23eb9fa5e0ab6 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_06_of_41_ad3ad3f6a2caebf56869b83b69e23eb9fa5e0ab6 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_07_511d9d34183662aada3890883e860b151d707e22 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_07_511d9d34183662aada3890883e860b151d707e22 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_07_511d9d34183662aada3890883e860b151d707e22 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_07_511d9d34183662aada3890883e860b151d707e22 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_07_of_41_cf1337f0447e5be8e66daa944f0ea3bcac2b6179 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_07_of_41_cf1337f0447e5be8e66daa944f0ea3bcac2b6179 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_07_of_41_cf1337f0447e5be8e66daa944f0ea3bcac2b6179 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_07_of_41_cf1337f0447e5be8e66daa944f0ea3bcac2b6179 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_08_of_41_fe962e90cb17a8426e144dee970e77ed789d98ee b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_08_of_41_fe962e90cb17a8426e144dee970e77ed789d98ee similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_08_of_41_fe962e90cb17a8426e144dee970e77ed789d98ee rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_08_of_41_fe962e90cb17a8426e144dee970e77ed789d98ee diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_09_94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_09_of_41_2ae21010694e56461a63bfc80e960090ce0a5ed9 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_09_of_41_2ae21010694e56461a63bfc80e960090ce0a5ed9 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_09_of_41_2ae21010694e56461a63bfc80e960090ce0a5ed9 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_09_of_41_2ae21010694e56461a63bfc80e960090ce0a5ed9 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_10_of_41_b6fcb33ad6c05f152a672f7c96c1fab006527b80 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_10_of_41_b6fcb33ad6c05f152a672f7c96c1fab006527b80 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_10_of_41_b6fcb33ad6c05f152a672f7c96c1fab006527b80 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_10_of_41_b6fcb33ad6c05f152a672f7c96c1fab006527b80 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_12_of_41_d94d93ca5cc36cd78c532def62772c98fe8ba5d7 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_12_of_41_d94d93ca5cc36cd78c532def62772c98fe8ba5d7 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_12_of_41_d94d93ca5cc36cd78c532def62772c98fe8ba5d7 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_12_of_41_d94d93ca5cc36cd78c532def62772c98fe8ba5d7 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_13_of_41_4dc2f96cacd1e74c688f94348a3bfd0a980817d5 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_13_of_41_4dc2f96cacd1e74c688f94348a3bfd0a980817d5 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_13_of_41_4dc2f96cacd1e74c688f94348a3bfd0a980817d5 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_13_of_41_4dc2f96cacd1e74c688f94348a3bfd0a980817d5 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_14_of_41_0c81c746f9bdbfaafe64322d540c8b7b59c27314 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_14_of_41_0c81c746f9bdbfaafe64322d540c8b7b59c27314 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_14_of_41_0c81c746f9bdbfaafe64322d540c8b7b59c27314 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_14_of_41_0c81c746f9bdbfaafe64322d540c8b7b59c27314 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_15_of_41_2d7a66d02e11af9ab8e16c76d22767e622b4e3d7 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_15_of_41_2d7a66d02e11af9ab8e16c76d22767e622b4e3d7 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_15_of_41_2d7a66d02e11af9ab8e16c76d22767e622b4e3d7 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_15_of_41_2d7a66d02e11af9ab8e16c76d22767e622b4e3d7 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_16_of_41_1b374e4d6f8b3eb2fcd034fcc24ea8ba1dfde7aa b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_16_of_41_1b374e4d6f8b3eb2fcd034fcc24ea8ba1dfde7aa similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_16_of_41_1b374e4d6f8b3eb2fcd034fcc24ea8ba1dfde7aa rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_16_of_41_1b374e4d6f8b3eb2fcd034fcc24ea8ba1dfde7aa diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_17_of_41_32e1d0a0651004f5fe47f85a2a5c725ad579a90c b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_17_of_41_32e1d0a0651004f5fe47f85a2a5c725ad579a90c similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_17_of_41_32e1d0a0651004f5fe47f85a2a5c725ad579a90c rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_17_of_41_32e1d0a0651004f5fe47f85a2a5c725ad579a90c diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_18_of_41_1cb11583a6c4ceda7426eb36f7bf0419da8dfbc2 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_18_of_41_1cb11583a6c4ceda7426eb36f7bf0419da8dfbc2 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_18_of_41_1cb11583a6c4ceda7426eb36f7bf0419da8dfbc2 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_18_of_41_1cb11583a6c4ceda7426eb36f7bf0419da8dfbc2 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_19_of_41_13c88fb58d0112d47f7839f24a755715c6218822 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_19_of_41_13c88fb58d0112d47f7839f24a755715c6218822 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_19_of_41_13c88fb58d0112d47f7839f24a755715c6218822 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_19_of_41_13c88fb58d0112d47f7839f24a755715c6218822 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_21_of_41_12a67cf6851871ca8df42025c94f140c303d0f7f b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_21_of_41_12a67cf6851871ca8df42025c94f140c303d0f7f similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_21_of_41_12a67cf6851871ca8df42025c94f140c303d0f7f rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_21_of_41_12a67cf6851871ca8df42025c94f140c303d0f7f diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_22_of_41_5c520a6724e912a7e6153b7597192edad6752750 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_22_of_41_5c520a6724e912a7e6153b7597192edad6752750 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_22_of_41_5c520a6724e912a7e6153b7597192edad6752750 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_22_of_41_5c520a6724e912a7e6153b7597192edad6752750 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_23_of_41_89027d35aa5b8f45ce0f7fa0911db85b46563da0 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_23_of_41_89027d35aa5b8f45ce0f7fa0911db85b46563da0 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_23_of_41_89027d35aa5b8f45ce0f7fa0911db85b46563da0 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_23_of_41_89027d35aa5b8f45ce0f7fa0911db85b46563da0 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_24_of_41_75c46fa61bc5b4ccd20a168ff325c58771248fcd b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_24_of_41_75c46fa61bc5b4ccd20a168ff325c58771248fcd similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_24_of_41_75c46fa61bc5b4ccd20a168ff325c58771248fcd rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_24_of_41_75c46fa61bc5b4ccd20a168ff325c58771248fcd diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_1_of_41_4c9961d56ec20c27ec5d02e49fd7427748312741 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_1_of_41_4c9961d56ec20c27ec5d02e49fd7427748312741 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_1_of_41_4c9961d56ec20c27ec5d02e49fd7427748312741 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_1_of_41_4c9961d56ec20c27ec5d02e49fd7427748312741 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_2_of_41_c535b6a1a685eb23f96e2c221777d6c1e05080d5 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_2_of_41_c535b6a1a685eb23f96e2c221777d6c1e05080d5 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_2_of_41_c535b6a1a685eb23f96e2c221777d6c1e05080d5 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_2_of_41_c535b6a1a685eb23f96e2c221777d6c1e05080d5 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 similarity index 99% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 index 7254f520a..d3e725fcf 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 +++ b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_25_of_41_6e1cb38a2aef7680975e71f23de187859ee8b158 @@ -298,7 +298,7 @@ Signed-off-by: Ingo Molnar return num_processors; --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -778,6 +778,8 @@ void __init setup_arch(char **cmdline_p) +@@ -769,6 +769,8 @@ void __init setup_arch(char **cmdline_p) #else num_physpages = max_pfn; diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_26_of_41_2d9579a124d746a3e0e0ba45e57d80800ee80807 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_26_of_41_2d9579a124d746a3e0e0ba45e57d80800ee80807 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_26_of_41_2d9579a124d746a3e0e0ba45e57d80800ee80807 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_26_of_41_2d9579a124d746a3e0e0ba45e57d80800ee80807 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_28_1_of_41_f910a9dc7c865896815e2a95fe33363e9522f277 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_28_1_of_41_f910a9dc7c865896815e2a95fe33363e9522f277 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_28_1_of_41_f910a9dc7c865896815e2a95fe33363e9522f277 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_28_1_of_41_f910a9dc7c865896815e2a95fe33363e9522f277 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_29_of_41_277d1f5846d84e16760131a93b7a67ebfa8eded4 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_29_of_41_277d1f5846d84e16760131a93b7a67ebfa8eded4 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_29_of_41_277d1f5846d84e16760131a93b7a67ebfa8eded4 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_29_of_41_277d1f5846d84e16760131a93b7a67ebfa8eded4 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_30_of_41_ad66dd340f561bdde2285992314d9e4fd9b6191e b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_30_of_41_ad66dd340f561bdde2285992314d9e4fd9b6191e similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_30_of_41_ad66dd340f561bdde2285992314d9e4fd9b6191e rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_30_of_41_ad66dd340f561bdde2285992314d9e4fd9b6191e diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_34_of_41_1b9b89e7f163336ad84200b66a17284dbf26aced b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_34_of_41_1b9b89e7f163336ad84200b66a17284dbf26aced similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_34_of_41_1b9b89e7f163336ad84200b66a17284dbf26aced rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_34_of_41_1b9b89e7f163336ad84200b66a17284dbf26aced diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_35_of_41_d25ae38b7e005af03843833bbd811ffe8c5f8cb4 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_35_of_41_d25ae38b7e005af03843833bbd811ffe8c5f8cb4 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_35_of_41_d25ae38b7e005af03843833bbd811ffe8c5f8cb4 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_35_of_41_d25ae38b7e005af03843833bbd811ffe8c5f8cb4 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_36_of_41_276605dddb74cbf1b77696e32c4a947e42cec52d b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_36_of_41_276605dddb74cbf1b77696e32c4a947e42cec52d similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_36_of_41_276605dddb74cbf1b77696e32c4a947e42cec52d rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_36_of_41_276605dddb74cbf1b77696e32c4a947e42cec52d diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_41_of_41_11c231a962c740b3216eb6565149ae5a7944cba7 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_41_of_41_11c231a962c740b3216eb6565149ae5a7944cba7 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_41_of_41_11c231a962c740b3216eb6565149ae5a7944cba7 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_41_of_41_11c231a962c740b3216eb6565149ae5a7944cba7 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_42_of_41_77322deb4bc676a5ee645444e7ed1a89f854473d b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_42_of_41_77322deb4bc676a5ee645444e7ed1a89f854473d similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_42_of_41_77322deb4bc676a5ee645444e7ed1a89f854473d rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_42_of_41_77322deb4bc676a5ee645444e7ed1a89f854473d diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_43_of_41_2c72d93f6593f386f5760ca8e7ac7026948c31d7 b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_43_of_41_2c72d93f6593f386f5760ca8e7ac7026948c31d7 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_43_of_41_2c72d93f6593f386f5760ca8e7ac7026948c31d7 rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_43_of_41_2c72d93f6593f386f5760ca8e7ac7026948c31d7 diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_x86-mach_apicdef.h-need-to-include-before-smp.h.patch b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_x86-mach_apicdef.h-need-to-include-before-smp.h.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_PATCH_x86-mach_apicdef.h-need-to-include-before-smp.h.patch rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_PATCH_x86-mach_apicdef.h-need-to-include-before-smp.h.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x2APIC_fix_section_mismatch.patch b/src/patches/suse-2.6.27.31/patches.arch/x2APIC_fix_section_mismatch.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x2APIC_fix_section_mismatch.patch rename to src/patches/suse-2.6.27.31/patches.arch/x2APIC_fix_section_mismatch.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-acpi-reroute-PCI-interrupt-to-legacy-boot-interrupt.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-acpi-reroute-PCI-interrupt-to-legacy-boot-interrupt.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-acpi-reroute-PCI-interrupt-to-legacy-boot-interrupt.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-acpi-reroute-PCI-interrupt-to-legacy-boot-interrupt.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-add-PCI-IDs-for-devices-that-need-boot-irq-quirk.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-add-PCI-IDs-for-devices-that-need-boot-irq-quirk.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-add-PCI-IDs-for-devices-that-need-boot-irq-quirk.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-add-PCI-IDs-for-devices-that-need-boot-irq-quirk.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-apic-force-bigsmp-apic-on-IBM-EXA3-4.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-apic-force-bigsmp-apic-on-IBM-EXA3-4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-apic-force-bigsmp-apic-on-IBM-EXA3-4.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-apic-force-bigsmp-apic-on-IBM-EXA3-4.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-call-boot-IRQ-quirks-at-end-of-device-init-and-during-resume.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-call-boot-IRQ-quirks-at-end-of-device-init-and-during-resume.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-call-boot-IRQ-quirks-at-end-of-device-init-and-during-resume.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-call-boot-IRQ-quirks-at-end-of-device-init-and-during-resume.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-disable-AMD-ATI-boot-interrupt-generation.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-disable-AMD-ATI-boot-interrupt-generation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-disable-AMD-ATI-boot-interrupt-generation.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-disable-AMD-ATI-boot-interrupt-generation.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-disable-broadcomm-boot-interrupt-generation.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-disable-broadcomm-boot-interrupt-generation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-disable-broadcomm-boot-interrupt-generation.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-disable-broadcomm-boot-interrupt-generation.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-disable-intel-boot-interrupt-generation.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-disable-intel-boot-interrupt-generation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-disable-intel-boot-interrupt-generation.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-disable-intel-boot-interrupt-generation.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-fix-kmap-contig.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-fix-kmap-contig.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-fix-kmap-contig.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-fix-kmap-contig.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-fix-nodac b/src/patches/suse-2.6.27.31/patches.arch/x86-fix-nodac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-fix-nodac rename to src/patches/suse-2.6.27.31/patches.arch/x86-fix-nodac diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-hpet-pre-read b/src/patches/suse-2.6.27.31/patches.arch/x86-hpet-pre-read similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-hpet-pre-read rename to src/patches/suse-2.6.27.31/patches.arch/x86-hpet-pre-read diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-introduce-config-option-for-pci-reroute-quirks.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-introduce-config-option-for-pci-reroute-quirks.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-introduce-config-option-for-pci-reroute-quirks.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-introduce-config-option-for-pci-reroute-quirks.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-introduce-pci-ioapicreroute-kernel-cmdline.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-introduce-pci-ioapicreroute-kernel-cmdline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-introduce-pci-ioapicreroute-kernel-cmdline.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-introduce-pci-ioapicreroute-kernel-cmdline.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-introduce-pci-noioapicquirk-kernel-cmdline.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-introduce-pci-noioapicquirk-kernel-cmdline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-introduce-pci-noioapicquirk-kernel-cmdline.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-introduce-pci-noioapicquirk-kernel-cmdline.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-mce-make-polling-timer-interval-per-cpu b/src/patches/suse-2.6.27.31/patches.arch/x86-mce-make-polling-timer-interval-per-cpu similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-mce-make-polling-timer-interval-per-cpu rename to src/patches/suse-2.6.27.31/patches.arch/x86-mce-make-polling-timer-interval-per-cpu diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-mce-switch-machine-check-polling-to-per-cpu-timer b/src/patches/suse-2.6.27.31/patches.arch/x86-mce-switch-machine-check-polling-to-per-cpu-timer similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-mce-switch-machine-check-polling-to-per-cpu-timer rename to src/patches/suse-2.6.27.31/patches.arch/x86-mce-switch-machine-check-polling-to-per-cpu-timer diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-mce-use-round_jiffies-instead-round_jiffies_relative b/src/patches/suse-2.6.27.31/patches.arch/x86-mce-use-round_jiffies-instead-round_jiffies_relative similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-mce-use-round_jiffies-instead-round_jiffies_relative rename to src/patches/suse-2.6.27.31/patches.arch/x86-mce-use-round_jiffies-instead-round_jiffies_relative diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-mcp51-no-dac b/src/patches/suse-2.6.27.31/patches.arch/x86-mcp51-no-dac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-mcp51-no-dac rename to src/patches/suse-2.6.27.31/patches.arch/x86-mcp51-no-dac diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-pageattr-pmd-permission-fix.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-pageattr-pmd-permission-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-pageattr-pmd-permission-fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-pageattr-pmd-permission-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-self-ptrace.patch b/src/patches/suse-2.6.27.31/patches.arch/x86-self-ptrace.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-self-ptrace.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86-self-ptrace.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-tracehook b/src/patches/suse-2.6.27.31/patches.arch/x86-tracehook similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-tracehook rename to src/patches/suse-2.6.27.31/patches.arch/x86-tracehook diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-01-add-TSC_RELIABLE b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-01-add-TSC_RELIABLE similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-01-add-TSC_RELIABLE rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-01-add-TSC_RELIABLE diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-02-add-X86_FEATURE_HYPERVISOR b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-02-add-X86_FEATURE_HYPERVISOR similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-02-add-X86_FEATURE_HYPERVISOR rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-02-add-X86_FEATURE_HYPERVISOR diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor similarity index 99% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor index 1d2e69f8a..9f1e82834 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor +++ b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-03-detect-from-hypervisor @@ -252,7 +252,7 @@ Signed-off-by: Takashi Iwai #include #include -@@ -905,6 +906,12 @@ void __init setup_arch(char **cmdline_p) +@@ -896,6 +897,12 @@ void __init setup_arch(char **cmdline_p) e820_reserve_resources(); e820_mark_nosave_regions(max_low_pfn); diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-04-use-TSC_RELIABLE b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-04-use-TSC_RELIABLE similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-04-use-TSC_RELIABLE rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-04-use-TSC_RELIABLE diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-05-skip-tsc-clocksource b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-05-skip-tsc-clocksource similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-05-skip-tsc-clocksource rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-05-skip-tsc-clocksource diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-06-fix-vmware_get_tsc b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-06-fix-vmware_get_tsc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-06-fix-vmware_get_tsc rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-06-fix-vmware_get_tsc diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-07-DMI-product-serial-key b/src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-07-DMI-product-serial-key similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86-vmware-tsc-07-DMI-product-serial-key rename to src/patches/suse-2.6.27.31/patches.arch/x86-vmware-tsc-07-DMI-product-serial-key diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_64-hpet-64bit-timer.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_64-hpet-64bit-timer.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_64-hpet-64bit-timer.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_64-hpet-64bit-timer.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_64-unwind-annotations b/src/patches/suse-2.6.27.31/patches.arch/x86_64-unwind-annotations similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_64-unwind-annotations rename to src/patches/suse-2.6.27.31/patches.arch/x86_64-unwind-annotations diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_agpgart-g33-stoeln-fix-2.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_agpgart-g33-stoeln-fix-2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_agpgart-g33-stoeln-fix-2.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_agpgart-g33-stoeln-fix-2.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_fix_llc_shared_map__cpu_llc_id_anomolies.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_fix_llc_shared_map__cpu_llc_id_anomolies.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_fix_llc_shared_map__cpu_llc_id_anomolies.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_fix_llc_shared_map__cpu_llc_id_anomolies.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_intel_cacheinfo_fix.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_intel_cacheinfo_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_intel_cacheinfo_fix.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_intel_cacheinfo_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_restrict_pci_early_quirks_to_root_bridges.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_restrict_pci_early_quirks_to_root_bridges.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_restrict_pci_early_quirks_to_root_bridges.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_restrict_pci_early_quirks_to_root_bridges.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi-uv-scir.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi-uv-scir.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi-uv-scir.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi-uv-scir.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-01-fix-smp_call_function.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-01-fix-smp_call_function.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-01-fix-smp_call_function.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-01-fix-smp_call_function.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-02-fix-send_call_func_ip.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-02-fix-send_call_func_ip.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-02-fix-send_call_func_ip.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-02-fix-send_call_func_ip.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-04-add-for_each_cpu_mask_and.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-04-add-for_each_cpu_mask_and.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-04-add-for_each_cpu_mask_and.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-04-add-for_each_cpu_mask_and.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-05-update-send_IPI_mask.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-05-update-send_IPI_mask.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-05-update-send_IPI_mask.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-05-update-send_IPI_mask.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-06-optimize-cpumask-in-sched_c.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-06-optimize-cpumask-in-sched_c.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-06-optimize-cpumask-in-sched_c.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-06-optimize-cpumask-in-sched_c.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-07_pae_compile_fixups.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-07_pae_compile_fixups.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_cpus4096-07_pae_compile_fixups.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_cpus4096-07_pae_compile_fixups.patch diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_uv_early_detect_oem.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_uv_early_detect_oem.patch similarity index 93% rename from src/patches/suse-2.6.27.25/patches.arch/x86_sgi_uv_early_detect_oem.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_sgi_uv_early_detect_oem.patch index 5f7266a13..c70a05c12 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/x86_sgi_uv_early_detect_oem.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/x86_sgi_uv_early_detect_oem.patch @@ -22,7 +22,7 @@ Signed-off-by: Thomas Renninger --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -827,6 +827,8 @@ void __init setup_arch(char **cmdline_p) +@@ -818,6 +818,8 @@ void __init setup_arch(char **cmdline_p) */ acpi_boot_table_init(); diff --git a/src/patches/suse-2.6.27.25/patches.arch/x86_uv_early_detect.patch b/src/patches/suse-2.6.27.31/patches.arch/x86_uv_early_detect.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.arch/x86_uv_early_detect.patch rename to src/patches/suse-2.6.27.31/patches.arch/x86_uv_early_detect.patch index dd88f437b..9eb70dd9b 100644 --- a/src/patches/suse-2.6.27.25/patches.arch/x86_uv_early_detect.patch +++ b/src/patches/suse-2.6.27.31/patches.arch/x86_uv_early_detect.patch @@ -186,7 +186,7 @@ Signed-off-by: Thomas Renninger - --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c -@@ -140,7 +140,7 @@ acpi_numa_processor_affinity_init(struct +@@ -142,7 +142,7 @@ acpi_numa_processor_affinity_init(struct return; } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0001-IB-ehca-Fix-problem-with-max-number-of-QPs-and-CQs.patch b/src/patches/suse-2.6.27.31/patches.drivers/0001-IB-ehca-Fix-problem-with-max-number-of-QPs-and-CQs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0001-IB-ehca-Fix-problem-with-max-number-of-QPs-and-CQs.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0001-IB-ehca-Fix-problem-with-max-number-of-QPs-and-CQs.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch b/src/patches/suse-2.6.27.31/patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch b/src/patches/suse-2.6.27.31/patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch b/src/patches/suse-2.6.27.31/patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch b/src/patches/suse-2.6.27.31/patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0005-Staging-add-et131x-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0005-Staging-add-et131x-network-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0005-Staging-add-et131x-network-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0005-Staging-add-et131x-network-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0007-Staging-add-sxg-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0007-Staging-add-sxg-network-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0007-Staging-add-sxg-network-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0007-Staging-add-sxg-network-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0008-Staging-add-me4000-firmware-files.patch b/src/patches/suse-2.6.27.31/patches.drivers/0008-Staging-add-me4000-firmware-files.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0008-Staging-add-me4000-firmware-files.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0008-Staging-add-me4000-firmware-files.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0010-Staging-add-the-go7007-video-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0010-Staging-add-the-go7007-video-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0010-Staging-add-the-go7007-video-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0010-Staging-add-the-go7007-video-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch b/src/patches/suse-2.6.27.31/patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0012-Staging-USB-IP-add-client-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0012-Staging-USB-IP-add-client-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0012-Staging-USB-IP-add-client-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0012-Staging-USB-IP-add-client-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0013-Staging-USB-IP-add-host-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0013-Staging-USB-IP-add-host-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0013-Staging-USB-IP-add-host-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0013-Staging-USB-IP-add-host-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0014-Staging-add-w35und-wifi-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0014-Staging-add-w35und-wifi-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0014-Staging-add-w35und-wifi-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0014-Staging-add-w35und-wifi-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0016-Staging-add-echo-cancelation-module.patch b/src/patches/suse-2.6.27.31/patches.drivers/0016-Staging-add-echo-cancelation-module.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0016-Staging-add-echo-cancelation-module.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0016-Staging-add-echo-cancelation-module.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch b/src/patches/suse-2.6.27.31/patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0018-Staging-go7007-v4l-fixes.patch b/src/patches/suse-2.6.27.31/patches.drivers/0018-Staging-go7007-v4l-fixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0018-Staging-go7007-v4l-fixes.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0018-Staging-go7007-v4l-fixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch b/src/patches/suse-2.6.27.31/patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch b/src/patches/suse-2.6.27.31/patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch b/src/patches/suse-2.6.27.31/patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/0023-Staging-Lindent-sxg.c.patch b/src/patches/suse-2.6.27.31/patches.drivers/0023-Staging-Lindent-sxg.c.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/0023-Staging-Lindent-sxg.c.patch rename to src/patches/suse-2.6.27.31/patches.drivers/0023-Staging-Lindent-sxg.c.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/Out-of-order-tx-frames-was-causing-several-check-con.patch b/src/patches/suse-2.6.27.31/patches.drivers/Out-of-order-tx-frames-was-causing-several-check-con.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/Out-of-order-tx-frames-was-causing-several-check-con.patch rename to src/patches/suse-2.6.27.31/patches.drivers/Out-of-order-tx-frames-was-causing-several-check-con.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-call-_osc-support-during-root-bridge-discovery.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-call-_osc-support-during-root-bridge-discovery.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-call-_osc-support-during-root-bridge-discovery.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-call-_osc-support-during-root-bridge-discovery.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-change-pci_osc_control_set-to-query-control-bits-first.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-change-pci_osc_control_set-to-query-control-bits-first.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-change-pci_osc_control_set-to-query-control-bits-first.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-change-pci_osc_control_set-to-query-control-bits-first.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-fix-possible-race-condition-on-_osc-evaluation.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-fix-possible-race-condition-on-_osc-evaluation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-fix-possible-race-condition-on-_osc-evaluation.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-fix-possible-race-condition-on-_osc-evaluation.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-include-missing-acpi.h-file-in-pci-acpi.h.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-include-missing-acpi.h-file-in-pci-acpi.h.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-include-missing-acpi.h-file-in-pci-acpi.h.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-include-missing-acpi.h-file-in-pci-acpi.h.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch index 93963e3a1..2fee2d428 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch +++ b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pci-extended-config-_osc-support-called-when-root-bridge-added.patch @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman if (!list_empty(&root->node)) --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c -@@ -1899,6 +1899,19 @@ static void __devinit pci_no_domains(voi +@@ -1900,6 +1900,19 @@ static void __devinit pci_no_domains(voi #endif } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pcie-aer-_osc-support-capabilities-called-when-root-bridge-added.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pcie-aer-_osc-support-capabilities-called-when-root-bridge-added.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pcie-aer-_osc-support-capabilities-called-when-root-bridge-added.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pcie-aer-_osc-support-capabilities-called-when-root-bridge-added.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch index 7144c0a33..ce90cf0ce 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch +++ b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-pcie-aspm-_osc-support-capabilities-called-when-root-bridge-added.patch @@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c -@@ -944,24 +944,15 @@ void pcie_no_aspm(void) +@@ -948,24 +948,15 @@ void pcie_no_aspm(void) aspm_disabled = 1; } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-remove-obsolete-_osc-capability-support-functions.patch b/src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-remove-obsolete-_osc-capability-support-functions.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/acpi-pci-remove-obsolete-_osc-capability-support-functions.patch rename to src/patches/suse-2.6.27.31/patches.drivers/acpi-pci-remove-obsolete-_osc-capability-support-functions.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/add-via-chrome9-drm-support.patch b/src/patches/suse-2.6.27.31/patches.drivers/add-via-chrome9-drm-support.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/add-via-chrome9-drm-support.patch rename to src/patches/suse-2.6.27.31/patches.drivers/add-via-chrome9-drm-support.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-ad1984-hp-volume-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-ad1984-hp-volume-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-ad1984-hp-volume-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-ad1984-hp-volume-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-ca0106-capture-no-44khz b/src/patches/suse-2.6.27.31/patches.drivers/alsa-ca0106-capture-no-44khz similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-ca0106-capture-no-44khz rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-ca0106-capture-no-44khz diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-ca0106-pm-support b/src/patches/suse-2.6.27.31/patches.drivers/alsa-ca0106-pm-support similarity index 99% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-ca0106-pm-support rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-ca0106-pm-support index 2d9b4534e..a5565f647 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-ca0106-pm-support +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-ca0106-pm-support @@ -10,264 +10,12 @@ Signed-off-by: Takashi Iwai --- ---- a/sound/pci/ca0106/ca0106_mixer.c -+++ b/sound/pci/ca0106/ca0106_mixer.c -@@ -75,6 +75,84 @@ - - #include "ca0106.h" - -+static void ca0106_spdif_enable(struct snd_ca0106 *emu) -+{ -+ unsigned int val; -+ -+ if (emu->spdif_enable) { -+ /* Digital */ -+ snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); -+ snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000); -+ val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000; -+ snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val); -+ val = inl(emu->port + GPIO) & ~0x101; -+ outl(val, emu->port + GPIO); -+ -+ } else { -+ /* Analog */ -+ snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); -+ snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000); -+ val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000; -+ snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val); -+ val = inl(emu->port + GPIO) | 0x101; -+ outl(val, emu->port + GPIO); -+ } -+} -+ -+static void ca0106_set_capture_source(struct snd_ca0106 *emu) -+{ -+ unsigned int val = emu->capture_source; -+ unsigned int source, mask; -+ source = (val << 28) | (val << 24) | (val << 20) | (val << 16); -+ mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff; -+ snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask); -+} -+ -+static void ca0106_set_i2c_capture_source(struct snd_ca0106 *emu, -+ unsigned int val, int force) -+{ -+ unsigned int ngain, ogain; -+ u32 source; -+ -+ snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ -+ ngain = emu->i2c_capture_volume[val][0]; /* Left */ -+ ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */ -+ if (force || ngain != ogain) -+ snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ngain & 0xff); -+ ngain = emu->i2c_capture_volume[val][1]; /* Right */ -+ ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Right */ -+ if (force || ngain != ogain) -+ snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ngain & 0xff); -+ source = 1 << val; -+ snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */ -+ emu->i2c_capture_source = val; -+} -+ -+static void ca0106_set_capture_mic_line_in(struct snd_ca0106 *emu) -+{ -+ u32 tmp; -+ -+ if (emu->capture_mic_line_in) { -+ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */ -+ tmp = inl(emu->port+GPIO) & ~0x400; -+ tmp = tmp | 0x400; -+ outl(tmp, emu->port+GPIO); -+ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */ -+ } else { -+ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */ -+ tmp = inl(emu->port+GPIO) & ~0x400; -+ outl(tmp, emu->port+GPIO); -+ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); */ -+ } -+} -+ -+static void ca0106_set_spdif_bits(struct snd_ca0106 *emu, int idx) -+{ -+ snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, emu->spdif_bits[idx]); -+} -+ -+/* -+ */ - static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale1, -5175, 25, 1); - static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale2, -10350, 50, 1); - -@@ -95,30 +173,12 @@ static int snd_ca0106_shared_spdif_put(s - struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); - unsigned int val; - int change = 0; -- u32 mask; - - val = !!ucontrol->value.integer.value[0]; - change = (emu->spdif_enable != val); - if (change) { - emu->spdif_enable = val; -- if (val) { -- /* Digital */ -- snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); -- snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000); -- snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, -- snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000); -- mask = inl(emu->port + GPIO) & ~0x101; -- outl(mask, emu->port + GPIO); -- -- } else { -- /* Analog */ -- snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); -- snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000); -- snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, -- snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000); -- mask = inl(emu->port + GPIO) | 0x101; -- outl(mask, emu->port + GPIO); -- } -+ ca0106_spdif_enable(emu); - } - return change; - } -@@ -154,8 +214,6 @@ static int snd_ca0106_capture_source_put - struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); - unsigned int val; - int change = 0; -- u32 mask; -- u32 source; - - val = ucontrol->value.enumerated.item[0] ; - if (val >= 6) -@@ -163,9 +221,7 @@ static int snd_ca0106_capture_source_put - change = (emu->capture_source != val); - if (change) { - emu->capture_source = val; -- source = (val << 28) | (val << 24) | (val << 20) | (val << 16); -- mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff; -- snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask); -+ ca0106_set_capture_source(emu); - } - return change; - } -@@ -200,9 +256,7 @@ static int snd_ca0106_i2c_capture_source - { - struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); - unsigned int source_id; -- unsigned int ngain, ogain; - int change = 0; -- u32 source; - /* If the capture source has changed, - * update the capture volume from the cached value - * for the particular source. -@@ -212,18 +266,7 @@ static int snd_ca0106_i2c_capture_source - return -EINVAL; - change = (emu->i2c_capture_source != source_id); - if (change) { -- snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ -- ngain = emu->i2c_capture_volume[source_id][0]; /* Left */ -- ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */ -- if (ngain != ogain) -- snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff)); -- ngain = emu->i2c_capture_volume[source_id][1]; /* Left */ -- ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Left */ -- if (ngain != ogain) -- snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff)); -- source = 1 << source_id; -- snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */ -- emu->i2c_capture_source = source_id; -+ ca0106_set_i2c_capture_source(emu, source_id, 0); - } - return change; - } -@@ -271,7 +314,6 @@ static int snd_ca0106_capture_mic_line_i - struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); - unsigned int val; - int change = 0; -- u32 tmp; - - val = ucontrol->value.enumerated.item[0] ; - if (val > 1) -@@ -279,18 +321,7 @@ static int snd_ca0106_capture_mic_line_i - change = (emu->capture_mic_line_in != val); - if (change) { - emu->capture_mic_line_in = val; -- if (val) { -- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ -- tmp = inl(emu->port+GPIO) & ~0x400; -- tmp = tmp | 0x400; -- outl(tmp, emu->port+GPIO); -- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); -- } else { -- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ -- tmp = inl(emu->port+GPIO) & ~0x400; -- outl(tmp, emu->port+GPIO); -- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); -- } -+ ca0106_set_capture_mic_line_in(emu); - } - return change; - } -@@ -359,8 +390,8 @@ static int snd_ca0106_spdif_put(struct s - (ucontrol->value.iec958.status[3] << 24); - change = val != emu->spdif_bits[idx]; - if (change) { -- snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, val); - emu->spdif_bits[idx] = val; -+ ca0106_set_spdif_bits(emu, idx); - } - return change; - } -@@ -773,3 +804,50 @@ int __devinit snd_ca0106_mixer(struct sn - return 0; - } - -+#ifdef CONFIG_PM -+struct ca0106_vol_tbl { -+ unsigned int channel_id; -+ unsigned int reg; -+}; -+ -+static struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = { -+ { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 }, -+ { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 }, -+ { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 }, -+ { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2 }, -+ { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME1 }, -+ { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME1 }, -+ { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME1 }, -+ { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME1 }, -+ { 1, CAPTURE_CONTROL }, -+}; -+ -+void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip) -+{ -+ int i; -+ -+ /* save volumes */ -+ for (i = 0; i < NUM_SAVED_VOLUMES; i++) -+ chip->saved_vol[i] = -+ snd_ca0106_ptr_read(chip, saved_volumes[i].reg, -+ saved_volumes[i].channel_id); -+} -+ -+void snd_ca0106_mixer_resume(struct snd_ca0106 *chip) -+{ -+ int i; -+ -+ for (i = 0; i < NUM_SAVED_VOLUMES; i++) -+ snd_ca0106_ptr_write(chip, saved_volumes[i].reg, -+ saved_volumes[i].channel_id, -+ chip->saved_vol[i]); -+ -+ ca0106_spdif_enable(chip); -+ ca0106_set_capture_source(chip); -+ ca0106_set_i2c_capture_source(chip, chip->i2c_capture_source, 1); -+ for (i = 0; i < 4; i++) -+ ca0106_set_spdif_bits(chip, i); -+ if (chip->details->i2c_adc) -+ ca0106_set_capture_mic_line_in(chip); -+} -+#endif /* CONFIG_PM */ +--- + sound/pci/ca0106/ca0106.h | 15 + + sound/pci/ca0106/ca0106_main.c | 532 +++++++++++++++++++++++----------------- + sound/pci/ca0106/ca0106_mixer.c | 182 +++++++++---- + 3 files changed, 457 insertions(+), 272 deletions(-) + --- a/sound/pci/ca0106/ca0106.h +++ b/sound/pci/ca0106/ca0106.h @@ -686,7 +686,7 @@ struct snd_ca0106 { @@ -1019,3 +767,261 @@ Signed-off-by: Takashi Iwai }; // initialization of the module +--- a/sound/pci/ca0106/ca0106_mixer.c ++++ b/sound/pci/ca0106/ca0106_mixer.c +@@ -75,6 +75,84 @@ + + #include "ca0106.h" + ++static void ca0106_spdif_enable(struct snd_ca0106 *emu) ++{ ++ unsigned int val; ++ ++ if (emu->spdif_enable) { ++ /* Digital */ ++ snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); ++ snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000); ++ val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000; ++ snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val); ++ val = inl(emu->port + GPIO) & ~0x101; ++ outl(val, emu->port + GPIO); ++ ++ } else { ++ /* Analog */ ++ snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); ++ snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000); ++ val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000; ++ snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val); ++ val = inl(emu->port + GPIO) | 0x101; ++ outl(val, emu->port + GPIO); ++ } ++} ++ ++static void ca0106_set_capture_source(struct snd_ca0106 *emu) ++{ ++ unsigned int val = emu->capture_source; ++ unsigned int source, mask; ++ source = (val << 28) | (val << 24) | (val << 20) | (val << 16); ++ mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff; ++ snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask); ++} ++ ++static void ca0106_set_i2c_capture_source(struct snd_ca0106 *emu, ++ unsigned int val, int force) ++{ ++ unsigned int ngain, ogain; ++ u32 source; ++ ++ snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ ++ ngain = emu->i2c_capture_volume[val][0]; /* Left */ ++ ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */ ++ if (force || ngain != ogain) ++ snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ngain & 0xff); ++ ngain = emu->i2c_capture_volume[val][1]; /* Right */ ++ ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Right */ ++ if (force || ngain != ogain) ++ snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ngain & 0xff); ++ source = 1 << val; ++ snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */ ++ emu->i2c_capture_source = val; ++} ++ ++static void ca0106_set_capture_mic_line_in(struct snd_ca0106 *emu) ++{ ++ u32 tmp; ++ ++ if (emu->capture_mic_line_in) { ++ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */ ++ tmp = inl(emu->port+GPIO) & ~0x400; ++ tmp = tmp | 0x400; ++ outl(tmp, emu->port+GPIO); ++ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */ ++ } else { ++ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */ ++ tmp = inl(emu->port+GPIO) & ~0x400; ++ outl(tmp, emu->port+GPIO); ++ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); */ ++ } ++} ++ ++static void ca0106_set_spdif_bits(struct snd_ca0106 *emu, int idx) ++{ ++ snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, emu->spdif_bits[idx]); ++} ++ ++/* ++ */ + static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale1, -5175, 25, 1); + static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale2, -10350, 50, 1); + +@@ -95,30 +173,12 @@ static int snd_ca0106_shared_spdif_put(s + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); + unsigned int val; + int change = 0; +- u32 mask; + + val = !!ucontrol->value.integer.value[0]; + change = (emu->spdif_enable != val); + if (change) { + emu->spdif_enable = val; +- if (val) { +- /* Digital */ +- snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); +- snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000); +- snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, +- snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000); +- mask = inl(emu->port + GPIO) & ~0x101; +- outl(mask, emu->port + GPIO); +- +- } else { +- /* Analog */ +- snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf); +- snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000); +- snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, +- snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000); +- mask = inl(emu->port + GPIO) | 0x101; +- outl(mask, emu->port + GPIO); +- } ++ ca0106_spdif_enable(emu); + } + return change; + } +@@ -154,8 +214,6 @@ static int snd_ca0106_capture_source_put + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); + unsigned int val; + int change = 0; +- u32 mask; +- u32 source; + + val = ucontrol->value.enumerated.item[0] ; + if (val >= 6) +@@ -163,9 +221,7 @@ static int snd_ca0106_capture_source_put + change = (emu->capture_source != val); + if (change) { + emu->capture_source = val; +- source = (val << 28) | (val << 24) | (val << 20) | (val << 16); +- mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff; +- snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask); ++ ca0106_set_capture_source(emu); + } + return change; + } +@@ -200,9 +256,7 @@ static int snd_ca0106_i2c_capture_source + { + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); + unsigned int source_id; +- unsigned int ngain, ogain; + int change = 0; +- u32 source; + /* If the capture source has changed, + * update the capture volume from the cached value + * for the particular source. +@@ -212,18 +266,7 @@ static int snd_ca0106_i2c_capture_source + return -EINVAL; + change = (emu->i2c_capture_source != source_id); + if (change) { +- snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ +- ngain = emu->i2c_capture_volume[source_id][0]; /* Left */ +- ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */ +- if (ngain != ogain) +- snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff)); +- ngain = emu->i2c_capture_volume[source_id][1]; /* Left */ +- ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Left */ +- if (ngain != ogain) +- snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff)); +- source = 1 << source_id; +- snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */ +- emu->i2c_capture_source = source_id; ++ ca0106_set_i2c_capture_source(emu, source_id, 0); + } + return change; + } +@@ -271,7 +314,6 @@ static int snd_ca0106_capture_mic_line_i + struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol); + unsigned int val; + int change = 0; +- u32 tmp; + + val = ucontrol->value.enumerated.item[0] ; + if (val > 1) +@@ -279,18 +321,7 @@ static int snd_ca0106_capture_mic_line_i + change = (emu->capture_mic_line_in != val); + if (change) { + emu->capture_mic_line_in = val; +- if (val) { +- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ +- tmp = inl(emu->port+GPIO) & ~0x400; +- tmp = tmp | 0x400; +- outl(tmp, emu->port+GPIO); +- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); +- } else { +- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ +- tmp = inl(emu->port+GPIO) & ~0x400; +- outl(tmp, emu->port+GPIO); +- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); +- } ++ ca0106_set_capture_mic_line_in(emu); + } + return change; + } +@@ -359,8 +390,8 @@ static int snd_ca0106_spdif_put(struct s + (ucontrol->value.iec958.status[3] << 24); + change = val != emu->spdif_bits[idx]; + if (change) { +- snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, val); + emu->spdif_bits[idx] = val; ++ ca0106_set_spdif_bits(emu, idx); + } + return change; + } +@@ -779,3 +810,50 @@ int __devinit snd_ca0106_mixer(struct sn + return 0; + } + ++#ifdef CONFIG_PM ++struct ca0106_vol_tbl { ++ unsigned int channel_id; ++ unsigned int reg; ++}; ++ ++static struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = { ++ { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 }, ++ { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 }, ++ { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 }, ++ { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2 }, ++ { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME1 }, ++ { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME1 }, ++ { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME1 }, ++ { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME1 }, ++ { 1, CAPTURE_CONTROL }, ++}; ++ ++void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip) ++{ ++ int i; ++ ++ /* save volumes */ ++ for (i = 0; i < NUM_SAVED_VOLUMES; i++) ++ chip->saved_vol[i] = ++ snd_ca0106_ptr_read(chip, saved_volumes[i].reg, ++ saved_volumes[i].channel_id); ++} ++ ++void snd_ca0106_mixer_resume(struct snd_ca0106 *chip) ++{ ++ int i; ++ ++ for (i = 0; i < NUM_SAVED_VOLUMES; i++) ++ snd_ca0106_ptr_write(chip, saved_volumes[i].reg, ++ saved_volumes[i].channel_id, ++ chip->saved_vol[i]); ++ ++ ca0106_spdif_enable(chip); ++ ca0106_set_capture_source(chip); ++ ca0106_set_i2c_capture_source(chip, chip->i2c_capture_source, 1); ++ for (i = 0; i < 4; i++) ++ ca0106_set_spdif_bits(chip, i); ++ if (chip->details->i2c_adc) ++ ca0106_set_capture_mic_line_in(chip); ++} ++#endif /* CONFIG_PM */ diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-emu10k1-audigy-fixes b/src/patches/suse-2.6.27.31/patches.drivers/alsa-emu10k1-audigy-fixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-emu10k1-audigy-fixes rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-emu10k1-audigy-fixes diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-92hd73x-desktop-fixes b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-92hd73x-desktop-fixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-92hd73x-desktop-fixes rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-92hd73x-desktop-fixes diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-ad1882-id-typo-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-ad1882-id-typo-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-ad1882-id-typo-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-ad1882-id-typo-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-add-volume-offset b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-add-volume-offset similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-add-volume-offset rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-add-volume-offset diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-alc269-fsc-amilo b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-alc269-fsc-amilo similarity index 84% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-alc269-fsc-amilo rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-alc269-fsc-amilo index 318390b48..fcbf75aec 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-alc269-fsc-amilo +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-alc269-fsc-amilo @@ -18,7 +18,7 @@ Signed-off-by: Takashi Iwai --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt -@@ -857,6 +857,8 @@ Prior to version 0.9.0rc4 options had a +@@ -857,6 +857,8 @@ Prior to version 0.9.0rc4 options had a quanta Quanta FL1 eeepc-p703 ASUS Eeepc P703 P900A eeepc-p901 ASUS Eeepc P901 S101 @@ -45,7 +45,7 @@ Signed-off-by: Takashi Iwai NULL, }; -@@ -11938,6 +11940,15 @@ static struct snd_kcontrol_new alc269_ca +@@ -11937,6 +11939,15 @@ static struct snd_kcontrol_new alc269_ca static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), @@ -61,7 +61,7 @@ Signed-off-by: Takashi Iwai { } /* end */ }; -@@ -12360,7 +12371,8 @@ static const char *alc269_models[ALC269_ +@@ -12359,7 +12370,8 @@ static const char *alc269_models[ALC269_ [ALC269_BASIC] = "basic", [ALC269_QUANTA_FL1] = "quanta", [ALC269_ASUS_EEEPC_P703] = "eeepc-p703", @@ -71,7 +71,7 @@ Signed-off-by: Takashi Iwai }; static struct snd_pci_quirk alc269_cfg_tbl[] = { -@@ -12371,6 +12383,7 @@ static struct snd_pci_quirk alc269_cfg_t +@@ -12370,6 +12382,7 @@ static struct snd_pci_quirk alc269_cfg_t ALC269_ASUS_EEEPC_P901), SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", ALC269_ASUS_EEEPC_P901), @@ -79,16 +79,10 @@ Signed-off-by: Takashi Iwai {} }; -@@ -12423,6 +12436,20 @@ static struct alc_config_preset alc269_p - .unsol_event = alc269_eeepc_dmic_unsol_event, - .init_hook = alc269_eeepc_dmic_inithook, - }, -+ [ALC269_FUJITSU] = { -+ .mixers = { alc269_fujitsu_mixer, alc269_beep_mixer, -+ alc269_epc_capture_mixer }, -+ .init_verbs = { alc269_init_verbs, -+ alc269_eeepc_dmic_init_verbs }, -+ .num_dacs = ARRAY_SIZE(alc269_dac_nids), +@@ -12414,6 +12427,20 @@ static struct alc_config_preset alc269_p + .init_verbs = { alc269_init_verbs, + alc269_eeepc_dmic_init_verbs }, + .num_dacs = ARRAY_SIZE(alc269_dac_nids), + .dac_nids = alc269_dac_nids, + .hp_nid = 0x03, + .num_channel_mode = ARRAY_SIZE(alc269_modes), @@ -97,6 +91,12 @@ Signed-off-by: Takashi Iwai + .unsol_event = alc269_eeepc_dmic_unsol_event, + .init_hook = alc269_eeepc_dmic_inithook, + }, - }; - - static int patch_alc269(struct hda_codec *codec) ++ [ALC269_FUJITSU] = { ++ .mixers = { alc269_fujitsu_mixer, alc269_beep_mixer, ++ alc269_epc_capture_mixer }, ++ .init_verbs = { alc269_init_verbs, ++ alc269_eeepc_dmic_init_verbs }, ++ .num_dacs = ARRAY_SIZE(alc269_dac_nids), + .dac_nids = alc269_dac_nids, + .hp_nid = 0x03, + .num_channel_mode = ARRAY_SIZE(alc269_modes), diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-analog-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-analog-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-analog-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-analog-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-atihdmi-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-atihdmi-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-atihdmi-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-atihdmi-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep-dig-switch b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep-dig-switch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep-dig-switch rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep-dig-switch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep-null-check-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep-null-check-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep-null-check-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-beep-null-check-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-dell-92hd73xx-models b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-dell-92hd73xx-models similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-dell-92hd73xx-models rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-dell-92hd73xx-models diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-dell-studio-probe-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-dell-studio-probe-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-dell-studio-probe-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-dell-studio-probe-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-fix2 b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-fix2 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-fix2 rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-fix2 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-t1616-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-t1616-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-gateway-t1616-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-gateway-t1616-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-3013-master-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-3013-master-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-3013-master-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-3013-master-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv4-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv4-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv4-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv4-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv5-mic-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv5-mic-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv5-mic-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv5-mic-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv5-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv5-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv5-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv5-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv7-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv7-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-dv7-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-dv7-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-zenith-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-zenith-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp-zenith-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp-zenith-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp2230s-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp2230s-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp2230s-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp2230s-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp6530b-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp6530b-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-hp6530b-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-hp6530b-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-idt92hd83-fix-typo b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-idt92hd83-fix-typo similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-idt92hd83-fix-typo rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-idt92hd83-fix-typo diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-intel-d945-ref-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-intel-d945-ref-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-intel-d945-ref-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-intel-d945-ref-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-nvidia-hdmi b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-nvidia-hdmi similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-nvidia-hdmi rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-nvidia-hdmi diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-probe-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-probe-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-probe-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-probe-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-proc-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-proc-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-proc-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-proc-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-proc-gpio-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-proc-gpio-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-proc-gpio-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-proc-gpio-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-acer-dmic b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-acer-dmic similarity index 91% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-acer-dmic rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-acer-dmic index fdb55f531..c376153ce 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-acer-dmic +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-acer-dmic @@ -22,7 +22,7 @@ Signed-off-by: Takashi Iwai --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt -@@ -844,6 +844,7 @@ Prior to version 0.9.0rc4 options had a +@@ -844,6 +844,7 @@ Prior to version 0.9.0rc4 options had a 3stack 3-stack model toshiba Toshiba A205 acer Acer laptops @@ -40,7 +40,7 @@ Signed-off-by: Takashi Iwai ALC268_ACER_ASPIRE_ONE, ALC268_DELL, ALC268_ZEPTO, -@@ -10949,6 +10950,22 @@ static struct snd_kcontrol_new alc268_ac +@@ -10948,6 +10949,22 @@ static struct snd_kcontrol_new alc268_ac { } }; @@ -63,7 +63,7 @@ Signed-off-by: Takashi Iwai static struct hda_verb alc268_acer_aspire_one_verbs[] = { {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, -@@ -11281,6 +11298,15 @@ static struct hda_input_mux alc268_acer_ +@@ -11280,6 +11297,15 @@ static struct hda_input_mux alc268_acer_ .num_items = 3, .items = { { "Mic", 0x0 }, @@ -79,7 +79,7 @@ Signed-off-by: Takashi Iwai { "Internal Mic", 0x6 }, { "Line", 0x2 }, }, -@@ -11561,6 +11587,7 @@ static const char *alc268_models[ALC268_ +@@ -11560,6 +11586,7 @@ static const char *alc268_models[ALC268_ [ALC268_3ST] = "3stack", [ALC268_TOSHIBA] = "toshiba", [ALC268_ACER] = "acer", @@ -87,7 +87,7 @@ Signed-off-by: Takashi Iwai [ALC268_ACER_ASPIRE_ONE] = "acer-aspire", [ALC268_DELL] = "dell", [ALC268_ZEPTO] = "zepto", -@@ -11656,6 +11683,23 @@ static struct alc_config_preset alc268_p +@@ -11655,6 +11682,23 @@ static struct alc_config_preset alc268_p .unsol_event = alc268_acer_unsol_event, .init_hook = alc268_acer_init_hook, }, diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-alc269-dmic b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-alc269-dmic similarity index 95% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-alc269-dmic rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-alc269-dmic index 2f548df09..1c70ee66a 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-alc269-dmic +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-alc269-dmic @@ -14,7 +14,7 @@ Signed-off-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -12251,8 +12251,26 @@ static int alc269_auto_create_multi_out_ +@@ -12250,8 +12250,26 @@ static int alc269_auto_create_multi_out_ return 0; } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-mic-automute-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-mic-automute-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-mic-automute-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-mic-automute-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-update similarity index 95% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-update index 231bfae2b..35b799c7f 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-realtek-update +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-realtek-update @@ -22,7 +22,7 @@ Signed-off-by: Takashi Iwai --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt -@@ -809,6 +809,7 @@ Prior to version 0.9.0rc4 options had a +@@ -809,6 +809,7 @@ Prior to version 0.9.0rc4 options had a ALC260 hp HP machines hp-3013 HP machines (3013-variant) @@ -30,7 +30,7 @@ Signed-off-by: Takashi Iwai fujitsu Fujitsu S7020 acer Acer TravelMate will Will laptops (PB V7900) -@@ -830,8 +831,11 @@ Prior to version 0.9.0rc4 options had a +@@ -830,8 +831,11 @@ Prior to version 0.9.0rc4 options had a hippo Hippo (ATI) with jack detection, Sony UX-90s hippo_1 Hippo (Benq) with jack detection sony-assamd Sony ASSAMD @@ -42,7 +42,7 @@ Signed-off-by: Takashi Iwai basic fixed pin assignment w/o SPDIF auto auto-config reading BIOS (default) -@@ -840,6 +844,7 @@ Prior to version 0.9.0rc4 options had a +@@ -840,6 +844,7 @@ Prior to version 0.9.0rc4 options had a 3stack 3-stack model toshiba Toshiba A205 acer Acer laptops @@ -50,7 +50,7 @@ Signed-off-by: Takashi Iwai dell Dell OEM laptops (Vostro 1200) zepto Zepto laptops test for testing/debugging purpose, almost all controls can -@@ -849,6 +854,9 @@ Prior to version 0.9.0rc4 options had a +@@ -849,6 +854,9 @@ Prior to version 0.9.0rc4 options had a ALC269 basic Basic preset @@ -60,7 +60,7 @@ Signed-off-by: Takashi Iwai ALC662/663 3stack-dig 3-stack (2-channel) with SPDIF -@@ -858,10 +866,17 @@ Prior to version 0.9.0rc4 options had a +@@ -858,10 +866,17 @@ Prior to version 0.9.0rc4 options had a lenovo-101e Lenovo laptop eeepc-p701 ASUS Eeepc P701 eeepc-ep20 ASUS Eeepc EP20 @@ -78,7 +78,7 @@ Signed-off-by: Takashi Iwai auto auto-config reading BIOS (default) ALC882/885 -@@ -893,12 +908,14 @@ Prior to version 0.9.0rc4 options had a +@@ -893,12 +908,14 @@ Prior to version 0.9.0rc4 options had a lenovo-101e Lenovo 101E lenovo-nb0763 Lenovo NB0763 lenovo-ms7195-dig Lenovo MS7195 @@ -1427,7 +1427,7 @@ Signed-off-by: Takashi Iwai /* mute/unmute internal speaker according to the hp jack and mute state */ static void alc262_hippo_automute(struct hda_codec *codec) { -@@ -9295,6 +9838,25 @@ static struct snd_kcontrol_new alc262_le +@@ -9299,6 +9842,25 @@ static struct snd_kcontrol_new alc262_le { } /* end */ }; @@ -1453,7 +1453,7 @@ Signed-off-by: Takashi Iwai /* additional init verbs for Benq laptops */ static struct hda_verb alc262_EAPD_verbs[] = { {0x20, AC_VERB_SET_COEF_INDEX, 0x07}, -@@ -9543,7 +10105,7 @@ static struct hda_verb alc262_volume_ini +@@ -9547,7 +10109,7 @@ static struct hda_verb alc262_volume_ini {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, @@ -1462,7 +1462,7 @@ Signed-off-by: Takashi Iwai /* set up input amps for analog loopback */ /* Amp Indices: DAC = 0, mixer = 1 */ {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, -@@ -9598,7 +10160,7 @@ static struct hda_verb alc262_HP_BPC_ini +@@ -9602,7 +10164,7 @@ static struct hda_verb alc262_HP_BPC_ini {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, @@ -1471,7 +1471,7 @@ Signed-off-by: Takashi Iwai /* * Set up output mixers (0x0c - 0x0e) */ -@@ -9759,6 +10321,24 @@ static struct hda_verb alc262_HP_BPC_Wil +@@ -9763,6 +10325,24 @@ static struct hda_verb alc262_HP_BPC_Wil { } }; @@ -1496,7 +1496,7 @@ Signed-off-by: Takashi Iwai #ifdef CONFIG_SND_HDA_POWER_SAVE #define alc262_loopbacks alc880_loopbacks #endif -@@ -9828,7 +10408,7 @@ static void alc262_auto_init(struct hda_ +@@ -9832,7 +10412,7 @@ static void alc262_auto_init(struct hda_ alc262_auto_init_analog_input(codec); alc262_auto_init_input_src(codec); if (spec->unsol_event) @@ -1505,7 +1505,7 @@ Signed-off-by: Takashi Iwai } /* -@@ -9846,6 +10426,8 @@ static const char *alc262_models[ALC262_ +@@ -9850,6 +10430,8 @@ static const char *alc262_models[ALC262_ [ALC262_BENQ_ED8] = "benq", [ALC262_BENQ_T31] = "benq-t31", [ALC262_SONY_ASSAMD] = "sony-assamd", @@ -1514,7 +1514,7 @@ Signed-off-by: Takashi Iwai [ALC262_ULTRA] = "ultra", [ALC262_LENOVO_3000] = "lenovo-3000", [ALC262_NEC] = "nec", -@@ -9883,7 +10465,8 @@ static struct snd_pci_quirk alc262_cfg_t +@@ -9887,7 +10469,8 @@ static struct snd_pci_quirk alc262_cfg_t SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", @@ -1524,7 +1524,7 @@ Signed-off-by: Takashi Iwai SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), -@@ -10038,7 +10621,7 @@ static struct alc_config_preset alc262_p +@@ -10042,7 +10625,7 @@ static struct alc_config_preset alc262_p .input_mux = &alc262_capture_source, .unsol_event = alc262_hippo_unsol_event, .init_hook = alc262_hippo_automute, @@ -1533,7 +1533,7 @@ Signed-off-by: Takashi Iwai [ALC262_ULTRA] = { .mixers = { alc262_ultra_mixer, alc262_ultra_capture_mixer }, .init_verbs = { alc262_ultra_verbs }, -@@ -10076,6 +10659,33 @@ static struct alc_config_preset alc262_p +@@ -10080,6 +10663,33 @@ static struct alc_config_preset alc262_p .channel_mode = alc262_modes, .input_mux = &alc262_capture_source, }, @@ -1567,7 +1567,7 @@ Signed-off-by: Takashi Iwai }; static int patch_alc262(struct hda_codec *codec) -@@ -10134,7 +10744,7 @@ static int patch_alc262(struct hda_codec +@@ -10138,7 +10748,7 @@ static int patch_alc262(struct hda_codec spec->stream_name_analog = "ALC262 Analog"; spec->stream_analog_playback = &alc262_pcm_analog_playback; spec->stream_analog_capture = &alc262_pcm_analog_capture; @@ -1576,7 +1576,7 @@ Signed-off-by: Takashi Iwai spec->stream_name_digital = "ALC262 Digital"; spec->stream_digital_playback = &alc262_pcm_digital_playback; spec->stream_digital_capture = &alc262_pcm_digital_capture; -@@ -10170,7 +10780,7 @@ static int patch_alc262(struct hda_codec +@@ -10174,7 +10784,7 @@ static int patch_alc262(struct hda_codec if (!spec->loopback.amplist) spec->loopback.amplist = alc262_loopbacks; #endif @@ -1585,7 +1585,7 @@ Signed-off-by: Takashi Iwai return 0; } -@@ -10179,7 +10789,7 @@ static int patch_alc262(struct hda_codec +@@ -10183,7 +10793,7 @@ static int patch_alc262(struct hda_codec */ #define ALC268_DIGOUT_NID ALC880_DIGOUT_NID #define alc268_modes alc260_modes @@ -1594,7 +1594,7 @@ Signed-off-by: Takashi Iwai static hda_nid_t alc268_dac_nids[2] = { /* front, hp */ 0x02, 0x03 -@@ -10239,6 +10849,14 @@ static struct hda_verb alc268_toshiba_ve +@@ -10243,6 +10853,14 @@ static struct hda_verb alc268_toshiba_ve { } /* end */ }; @@ -1609,7 +1609,7 @@ Signed-off-by: Takashi Iwai /* Acer specific */ /* bind volumes of both NID 0x02 and 0x03 */ static struct hda_bind_ctls alc268_acer_bind_master_vol = { -@@ -10291,6 +10909,21 @@ static int alc268_acer_master_sw_put(str +@@ -10290,6 +10908,21 @@ static int alc268_acer_master_sw_put(str return change; } @@ -1631,7 +1631,7 @@ Signed-off-by: Takashi Iwai static struct snd_kcontrol_new alc268_acer_mixer[] = { /* output mixer control */ HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol), -@@ -10308,6 +10941,16 @@ static struct snd_kcontrol_new alc268_ac +@@ -10307,6 +10940,16 @@ static struct snd_kcontrol_new alc268_ac { } }; @@ -1648,7 +1648,7 @@ Signed-off-by: Takashi Iwai static struct hda_verb alc268_acer_verbs[] = { {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* internal dmic? */ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, -@@ -10315,7 +10958,6 @@ static struct hda_verb alc268_acer_verbs +@@ -10314,7 +10957,6 @@ static struct hda_verb alc268_acer_verbs {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, @@ -1656,7 +1656,7 @@ Signed-off-by: Takashi Iwai {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, { } }; -@@ -10342,10 +10984,51 @@ static void alc268_acer_init_hook(struct +@@ -10341,10 +10983,51 @@ static void alc268_acer_init_hook(struct alc268_acer_automute(codec, 1); } @@ -1712,7 +1712,7 @@ Signed-off-by: Takashi Iwai HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), -@@ -10490,7 +11173,7 @@ static struct hda_verb alc268_base_init_ +@@ -10489,7 +11172,7 @@ static struct hda_verb alc268_base_init_ {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* Unmute Selector 23h,24h and set the default input to mic-in */ @@ -1721,7 +1721,7 @@ Signed-off-by: Takashi Iwai {0x23, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x24, AC_VERB_SET_CONNECT_SEL, 0x00}, -@@ -10689,7 +11372,7 @@ static int alc268_auto_create_multi_out_ +@@ -10688,7 +11371,7 @@ static int alc268_auto_create_multi_out_ nid = cfg->line_out_pins[0]; if (nid) @@ -1730,7 +1730,7 @@ Signed-off-by: Takashi Iwai nid = cfg->speaker_pins[0]; if (nid == 0x1d) { -@@ -10711,7 +11394,7 @@ static int alc268_auto_create_multi_out_ +@@ -10710,7 +11393,7 @@ static int alc268_auto_create_multi_out_ if (err < 0) return err; } @@ -1739,7 +1739,7 @@ Signed-off-by: Takashi Iwai } /* create playback/capture controls for input pins */ -@@ -10732,7 +11415,7 @@ static int alc268_auto_create_analog_inp +@@ -10731,7 +11414,7 @@ static int alc268_auto_create_analog_inp case 0x1a: idx1 = 2; /* Line In */ break; @@ -1748,7 +1748,7 @@ Signed-off-by: Takashi Iwai idx1 = 3; /* CD */ break; case 0x12: -@@ -10744,7 +11427,7 @@ static int alc268_auto_create_analog_inp +@@ -10743,7 +11426,7 @@ static int alc268_auto_create_analog_inp } imux->items[imux->num_items].label = auto_pin_cfg_labels[i]; imux->items[imux->num_items].index = idx1; @@ -1757,7 +1757,7 @@ Signed-off-by: Takashi Iwai } return 0; } -@@ -10774,11 +11457,11 @@ static void alc268_auto_init_mono_speake +@@ -10773,11 +11456,11 @@ static void alc268_auto_init_mono_speake } dac_vol1 = dac_vol2 = 0xb000 | 0x40; /* set max volume */ @@ -1771,7 +1771,7 @@ Signed-off-by: Takashi Iwai dac_vol2 = AMP_OUT_ZERO; else if (hp_nid == 0x15) dac_vol1 = AMP_OUT_ZERO; -@@ -10859,7 +11542,7 @@ static void alc268_auto_init(struct hda_ +@@ -10858,7 +11541,7 @@ static void alc268_auto_init(struct hda_ alc268_auto_init_mono_speaker_out(codec); alc268_auto_init_analog_input(codec); if (spec->unsol_event) @@ -1780,7 +1780,7 @@ Signed-off-by: Takashi Iwai } /* -@@ -10870,6 +11553,7 @@ static const char *alc268_models[ALC268_ +@@ -10869,6 +11552,7 @@ static const char *alc268_models[ALC268_ [ALC268_3ST] = "3stack", [ALC268_TOSHIBA] = "toshiba", [ALC268_ACER] = "acer", @@ -1788,7 +1788,7 @@ Signed-off-by: Takashi Iwai [ALC268_DELL] = "dell", [ALC268_ZEPTO] = "zepto", #ifdef CONFIG_SND_DEBUG -@@ -10884,6 +11568,8 @@ static struct snd_pci_quirk alc268_cfg_t +@@ -10883,6 +11567,8 @@ static struct snd_pci_quirk alc268_cfg_t SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER), SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER), SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER), @@ -1797,7 +1797,7 @@ Signed-off-by: Takashi Iwai SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), -@@ -10962,6 +11648,23 @@ static struct alc_config_preset alc268_p +@@ -10961,6 +11647,23 @@ static struct alc_config_preset alc268_p .unsol_event = alc268_acer_unsol_event, .init_hook = alc268_acer_init_hook, }, @@ -1821,7 +1821,7 @@ Signed-off-by: Takashi Iwai [ALC268_DELL] = { .mixers = { alc268_dell_mixer, alc268_beep_mixer }, .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, -@@ -11106,7 +11809,7 @@ static int patch_alc268(struct hda_codec +@@ -11105,7 +11808,7 @@ static int patch_alc268(struct hda_codec codec->patch_ops = alc_patch_ops; if (board_config == ALC268_AUTO) spec->init_hook = alc268_auto_init; @@ -1830,7 +1830,7 @@ Signed-off-by: Takashi Iwai return 0; } -@@ -11156,6 +11859,8 @@ static struct snd_kcontrol_new alc269_ba +@@ -11155,6 +11858,8 @@ static struct snd_kcontrol_new alc269_ba HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), @@ -1839,7 +1839,7 @@ Signed-off-by: Takashi Iwai HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), -@@ -11165,6 +11870,28 @@ static struct snd_kcontrol_new alc269_ba +@@ -11164,6 +11869,28 @@ static struct snd_kcontrol_new alc269_ba { } /* end */ }; @@ -1868,7 +1868,7 @@ Signed-off-by: Takashi Iwai /* bind volumes of both NID 0x0c and 0x0d */ static struct hda_bind_ctls alc269_epc_bind_vol = { .ops = &snd_hda_bind_vol, -@@ -11208,75 +11935,72 @@ static struct snd_kcontrol_new alc269_ep +@@ -11207,75 +11934,72 @@ static struct snd_kcontrol_new alc269_ep { } /* end */ }; @@ -2002,7 +2002,7 @@ Signed-off-by: Takashi Iwai static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, -@@ -11303,42 +12027,42 @@ static struct hda_verb alc269_eeepc_amic +@@ -11302,42 +12026,42 @@ static struct hda_verb alc269_eeepc_amic static void alc269_speaker_automute(struct hda_codec *codec) { unsigned int present; @@ -2058,7 +2058,7 @@ Signed-off-by: Takashi Iwai { if ((res >> 26) == ALC880_HP_EVENT) alc269_speaker_automute(codec); -@@ -11355,7 +12079,7 @@ static void alc269_eeepc_dmic_inithook(s +@@ -11354,7 +12078,7 @@ static void alc269_eeepc_dmic_inithook(s /* unsolicited event for HP jack sensing */ static void alc269_eeepc_amic_unsol_event(struct hda_codec *codec, @@ -2067,7 +2067,7 @@ Signed-off-by: Takashi Iwai { if ((res >> 26) == ALC880_HP_EVENT) alc269_speaker_automute(codec); -@@ -11370,6 +12094,76 @@ static void alc269_eeepc_amic_inithook(s +@@ -11369,6 +12093,76 @@ static void alc269_eeepc_amic_inithook(s alc269_eeepc_amic_automute(codec); } @@ -2144,7 +2144,7 @@ Signed-off-by: Takashi Iwai /* add playback controls from the parsed DAC table */ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, const struct auto_pin_cfg *cfg) -@@ -11470,7 +12264,7 @@ static int alc269_auto_create_multi_out_ +@@ -11469,7 +12263,7 @@ static int alc269_auto_create_multi_out_ static int alc269_parse_auto_config(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; @@ -2153,7 +2153,7 @@ Signed-off-by: Takashi Iwai static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, -@@ -11493,6 +12287,13 @@ static int alc269_parse_auto_config(stru +@@ -11492,6 +12286,13 @@ static int alc269_parse_auto_config(stru if (spec->kctl_alloc) spec->mixers[spec->num_mixers++] = spec->kctl_alloc; @@ -2167,7 +2167,7 @@ Signed-off-by: Takashi Iwai spec->init_verbs[spec->num_init_verbs++] = alc269_init_verbs; spec->num_mux_defs = 1; spec->input_mux = &spec->private_imux; -@@ -11525,21 +12326,27 @@ static void alc269_auto_init(struct hda_ +@@ -11524,21 +12325,27 @@ static void alc269_auto_init(struct hda_ alc269_auto_init_hp_out(codec); alc269_auto_init_analog_input(codec); if (spec->unsol_event) @@ -2197,7 +2197,7 @@ Signed-off-by: Takashi Iwai {} }; -@@ -11554,17 +12361,29 @@ static struct alc_config_preset alc269_p +@@ -11553,17 +12360,29 @@ static struct alc_config_preset alc269_p .channel_mode = alc269_modes, .input_mux = &alc269_capture_source, }, @@ -2233,7 +2233,7 @@ Signed-off-by: Takashi Iwai .init_hook = alc269_eeepc_amic_inithook, }, [ALC269_ASUS_EEEPC_P901] = { -@@ -11835,7 +12654,7 @@ static struct snd_kcontrol_new alc861_to +@@ -11834,7 +12653,7 @@ static struct snd_kcontrol_new alc861_to HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT), @@ -2242,7 +2242,7 @@ Signed-off-by: Takashi Iwai /*Capture mixer control */ HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), -@@ -11978,20 +12797,20 @@ static struct hda_verb alc861_base_init_ +@@ -11977,20 +12796,20 @@ static struct hda_verb alc861_base_init_ /* route front mic to ADC1*/ {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, @@ -2266,7 +2266,7 @@ Signed-off-by: Takashi Iwai /* Unmute Stereo Mixer 15 */ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, -@@ -12047,13 +12866,13 @@ static struct hda_verb alc861_threestack +@@ -12046,13 +12865,13 @@ static struct hda_verb alc861_threestack {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, @@ -2282,7 +2282,7 @@ Signed-off-by: Takashi Iwai /* Unmute Stereo Mixer 15 */ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, -@@ -12109,13 +12928,13 @@ static struct hda_verb alc861_uniwill_m3 +@@ -12108,13 +12927,13 @@ static struct hda_verb alc861_uniwill_m3 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, @@ -2298,7 +2298,7 @@ Signed-off-by: Takashi Iwai /* Unmute Stereo Mixer 15 */ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, -@@ -12180,7 +12999,7 @@ static struct hda_verb alc861_asus_init_ +@@ -12179,7 +12998,7 @@ static struct hda_verb alc861_asus_init_ {0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, {0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, @@ -2307,7 +2307,7 @@ Signed-off-by: Takashi Iwai /* Unmute Stereo Mixer 15 */ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, -@@ -12217,20 +13036,20 @@ static struct hda_verb alc861_auto_init_ +@@ -12216,20 +13035,20 @@ static struct hda_verb alc861_auto_init_ */ /* {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, */ {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, @@ -2331,7 +2331,7 @@ Signed-off-by: Takashi Iwai /* Unmute Stereo Mixer 15 */ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, -@@ -12589,7 +13408,7 @@ static void alc861_auto_init(struct hda_ +@@ -12588,7 +13407,7 @@ static void alc861_auto_init(struct hda_ alc861_auto_init_hp_out(codec); alc861_auto_init_analog_input(codec); if (spec->unsol_event) @@ -2340,7 +2340,7 @@ Signed-off-by: Takashi Iwai } #ifdef CONFIG_SND_HDA_POWER_SAVE -@@ -12806,7 +13625,7 @@ static int patch_alc861(struct hda_codec +@@ -12805,7 +13624,7 @@ static int patch_alc861(struct hda_codec if (!spec->loopback.amplist) spec->loopback.amplist = alc861_loopbacks; #endif @@ -2349,7 +2349,7 @@ Signed-off-by: Takashi Iwai return 0; } -@@ -13060,7 +13879,7 @@ static struct snd_kcontrol_new alc861vd_ +@@ -13059,7 +13878,7 @@ static struct snd_kcontrol_new alc861vd_ HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), @@ -2358,7 +2358,7 @@ Signed-off-by: Takashi Iwai { } /* end */ }; -@@ -13205,7 +14024,7 @@ static struct hda_verb alc861vd_lenovo_u +@@ -13204,7 +14023,7 @@ static struct hda_verb alc861vd_lenovo_u {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, @@ -2367,7 +2367,7 @@ Signed-off-by: Takashi Iwai {} }; -@@ -13267,7 +14086,7 @@ static struct hda_verb alc861vd_dallas_v +@@ -13266,7 +14085,7 @@ static struct hda_verb alc861vd_dallas_v {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, @@ -2376,7 +2376,7 @@ Signed-off-by: Takashi Iwai {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, -@@ -13292,7 +14111,7 @@ static struct hda_verb alc861vd_dallas_v +@@ -13291,7 +14110,7 @@ static struct hda_verb alc861vd_dallas_v {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, @@ -2385,7 +2385,7 @@ Signed-off-by: Takashi Iwai {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, { } /* end */ -@@ -13451,7 +14270,7 @@ static struct alc_config_preset alc861vd +@@ -13450,7 +14269,7 @@ static struct alc_config_preset alc861vd .input_mux = &alc861vd_hp_capture_source, .unsol_event = alc861vd_dallas_unsol_event, .init_hook = alc861vd_dallas_automute, @@ -2394,7 +2394,7 @@ Signed-off-by: Takashi Iwai }; /* -@@ -13702,7 +14521,7 @@ static void alc861vd_auto_init(struct hd +@@ -13701,7 +14520,7 @@ static void alc861vd_auto_init(struct hd alc861vd_auto_init_analog_input(codec); alc861vd_auto_init_input_src(codec); if (spec->unsol_event) @@ -2403,7 +2403,7 @@ Signed-off-by: Takashi Iwai } static int patch_alc861vd(struct hda_codec *codec) -@@ -14031,13 +14850,120 @@ static struct snd_kcontrol_new alc662_ee +@@ -14030,13 +14849,120 @@ static struct snd_kcontrol_new alc662_ee { } /* end */ }; @@ -2525,7 +2525,7 @@ Signed-off-by: Takashi Iwai { } /* end */ }; -@@ -14222,14 +15148,81 @@ static struct hda_verb alc663_auto_init_ +@@ -14221,14 +15147,81 @@ static struct hda_verb alc663_auto_init_ }; static struct hda_verb alc663_m51va_init_verbs[] = { @@ -2609,7 +2609,7 @@ Signed-off-by: Takashi Iwai {} }; -@@ -14258,6 +15251,14 @@ static struct hda_verb alc663_g50v_init_ +@@ -14257,6 +15250,14 @@ static struct hda_verb alc663_g50v_init_ {} }; @@ -2624,7 +2624,7 @@ Signed-off-by: Takashi Iwai /* capture mixer elements */ static struct snd_kcontrol_new alc662_capture_mixer[] = { HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), -@@ -14277,6 +15278,12 @@ static struct snd_kcontrol_new alc662_ca +@@ -14276,6 +15277,12 @@ static struct snd_kcontrol_new alc662_ca { } /* end */ }; @@ -2637,7 +2637,7 @@ Signed-off-by: Takashi Iwai static void alc662_lenovo_101e_ispeaker_automute(struct hda_codec *codec) { unsigned int present; -@@ -14357,12 +15364,12 @@ static void alc662_eeepc_ep20_automute(s +@@ -14356,12 +15363,12 @@ static void alc662_eeepc_ep20_automute(s if (present) { /* mute internal speaker */ snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, @@ -2652,7 +2652,7 @@ Signed-off-by: Takashi Iwai } } -@@ -14385,11 +15392,108 @@ static void alc663_m51va_speaker_automut +@@ -14384,11 +15391,108 @@ static void alc663_m51va_speaker_automut unsigned char bits; present = snd_hda_codec_read(codec, 0x21, 0, @@ -2765,7 +2765,7 @@ Signed-off-by: Takashi Iwai } static void alc663_m51va_mic_automute(struct hda_codec *codec) -@@ -14397,16 +15501,16 @@ static void alc663_m51va_mic_automute(st +@@ -14396,16 +15500,16 @@ static void alc663_m51va_mic_automute(st unsigned int present; present = snd_hda_codec_read(codec, 0x18, 0, @@ -2788,7 +2788,7 @@ Signed-off-by: Takashi Iwai } static void alc663_m51va_unsol_event(struct hda_codec *codec, -@@ -14428,6 +15532,121 @@ static void alc663_m51va_inithook(struct +@@ -14427,6 +15531,121 @@ static void alc663_m51va_inithook(struct alc663_m51va_mic_automute(codec); } @@ -2910,7 +2910,7 @@ Signed-off-by: Takashi Iwai static void alc663_g71v_hp_automute(struct hda_codec *codec) { unsigned int present; -@@ -14498,6 +15717,46 @@ static void alc663_g50v_inithook(struct +@@ -14497,6 +15716,46 @@ static void alc663_g50v_inithook(struct alc662_eeepc_mic_automute(codec); } @@ -2957,7 +2957,7 @@ Signed-off-by: Takashi Iwai #ifdef CONFIG_SND_HDA_POWER_SAVE #define alc662_loopbacks alc880_loopbacks #endif -@@ -14520,21 +15779,68 @@ static const char *alc662_models[ALC662_ +@@ -14519,21 +15778,68 @@ static const char *alc662_models[ALC662_ [ALC662_LENOVO_101E] = "lenovo-101e", [ALC662_ASUS_EEEPC_P701] = "eeepc-p701", [ALC662_ASUS_EEEPC_EP20] = "eeepc-ep20", @@ -3028,7 +3028,7 @@ Signed-off-by: Takashi Iwai SND_PCI_QUIRK(0x1854, 0x2000, "ASUS H13-2000", ALC663_ASUS_H13), SND_PCI_QUIRK(0x1854, 0x2001, "ASUS H13-2001", ALC663_ASUS_H13), SND_PCI_QUIRK(0x1854, 0x2002, "ASUS H13-2002", ALC663_ASUS_H13), -@@ -14625,6 +15931,18 @@ static struct alc_config_preset alc662_p +@@ -14624,6 +15930,18 @@ static struct alc_config_preset alc662_p .unsol_event = alc662_eeepc_ep20_unsol_event, .init_hook = alc662_eeepc_ep20_inithook, }, @@ -3047,7 +3047,7 @@ Signed-off-by: Takashi Iwai [ALC663_ASUS_M51VA] = { .mixers = { alc663_m51va_mixer, alc662_capture_mixer}, .init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs }, -@@ -14672,6 +15990,91 @@ static struct alc_config_preset alc662_p +@@ -14671,6 +15989,91 @@ static struct alc_config_preset alc662_p .unsol_event = alc663_g50v_unsol_event, .init_hook = alc663_g50v_inithook, }, @@ -3139,7 +3139,7 @@ Signed-off-by: Takashi Iwai }; -@@ -14708,15 +16111,15 @@ static int alc662_auto_create_multi_out_ +@@ -14707,15 +16110,15 @@ static int alc662_auto_create_multi_out_ HDA_OUTPUT)); if (err < 0) return err; @@ -3159,7 +3159,7 @@ Signed-off-by: Takashi Iwai HDA_INPUT)); if (err < 0) return err; -@@ -14728,9 +16131,9 @@ static int alc662_auto_create_multi_out_ +@@ -14727,9 +16130,9 @@ static int alc662_auto_create_multi_out_ if (err < 0) return err; sprintf(name, "%s Playback Switch", chname[i]); @@ -3172,7 +3172,7 @@ Signed-off-by: Takashi Iwai if (err < 0) return err; } -@@ -14925,7 +16328,7 @@ static int alc662_parse_auto_config(stru +@@ -14924,7 +16327,7 @@ static int alc662_parse_auto_config(stru spec->num_mux_defs = 1; spec->input_mux = &spec->private_imux; @@ -3181,7 +3181,7 @@ Signed-off-by: Takashi Iwai spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; if (codec->vendor_id == 0x10ec0663) spec->init_verbs[spec->num_init_verbs++] = -@@ -14951,7 +16354,7 @@ static void alc662_auto_init(struct hda_ +@@ -14950,7 +16353,7 @@ static void alc662_auto_init(struct hda_ alc662_auto_init_analog_input(codec); alc662_auto_init_input_src(codec); if (spec->unsol_event) @@ -3190,7 +3190,7 @@ Signed-off-by: Takashi Iwai } static int patch_alc662(struct hda_codec *codec) -@@ -15057,6 +16460,8 @@ struct hda_codec_preset snd_hda_preset_r +@@ -15056,6 +16459,8 @@ struct hda_codec_preset snd_hda_preset_r { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 }, { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-seek-for-codec-id b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-seek-for-codec-id similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-seek-for-codec-id rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-seek-for-codec-id diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-add-missing-terminators b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-add-missing-terminators similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-add-missing-terminators rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-add-missing-terminators diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-hp-m4-check-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-hp-m4-check-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-hp-m4-check-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-hp-m4-check-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-spdif-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-spdif-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-spdif-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-spdif-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-vref-event-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-vref-event-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sigmatel-vref-event-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sigmatel-vref-event-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk similarity index 93% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk index 9fb330cc5..f87cbeef0 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-sony-vaio-vgn-sr19xn-quirk @@ -15,7 +15,7 @@ Signed-off-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -10473,6 +10473,8 @@ static struct snd_pci_quirk alc262_cfg_t +@@ -10477,6 +10477,8 @@ static struct snd_pci_quirk alc262_cfg_t SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-spdif-bits-cache-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-spdif-bits-cache-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-spdif-bits-cache-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-spdif-bits-cache-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-spdif-slave b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-spdif-slave similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-spdif-slave rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-spdif-slave diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-92hd71bxx-gpio-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-92hd71bxx-gpio-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-92hd71bxx-gpio-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-92hd71bxx-gpio-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-dell-m4-3-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-dell-m4-3-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-dell-m4-3-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-dell-m4-3-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-gpio-unsol-resume-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-gpio-unsol-resume-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-gpio-unsol-resume-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-gpio-unsol-resume-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-detect-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-detect-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-detect-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-detect-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-gpio-switch-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-gpio-switch-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-gpio-switch-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-gpio-switch-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-pavilion-quirks b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-pavilion-quirks similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-hp-pavilion-quirks rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-hp-pavilion-quirks diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-reduce-volume-scale b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-reduce-volume-scale similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-reduce-volume-scale rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-reduce-volume-scale diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-yet-more-fixes b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-yet-more-fixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac-yet-more-fixes rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac-yet-more-fixes diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac9200-missing-mux-capture b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac9200-missing-mux-capture similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac9200-missing-mux-capture rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac9200-missing-mux-capture diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac925x-init-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac925x-init-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac925x-init-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac925x-init-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac92xx-mic-pin-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac92xx-mic-pin-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-stac92xx-mic-pin-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-stac92xx-mic-pin-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-via-rec-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-via-rec-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-via-rec-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-via-rec-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-via-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-via-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-via-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-hda-via-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-ad1884a-mobile-init-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-ad1884a-mobile-init-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-ad1884a-mobile-init-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-ad1884a-mobile-init-fix diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc268-mono-output-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc268-mono-output-fix new file mode 100644 index 000000000..fa5e59f06 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc268-mono-output-fix @@ -0,0 +1,121 @@ +From 3f3b7c1aed70fa25c6811f830c5fb1a7054681ae Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 17 Jul 2009 14:36:59 +0200 +Subject: ALSA: hda - Fix ALC268 parser for mono speaker +Patch-mainline: +References: bnc#467846 + +- Parse the mono output pin 0x16 correctly even as the primary output +- Create "Speaker" volume control if the primary output is a speaker +- Fix the wrong direction of (optional) "Mono" switch + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_realtek.c | 62 +++++++++++++++++++++++++++++------------- + 1 file changed, 43 insertions(+), 19 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -11421,26 +11421,38 @@ static int alc268_new_analog_output(stru + const char *ctlname, int idx) + { + char name[32]; ++ hda_nid_t dac; + int err; + + sprintf(name, "%s Playback Volume", ctlname); +- if (nid == 0x14) { +- err = add_control(spec, ALC_CTL_WIDGET_VOL, name, +- HDA_COMPOSE_AMP_VAL(0x02, 3, idx, +- HDA_OUTPUT)); +- if (err < 0) +- return err; +- } else if (nid == 0x15) { ++ switch (nid) { ++ case 0x14: ++ case 0x16: ++ dac = 0x02; ++ break; ++ case 0x15: ++ dac = 0x03; ++ break; ++ default: ++ return 0; ++ } ++ if (spec->multiout.dac_nids[0] != dac && ++ spec->multiout.dac_nids[1] != dac) { + err = add_control(spec, ALC_CTL_WIDGET_VOL, name, +- HDA_COMPOSE_AMP_VAL(0x03, 3, idx, ++ HDA_COMPOSE_AMP_VAL(dac, 3, idx, + HDA_OUTPUT)); + if (err < 0) + return err; +- } else +- return -1; ++ spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac; ++ } ++ + sprintf(name, "%s Playback Switch", ctlname); +- err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, ++ if (nid != 0x16) ++ err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, + HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_OUTPUT)); ++ else /* mono */ ++ err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, ++ HDA_COMPOSE_AMP_VAL(nid, 2, idx, HDA_OUTPUT)); + if (err < 0) + return err; + return 0; +@@ -11453,14 +11465,19 @@ static int alc268_auto_create_multi_out_ + hda_nid_t nid; + int err; + +- spec->multiout.num_dacs = 2; /* only use one dac */ + spec->multiout.dac_nids = spec->private_dac_nids; +- spec->multiout.dac_nids[0] = 2; +- spec->multiout.dac_nids[1] = 3; + + nid = cfg->line_out_pins[0]; +- if (nid) +- alc268_new_analog_output(spec, nid, "Front", 0); ++ if (nid) { ++ const char *name; ++ if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) ++ name = "Speaker"; ++ else ++ name = "Front"; ++ err = alc268_new_analog_output(spec, nid, name, 0); ++ if (err < 0) ++ return err; ++ } + + nid = cfg->speaker_pins[0]; + if (nid == 0x1d) { +@@ -11469,16 +11486,23 @@ static int alc268_auto_create_multi_out_ + HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); + if (err < 0) + return err; ++ } else { ++ err = alc268_new_analog_output(spec, nid, "Speaker", 0); ++ if (err < 0) ++ return err; + } + nid = cfg->hp_pins[0]; +- if (nid) +- alc268_new_analog_output(spec, nid, "Headphone", 0); ++ if (nid) { ++ err = alc268_new_analog_output(spec, nid, "Headphone", 0); ++ if (err < 0) ++ return err; ++ } + + nid = cfg->line_out_pins[1] | cfg->line_out_pins[2]; + if (nid == 0x16) { + err = add_control(spec, ALC_CTL_WIDGET_MUTE, + "Mono Playback Switch", +- HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_INPUT)); ++ HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT)); + if (err < 0) + return err; + } diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc269-fix-vmaster b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc269-fix-vmaster new file mode 100644 index 000000000..ec1063cbc --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc269-fix-vmaster @@ -0,0 +1,31 @@ +From 100d5eb36ba20dc0b99a17ea2b9800c567bfc3d1 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 10 Aug 2009 11:55:51 +0200 +Subject: [PATCH] ALSA: hda - Add missing vmaster initialization for ALC269 +Patch-mainline: +References: bnc#527361 + +Without the initialization of vmaster NID, the dB information got +confused for ALC269 codec. + +Reference: Novell bnc#527361 + https://bugzilla.novell.com/show_bug.cgi?id=527361 + +Signed-off-by: Takashi Iwai +Cc: + +--- + sound/pci/hda/patch_realtek.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -12654,6 +12654,8 @@ + spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); + spec->capsrc_nids = alc269_capsrc_nids; + ++ spec->vmaster_nid = 0x02; ++ + codec->patch_ops = alc_patch_ops; + if (board_config == ALC269_AUTO) + spec->init_hook = alc269_auto_init; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-coef-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-coef-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-coef-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-coef-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-3stack-auto-mute b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-3stack-auto-mute similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-3stack-auto-mute rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-3stack-auto-mute diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-4ch-mode b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-4ch-mode similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-4ch-mode rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-4ch-mode diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-alc888-hp-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-alc888-hp-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix similarity index 89% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix index 860ff5c9f..db099e349 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix @@ -13,7 +13,7 @@ Signed-off-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -11990,7 +11990,6 @@ +@@ -11989,7 +11989,6 @@ static struct snd_kcontrol_new alc269_qu }, HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), @@ -21,7 +21,7 @@ Signed-off-by: Takashi Iwai HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT), -@@ -12519,7 +12518,7 @@ +@@ -12518,7 +12517,7 @@ static struct alc_config_preset alc269_p .input_mux = &alc269_capture_source, }, [ALC269_QUANTA_FL1] = { diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-ati-pos-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-ati-pos-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-ati-pos-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-ati-pos-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-bus-intapi-change b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-bus-intapi-change similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-bus-intapi-change rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-bus-intapi-change diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-limit-verb-retry b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-limit-verb-retry similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-limit-verb-retry rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-limit-verb-retry diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-verb-retry b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-verb-retry similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-codec-verb-retry rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-codec-verb-retry diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-forced-codec-slots b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-forced-codec-slots similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-forced-codec-slots rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-forced-codec-slots diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk2 b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk2 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk2 rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-ad1984a-more-quirk2 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-more-quirks b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-more-quirks similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-more-quirks rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-more-quirks diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-xw-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-xw-quirk similarity index 92% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-xw-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-xw-quirk index ba15ac4a1..dfb57d7a4 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hp-xw-quirk +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hp-xw-quirk @@ -13,7 +13,7 @@ Signed-off-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -10454,6 +10454,7 @@ static struct snd_pci_quirk alc262_cfg_t +@@ -10458,6 +10458,7 @@ static struct snd_pci_quirk alc262_cfg_t SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC), SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC), diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hwptr-stabilize b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hwptr-stabilize similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-hwptr-stabilize rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-hwptr-stabilize diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-idt92hd8x-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-idt92hd8x-fix new file mode 100644 index 000000000..cf3e5d293 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-idt92hd8x-fix @@ -0,0 +1,277 @@ +From 667067d8980249a71ccf82a55202fff2cd1cd54f Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 13 Aug 2009 18:14:42 +0200 +Subject: ALSA: hda - Fix / clean up IDT92HD83xxx codec parser +Patch-mainline: +References: bnc#531533 + +A few improvements for IDT 92HD83xxx codec pareser: +- Remove unused / deprecated mixer-amp controls +- Handle d-mics as normal inputs since this codec has no separate + MUXes for analog and digital +- Don't create duplicated controls for capture volumes with Mux + capture volumes + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_sigmatel.c | 150 +++++++++++++++++++---------------------- + 1 file changed, 70 insertions(+), 80 deletions(-) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -349,14 +349,9 @@ + }; + #define stac92hd73xx_capsws stac92hd73xx_capvols + +-#define STAC92HD83XXX_NUM_DMICS 2 +-static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = { +- 0x11, 0x12, 0 +-}; +- + #define STAC92HD83_DAC_COUNT 3 + +-static hda_nid_t stac92hd83xxx_dmux_nids[2] = { ++static hda_nid_t stac92hd83xxx_mux_nids[2] = { + 0x17, 0x18, + }; + +@@ -376,10 +371,6 @@ + 0x03, 0x0c, 0x20, 0x40, + }; + +-static hda_nid_t stac92hd83xxx_amp_nids[1] = { +- 0xc, +-}; +- + #define STAC92HD83XXX_NUM_CAPS 2 + static unsigned long stac92hd83xxx_capvols[] = { + HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), +@@ -1092,26 +1083,6 @@ + }; + + +-static struct snd_kcontrol_new stac92hd83xxx_mixer[] = { +- HDA_CODEC_VOLUME("DAC0 Capture Volume", 0x1b, 0x3, HDA_INPUT), +- HDA_CODEC_MUTE("DAC0 Capture Switch", 0x1b, 0x3, HDA_INPUT), +- +- HDA_CODEC_VOLUME("DAC1 Capture Volume", 0x1b, 0x4, HDA_INPUT), +- HDA_CODEC_MUTE("DAC1 Capture Switch", 0x1b, 0x4, HDA_INPUT), +- +- HDA_CODEC_VOLUME("Front Mic Capture Volume", 0x1b, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE("Front Mic Capture Switch", 0x1b, 0x0, HDA_INPUT), +- +- HDA_CODEC_VOLUME("Line In Capture Volume", 0x1b, 0x2, HDA_INPUT), +- HDA_CODEC_MUTE("Line In Capture Switch", 0x1b, 0x2, HDA_INPUT), +- +- /* +- HDA_CODEC_VOLUME("Mic Capture Volume", 0x1b, 0x1, HDA_INPUT), +- HDA_CODEC_MUTE("Mic Capture Switch", 0x1b 0x1, HDA_INPUT), +- */ +- { } /* end */ +-}; +- + static struct snd_kcontrol_new stac925x_mixer[] = { + HDA_CODEC_VOLUME("Master Playback Volume", 0x0e, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Master Playback Switch", 0x0e, 0, HDA_OUTPUT), +@@ -3380,19 +3351,33 @@ + static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) + { + struct sigmatel_spec *spec = codec->spec; +- int wcaps, nid, i, err = 0; ++ int i, j, err = 0; + + for (i = 0; i < spec->num_muxes; i++) { ++ hda_nid_t nid; ++ unsigned int wcaps; ++ unsigned long val; ++ + nid = spec->mux_nids[i]; + wcaps = get_wcaps(codec, nid); ++ if (!(wcaps & AC_WCAP_OUT_AMP)) ++ continue; + +- if (wcaps & AC_WCAP_OUT_AMP) { +- err = stac92xx_add_control_idx(spec, +- STAC_CTL_WIDGET_VOL, i, "Mux Capture Volume", +- HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT)); +- if (err < 0) +- return err; ++ /* check whether already the same control was created as ++ * normal Capture Volume. ++ */ ++ val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT); ++ for (j = 0; j < spec->num_caps; j++) { ++ if (spec->capvols[j] == val) ++ break; + } ++ if (j < spec->num_caps) ++ continue; ++ ++ err = stac92xx_add_control_idx(spec, STAC_CTL_WIDGET_VOL, i, ++ "Mux Capture Volume", val); ++ if (err < 0) ++ return err; + } + return 0; + }; +@@ -3447,6 +3432,24 @@ + return -1; + } + ++/* create a volume assigned to the given pin (only if supported) */ ++static int create_elem_capture_vol(struct hda_codec *codec, hda_nid_t nid, ++ const char *label) ++{ ++ unsigned int caps, nums; ++ char name[32]; ++ ++ if (!(get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) ++ return 0; ++ caps = query_amp_caps(codec, nid, HDA_OUTPUT); ++ nums = (caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT; ++ if (!nums) ++ return 0; ++ snprintf(name, sizeof(name), "%s Capture Volume", label); ++ return stac92xx_add_control(codec->spec, STAC_CTL_WIDGET_VOL, name, ++ HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); ++} ++ + /* create playback/capture controls for input pins on dmic capable codecs */ + static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec, + const struct auto_pin_cfg *cfg) +@@ -3456,7 +3459,6 @@ + struct hda_input_mux *dimux = &spec->private_dimux; + int err, i, active_mics; + unsigned int def_conf; +- char name[32]; + + dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0]; + dimux->items[dimux->num_items].index = 0; +@@ -3464,6 +3466,10 @@ + + active_mics = 0; + for (i = 0; i < spec->num_dmics; i++) { ++ /* check the validity: sometimes it's a dead vendor-spec node */ ++ if (get_wcaps_type(get_wcaps(codec, spec->dmic_nids[i])) ++ != AC_WID_PIN) ++ continue; + def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]); + if (get_defcfg_connect(def_conf) != AC_JACK_PORT_NONE) + active_mics++; +@@ -3472,14 +3478,15 @@ + for (i = 0; i < spec->num_dmics; i++) { + hda_nid_t nid; + int index; +- unsigned int wcaps; + const char *label; + +- def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]); ++ nid = spec->dmic_nids[i]; ++ if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) ++ continue; ++ def_conf = snd_hda_codec_get_pincfg(codec, nid); + if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) + continue; + +- nid = spec->dmic_nids[i]; + index = get_connection_index(codec, spec->dmux_nids[0], nid); + if (index < 0) + continue; +@@ -3489,21 +3496,9 @@ + else + label = stac92xx_dmic_labels[dimux->num_items]; + +- wcaps = get_wcaps(codec, nid) & +- (AC_WCAP_OUT_AMP | AC_WCAP_IN_AMP); +- +- if (wcaps) { +- sprintf(name, "%s Capture Volume", label); +- +- err = stac92xx_add_control(spec, +- STAC_CTL_WIDGET_VOL, +- name, +- HDA_COMPOSE_AMP_VAL(nid, 3, 0, +- (wcaps & AC_WCAP_OUT_AMP) ? +- HDA_OUTPUT : HDA_INPUT)); +- if (err < 0) +- return err; +- } ++ err = create_elem_capture_vol(codec, nid, label); ++ if (err < 0) ++ return err; + + dimux->items[dimux->num_items].label = label; + dimux->items[dimux->num_items].index = index; +@@ -3604,29 +3599,29 @@ + { + struct sigmatel_spec *spec = codec->spec; + struct hda_input_mux *imux = &spec->private_imux; +- hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; +- int i, j, k; ++ int i, j; + + for (i = 0; i < AUTO_PIN_LAST; i++) { +- int index; ++ hda_nid_t nid = cfg->input_pins[i]; ++ int index, err; + +- if (!cfg->input_pins[i]) ++ if (!nid) + continue; + index = -1; + for (j = 0; j < spec->num_muxes; j++) { +- int num_cons; +- num_cons = snd_hda_get_connections(codec, +- spec->mux_nids[j], +- con_lst, +- HDA_MAX_NUM_INPUTS); +- for (k = 0; k < num_cons; k++) +- if (con_lst[k] == cfg->input_pins[i]) { +- index = k; +- goto found; +- } ++ index = get_connection_index(codec, spec->mux_nids[j], ++ nid); ++ if (index >= 0) ++ break; + } +- continue; +- found: ++ if (index < 0) ++ continue; ++ ++ err = create_elem_capture_vol(codec, nid, ++ auto_pin_cfg_labels[i]); ++ if (err < 0) ++ return err; ++ + imux->items[imux->num_items].label = auto_pin_cfg_labels[i]; + imux->items[imux->num_items].index = index; + imux->num_items++; +@@ -4998,22 +4993,17 @@ + codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; + spec->mono_nid = 0x19; + spec->digbeep_nid = 0x21; +- spec->dmic_nids = stac92hd83xxx_dmic_nids; +- spec->dmux_nids = stac92hd83xxx_dmux_nids; ++ spec->mux_nids = stac92hd83xxx_mux_nids; ++ spec->num_muxes = ARRAY_SIZE(stac92hd83xxx_mux_nids); + spec->adc_nids = stac92hd83xxx_adc_nids; ++ spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); + spec->pwr_nids = stac92hd83xxx_pwr_nids; +- spec->amp_nids = stac92hd83xxx_amp_nids; + spec->pwr_mapping = stac92hd83xxx_pwr_mapping; + spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); + spec->multiout.dac_nids = spec->dac_nids; + + spec->init = stac92hd83xxx_core_init; +- spec->mixer = stac92hd83xxx_mixer; + spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); +- spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); +- spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); +- spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids); +- spec->num_dmics = STAC92HD83XXX_NUM_DMICS; + spec->pin_nids = stac92hd83xxx_pin_nids; + spec->num_caps = STAC92HD83XXX_NUM_CAPS; + spec->capvols = stac92hd83xxx_capvols; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-intel-cleanup b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-intel-cleanup similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-intel-cleanup rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-intel-cleanup diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-intelhdmi b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-intelhdmi similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-intelhdmi rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-intelhdmi diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-internal-binary-compat b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-internal-binary-compat similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-internal-binary-compat rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-internal-binary-compat diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-own-workq b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-own-workq similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-own-workq rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-own-workq diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk similarity index 95% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk index 7c4d13781..bc7e82045 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-pb-rs65-quirk @@ -18,7 +18,7 @@ Signed-off-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -16011,12 +16011,13 @@ +@@ -16010,12 +16010,13 @@ static struct snd_pci_quirk alc662_cfg_t SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6), SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", ALC662_3ST_6ch_DIG), diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-quirk-ext b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-quirk-ext new file mode 100644 index 000000000..766c195d4 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-quirk-ext @@ -0,0 +1,97 @@ +From: Takashi Iwai +Subject: ALSA: Backport snd_pci_quirk*() extension +Patch-mainline: +References: bnc#511306 + +Backport the extension of snd_pci_quirk*() helper for updating the +HD-audio stuff. To avoid the conflict, all renamed and localized into +snd-hda-intel driver. + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/hda_codec.c | 15 +++++++++++++ + sound/pci/hda/hda_codec.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 66 insertions(+) + +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -3432,3 +3432,18 @@ + buf[j] = '\0'; /* necessary when j == 0 */ + } + ++/* backported */ ++const struct snd_pci_quirk * ++snd_hda_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list) ++{ ++ const struct snd_pci_quirk *q; ++ ++ for (q = list; q->subvendor; q++) { ++ if (q->subvendor != pci->subsystem_vendor) ++ continue; ++ if (!q->subdevice || ++ (pci->subsystem_device & q->subdevice_mask) == q->subdevice) ++ return q; ++ } ++ return NULL; ++} +--- a/sound/pci/hda/hda_codec.h ++++ b/sound/pci/hda/hda_codec.h +@@ -26,6 +26,57 @@ + #include + #include + ++ ++/* ++ * quirk with mask; backported ++ */ ++ ++/* PCI quirk list helper */ ++struct snd_hda_quirk { ++ unsigned short subvendor; /* PCI subvendor ID */ ++ unsigned short subdevice; /* PCI subdevice ID */ ++ unsigned short subdevice_mask; /* bitmask to match */ ++ int value; /* value */ ++#ifdef CONFIG_SND_DEBUG_VERBOSE ++ const char *name; /* name of the device (optional) */ ++#endif ++}; ++ ++#define snd_pci_quirk snd_hda_quirk ++#undef _SND_PCI_QUIRK_ID_MASK ++#undef _SND_PCI_QUIRK_ID ++#undef SND_PCI_QUIRK_ID ++#undef SND_PCI_QUIRK ++#undef SND_PCI_QUIRK_MASK ++#undef SND_PCI_QUIRK_VENDOR ++ ++#define _SND_PCI_QUIRK_ID_MASK(vend, mask, dev) \ ++ .subvendor = (vend), .subdevice = (dev), .subdevice_mask = (mask) ++#define _SND_PCI_QUIRK_ID(vend, dev) \ ++ _SND_PCI_QUIRK_ID_MASK(vend, 0xffff, dev) ++#define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)} ++#ifdef CONFIG_SND_DEBUG_VERBOSE ++#define SND_PCI_QUIRK(vend,dev,xname,val) \ ++ {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)} ++#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \ ++ {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val), .name = (xname)} ++#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \ ++ {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \ ++ .value = (val), .name = (xname)} ++#else ++#define SND_PCI_QUIRK(vend,dev,xname,val) \ ++ {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)} ++#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \ ++ {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)} ++#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \ ++ {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)} ++#endif ++ ++const struct snd_pci_quirk * ++snd_hda_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list); ++ ++#define snd_pci_quirk_lookup snd_hda_quirk_lookup ++ + #if defined(CONFIG_PM) || defined(CONFIG_SND_HDA_POWER_SAVE) + #define SND_HDA_NEEDS_RESUME /* resume control code is required */ + #endif diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-reduce-click-noise b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-reduce-click-noise new file mode 100644 index 000000000..05dad966b --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-reduce-click-noise @@ -0,0 +1,61 @@ +From 05ff7e11b78f18ff6819d2c260b7bcc7da0c8f46 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Subject: [PATCH] ALSA: hda - Reduce click noise at power-saving +Patch-mainline: +References: bnc#521190 + +Add some tricks to reduce the click noise at powering down to D3 +in the power saving mode on STAC/IDT codecs. +The key seems to be to reset PINs before the power-down, and some +delay before entering D3. The needed delay is significantly long, +but I don't know why. + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/hda_codec.c | 9 +++++++-- + sound/pci/hda/patch_sigmatel.c | 14 ++++++++++++++ + 2 files changed, 21 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -1979,9 +1979,14 @@ static void hda_set_power_state(struct h + hda_nid_t nid; + int i; + +- snd_hda_codec_write(codec, fg, 0, AC_VERB_SET_POWER_STATE, ++ /* this delay seems necessary to avoid click noise at power-down */ ++ if (power_state == AC_PWRST_D3) ++ msleep(100); ++ snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, + power_state); +- msleep(10); /* partial workaround for "azx_get_response timeout" */ ++ /* partial workaround for "azx_get_response timeout" */ ++ if (power_state == AC_PWRST_D0) ++ msleep(10); + + nid = codec->start_nid; + for (i = 0; i < codec->num_nodes; i++, nid++) { +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -4268,6 +4268,20 @@ static int stac92xx_resume(struct hda_co + static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) + { + struct sigmatel_spec *spec = codec->spec; ++ int i; ++ hda_nid_t nid; ++ ++ /* reset each pin before powering down DAC/ADC to avoid click noise */ ++ nid = codec->start_nid; ++ for (i = 0; i < codec->num_nodes; i++, nid++) { ++ unsigned int wcaps = get_wcaps(codec, nid); ++ unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >> ++ AC_WCAP_TYPE_SHIFT; ++ if (wid_type == AC_WID_PIN) ++ snd_hda_codec_read(codec, nid, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, 0); ++ } ++ + if (spec->eapd_mask) + stac_gpio_set(codec, spec->gpio_mask, + spec->gpio_dir, spec->gpio_data & diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-robust-codec-probe b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-robust-codec-probe similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-robust-codec-probe rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-robust-codec-probe diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update2 b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update2 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update2 rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update2 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update3 b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update3 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sigmatel-update3 rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sigmatel-update3 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-single-cmd-concurrent-access b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-single-cmd-concurrent-access similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-single-cmd-concurrent-access rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-single-cmd-concurrent-access diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-single-cmd-sync-write b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-single-cmd-sync-write similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-single-cmd-sync-write rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-single-cmd-sync-write diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-snd-array b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-snd-array new file mode 100644 index 000000000..53615e607 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-snd-array @@ -0,0 +1,100 @@ +From: Takashi Iwai +Subject: ALSA: Backport snd_array_*() for HD-audio driver +Patch-mainline: +References: bnc#511306 + +Backport snd_array_*() from the recent kernel to update the +HD-audio driver code. + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/hda_codec.c | 37 +++++++++++++++++++++++++++++++++++++ + sound/pci/hda/hda_codec.h | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 67 insertions(+) + +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -3366,6 +3366,43 @@ + #endif + + /* ++ * generic arrays ++ */ ++ ++/* get a new element from the given array ++ * if it exceeds the pre-allocated array size, re-allocate the array ++ */ ++void *snd_array_new(struct snd_array *array) ++{ ++ if (array->used >= array->alloced) { ++ int num = array->alloced + array->alloc_align; ++ void *nlist; ++ if (num >= 4096) ++ return NULL; ++ nlist = kcalloc(num + 1, array->elem_size, GFP_KERNEL); ++ if (!nlist) ++ return NULL; ++ if (array->list) { ++ memcpy(nlist, array->list, ++ array->elem_size * array->alloced); ++ kfree(array->list); ++ } ++ array->list = nlist; ++ array->alloced = num; ++ } ++ return snd_array_elem(array, array->used++); ++} ++ ++/* free the given array elements */ ++void snd_array_free(struct snd_array *array) ++{ ++ kfree(array->list); ++ array->used = 0; ++ array->alloced = 0; ++ array->list = NULL; ++} ++ ++/* + * used by hda_proc.c and hda_eld.c + */ + void snd_print_pcm_rates(int pcm, char *buf, int buflen) +--- a/sound/pci/hda/hda_codec.h ++++ b/sound/pci/hda/hda_codec.h +@@ -520,6 +520,36 @@ + #define HDA_MAX_CODEC_ADDRESS 0x0f + + /* ++ * generic arrays ++ */ ++struct snd_array { ++ unsigned int used; ++ unsigned int alloced; ++ unsigned int elem_size; ++ unsigned int alloc_align; ++ void *list; ++}; ++ ++void *snd_array_new(struct snd_array *array); ++void snd_array_free(struct snd_array *array); ++static inline void snd_array_init(struct snd_array *array, unsigned int size, ++ unsigned int align) ++{ ++ array->elem_size = size; ++ array->alloc_align = align; ++} ++ ++static inline void *snd_array_elem(struct snd_array *array, unsigned int idx) ++{ ++ return array->list + idx * array->elem_size; ++} ++ ++static inline unsigned int snd_array_index(struct snd_array *array, void *ptr) ++{ ++ return (unsigned long)(ptr - array->list) / array->elem_size; ++} ++ ++/* + * Structures + */ + diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-automic b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-automic new file mode 100644 index 000000000..a2cd15c5e --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-automic @@ -0,0 +1,3117 @@ +From: Takashi Iwai +Subject: ALSA: Update STAC/IDT codec support (auto-mic, etc) +Patch-mainline: +References: bnc#511306, bnc#520975 + +Backport the latest STAC/IDT codec driver to support the automatic +mic selection and the proper fix for docking station, etc for HP +and Dell laptops/desktops. + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_sigmatel.c | 1791 +++++++++++++++++++++++++---------------- + 1 file changed, 1135 insertions(+), 656 deletions(-) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -35,14 +35,17 @@ + #include "hda_patch.h" + #include "hda_beep.h" + +-#define NUM_CONTROL_ALLOC 32 +- +-#define STAC_VREF_EVENT 0x00 +-#define STAC_INSERT_EVENT 0x10 +-#define STAC_PWR_EVENT 0x20 +-#define STAC_HP_EVENT 0x30 ++enum { ++ STAC_VREF_EVENT = 1, ++ STAC_INSERT_EVENT, ++ STAC_PWR_EVENT, ++ STAC_HP_EVENT, ++ STAC_LO_EVENT, ++ STAC_MIC_EVENT, ++}; + + enum { ++ STAC_AUTO, + STAC_REF, + STAC_9200_OQO, + STAC_9200_DELL_D21, +@@ -62,6 +65,7 @@ + }; + + enum { ++ STAC_9205_AUTO, + STAC_9205_REF, + STAC_9205_DELL_M42, + STAC_9205_DELL_M43, +@@ -71,6 +75,7 @@ + }; + + enum { ++ STAC_92HD73XX_AUTO, + STAC_92HD73XX_NO_JD, /* no jack-detection */ + STAC_92HD73XX_REF, + STAC_DELL_M6_AMIC, +@@ -81,22 +86,28 @@ + }; + + enum { ++ STAC_92HD83XXX_AUTO, + STAC_92HD83XXX_REF, + STAC_92HD83XXX_PWR_REF, ++ STAC_DELL_S14, + STAC_92HD83XXX_MODELS + }; + + enum { ++ STAC_92HD71BXX_AUTO, + STAC_92HD71BXX_REF, + STAC_DELL_M4_1, + STAC_DELL_M4_2, + STAC_DELL_M4_3, + STAC_HP_M4, + STAC_HP_DV5, ++ STAC_HP_HDX, ++ STAC_HP_DV4_1222NR, + STAC_92HD71BXX_MODELS + }; + + enum { ++ STAC_925x_AUTO, + STAC_925x_REF, + STAC_M1, + STAC_M1_2, +@@ -109,6 +120,7 @@ + }; + + enum { ++ STAC_922X_AUTO, + STAC_D945_REF, + STAC_D945GTP3, + STAC_D945GTP5, +@@ -136,10 +148,12 @@ + }; + + enum { ++ STAC_927X_AUTO, + STAC_D965_REF_NO_JD, /* no jack-detection */ + STAC_D965_REF, + STAC_D965_3ST, + STAC_D965_5ST, ++ STAC_D965_5ST_NO_FP, + STAC_DELL_3ST, + STAC_DELL_BIOS, + STAC_927X_MODELS +@@ -152,6 +166,18 @@ + int data; + }; + ++struct sigmatel_jack { ++ hda_nid_t nid; ++ int type; ++ struct snd_jack *jack; ++}; ++ ++struct sigmatel_mic_route { ++ hda_nid_t pin; ++ unsigned char mux_idx; ++ unsigned char dmux_idx; ++}; ++ + struct sigmatel_spec { + struct snd_kcontrol_new *mixers[4]; + unsigned int num_mixers; +@@ -163,6 +189,7 @@ + unsigned int hp_detect: 1; + unsigned int spdif_mute: 1; + unsigned int check_volume_offset:1; ++ unsigned int auto_mic:1; + + /* gpio lines */ + unsigned int eapd_mask; +@@ -170,23 +197,22 @@ + unsigned int gpio_dir; + unsigned int gpio_data; + unsigned int gpio_mute; ++ unsigned int gpio_led; + + /* stream */ + unsigned int stream_delay; + +- /* analog loopback */ +- unsigned char aloopback_mask; +- unsigned char aloopback_shift; +- + /* power management */ + unsigned int num_pwrs; + unsigned int *pwr_mapping; + hda_nid_t *pwr_nids; + hda_nid_t *dac_list; + ++ /* jack detection */ ++ struct snd_array jacks; ++ + /* events */ +- int num_events; +- struct sigmatel_event events[32]; ++ struct snd_array events; + + /* playback */ + struct hda_input_mux *mono_mux; +@@ -210,6 +236,15 @@ + unsigned int num_dmuxes; + hda_nid_t *smux_nids; + unsigned int num_smuxes; ++ unsigned int num_analog_muxes; ++ ++ unsigned long *capvols; /* amp-volume attr: HDA_COMPOSE_AMP_VAL() */ ++ unsigned long *capsws; /* amp-mute attr: HDA_COMPOSE_AMP_VAL() */ ++ unsigned int num_caps; /* number of capture volume/switch elements */ ++ ++ struct sigmatel_mic_route ext_mic; ++ struct sigmatel_mic_route int_mic; ++ + const char **spdif_labels; + + hda_nid_t dig_in_nid; +@@ -245,14 +280,12 @@ + hda_nid_t line_switch; /* shared line-in for input and output */ + hda_nid_t mic_switch; /* shared mic-in for input and output */ + hda_nid_t hp_switch; /* NID of HP as line-out */ +- unsigned int aloopback; + + struct hda_pcm pcm_rec[2]; /* PCM information */ + + /* dynamic controls and input_mux */ + struct auto_pin_cfg autocfg; +- unsigned int num_kctl_alloc, num_kctl_used; +- struct snd_kcontrol_new *kctl_alloc; ++ struct snd_array kctls; + struct hda_input_mux private_dimux; + struct hda_input_mux private_imux; + struct hda_input_mux private_smux; +@@ -309,6 +342,13 @@ + 0x22, 0x23, + }; + ++#define STAC92HD73XX_NUM_CAPS 2 ++static unsigned long stac92hd73xx_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x20, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT), ++}; ++#define stac92hd73xx_capsws stac92hd73xx_capvols ++ + #define STAC92HD83XXX_NUM_DMICS 2 + static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = { + 0x11, 0x12, 0 +@@ -340,6 +380,13 @@ + 0xc, + }; + ++#define STAC92HD83XXX_NUM_CAPS 2 ++static unsigned long stac92hd83xxx_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x18, 3, 0, HDA_OUTPUT), ++}; ++#define stac92hd83xxx_capsws stac92hd83xxx_capvols ++ + static hda_nid_t stac92hd71bxx_pwr_nids[3] = { + 0x0a, 0x0d, 0x0f + }; +@@ -369,6 +416,13 @@ + 0x22, 0 + }; + ++#define STAC92HD71BXX_NUM_CAPS 2 ++static unsigned long stac92hd71bxx_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x1c, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), ++}; ++#define stac92hd71bxx_capsws stac92hd71bxx_capvols ++ + static hda_nid_t stac925x_adc_nids[1] = { + 0x03, + }; +@@ -390,6 +444,13 @@ + 0x14, + }; + ++static unsigned long stac925x_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT), ++}; ++static unsigned long stac925x_capsws[] = { ++ HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), ++}; ++ + static hda_nid_t stac922x_adc_nids[2] = { + 0x06, 0x07, + }; +@@ -398,6 +459,17 @@ + 0x12, 0x13, + }; + ++#define STAC922X_NUM_CAPS 2 ++static unsigned long stac922x_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_INPUT), ++ HDA_COMPOSE_AMP_VAL(0x18, 3, 0, HDA_INPUT), ++}; ++#define stac922x_capsws stac922x_capvols ++ ++static hda_nid_t stac927x_slave_dig_outs[2] = { ++ 0x1f, 0, ++}; ++ + static hda_nid_t stac927x_adc_nids[3] = { + 0x07, 0x08, 0x09 + }; +@@ -423,6 +495,18 @@ + 0x13, 0x14, 0 + }; + ++#define STAC927X_NUM_CAPS 3 ++static unsigned long stac927x_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x18, 3, 0, HDA_INPUT), ++ HDA_COMPOSE_AMP_VAL(0x19, 3, 0, HDA_INPUT), ++ HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_INPUT), ++}; ++static unsigned long stac927x_capsws[] = { ++ HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x1c, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), ++}; ++ + static const char *stac927x_spdif_labels[5] = { + "Digital Playback", "ADAT", "Analog Mux 1", + "Analog Mux 2", "Analog Mux 3" +@@ -449,6 +533,16 @@ + 0x17, 0x18, 0 + }; + ++#define STAC9205_NUM_CAPS 2 ++static unsigned long stac9205_capvols[] = { ++ HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_INPUT), ++ HDA_COMPOSE_AMP_VAL(0x1c, 3, 0, HDA_INPUT), ++}; ++static unsigned long stac9205_capsws[] = { ++ HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), ++ HDA_COMPOSE_AMP_VAL(0x1e, 3, 0, HDA_OUTPUT), ++}; ++ + static hda_nid_t stac9200_pin_nids[8] = { + 0x08, 0x09, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, +@@ -470,15 +564,21 @@ + 0x14, 0x22, 0x23 + }; + +-static hda_nid_t stac92hd83xxx_pin_nids[14] = { ++static hda_nid_t stac92hd83xxx_pin_nids[10] = { + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, +- 0x0f, 0x10, 0x11, 0x12, 0x13, +- 0x1d, 0x1e, 0x1f, 0x20 ++ 0x0f, 0x10, 0x11, 0x1f, 0x20, ++}; ++ ++#define STAC92HD71BXX_NUM_PINS 13 ++static hda_nid_t stac92hd71bxx_pin_nids_4port[STAC92HD71BXX_NUM_PINS] = { ++ 0x0a, 0x0b, 0x0c, 0x0d, 0x00, ++ 0x00, 0x14, 0x18, 0x19, 0x1e, ++ 0x1f, 0x20, 0x27 + }; +-static hda_nid_t stac92hd71bxx_pin_nids[11] = { ++static hda_nid_t stac92hd71bxx_pin_nids_6port[STAC92HD71BXX_NUM_PINS] = { + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x14, 0x18, 0x19, 0x1e, +- 0x1f, ++ 0x1f, 0x20, 0x27 + }; + + static hda_nid_t stac927x_pin_nids[14] = { +@@ -521,36 +621,6 @@ + return snd_hda_mixer_amp_volume_put(kcontrol, ucontrol); + } + +-static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol, +- struct snd_ctl_elem_info *uinfo) +-{ +- struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +- struct sigmatel_spec *spec = codec->spec; +- return snd_hda_input_mux_info(spec->dinput_mux, uinfo); +-} +- +-static int stac92xx_dmux_enum_get(struct snd_kcontrol *kcontrol, +- struct snd_ctl_elem_value *ucontrol) +-{ +- struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +- struct sigmatel_spec *spec = codec->spec; +- unsigned int dmux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); +- +- ucontrol->value.enumerated.item[0] = spec->cur_dmux[dmux_idx]; +- return 0; +-} +- +-static int stac92xx_dmux_enum_put(struct snd_kcontrol *kcontrol, +- struct snd_ctl_elem_value *ucontrol) +-{ +- struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +- struct sigmatel_spec *spec = codec->spec; +- unsigned int dmux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); +- +- return snd_hda_input_mux_put(codec, spec->dinput_mux, ucontrol, +- spec->dmux_nids[dmux_idx], &spec->cur_dmux[dmux_idx]); +-} +- + static int stac92xx_smux_enum_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) + { +@@ -601,6 +671,40 @@ + return 0; + } + ++static unsigned int stac92xx_vref_set(struct hda_codec *codec, ++ hda_nid_t nid, unsigned int new_vref) ++{ ++ int error; ++ unsigned int pincfg; ++ pincfg = snd_hda_codec_read(codec, nid, 0, ++ AC_VERB_GET_PIN_WIDGET_CONTROL, 0); ++ ++ pincfg &= 0xff; ++ pincfg &= ~(AC_PINCTL_VREFEN | AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN); ++ pincfg |= new_vref; ++ ++ if (new_vref == AC_PINCTL_VREF_HIZ) ++ pincfg |= AC_PINCTL_OUT_EN; ++ else ++ pincfg |= AC_PINCTL_IN_EN; ++ ++ error = snd_hda_codec_write_cache(codec, nid, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, pincfg); ++ if (error < 0) ++ return error; ++ else ++ return 1; ++} ++ ++static unsigned int stac92xx_vref_get(struct hda_codec *codec, hda_nid_t nid) ++{ ++ unsigned int vref; ++ vref = snd_hda_codec_read(codec, nid, 0, ++ AC_VERB_GET_PIN_WIDGET_CONTROL, 0); ++ vref &= AC_PINCTL_VREFEN; ++ return vref; ++} ++ + static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) + { + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +@@ -623,9 +727,35 @@ + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct sigmatel_spec *spec = codec->spec; + unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); ++ const struct hda_input_mux *imux = spec->input_mux; ++ unsigned int idx, prev_idx; + +- return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, +- spec->mux_nids[adc_idx], &spec->cur_mux[adc_idx]); ++ idx = ucontrol->value.enumerated.item[0]; ++ if (idx >= imux->num_items) ++ idx = imux->num_items - 1; ++ prev_idx = spec->cur_mux[adc_idx]; ++ if (prev_idx == idx) ++ return 0; ++ if (idx < spec->num_analog_muxes) { ++ snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0, ++ AC_VERB_SET_CONNECT_SEL, ++ imux->items[idx].index); ++ if (prev_idx >= spec->num_analog_muxes) { ++ imux = spec->dinput_mux; ++ /* 0 = analog */ ++ snd_hda_codec_write_cache(codec, ++ spec->dmux_nids[adc_idx], 0, ++ AC_VERB_SET_CONNECT_SEL, ++ imux->items[0].index); ++ } ++ } else { ++ imux = spec->dinput_mux; ++ snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0, ++ AC_VERB_SET_CONNECT_SEL, ++ imux->items[idx - 1].index); ++ } ++ spec->cur_mux[adc_idx] = idx; ++ return 1; + } + + static int stac92xx_mono_mux_enum_info(struct snd_kcontrol *kcontrol, +@@ -691,60 +821,6 @@ + 0, &spec->cur_amux); + } + +-#define stac92xx_aloopback_info snd_ctl_boolean_mono_info +- +-static int stac92xx_aloopback_get(struct snd_kcontrol *kcontrol, +- struct snd_ctl_elem_value *ucontrol) +-{ +- struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +- unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); +- struct sigmatel_spec *spec = codec->spec; +- +- ucontrol->value.integer.value[0] = !!(spec->aloopback & +- (spec->aloopback_mask << idx)); +- return 0; +-} +- +-static int stac92xx_aloopback_put(struct snd_kcontrol *kcontrol, +- struct snd_ctl_elem_value *ucontrol) +-{ +- struct hda_codec *codec = snd_kcontrol_chip(kcontrol); +- struct sigmatel_spec *spec = codec->spec; +- unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); +- unsigned int dac_mode; +- unsigned int val, idx_val; +- +- idx_val = spec->aloopback_mask << idx; +- if (ucontrol->value.integer.value[0]) +- val = spec->aloopback | idx_val; +- else +- val = spec->aloopback & ~idx_val; +- if (spec->aloopback == val) +- return 0; +- +- spec->aloopback = val; +- +- /* Only return the bits defined by the shift value of the +- * first two bytes of the mask +- */ +- dac_mode = snd_hda_codec_read(codec, codec->afg, 0, +- kcontrol->private_value & 0xFFFF, 0x0); +- dac_mode >>= spec->aloopback_shift; +- +- if (spec->aloopback & idx_val) { +- snd_hda_power_up(codec); +- dac_mode |= idx_val; +- } else { +- snd_hda_power_down(codec); +- dac_mode &= ~idx_val; +- } +- +- snd_hda_codec_write_cache(codec, codec->afg, 0, +- kcontrol->private_value >> 16, dac_mode); +- +- return 1; +-} +- + static struct hda_verb stac9200_core_init[] = { + /* set dac0mux for dac converter */ + { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, +@@ -840,9 +916,9 @@ + }; + + static struct hda_verb stac92hd83xxx_core_init[] = { +- { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0}, +- { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0}, +- { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1}, ++ { 0xa, AC_VERB_SET_CONNECT_SEL, 0x1}, ++ { 0xb, AC_VERB_SET_CONNECT_SEL, 0x1}, ++ { 0xd, AC_VERB_SET_CONNECT_SEL, 0x0}, + + /* power state controls amps */ + { 0x01, AC_VERB_SET_EAPD, 1 << 2}, +@@ -852,26 +928,12 @@ + static struct hda_verb stac92hd71bxx_core_init[] = { + /* set master volume and direct control */ + { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, +- /* unmute right and left channels for nodes 0x0a, 0xd, 0x0f */ +- { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, +- { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, +- { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {} + }; + +-#define HD_DISABLE_PORTF 2 +-static struct hda_verb stac92hd71bxx_analog_core_init[] = { +- /* start of config #1 */ +- +- /* connect port 0f to audio mixer */ +- { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x2}, +- /* unmute right and left channels for node 0x0f */ ++static struct hda_verb stac92hd71bxx_unmute_core_init[] = { ++ /* unmute right and left channels for nodes 0x0f, 0xa, 0x0d */ + { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, +- /* start of config #2 */ +- +- /* set master volume and direct control */ +- { 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, +- /* unmute right and left channels for nodes 0x0a, 0xd */ + { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {} +@@ -952,31 +1014,20 @@ + .private_value = HDA_COMPOSE_AMP_VAL(nid, chs, idx, dir) \ + } + +-#define STAC_INPUT_SOURCE(cnt) \ +- { \ +- .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ +- .name = "Input Source", \ +- .count = cnt, \ +- .info = stac92xx_mux_enum_info, \ +- .get = stac92xx_mux_enum_get, \ +- .put = stac92xx_mux_enum_put, \ +- } +- +-#define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \ ++#define DC_BIAS(xname, idx, nid) \ + { \ + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ +- .name = "Analog Loopback", \ +- .count = cnt, \ +- .info = stac92xx_aloopback_info, \ +- .get = stac92xx_aloopback_get, \ +- .put = stac92xx_aloopback_put, \ +- .private_value = verb_read | (verb_write << 16), \ ++ .name = xname, \ ++ .index = idx, \ ++ .info = stac92xx_dc_bias_info, \ ++ .get = stac92xx_dc_bias_get, \ ++ .put = stac92xx_dc_bias_put, \ ++ .private_value = nid, \ + } + + static struct snd_kcontrol_new stac9200_mixer[] = { + HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), +- STAC_INPUT_SOURCE(1), + HDA_CODEC_VOLUME("Capture Volume", 0x0a, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x0a, 0, HDA_OUTPUT), + { } /* end */ +@@ -1001,26 +1052,10 @@ + HDA_CODEC_VOLUME("DAC Mixer Capture Volume", 0x1d, 0x3, HDA_INPUT), + HDA_CODEC_MUTE("DAC Mixer Capture Switch", 0x1d, 0x3, HDA_INPUT), + +- STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 3), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x20, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x20, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x21, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x21, 0x0, HDA_OUTPUT), +- + { } /* end */ + }; + + static struct snd_kcontrol_new stac92hd73xx_8ch_mixer[] = { +- STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 4), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x20, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x20, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x21, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x21, 0x0, HDA_OUTPUT), +- + HDA_CODEC_VOLUME("Front Mic Mixer Capture Volume", 0x1d, 0, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Mixer Capture Switch", 0x1d, 0, HDA_INPUT), + +@@ -1039,14 +1074,6 @@ + }; + + static struct snd_kcontrol_new stac92hd73xx_10ch_mixer[] = { +- STAC_ANALOG_LOOPBACK(0xFA0, 0x7A1, 5), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x20, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x20, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x21, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x21, 0x0, HDA_OUTPUT), +- + HDA_CODEC_VOLUME("Front Mic Mixer Capture Volume", 0x1d, 0, HDA_INPUT), + HDA_CODEC_MUTE("Front Mic Mixer Capture Switch", 0x1d, 0, HDA_INPUT), + +@@ -1066,12 +1093,6 @@ + + + static struct snd_kcontrol_new stac92hd83xxx_mixer[] = { +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x18, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x18, 0x0, HDA_OUTPUT), +- + HDA_CODEC_VOLUME("DAC0 Capture Volume", 0x1b, 0x3, HDA_INPUT), + HDA_CODEC_MUTE("DAC0 Capture Switch", 0x1b, 0x3, HDA_INPUT), + +@@ -1091,104 +1112,12 @@ + { } /* end */ + }; + +-static struct snd_kcontrol_new stac92hd71bxx_analog_mixer[] = { +- STAC_INPUT_SOURCE(2), +- STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1c, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1c, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1d, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1d, 0x0, HDA_OUTPUT), +- /* analog pc-beep replaced with digital beep support */ +- /* +- HDA_CODEC_VOLUME("PC Beep Volume", 0x17, 0x2, HDA_INPUT), +- HDA_CODEC_MUTE("PC Beep Switch", 0x17, 0x2, HDA_INPUT), +- */ +- +- HDA_CODEC_MUTE("Import0 Mux Capture Switch", 0x17, 0x0, HDA_INPUT), +- HDA_CODEC_VOLUME("Import0 Mux Capture Volume", 0x17, 0x0, HDA_INPUT), +- +- HDA_CODEC_MUTE("Import1 Mux Capture Switch", 0x17, 0x1, HDA_INPUT), +- HDA_CODEC_VOLUME("Import1 Mux Capture Volume", 0x17, 0x1, HDA_INPUT), +- +- HDA_CODEC_MUTE("DAC0 Capture Switch", 0x17, 0x3, HDA_INPUT), +- HDA_CODEC_VOLUME("DAC0 Capture Volume", 0x17, 0x3, HDA_INPUT), +- +- HDA_CODEC_MUTE("DAC1 Capture Switch", 0x17, 0x4, HDA_INPUT), +- HDA_CODEC_VOLUME("DAC1 Capture Volume", 0x17, 0x4, HDA_INPUT), +- { } /* end */ +-}; +- +-static struct snd_kcontrol_new stac92hd71bxx_mixer[] = { +- STAC_INPUT_SOURCE(2), +- STAC_ANALOG_LOOPBACK(0xFA0, 0x7A0, 2), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1c, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1c, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1d, 0x0, HDA_OUTPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1d, 0x0, HDA_OUTPUT), +- { } /* end */ +-}; +- + static struct snd_kcontrol_new stac925x_mixer[] = { + HDA_CODEC_VOLUME("Master Playback Volume", 0x0e, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Master Playback Switch", 0x0e, 0, HDA_OUTPUT), +- STAC_INPUT_SOURCE(1), +- HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), +- HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT), +- { } /* end */ +-}; +- +-static struct snd_kcontrol_new stac9205_mixer[] = { +- STAC_INPUT_SOURCE(2), +- STAC_ANALOG_LOOPBACK(0xFE0, 0x7E0, 1), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x1b, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1d, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x1c, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1e, 0x0, HDA_OUTPUT), +- { } /* end */ +-}; +- +-/* This needs to be generated dynamically based on sequence */ +-static struct snd_kcontrol_new stac922x_mixer[] = { +- STAC_INPUT_SOURCE(2), +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x17, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x17, 0x0, HDA_INPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x18, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x18, 0x0, HDA_INPUT), +- { } /* end */ +-}; +- +- +-static struct snd_kcontrol_new stac927x_mixer[] = { +- STAC_INPUT_SOURCE(3), +- STAC_ANALOG_LOOPBACK(0xFEB, 0x7EB, 1), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x0, 0x18, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x0, 0x1b, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x1, 0x19, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x1, 0x1c, 0x0, HDA_OUTPUT), +- +- HDA_CODEC_VOLUME_IDX("Capture Volume", 0x2, 0x1A, 0x0, HDA_INPUT), +- HDA_CODEC_MUTE_IDX("Capture Switch", 0x2, 0x1d, 0x0, HDA_OUTPUT), + { } /* end */ + }; + +-static struct snd_kcontrol_new stac_dmux_mixer = { +- .iface = SNDRV_CTL_ELEM_IFACE_MIXER, +- .name = "Digital Input Source", +- /* count set later */ +- .info = stac92xx_dmux_enum_info, +- .get = stac92xx_dmux_enum_get, +- .put = stac92xx_dmux_enum_put, +-}; +- + static struct snd_kcontrol_new stac_smux_mixer = { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "IEC958 Playback Source", +@@ -1205,10 +1134,7 @@ + "LFE Playback Volume", + "Side Playback Volume", + "Headphone Playback Volume", +- "Headphone2 Playback Volume", + "Speaker Playback Volume", +- "External Speaker Playback Volume", +- "Speaker2 Playback Volume", + NULL + }; + +@@ -1219,33 +1145,27 @@ + "LFE Playback Switch", + "Side Playback Switch", + "Headphone Playback Switch", +- "Headphone2 Playback Switch", + "Speaker Playback Switch", +- "External Speaker Playback Switch", +- "Speaker2 Playback Switch", + "IEC958 Playback Switch", + NULL + }; + ++static void stac92xx_free_kctls(struct hda_codec *codec); ++ + static int stac92xx_build_controls(struct hda_codec *codec) + { + struct sigmatel_spec *spec = codec->spec; + int err; + int i; + +- err = snd_hda_add_new_ctls(codec, spec->mixer); +- if (err < 0) +- return err; +- +- for (i = 0; i < spec->num_mixers; i++) { +- err = snd_hda_add_new_ctls(codec, spec->mixers[i]); ++ if (spec->mixer) { ++ err = snd_hda_add_new_ctls(codec, spec->mixer); + if (err < 0) + return err; + } +- if (spec->num_dmuxes > 0) { +- stac_dmux_mixer.count = spec->num_dmuxes; +- err = snd_ctl_add(codec->bus->card, +- snd_ctl_new1(&stac_dmux_mixer, codec)); ++ ++ for (i = 0; i < spec->num_mixers; i++) { ++ err = snd_hda_add_new_ctls(codec, spec->mixers[i]); + if (err < 0) + return err; + } +@@ -1301,6 +1221,8 @@ + return err; + } + ++ stac92xx_free_kctls(codec); /* no longer needed */ ++ + return 0; + } + +@@ -1454,6 +1376,7 @@ + }; + + static const char *stac9200_models[STAC_9200_MODELS] = { ++ [STAC_AUTO] = "auto", + [STAC_REF] = "ref", + [STAC_9200_OQO] = "oqo", + [STAC_9200_DELL_D21] = "dell-d21", +@@ -1471,10 +1394,16 @@ + [STAC_9200_PANASONIC] = "panasonic", + }; + ++#ifndef PCI_VENDOR_ID_DFI ++#define PCI_VENDOR_ID_DFI 0x106e ++#endif ++ + static struct snd_pci_quirk stac9200_cfg_tbl[] = { + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_REF), + /* Dell laptops have BIOS problem */ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a8, + "unknown Dell", STAC_9200_DELL_D21), +@@ -1597,6 +1526,7 @@ + }; + + static const char *stac925x_models[STAC_925x_MODELS] = { ++ [STAC_925x_AUTO] = "auto", + [STAC_REF] = "ref", + [STAC_M1] = "m1", + [STAC_M1_2] = "m1-2", +@@ -1624,6 +1554,7 @@ + static struct snd_pci_quirk stac925x_cfg_tbl[] = { + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, "DFI LanParty", STAC_REF), + SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF), + + /* Default table for unknown ID */ +@@ -1655,6 +1586,7 @@ + }; + + static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { ++ [STAC_92HD73XX_AUTO] = "auto", + [STAC_92HD73XX_NO_JD] = "no-jd", + [STAC_92HD73XX_REF] = "ref", + [STAC_DELL_M6_AMIC] = "dell-m6-amic", +@@ -1667,6 +1599,8 @@ + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_92HD73XX_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_92HD73XX_REF), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, + "Dell Studio 1535", STAC_DELL_M6_DMIC), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, +@@ -1687,55 +1621,73 @@ + "Dell Studio 1537", STAC_DELL_M6_DMIC), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, + "Dell Studio 17", STAC_DELL_M6_DMIC), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, ++ "Dell Studio 1555", STAC_DELL_M6_DMIC), + {} /* terminator */ + }; + +-static unsigned int ref92hd83xxx_pin_configs[14] = { ++static unsigned int ref92hd83xxx_pin_configs[10] = { + 0x02214030, 0x02211010, 0x02a19020, 0x02170130, + 0x01014050, 0x01819040, 0x01014020, 0x90a3014e, +- 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x40f000f0, + 0x01451160, 0x98560170, + }; + ++static unsigned int dell_s14_pin_configs[10] = { ++ 0x02214030, 0x02211010, 0x02a19020, 0x01014050, ++ 0x40f000f0, 0x01819040, 0x40f000f0, 0x90a60160, ++ 0x40f000f0, 0x40f000f0, ++}; ++ + static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { + [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, + [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs, ++ [STAC_DELL_S14] = dell_s14_pin_configs, + }; + + static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { ++ [STAC_92HD83XXX_AUTO] = "auto", + [STAC_92HD83XXX_REF] = "ref", + [STAC_92HD83XXX_PWR_REF] = "mic-ref", ++ [STAC_DELL_S14] = "dell-s14", + }; + + static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_92HD83XXX_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_92HD83XXX_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba, ++ "unknown Dell", STAC_DELL_S14), + {} /* terminator */ + }; + +-static unsigned int ref92hd71bxx_pin_configs[11] = { ++static unsigned int ref92hd71bxx_pin_configs[STAC92HD71BXX_NUM_PINS] = { + 0x02214030, 0x02a19040, 0x01a19020, 0x01014010, + 0x0181302e, 0x01014010, 0x01019020, 0x90a000f0, +- 0x90a000f0, 0x01452050, 0x01452050, ++ 0x90a000f0, 0x01452050, 0x01452050, 0x00000000, ++ 0x00000000 + }; + +-static unsigned int dell_m4_1_pin_configs[11] = { ++static unsigned int dell_m4_1_pin_configs[STAC92HD71BXX_NUM_PINS] = { + 0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110, + 0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0, +- 0x40f000f0, 0x4f0000f0, 0x4f0000f0, ++ 0x40f000f0, 0x4f0000f0, 0x4f0000f0, 0x00000000, ++ 0x00000000 + }; + +-static unsigned int dell_m4_2_pin_configs[11] = { ++static unsigned int dell_m4_2_pin_configs[STAC92HD71BXX_NUM_PINS] = { + 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110, + 0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0, +- 0x40f000f0, 0x044413b0, 0x044413b0, ++ 0x40f000f0, 0x044413b0, 0x044413b0, 0x00000000, ++ 0x00000000 + }; + +-static unsigned int dell_m4_3_pin_configs[11] = { ++static unsigned int dell_m4_3_pin_configs[STAC92HD71BXX_NUM_PINS] = { + 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110, + 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a000f0, +- 0x40f000f0, 0x044413b0, 0x044413b0, ++ 0x40f000f0, 0x044413b0, 0x044413b0, 0x00000000, ++ 0x00000000 + }; + + static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { +@@ -1745,39 +1697,42 @@ + [STAC_DELL_M4_3] = dell_m4_3_pin_configs, + [STAC_HP_M4] = NULL, + [STAC_HP_DV5] = NULL, ++ [STAC_HP_HDX] = NULL, ++ [STAC_HP_DV4_1222NR] = NULL, + }; + + static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { ++ [STAC_92HD71BXX_AUTO] = "auto", + [STAC_92HD71BXX_REF] = "ref", + [STAC_DELL_M4_1] = "dell-m4-1", + [STAC_DELL_M4_2] = "dell-m4-2", + [STAC_DELL_M4_3] = "dell-m4-3", + [STAC_HP_M4] = "hp-m4", + [STAC_HP_DV5] = "hp-dv5", ++ [STAC_HP_HDX] = "hp-hdx", ++ [STAC_HP_DV4_1222NR] = "hp-dv4-1222nr", + }; + + static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_92HD71BXX_REF), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x308c, +- "HP", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x308d, ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_92HD71BXX_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb, ++ "HP dv4-1222nr", STAC_HP_DV4_1222NR), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, + "HP", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2, +- "HP dv5", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4, +- "HP dv7", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7, +- "HP dv4", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, +- "HP dv7", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3600, +- "HP dv5", STAC_HP_DV5), +- SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603, +- "HP dv5", STAC_HP_DV5), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, ++ "HP dv4-7", STAC_HP_DV5), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3600, ++ "HP dv4-7", STAC_HP_DV5), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3610, ++ "HP HDX", STAC_HP_HDX), /* HDX18 */ + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, +- "unknown HP", STAC_HP_M4), ++ "HP mini 1000", STAC_HP_M4), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b, ++ "HP HDX", STAC_HP_HDX), /* HDX16 */ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, + "unknown Dell", STAC_DELL_M4_1), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234, +@@ -1929,6 +1884,7 @@ + }; + + static const char *stac922x_models[STAC_922X_MODELS] = { ++ [STAC_922X_AUTO] = "auto", + [STAC_D945_REF] = "ref", + [STAC_D945GTP5] = "5stack", + [STAC_D945GTP3] = "3stack", +@@ -1956,6 +1912,8 @@ + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_D945_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_D945_REF), + /* Intel 945G based systems */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0101, + "Intel D945G", STAC_D945GTP3), +@@ -2036,31 +1994,7 @@ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7, + "Dell XPS M1210", STAC_922X_DELL_M82), + /* ECS/PC Chips boards */ +- SND_PCI_QUIRK(0x1019, 0x2144, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2608, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2633, +- "ECS/PC chips P17G/1333", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2811, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2812, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2813, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2814, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2815, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2816, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2817, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2818, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2819, +- "ECS/PC chips", STAC_ECS_202), +- SND_PCI_QUIRK(0x1019, 0x2820, ++ SND_PCI_QUIRK_MASK(0x1019, 0xf000, 0x2000, + "ECS/PC chips", STAC_ECS_202), + {} /* terminator */ + }; +@@ -2086,6 +2020,13 @@ + 0x40000100, 0x40000100 + }; + ++static unsigned int d965_5st_no_fp_pin_configs[14] = { ++ 0x40000100, 0x40000100, 0x0181304e, 0x01014010, ++ 0x01a19040, 0x01011012, 0x01016011, 0x40000100, ++ 0x40000100, 0x40000100, 0x40000100, 0x01442070, ++ 0x40000100, 0x40000100 ++}; ++ + static unsigned int dell_3st_pin_configs[14] = { + 0x02211230, 0x02a11220, 0x01a19040, 0x01114210, + 0x01111212, 0x01116211, 0x01813050, 0x01112214, +@@ -2098,15 +2039,18 @@ + [STAC_D965_REF] = ref927x_pin_configs, + [STAC_D965_3ST] = d965_3st_pin_configs, + [STAC_D965_5ST] = d965_5st_pin_configs, ++ [STAC_D965_5ST_NO_FP] = d965_5st_no_fp_pin_configs, + [STAC_DELL_3ST] = dell_3st_pin_configs, + [STAC_DELL_BIOS] = NULL, + }; + + static const char *stac927x_models[STAC_927X_MODELS] = { ++ [STAC_927X_AUTO] = "auto", + [STAC_D965_REF_NO_JD] = "ref-no-jd", + [STAC_D965_REF] = "ref", + [STAC_D965_3ST] = "3stack", + [STAC_D965_5ST] = "5stack", ++ [STAC_D965_5ST_NO_FP] = "5stack-no-fp", + [STAC_DELL_3ST] = "dell-3stack", + [STAC_DELL_BIOS] = "dell-bios", + }; +@@ -2115,26 +2059,16 @@ + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_D965_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_D965_REF), + /* Intel 946 based systems */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x3d01, "Intel D946", STAC_D965_3ST), + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xa301, "Intel D946", STAC_D965_3ST), + /* 965 based 3 stack systems */ +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2116, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2115, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2114, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2113, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2112, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2111, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2110, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2009, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2008, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2007, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2006, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2005, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2004, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2003, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2002, "Intel D965", STAC_D965_3ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2001, "Intel D965", STAC_D965_3ST), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2100, ++ "Intel D965", STAC_D965_3ST), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000, ++ "Intel D965", STAC_D965_3ST), + /* Dell 3 stack systems */ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_3ST), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST), +@@ -2144,21 +2078,16 @@ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), +- SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_3ST), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0209, "Dell XPS 1330", STAC_DELL_BIOS), + /* 965 based 5 stack systems */ +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2301, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2302, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2303, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2304, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2305, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2501, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2502, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2503, "Intel D965", STAC_D965_5ST), +- SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2504, "Intel D965", STAC_D965_5ST), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2300, ++ "Intel D965", STAC_D965_5ST), ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500, ++ "Intel D965", STAC_D965_5ST), + {} /* terminator */ + }; + +@@ -2215,6 +2144,7 @@ + }; + + static const char *stac9205_models[STAC_9205_MODELS] = { ++ [STAC_9205_AUTO] = "auto", + [STAC_9205_REF] = "ref", + [STAC_9205_DELL_M42] = "dell-m42", + [STAC_9205_DELL_M43] = "dell-m43", +@@ -2226,6 +2156,10 @@ + /* SigmaTel reference board */ + SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, + "DFI LanParty", STAC_9205_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30, ++ "SigmaTel", STAC_9205_REF), ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, ++ "DFI LanParty", STAC_9205_REF), + /* Dell */ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f1, + "unknown Dell", STAC_9205_DELL_M42), +@@ -2258,6 +2192,7 @@ + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, + "Dell Vostro 1500", STAC_9205_DELL_M42), + /* Gateway */ ++ SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD), + SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), + {} /* terminator */ + }; +@@ -2515,10 +2450,18 @@ + return 0; + } + +-static unsigned int stac92xx_get_vref(struct hda_codec *codec, hda_nid_t nid) ++#define snd_hda_query_pin_caps(codec, nid) \ ++ snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP) ++#define snd_hda_codec_get_pincfg(codec, nid) \ ++ snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0) ++#define snd_hda_codec_set_pincfg(codec, nid, val) \ ++ stac92xx_set_config_reg(codec, nid, val) ++#define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT) ++ ++static unsigned int stac92xx_get_default_vref(struct hda_codec *codec, ++ hda_nid_t nid) + { +- unsigned int pincap = snd_hda_param_read(codec, nid, +- AC_PAR_PIN_CAP); ++ unsigned int pincap = snd_hda_query_pin_caps(codec, nid); + pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; + if (pincap & AC_PINCAP_VREF_100) + return AC_PINCTL_VREF_100; +@@ -2550,8 +2493,7 @@ + return 0; + } + +-static void stac_issue_unsol_event(struct hda_codec *codec, hda_nid_t nid, +- unsigned char type); ++static void stac_issue_unsol_event(struct hda_codec *codec, hda_nid_t nid); + + static int stac92xx_hp_switch_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +@@ -2559,25 +2501,119 @@ + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct sigmatel_spec *spec = codec->spec; + int nid = kcontrol->private_value; +- ++ + spec->hp_switch = ucontrol->value.integer.value[0] ? nid : 0; + + /* check to be sure that the ports are upto date with + * switch changes + */ +- stac_issue_unsol_event(codec, nid, STAC_HP_EVENT); ++ stac_issue_unsol_event(codec, nid); ++ + return 1; + } + +-#define stac92xx_io_switch_info snd_ctl_boolean_mono_info ++static int stac92xx_dc_bias_info(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_info *uinfo) ++{ ++ int i; ++ static char *texts[] = { ++ "Mic In", "Line In", "Line Out" ++ }; ++ ++ struct hda_codec *codec = snd_kcontrol_chip(kcontrol); ++ struct sigmatel_spec *spec = codec->spec; ++ hda_nid_t nid = kcontrol->private_value; ++ ++ if (nid == spec->mic_switch || nid == spec->line_switch) ++ i = 3; ++ else ++ i = 2; ++ ++ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ++ uinfo->value.enumerated.items = i; ++ uinfo->count = 1; ++ if (uinfo->value.enumerated.item >= i) ++ uinfo->value.enumerated.item = i-1; ++ strcpy(uinfo->value.enumerated.name, ++ texts[uinfo->value.enumerated.item]); ++ ++ return 0; ++} ++ ++static int stac92xx_dc_bias_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct hda_codec *codec = snd_kcontrol_chip(kcontrol); ++ hda_nid_t nid = kcontrol->private_value; ++ unsigned int vref = stac92xx_vref_get(codec, nid); ++ ++ if (vref == stac92xx_get_default_vref(codec, nid)) ++ ucontrol->value.enumerated.item[0] = 0; ++ else if (vref == AC_PINCTL_VREF_GRD) ++ ucontrol->value.enumerated.item[0] = 1; ++ else if (vref == AC_PINCTL_VREF_HIZ) ++ ucontrol->value.enumerated.item[0] = 2; ++ ++ return 0; ++} ++ ++static int stac92xx_dc_bias_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct hda_codec *codec = snd_kcontrol_chip(kcontrol); ++ unsigned int new_vref = 0; ++ int error; ++ hda_nid_t nid = kcontrol->private_value; ++ ++ if (ucontrol->value.enumerated.item[0] == 0) ++ new_vref = stac92xx_get_default_vref(codec, nid); ++ else if (ucontrol->value.enumerated.item[0] == 1) ++ new_vref = AC_PINCTL_VREF_GRD; ++ else if (ucontrol->value.enumerated.item[0] == 2) ++ new_vref = AC_PINCTL_VREF_HIZ; ++ else ++ return 0; ++ ++ if (new_vref != stac92xx_vref_get(codec, nid)) { ++ error = stac92xx_vref_set(codec, nid, new_vref); ++ return error; ++ } ++ ++ return 0; ++} ++ ++static int stac92xx_io_switch_info(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_info *uinfo) ++{ ++ static char *texts[2]; ++ struct hda_codec *codec = snd_kcontrol_chip(kcontrol); ++ struct sigmatel_spec *spec = codec->spec; ++ ++ if (kcontrol->private_value == spec->line_switch) ++ texts[0] = "Line In"; ++ else ++ texts[0] = "Mic In"; ++ texts[1] = "Line Out"; ++ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ++ uinfo->value.enumerated.items = 2; ++ uinfo->count = 1; ++ ++ if (uinfo->value.enumerated.item >= 2) ++ uinfo->value.enumerated.item = 1; ++ strcpy(uinfo->value.enumerated.name, ++ texts[uinfo->value.enumerated.item]); ++ ++ return 0; ++} + + static int stac92xx_io_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) + { + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct sigmatel_spec *spec = codec->spec; +- int io_idx = kcontrol-> private_value & 0xff; ++ hda_nid_t nid = kcontrol->private_value; ++ int io_idx = (nid == spec->mic_switch) ? 1 : 0; + +- ucontrol->value.integer.value[0] = spec->io_switch[io_idx]; ++ ucontrol->value.enumerated.item[0] = spec->io_switch[io_idx]; + return 0; + } + +@@ -2585,9 +2621,9 @@ + { + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + struct sigmatel_spec *spec = codec->spec; +- hda_nid_t nid = kcontrol->private_value >> 8; +- int io_idx = kcontrol-> private_value & 0xff; +- unsigned short val = !!ucontrol->value.integer.value[0]; ++ hda_nid_t nid = kcontrol->private_value; ++ int io_idx = (nid == spec->mic_switch) ? 1 : 0; ++ unsigned short val = !!ucontrol->value.enumerated.item[0]; + + spec->io_switch[io_idx] = val; + +@@ -2596,7 +2632,7 @@ + else { + unsigned int pinctl = AC_PINCTL_IN_EN; + if (io_idx) /* set VREF for mic */ +- pinctl |= stac92xx_get_vref(codec, nid); ++ pinctl |= stac92xx_get_default_vref(codec, nid); + stac92xx_auto_set_pinctl(codec, nid, pinctl); + } + +@@ -2604,7 +2640,7 @@ + * appropriately according to the pin direction + */ + if (spec->hp_detect) +- stac_issue_unsol_event(codec, nid, STAC_HP_EVENT); ++ stac_issue_unsol_event(codec, nid); + + return 1; + } +@@ -2677,7 +2713,8 @@ + STAC_CTL_WIDGET_AMP_VOL, + STAC_CTL_WIDGET_HP_SWITCH, + STAC_CTL_WIDGET_IO_SWITCH, +- STAC_CTL_WIDGET_CLFE_SWITCH ++ STAC_CTL_WIDGET_CLFE_SWITCH, ++ STAC_CTL_WIDGET_DC_BIAS + }; + + static struct snd_kcontrol_new stac92xx_control_templates[] = { +@@ -2689,38 +2726,42 @@ + STAC_CODEC_HP_SWITCH(NULL), + STAC_CODEC_IO_SWITCH(NULL, 0), + STAC_CODEC_CLFE_SWITCH(NULL, 0), ++ DC_BIAS(NULL, 0, 0), + }; + + /* add dynamic controls */ +-static int stac92xx_add_control_temp(struct sigmatel_spec *spec, +- struct snd_kcontrol_new *ktemp, +- int idx, const char *name, +- unsigned long val) ++static struct snd_kcontrol_new * ++stac_control_new(struct sigmatel_spec *spec, ++ struct snd_kcontrol_new *ktemp, ++ const char *name) + { + struct snd_kcontrol_new *knew; + +- if (spec->num_kctl_used >= spec->num_kctl_alloc) { +- int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC; +- +- knew = kcalloc(num + 1, sizeof(*knew), GFP_KERNEL); /* array + terminator */ +- if (! knew) +- return -ENOMEM; +- if (spec->kctl_alloc) { +- memcpy(knew, spec->kctl_alloc, sizeof(*knew) * spec->num_kctl_alloc); +- kfree(spec->kctl_alloc); +- } +- spec->kctl_alloc = knew; +- spec->num_kctl_alloc = num; +- } +- +- knew = &spec->kctl_alloc[spec->num_kctl_used]; ++ snd_array_init(&spec->kctls, sizeof(*knew), 32); ++ knew = snd_array_new(&spec->kctls); ++ if (!knew) ++ return NULL; + *knew = *ktemp; +- knew->index = idx; + knew->name = kstrdup(name, GFP_KERNEL); +- if (!knew->name) ++ if (!knew->name) { ++ /* roolback */ ++ memset(knew, 0, sizeof(*knew)); ++ spec->kctls.alloced--; ++ return NULL; ++ } ++ return knew; ++} ++ ++static int stac92xx_add_control_temp(struct sigmatel_spec *spec, ++ struct snd_kcontrol_new *ktemp, ++ int idx, const char *name, ++ unsigned long val) ++{ ++ struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name); ++ if (!knew) + return -ENOMEM; ++ knew->index = idx; + knew->private_value = val; +- spec->num_kctl_used++; + return 0; + } + +@@ -2741,7 +2782,60 @@ + return stac92xx_add_control_idx(spec, type, 0, name, val); + } + +-/* check whether the line-input can be used as line-out */ ++static struct snd_kcontrol_new stac_input_src_temp = { ++ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ++ .name = "Input Source", ++ .info = stac92xx_mux_enum_info, ++ .get = stac92xx_mux_enum_get, ++ .put = stac92xx_mux_enum_put, ++}; ++ ++static inline int stac92xx_add_jack_mode_control(struct hda_codec *codec, ++ hda_nid_t nid, int idx) ++{ ++ int def_conf = snd_hda_codec_get_pincfg(codec, nid); ++ int control = 0; ++ struct sigmatel_spec *spec = codec->spec; ++ char name[22]; ++ ++ if (!((get_defcfg_connect(def_conf)) & AC_JACK_PORT_FIXED)) { ++ if (stac92xx_get_default_vref(codec, nid) == AC_PINCTL_VREF_GRD ++ && nid == spec->line_switch) ++ control = STAC_CTL_WIDGET_IO_SWITCH; ++ else if (snd_hda_query_pin_caps(codec, nid) ++ & (AC_PINCAP_VREF_GRD << AC_PINCAP_VREF_SHIFT)) ++ control = STAC_CTL_WIDGET_DC_BIAS; ++ else if (nid == spec->mic_switch) ++ control = STAC_CTL_WIDGET_IO_SWITCH; ++ } ++ ++ if (control) { ++ strcpy(name, auto_pin_cfg_labels[idx]); ++ return stac92xx_add_control(codec->spec, control, ++ strcat(name, " Jack Mode"), nid); ++ } ++ ++ return 0; ++} ++ ++static int stac92xx_add_input_source(struct sigmatel_spec *spec) ++{ ++ struct snd_kcontrol_new *knew; ++ struct hda_input_mux *imux = &spec->private_imux; ++ ++ if (spec->auto_mic) ++ return 0; /* no need for input source */ ++ if (!spec->num_adcs || imux->num_items <= 1) ++ return 0; /* no need for input source control */ ++ knew = stac_control_new(spec, &stac_input_src_temp, ++ stac_input_src_temp.name); ++ if (!knew) ++ return -ENOMEM; ++ knew->count = spec->num_adcs; ++ return 0; ++} ++ ++/* check whether the line-input can be used as line-out */ + static hda_nid_t check_line_out_switch(struct hda_codec *codec) + { + struct sigmatel_spec *spec = codec->spec; +@@ -2752,7 +2846,7 @@ + if (cfg->line_out_type != AUTO_PIN_LINE_OUT) + return 0; + nid = cfg->input_pins[AUTO_PIN_LINE]; +- pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); ++ pincap = snd_hda_query_pin_caps(codec, nid); + if (pincap & AC_PINCAP_OUT) + return nid; + return 0; +@@ -2771,12 +2865,11 @@ + mic_pin = AUTO_PIN_MIC; + for (;;) { + hda_nid_t nid = cfg->input_pins[mic_pin]; +- def_conf = snd_hda_codec_read(codec, nid, 0, +- AC_VERB_GET_CONFIG_DEFAULT, 0); ++ def_conf = snd_hda_codec_get_pincfg(codec, nid); + /* some laptops have an internal analog microphone + * which can't be used as a output */ + if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) { +- pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); ++ pincap = snd_hda_query_pin_caps(codec, nid); + if (pincap & AC_PINCAP_OUT) + return nid; + } +@@ -2824,9 +2917,8 @@ + conn_len = snd_hda_get_connections(codec, nid, conn, + HDA_MAX_CONNECTIONS); + for (j = 0; j < conn_len; j++) { +- wcaps = snd_hda_param_read(codec, conn[j], +- AC_PAR_AUDIO_WIDGET_CAP); +- wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; ++ wcaps = get_wcaps(codec, conn[j]); ++ wtype = get_wcaps_type(wcaps); + /* we check only analog outputs */ + if (wtype != AC_WID_AUD_OUT || (wcaps & AC_WCAP_DIGITAL)) + continue; +@@ -2840,6 +2932,16 @@ + return conn[j]; + } + } ++ /* if all DACs are already assigned, connect to the primary DAC */ ++ if (conn_len > 1) { ++ for (j = 0; j < conn_len; j++) { ++ if (conn[j] == spec->multiout.dac_nids[0]) { ++ snd_hda_codec_write_cache(codec, nid, 0, ++ AC_VERB_SET_CONNECT_SEL, j); ++ break; ++ } ++ } ++ } + return 0; + } + +@@ -2880,6 +2982,26 @@ + add_spec_dacs(spec, dac); + } + ++ for (i = 0; i < cfg->hp_outs; i++) { ++ nid = cfg->hp_pins[i]; ++ dac = get_unassigned_dac(codec, nid); ++ if (dac) { ++ if (!spec->multiout.hp_nid) ++ spec->multiout.hp_nid = dac; ++ else ++ add_spec_extra_dacs(spec, dac); ++ } ++ spec->hp_dacs[i] = dac; ++ } ++ ++ for (i = 0; i < cfg->speaker_outs; i++) { ++ nid = cfg->speaker_pins[i]; ++ dac = get_unassigned_dac(codec, nid); ++ if (dac) ++ add_spec_extra_dacs(spec, dac); ++ spec->speaker_dacs[i] = dac; ++ } ++ + /* add line-in as output */ + nid = check_line_out_switch(codec); + if (nid) { +@@ -2907,26 +3029,6 @@ + } + } + +- for (i = 0; i < cfg->hp_outs; i++) { +- nid = cfg->hp_pins[i]; +- dac = get_unassigned_dac(codec, nid); +- if (dac) { +- if (!spec->multiout.hp_nid) +- spec->multiout.hp_nid = dac; +- else +- add_spec_extra_dacs(spec, dac); +- } +- spec->hp_dacs[i] = dac; +- } +- +- for (i = 0; i < cfg->speaker_outs; i++) { +- nid = cfg->speaker_pins[i]; +- dac = get_unassigned_dac(codec, nid); +- if (dac) +- add_spec_extra_dacs(spec, dac); +- spec->speaker_dacs[i] = dac; +- } +- + snd_printd("stac92xx: dac_nids=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n", + spec->multiout.num_dacs, + spec->multiout.dac_nids[0], +@@ -2939,8 +3041,8 @@ + } + + /* create volume control/switch for the given prefx type */ +-static int create_controls(struct hda_codec *codec, const char *pfx, +- hda_nid_t nid, int chs) ++static int create_controls_idx(struct hda_codec *codec, const char *pfx, ++ int idx, hda_nid_t nid, int chs) + { + struct sigmatel_spec *spec = codec->spec; + char name[32]; +@@ -2964,19 +3066,22 @@ + } + + sprintf(name, "%s Playback Volume", pfx); +- err = stac92xx_add_control(spec, STAC_CTL_WIDGET_VOL, name, ++ err = stac92xx_add_control_idx(spec, STAC_CTL_WIDGET_VOL, idx, name, + HDA_COMPOSE_AMP_VAL_OFS(nid, chs, 0, HDA_OUTPUT, + spec->volume_offset)); + if (err < 0) + return err; + sprintf(name, "%s Playback Switch", pfx); +- err = stac92xx_add_control(spec, STAC_CTL_WIDGET_MUTE, name, ++ err = stac92xx_add_control_idx(spec, STAC_CTL_WIDGET_MUTE, idx, name, + HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT)); + if (err < 0) + return err; + return 0; + } + ++#define create_controls(codec, pfx, nid, chs) \ ++ create_controls_idx(codec, pfx, 0, nid, chs) ++ + static int add_spec_dacs(struct sigmatel_spec *spec, hda_nid_t nid) + { + if (spec->multiout.num_dacs > 4) { +@@ -3014,12 +3119,6 @@ + static const char *chname[4] = { + "Front", "Surround", NULL /*CLFE*/, "Side" + }; +- static const char *hp_pfxs[] = { +- "Headphone", "Headphone2", "Headphone3", "Headphone4" +- }; +- static const char *speaker_pfxs[] = { +- "Speaker", "External Speaker", "Speaker2", "Speaker3" +- }; + hda_nid_t nid; + int i, err; + unsigned int wid_caps; +@@ -3055,18 +3154,22 @@ + + } else { + const char *name; ++ int idx; + switch (type) { + case AUTO_PIN_HP_OUT: +- name = hp_pfxs[i]; ++ name = "Headphone"; ++ idx = i; + break; + case AUTO_PIN_SPEAKER_OUT: +- name = speaker_pfxs[i]; ++ name = "Speaker"; ++ idx = i; + break; + default: + name = chname[i]; ++ idx = 0; + break; + } +- err = create_controls(codec, name, nid, 3); ++ err = create_controls_idx(codec, name, idx, nid, 3); + if (err < 0) + return err; + } +@@ -3074,12 +3177,29 @@ + return 0; + } + ++static int stac92xx_add_capvol_ctls(struct hda_codec *codec, unsigned long vol, ++ unsigned long sw, int idx) ++{ ++ int err; ++ err = stac92xx_add_control_idx(codec->spec, STAC_CTL_WIDGET_VOL, idx, ++ "Capture Volume", vol); ++ if (err < 0) ++ return err; ++ err = stac92xx_add_control_idx(codec->spec, STAC_CTL_WIDGET_MUTE, idx, ++ "Capture Switch", sw); ++ if (err < 0) ++ return err; ++ return 0; ++} ++ + /* add playback controls from the parsed DAC table */ + static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, + const struct auto_pin_cfg *cfg) + { + struct sigmatel_spec *spec = codec->spec; ++ hda_nid_t nid; + int err; ++ int idx; + + err = create_multi_out_ctls(codec, cfg->line_outs, cfg->line_out_pins, + spec->multiout.dac_nids, +@@ -3096,20 +3216,13 @@ + return err; + } + +- if (spec->line_switch) { +- err = stac92xx_add_control(spec, STAC_CTL_WIDGET_IO_SWITCH, +- "Line In as Output Switch", +- spec->line_switch << 8); +- if (err < 0) +- return err; +- } +- +- if (spec->mic_switch) { +- err = stac92xx_add_control(spec, STAC_CTL_WIDGET_IO_SWITCH, +- "Mic as Output Switch", +- (spec->mic_switch << 8) | 1); +- if (err < 0) +- return err; ++ for (idx = AUTO_PIN_MIC; idx <= AUTO_PIN_FRONT_LINE; idx++) { ++ nid = cfg->input_pins[idx]; ++ if (nid) { ++ err = stac92xx_add_jack_mode_control(codec, nid, idx); ++ if (err < 0) ++ return err; ++ } + } + + return 0; +@@ -3152,7 +3265,7 @@ + spec->mono_nid, + con_lst, + HDA_MAX_NUM_INPUTS); +- if (!num_cons || num_cons > ARRAY_SIZE(stac92xx_mono_labels)) ++ if (num_cons <= 0 || num_cons > ARRAY_SIZE(stac92xx_mono_labels)) + return -EINVAL; + + for (i = 0; i < num_cons; i++) { +@@ -3298,7 +3411,7 @@ + spec->smux_nids[0], + con_lst, + HDA_MAX_NUM_INPUTS); +- if (!num_cons) ++ if (num_cons <= 0) + return -EINVAL; + + if (!labels) +@@ -3319,53 +3432,66 @@ + "Digital Mic 3", "Digital Mic 4" + }; + ++static int get_connection_index(struct hda_codec *codec, hda_nid_t mux, ++ hda_nid_t nid) ++{ ++ hda_nid_t conn[HDA_MAX_NUM_INPUTS]; ++ int i, nums; ++ ++ nums = snd_hda_get_connections(codec, mux, conn, ARRAY_SIZE(conn)); ++ for (i = 0; i < nums; i++) ++ if (conn[i] == nid) ++ return i; ++ return -1; ++} ++ + /* create playback/capture controls for input pins on dmic capable codecs */ + static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec, + const struct auto_pin_cfg *cfg) + { + struct sigmatel_spec *spec = codec->spec; ++ struct hda_input_mux *imux = &spec->private_imux; + struct hda_input_mux *dimux = &spec->private_dimux; +- hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; +- int err, i, j; ++ int err, i, active_mics; ++ unsigned int def_conf; + char name[32]; + + dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0]; + dimux->items[dimux->num_items].index = 0; + dimux->num_items++; + ++ active_mics = 0; ++ for (i = 0; i < spec->num_dmics; i++) { ++ def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]); ++ if (get_defcfg_connect(def_conf) != AC_JACK_PORT_NONE) ++ active_mics++; ++ } ++ + for (i = 0; i < spec->num_dmics; i++) { + hda_nid_t nid; + int index; +- int num_cons; + unsigned int wcaps; +- unsigned int def_conf; ++ const char *label; + +- def_conf = snd_hda_codec_read(codec, +- spec->dmic_nids[i], +- 0, +- AC_VERB_GET_CONFIG_DEFAULT, +- 0); ++ def_conf = snd_hda_codec_get_pincfg(codec, spec->dmic_nids[i]); + if (get_defcfg_connect(def_conf) == AC_JACK_PORT_NONE) + continue; + + nid = spec->dmic_nids[i]; +- num_cons = snd_hda_get_connections(codec, +- spec->dmux_nids[0], +- con_lst, +- HDA_MAX_NUM_INPUTS); +- for (j = 0; j < num_cons; j++) +- if (con_lst[j] == nid) { +- index = j; +- goto found; +- } +- continue; +-found: ++ index = get_connection_index(codec, spec->dmux_nids[0], nid); ++ if (index < 0) ++ continue; ++ ++ if (active_mics == 1) ++ label = "Digital Mic"; ++ else ++ label = stac92xx_dmic_labels[dimux->num_items]; ++ + wcaps = get_wcaps(codec, nid) & + (AC_WCAP_OUT_AMP | AC_WCAP_IN_AMP); + + if (wcaps) { +- sprintf(name, "%s Capture Volume", +- stac92xx_dmic_labels[dimux->num_items]); ++ sprintf(name, "%s Capture Volume", label); + + err = stac92xx_add_control(spec, + STAC_CTL_WIDGET_VOL, +@@ -3377,15 +3503,100 @@ + return err; + } + +- dimux->items[dimux->num_items].label = +- stac92xx_dmic_labels[dimux->num_items]; ++ dimux->items[dimux->num_items].label = label; + dimux->items[dimux->num_items].index = index; + dimux->num_items++; ++ ++ imux->items[imux->num_items].label = label; ++ imux->items[imux->num_items].index = index; ++ imux->num_items++; + } + + return 0; + } + ++static int check_mic_pin(struct hda_codec *codec, hda_nid_t nid, ++ hda_nid_t *fixed, hda_nid_t *ext) ++{ ++ unsigned int cfg; ++ ++ if (!nid) ++ return 0; ++ cfg = snd_hda_codec_get_pincfg(codec, nid); ++ switch (get_defcfg_connect(cfg)) { ++ case AC_JACK_PORT_FIXED: ++ if (*fixed) ++ return 1; /* already occupied */ ++ *fixed = nid; ++ break; ++ case AC_JACK_PORT_COMPLEX: ++ if (*ext) ++ return 1; /* already occupied */ ++ *ext = nid; ++ break; ++ } ++ return 0; ++} ++ ++static int set_mic_route(struct hda_codec *codec, ++ struct sigmatel_mic_route *mic, ++ hda_nid_t pin) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ struct auto_pin_cfg *cfg = &spec->autocfg; ++ int i; ++ ++ mic->pin = pin; ++ for (i = AUTO_PIN_MIC; i <= AUTO_PIN_FRONT_MIC; i++) ++ if (pin == cfg->input_pins[i]) ++ break; ++ if (i <= AUTO_PIN_FRONT_MIC) { ++ /* analog pin */ ++ mic->dmux_idx = 0; ++ i = get_connection_index(codec, spec->mux_nids[0], pin); ++ if (i < 0) ++ return -1; ++ mic->mux_idx = i; ++ } else if (spec->dmux_nids) { ++ /* digital pin */ ++ mic->mux_idx = 0; ++ i = get_connection_index(codec, spec->dmux_nids[0], pin); ++ if (i < 0) ++ return -1; ++ mic->dmux_idx = i; ++ } ++ return 0; ++} ++ ++/* return non-zero if the device is for automatic mic switch */ ++static int stac_check_auto_mic(struct hda_codec *codec) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ struct auto_pin_cfg *cfg = &spec->autocfg; ++ hda_nid_t fixed, ext; ++ int i; ++ ++ for (i = AUTO_PIN_LINE; i < AUTO_PIN_LAST; i++) { ++ if (cfg->input_pins[i]) ++ return 0; /* must be exclusively mics */ ++ } ++ fixed = ext = 0; ++ for (i = AUTO_PIN_MIC; i <= AUTO_PIN_FRONT_MIC; i++) ++ if (check_mic_pin(codec, cfg->input_pins[i], &fixed, &ext)) ++ return 0; ++ for (i = 0; i < spec->num_dmics; i++) ++ if (check_mic_pin(codec, spec->dmic_nids[i], &fixed, &ext)) ++ return 0; ++ if (!fixed || !ext) ++ return 0; ++ if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) ++ return 0; /* no unsol support */ ++ if (set_mic_route(codec, &spec->ext_mic, ext) || ++ set_mic_route(codec, &spec->int_mic, fixed)) ++ return 0; /* something is wrong */ ++ return 1; ++} ++ + /* create playback/capture controls for input pins */ + static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const struct auto_pin_cfg *cfg) + { +@@ -3418,6 +3629,7 @@ + imux->items[imux->num_items].index = index; + imux->num_items++; + } ++ spec->num_analog_muxes = imux->num_items; + + if (imux->num_items) { + /* +@@ -3469,7 +3681,7 @@ + { + struct sigmatel_spec *spec = codec->spec; + int hp_swap = 0; +- int err; ++ int i, err; + + if ((err = snd_hda_parse_pin_def_config(codec, + &spec->autocfg, +@@ -3509,11 +3721,10 @@ + if (snd_hda_get_connections(codec, + spec->autocfg.mono_out_pin, conn_list, 1) && + snd_hda_get_connections(codec, conn_list[0], +- conn_list, 1)) { ++ conn_list, 1) > 0) { + + int wcaps = get_wcaps(codec, conn_list[0]); +- int wid_type = (wcaps & AC_WCAP_TYPE) +- >> AC_WCAP_TYPE_SHIFT; ++ int wid_type = get_wcaps_type(wcaps); + /* LR swap check, some stac925x have a mux that + * changes the DACs output path instead of the + * mono-mux path. +@@ -3578,6 +3789,8 @@ + err = snd_hda_attach_beep_device(codec, nid); + if (err < 0) + return err; ++ /* IDT/STAC codecs have linear beep tone parameter */ ++ /*codec->beep->linear_tone = 1;*/ + /* if no beep switch is available, make its own one */ + caps = query_amp_caps(codec, nid, HDA_OUTPUT); + if (codec->beep && +@@ -3602,6 +3815,21 @@ + spec->autocfg.line_outs = 0; + } + ++ if (stac_check_auto_mic(codec)) { ++ spec->auto_mic = 1; ++ /* only one capture for auto-mic */ ++ spec->num_adcs = 1; ++ spec->num_caps = 1; ++ spec->num_muxes = 1; ++ } ++ ++ for (i = 0; i < spec->num_caps; i++) { ++ err = stac92xx_add_capvol_ctls(codec, spec->capvols[i], ++ spec->capsws[i], i); ++ if (err < 0) ++ return err; ++ } ++ + err = stac92xx_auto_create_analog_input_ctls(codec, &spec->autocfg); + if (err < 0) + return err; +@@ -3631,6 +3859,10 @@ + return err; + } + ++ err = stac92xx_add_input_source(spec); ++ if (err < 0) ++ return err; ++ + spec->multiout.max_channels = spec->multiout.num_dacs * 2; + if (spec->multiout.max_channels > 2) + spec->surr_switch = 1; +@@ -3640,8 +3872,8 @@ + if (dig_in && spec->autocfg.dig_in_pin) + spec->dig_in_nid = dig_in; + +- if (spec->kctl_alloc) +- spec->mixers[spec->num_mixers++] = spec->kctl_alloc; ++ if (spec->kctls.list) ++ spec->mixers[spec->num_mixers++] = spec->kctls.list; + + spec->input_mux = &spec->private_imux; + if (!spec->dinput_mux) +@@ -3698,9 +3930,7 @@ + for (i = 0; i < spec->autocfg.line_outs && lfe_pin == 0x0; i++) { + hda_nid_t pin = spec->autocfg.line_out_pins[i]; + unsigned int defcfg; +- defcfg = snd_hda_codec_read(codec, pin, 0, +- AC_VERB_GET_CONFIG_DEFAULT, +- 0x00); ++ defcfg = snd_hda_codec_get_pincfg(codec, pin); + if (get_defcfg_device(defcfg) == AC_JACK_SPEAKER) { + unsigned int wcaps = get_wcaps(codec, pin); + wcaps &= (AC_WCAP_STEREO | AC_WCAP_OUT_AMP); +@@ -3744,13 +3974,17 @@ + return err; + } + ++ err = stac92xx_add_input_source(spec); ++ if (err < 0) ++ return err; ++ + if (spec->autocfg.dig_out_pin) + spec->multiout.dig_out_nid = 0x05; + if (spec->autocfg.dig_in_pin) + spec->dig_in_nid = 0x04; + +- if (spec->kctl_alloc) +- spec->mixers[spec->num_mixers++] = spec->kctl_alloc; ++ if (spec->kctls.list) ++ spec->mixers[spec->num_mixers++] = spec->kctls.list; + + spec->input_mux = &spec->private_imux; + spec->dinput_mux = &spec->private_dimux; +@@ -3799,26 +4033,27 @@ + { + struct sigmatel_event *event; + +- if (spec->num_events >= ARRAY_SIZE(spec->events)) ++ snd_array_init(&spec->events, sizeof(*event), 32); ++ event = snd_array_new(&spec->events); ++ if (!event) + return -ENOMEM; +- event = &spec->events[spec->num_events++]; + event->nid = nid; + event->type = type; +- event->tag = spec->num_events; ++ event->tag = spec->events.used; + event->data = data; + + return event->tag; + } + + static struct sigmatel_event *stac_get_event(struct hda_codec *codec, +- hda_nid_t nid, unsigned char type) ++ hda_nid_t nid) + { + struct sigmatel_spec *spec = codec->spec; +- struct sigmatel_event *event = spec->events; ++ struct sigmatel_event *event = spec->events.list; + int i; + +- for (i = 0; i < spec->num_events; i++, event++) { +- if (event->nid == nid && event->type == type) ++ for (i = 0; i < spec->events.used; i++, event++) { ++ if (event->nid == nid) + return event; + } + return NULL; +@@ -3828,34 +4063,42 @@ + unsigned char tag) + { + struct sigmatel_spec *spec = codec->spec; +- struct sigmatel_event *event = spec->events; ++ struct sigmatel_event *event = spec->events.list; + int i; + +- for (i = 0; i < spec->num_events; i++, event++) { ++ for (i = 0; i < spec->events.used; i++, event++) { + if (event->tag == tag) + return event; + } + return NULL; + } + +-static void enable_pin_detect(struct hda_codec *codec, hda_nid_t nid, +- unsigned int type) ++/* check if given nid is a valid pin and no other events are assigned ++ * to it. If OK, assign the event, set the unsol flag, and returns 1. ++ * Otherwise, returns zero. ++ */ ++static int enable_pin_detect(struct hda_codec *codec, hda_nid_t nid, ++ unsigned int type) + { + struct sigmatel_event *event; + int tag; + + if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP)) +- return; +- event = stac_get_event(codec, nid, type); +- if (event) ++ return 0; ++ event = stac_get_event(codec, nid); ++ if (event) { ++ if (event->type != type) ++ return 0; + tag = event->tag; +- else ++ } else { + tag = stac_add_event(codec->spec, nid, type, 0); +- if (tag < 0) +- return; ++ if (tag < 0) ++ return 0; ++ } + snd_hda_codec_write_cache(codec, nid, 0, + AC_VERB_SET_UNSOLICITED_ENABLE, + AC_USRSP_EN | tag); ++ return 1; + } + + static int is_nid_hp_pin(struct auto_pin_cfg *cfg, hda_nid_t nid) +@@ -3915,46 +4158,64 @@ + hda_nid_t nid = cfg->hp_pins[i]; + enable_pin_detect(codec, nid, STAC_HP_EVENT); + } ++ if (cfg->line_out_type == AUTO_PIN_LINE_OUT) { ++ /* enable pin-detect for line-outs as well */ ++ for (i = 0; i < cfg->line_outs; i++) { ++ hda_nid_t nid = cfg->line_out_pins[i]; ++ enable_pin_detect(codec, nid, STAC_LO_EVENT); ++ } ++ } ++ + /* force to enable the first line-out; the others are set up + * in unsol_event + */ + stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0], +- AC_PINCTL_OUT_EN); ++ AC_PINCTL_OUT_EN); + /* fake event to set up pins */ +- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0], +- STAC_HP_EVENT); ++ stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]); + } else { + stac92xx_auto_init_multi_out(codec); + stac92xx_auto_init_hp_out(codec); + for (i = 0; i < cfg->hp_outs; i++) + stac_toggle_power_map(codec, cfg->hp_pins[i], 1); + } ++ if (spec->auto_mic) { ++ /* initialize connection to analog input */ ++ if (spec->dmux_nids) ++ snd_hda_codec_write_cache(codec, spec->dmux_nids[0], 0, ++ AC_VERB_SET_CONNECT_SEL, 0); ++ if (enable_pin_detect(codec, spec->ext_mic.pin, STAC_MIC_EVENT)) ++ stac_issue_unsol_event(codec, spec->ext_mic.pin); ++ } + for (i = 0; i < AUTO_PIN_LAST; i++) { + hda_nid_t nid = cfg->input_pins[i]; + if (nid) { + unsigned int pinctl, conf; + if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) { + /* for mic pins, force to initialize */ +- pinctl = stac92xx_get_vref(codec, nid); ++ pinctl = stac92xx_get_default_vref(codec, nid); + pinctl |= AC_PINCTL_IN_EN; + stac92xx_auto_set_pinctl(codec, nid, pinctl); + } else { + pinctl = snd_hda_codec_read(codec, nid, 0, + AC_VERB_GET_PIN_WIDGET_CONTROL, 0); + /* if PINCTL already set then skip */ +- if (!(pinctl & AC_PINCTL_IN_EN)) { ++ /* Also, if both INPUT and OUTPUT are set, ++ * it must be a BIOS bug; need to override, too ++ */ ++ if (!(pinctl & AC_PINCTL_IN_EN) || ++ (pinctl & AC_PINCTL_OUT_EN)) { ++ pinctl &= ~AC_PINCTL_OUT_EN; + pinctl |= AC_PINCTL_IN_EN; + stac92xx_auto_set_pinctl(codec, nid, + pinctl); + } + } +- conf = snd_hda_codec_read(codec, nid, 0, +- AC_VERB_GET_CONFIG_DEFAULT, 0); ++ conf = snd_hda_codec_get_pincfg(codec, nid); + if (get_defcfg_connect(conf) != AC_JACK_PORT_FIXED) { +- enable_pin_detect(codec, nid, +- STAC_INSERT_EVENT); +- stac_issue_unsol_event(codec, nid, +- STAC_INSERT_EVENT); ++ if (enable_pin_detect(codec, nid, ++ STAC_INSERT_EVENT)) ++ stac_issue_unsol_event(codec, nid); + } + } + } +@@ -3990,8 +4251,7 @@ + stac_toggle_power_map(codec, nid, 1); + continue; + } +- def_conf = snd_hda_codec_read(codec, nid, 0, +- AC_VERB_GET_CONFIG_DEFAULT, 0); ++ def_conf = snd_hda_codec_get_pincfg(codec, nid); + def_conf = get_defcfg_connect(def_conf); + /* skip any ports that don't have jacks since presence + * detection is useless */ +@@ -4000,32 +4260,35 @@ + stac_toggle_power_map(codec, nid, 1); + continue; + } +- if (!stac_get_event(codec, nid, STAC_INSERT_EVENT)) { +- enable_pin_detect(codec, nid, STAC_PWR_EVENT); +- stac_issue_unsol_event(codec, nid, STAC_PWR_EVENT); +- } ++ if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) ++ stac_issue_unsol_event(codec, nid); + } + if (spec->dac_list) + stac92xx_power_down(codec); + return 0; + } + ++static void stac92xx_free_kctls(struct hda_codec *codec) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ ++ if (spec->kctls.list) { ++ struct snd_kcontrol_new *kctl = spec->kctls.list; ++ int i; ++ for (i = 0; i < spec->kctls.used; i++) ++ kfree(kctl[i].name); ++ } ++ snd_array_free(&spec->kctls); ++} ++ + static void stac92xx_free(struct hda_codec *codec) + { + struct sigmatel_spec *spec = codec->spec; +- int i; + + if (! spec) + return; + +- if (spec->kctl_alloc) { +- for (i = 0; i < spec->num_kctl_used; i++) +- kfree(spec->kctl_alloc[i].name); +- kfree(spec->kctl_alloc); +- } +- +- if (spec->bios_pin_configs) +- kfree(spec->bios_pin_configs); ++ snd_array_free(&spec->events); + + kfree(spec); + snd_hda_detach_beep_device(codec); +@@ -4034,7 +4297,9 @@ + static void stac92xx_set_pinctl(struct hda_codec *codec, hda_nid_t nid, + unsigned int flag) + { +- unsigned int pin_ctl = snd_hda_codec_read(codec, nid, ++ unsigned int old_ctl, pin_ctl; ++ ++ pin_ctl = snd_hda_codec_read(codec, nid, + 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00); + + if (pin_ctl & AC_PINCTL_IN_EN) { +@@ -4048,14 +4313,17 @@ + return; + } + ++ old_ctl = pin_ctl; + /* if setting pin direction bits, clear the current + direction bits first */ + if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)) + pin_ctl &= ~(AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN); + +- snd_hda_codec_write_cache(codec, nid, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, +- pin_ctl | flag); ++ pin_ctl |= flag; ++ if (old_ctl != pin_ctl) ++ snd_hda_codec_write_cache(codec, nid, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, ++ pin_ctl); + } + + static void stac92xx_reset_pinctl(struct hda_codec *codec, hda_nid_t nid, +@@ -4063,9 +4331,10 @@ + { + unsigned int pin_ctl = snd_hda_codec_read(codec, nid, + 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00); +- snd_hda_codec_write_cache(codec, nid, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, +- pin_ctl & ~flag); ++ if (pin_ctl & flag) ++ snd_hda_codec_write_cache(codec, nid, 0, ++ AC_VERB_SET_PIN_WIDGET_CONTROL, ++ pin_ctl & ~flag); + } + + static int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) +@@ -4078,6 +4347,48 @@ + return 0; + } + ++static void stac92xx_line_out_detect(struct hda_codec *codec, ++ int presence) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ struct auto_pin_cfg *cfg = &spec->autocfg; ++ int i; ++ ++ for (i = 0; i < cfg->line_outs; i++) { ++ if (presence) ++ break; ++ presence = get_pin_presence(codec, cfg->line_out_pins[i]); ++ if (presence) { ++ unsigned int pinctl; ++ pinctl = snd_hda_codec_read(codec, ++ cfg->line_out_pins[i], 0, ++ AC_VERB_GET_PIN_WIDGET_CONTROL, 0); ++ if (pinctl & AC_PINCTL_IN_EN) ++ presence = 0; /* mic- or line-input */ ++ } ++ } ++ ++ if (presence) { ++ /* disable speakers */ ++ for (i = 0; i < cfg->speaker_outs; i++) ++ stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], ++ AC_PINCTL_OUT_EN); ++ if (spec->eapd_mask && spec->eapd_switch) ++ stac_gpio_set(codec, spec->gpio_mask, ++ spec->gpio_dir, spec->gpio_data & ++ ~spec->eapd_mask); ++ } else { ++ /* enable speakers */ ++ for (i = 0; i < cfg->speaker_outs; i++) ++ stac92xx_set_pinctl(codec, cfg->speaker_pins[i], ++ AC_PINCTL_OUT_EN); ++ if (spec->eapd_mask && spec->eapd_switch) ++ stac_gpio_set(codec, spec->gpio_mask, ++ spec->gpio_dir, spec->gpio_data | ++ spec->eapd_mask); ++ } ++} ++ + /* return non-zero if the hp-pin of the given array index isn't + * a jack-detection target + */ +@@ -4130,13 +4441,6 @@ + for (i = 0; i < cfg->line_outs; i++) + stac92xx_reset_pinctl(codec, cfg->line_out_pins[i], + AC_PINCTL_OUT_EN); +- for (i = 0; i < cfg->speaker_outs; i++) +- stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], +- AC_PINCTL_OUT_EN); +- if (spec->eapd_mask && spec->eapd_switch) +- stac_gpio_set(codec, spec->gpio_mask, +- spec->gpio_dir, spec->gpio_data & +- ~spec->eapd_mask); + } else { + /* enable lineouts */ + if (spec->hp_switch) +@@ -4145,14 +4449,8 @@ + for (i = 0; i < cfg->line_outs; i++) + stac92xx_set_pinctl(codec, cfg->line_out_pins[i], + AC_PINCTL_OUT_EN); +- for (i = 0; i < cfg->speaker_outs; i++) +- stac92xx_set_pinctl(codec, cfg->speaker_pins[i], +- AC_PINCTL_OUT_EN); +- if (spec->eapd_mask && spec->eapd_switch) +- stac_gpio_set(codec, spec->gpio_mask, +- spec->gpio_dir, spec->gpio_data | +- spec->eapd_mask); + } ++ stac92xx_line_out_detect(codec, presence); + /* toggle hp outs */ + for (i = 0; i < cfg->hp_outs; i++) { + unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN; +@@ -4210,10 +4508,28 @@ + stac_toggle_power_map(codec, nid, get_pin_presence(codec, nid)); + } + +-static void stac_issue_unsol_event(struct hda_codec *codec, hda_nid_t nid, +- unsigned char type) ++static void stac92xx_mic_detect(struct hda_codec *codec) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ struct sigmatel_mic_route *mic; ++ ++ if (get_pin_presence(codec, spec->ext_mic.pin)) ++ mic = &spec->ext_mic; ++ else ++ mic = &spec->int_mic; ++ if (mic->dmux_idx) ++ snd_hda_codec_write_cache(codec, spec->dmux_nids[0], 0, ++ AC_VERB_SET_CONNECT_SEL, ++ mic->dmux_idx); ++ else ++ snd_hda_codec_write_cache(codec, spec->mux_nids[0], 0, ++ AC_VERB_SET_CONNECT_SEL, ++ mic->mux_idx); ++} ++ ++static void stac_issue_unsol_event(struct hda_codec *codec, hda_nid_t nid) + { +- struct sigmatel_event *event = stac_get_event(codec, nid, type); ++ struct sigmatel_event *event = stac_get_event(codec, nid); + if (!event) + return; + codec->patch_ops.unsol_event(codec, (unsigned)event->tag << 26); +@@ -4232,12 +4548,40 @@ + + switch (event->type) { + case STAC_HP_EVENT: ++ case STAC_LO_EVENT: + stac92xx_hp_detect(codec); +- /* fallthru */ ++ break; ++ case STAC_MIC_EVENT: ++ stac92xx_mic_detect(codec); ++ break; ++ } ++ ++ switch (event->type) { ++ case STAC_HP_EVENT: ++ case STAC_LO_EVENT: ++ case STAC_MIC_EVENT: + case STAC_INSERT_EVENT: + case STAC_PWR_EVENT: + if (spec->num_pwrs > 0) + stac92xx_pin_sense(codec, event->nid); ++ ++ switch (codec->subsystem_id) { ++ case 0x103c308f: ++ if (event->nid == 0xb) { ++ int pin = AC_PINCTL_IN_EN; ++ ++ if (get_pin_presence(codec, 0xa) ++ && get_pin_presence(codec, 0xb)) ++ pin |= AC_PINCTL_VREF_80; ++ if (!get_pin_presence(codec, 0xb)) ++ pin |= AC_PINCTL_VREF_80; ++ ++ /* toggle VREF state based on mic + hp pin ++ * status ++ */ ++ stac92xx_auto_set_pinctl(codec, 0x0a, pin); ++ } ++ } + break; + case STAC_VREF_EVENT: + data = snd_hda_codec_read(codec, codec->afg, 0, +@@ -4254,17 +4598,48 @@ + { + struct sigmatel_spec *spec = codec->spec; + +- stac92xx_set_config_regs(codec); + stac92xx_init(codec); + snd_hda_codec_resume_amp(codec); + snd_hda_codec_resume_cache(codec); + /* fake event to set up pins again to override cached values */ + if (spec->hp_detect) +- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0], +- STAC_HP_EVENT); ++ stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]); + return 0; + } + ++/* ++ * using power check for controlling mute led of HP notebooks ++ * check for mute state only on Speakers (nid = 0x10) ++ * ++ * For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise ++ * the LED is NOT working properly ! ++ * ++ * Changed name to reflect that it now works for any designated ++ * model, not just HP HDX. ++ */ ++ ++#ifdef CONFIG_SND_HDA_POWER_SAVE ++static int stac92xx_hp_check_power_status(struct hda_codec *codec, ++ hda_nid_t nid) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ ++ if (nid == 0x10) { ++ if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & ++ HDA_AMP_MUTE) ++ spec->gpio_data &= ~spec->gpio_led; /* orange */ ++ else ++ spec->gpio_data |= spec->gpio_led; /* white */ ++ ++ stac_gpio_set(codec, spec->gpio_mask, ++ spec->gpio_dir, ++ spec->gpio_data); ++ } ++ ++ return 0; ++} ++#endif ++ + static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) + { + struct sigmatel_spec *spec = codec->spec; +@@ -4275,8 +4650,7 @@ + nid = codec->start_nid; + for (i = 0; i < codec->num_nodes; i++, nid++) { + unsigned int wcaps = get_wcaps(codec, nid); +- unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >> +- AC_WCAP_TYPE_SHIFT; ++ unsigned int wid_type = get_wcaps_type(wcaps); + if (wid_type == AC_WID_PIN) + snd_hda_codec_read(codec, nid, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0); +@@ -4435,6 +4809,9 @@ + + spec->init = stac925x_core_init; + spec->mixer = stac925x_mixer; ++ spec->num_caps = 1; ++ spec->capvols = stac925x_capvols; ++ spec->capsws = stac925x_capsws; + + err = stac92xx_parse_auto_config(codec, 0x8, 0x7); + if (!err) { +@@ -4456,16 +4833,6 @@ + return 0; + } + +-static struct hda_input_mux stac92hd73xx_dmux = { +- .num_items = 4, +- .items = { +- { "Analog Inputs", 0x0b }, +- { "Digital Mic 1", 0x09 }, +- { "Digital Mic 2", 0x0a }, +- { "CD", 0x08 }, +- } +-}; +- + static int patch_stac92hd73xx(struct hda_codec *codec) + { + struct sigmatel_spec *spec; +@@ -4520,12 +4887,10 @@ + case 0x5: /* 10 Channel */ + spec->mixer = stac92hd73xx_10ch_mixer; + spec->init = stac92hd73xx_10ch_core_init; ++ break; + } + spec->multiout.dac_nids = spec->dac_nids; + +- spec->aloopback_mask = 0x01; +- spec->aloopback_shift = 8; +- + spec->digbeep_nid = 0x1c; + spec->mux_nids = stac92hd73xx_mux_nids; + spec->adc_nids = stac92hd73xx_adc_nids; +@@ -4538,8 +4903,10 @@ + spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids); + spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids); + spec->num_dmuxes = ARRAY_SIZE(stac92hd73xx_dmux_nids); +- memcpy(&spec->private_dimux, &stac92hd73xx_dmux, +- sizeof(stac92hd73xx_dmux)); ++ ++ spec->num_caps = STAC92HD73XX_NUM_CAPS; ++ spec->capvols = stac92hd73xx_capvols; ++ spec->capsws = stac92hd73xx_capsws; + + switch (spec->board_config) { + case STAC_DELL_EQ: +@@ -4558,20 +4925,17 @@ + spec->init = dell_m6_core_init; + switch (spec->board_config) { + case STAC_DELL_M6_AMIC: /* Analog Mics */ +- stac92xx_set_config_reg(codec, 0x0b, 0x90A70170); ++ snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); + spec->num_dmics = 0; +- spec->private_dimux.num_items = 1; + break; + case STAC_DELL_M6_DMIC: /* Digital Mics */ +- stac92xx_set_config_reg(codec, 0x13, 0x90A60160); ++ snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); + spec->num_dmics = 1; +- spec->private_dimux.num_items = 2; + break; + case STAC_DELL_M6_BOTH: /* Both */ +- stac92xx_set_config_reg(codec, 0x0b, 0x90A70170); +- stac92xx_set_config_reg(codec, 0x13, 0x90A60160); ++ snd_hda_codec_set_pincfg(codec, 0x0b, 0x90A70170); ++ snd_hda_codec_set_pincfg(codec, 0x13, 0x90A60160); + spec->num_dmics = 1; +- spec->private_dimux.num_items = 2; + break; + } + break; +@@ -4579,13 +4943,13 @@ + spec->num_dmics = STAC92HD73XX_NUM_DMICS; + spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); + spec->eapd_switch = 1; ++ break; + } + if (spec->board_config > STAC_92HD73XX_REF) { + /* GPIO0 High = Enable EAPD */ + spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1; + spec->gpio_data = 0x01; + } +- spec->dinput_mux = &spec->private_dimux; + + spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids); + spec->pwr_nids = stac92hd73xx_pwr_nids; +@@ -4615,21 +4979,13 @@ + return 0; + } + +-static struct hda_input_mux stac92hd83xxx_dmux = { +- .num_items = 3, +- .items = { +- { "Analog Inputs", 0x03 }, +- { "Digital Mic 1", 0x04 }, +- { "Digital Mic 2", 0x05 }, +- } +-}; +- + static int patch_stac92hd83xxx(struct hda_codec *codec) + { + struct sigmatel_spec *spec; + hda_nid_t conn[STAC92HD83_DAC_COUNT + 1]; + int err; + int num_dacs; ++ hda_nid_t nid; + + spec = kzalloc(sizeof(*spec), GFP_KERNEL); + if (spec == NULL) +@@ -4648,14 +5004,6 @@ + spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); + spec->multiout.dac_nids = spec->dac_nids; + +- /* set port 0xe to select the last DAC +- */ +- num_dacs = snd_hda_get_connections(codec, 0x0e, +- conn, STAC92HD83_DAC_COUNT + 1) - 1; +- +- snd_hda_codec_write_cache(codec, 0xe, 0, +- AC_VERB_SET_CONNECT_SEL, num_dacs); +- + spec->init = stac92hd83xxx_core_init; + spec->mixer = stac92hd83xxx_mixer; + spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); +@@ -4663,8 +5011,11 @@ + spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids); + spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids); + spec->num_dmics = STAC92HD83XXX_NUM_DMICS; +- spec->dinput_mux = &stac92hd83xxx_dmux; + spec->pin_nids = stac92hd83xxx_pin_nids; ++ spec->num_caps = STAC92HD83XXX_NUM_CAPS; ++ spec->capvols = stac92hd83xxx_capvols; ++ spec->capsws = stac92hd83xxx_capsws; ++ + spec->board_config = snd_hda_check_board_config(codec, + STAC_92HD83XXX_MODELS, + stac92hd83xxx_models, +@@ -4687,6 +5038,7 @@ + switch (codec->vendor_id) { + case 0x111d7604: + case 0x111d7605: ++ case 0x111d76d5: + if (spec->board_config == STAC_92HD83XXX_PWR_REF) + break; + spec->num_pwrs = 0; +@@ -4709,24 +5061,89 @@ + return err; + } + ++ switch (spec->board_config) { ++ case STAC_DELL_S14: ++ nid = 0xf; ++ break; ++ default: ++ nid = 0xe; ++ break; ++ } ++ ++ num_dacs = snd_hda_get_connections(codec, nid, ++ conn, STAC92HD83_DAC_COUNT + 1) - 1; ++ if (num_dacs < 0) ++ num_dacs = STAC92HD83_DAC_COUNT; ++ ++ /* set port X to select the last DAC ++ */ ++ snd_hda_codec_write_cache(codec, nid, 0, ++ AC_VERB_SET_CONNECT_SEL, num_dacs); ++ + codec->patch_ops = stac92xx_patch_ops; + + return 0; + } + +-static struct hda_input_mux stac92hd71bxx_dmux = { +- .num_items = 4, +- .items = { +- { "Analog Inputs", 0x00 }, +- { "Mixer", 0x01 }, +- { "Digital Mic 1", 0x02 }, +- { "Digital Mic 2", 0x03 }, ++/* get the pin connection (fixed, none, etc) */ ++static unsigned int stac_get_defcfg_connect(struct hda_codec *codec, int idx) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ unsigned int cfg; ++ ++ cfg = snd_hda_codec_get_pincfg(codec, spec->pin_nids[idx]); ++ return get_defcfg_connect(cfg); ++} ++ ++static int stac92hd71bxx_connected_ports(struct hda_codec *codec, ++ hda_nid_t *nids, int num_nids) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ int idx, num; ++ unsigned int def_conf; ++ ++ for (num = 0; num < num_nids; num++) { ++ for (idx = 0; idx < spec->num_pins; idx++) ++ if (spec->pin_nids[idx] == nids[num]) ++ break; ++ if (idx >= spec->num_pins) ++ break; ++ def_conf = stac_get_defcfg_connect(codec, idx); ++ if (def_conf == AC_JACK_PORT_NONE) ++ break; + } +-}; ++ return num; ++} ++ ++static int stac92hd71bxx_connected_smuxes(struct hda_codec *codec, ++ hda_nid_t dig0pin) ++{ ++ struct sigmatel_spec *spec = codec->spec; ++ int idx; ++ ++ for (idx = 0; idx < spec->num_pins; idx++) ++ if (spec->pin_nids[idx] == dig0pin) ++ break; ++ if ((idx + 2) >= spec->num_pins) ++ return 0; ++ ++ /* dig1pin case */ ++ if (stac_get_defcfg_connect(codec, idx + 1) != AC_JACK_PORT_NONE) ++ return 2; ++ ++ /* dig0pin + dig2pin case */ ++ if (stac_get_defcfg_connect(codec, idx + 2) != AC_JACK_PORT_NONE) ++ return 2; ++ if (stac_get_defcfg_connect(codec, idx) != AC_JACK_PORT_NONE) ++ return 1; ++ else ++ return 0; ++} + + static int patch_stac92hd71bxx(struct hda_codec *codec) + { + struct sigmatel_spec *spec; ++ struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; + int err = 0; + + spec = kzalloc(sizeof(*spec), GFP_KERNEL); +@@ -4735,11 +5152,21 @@ + + codec->spec = spec; + codec->patch_ops = stac92xx_patch_ops; +- spec->num_pins = ARRAY_SIZE(stac92hd71bxx_pin_nids); ++ spec->num_pins = STAC92HD71BXX_NUM_PINS; ++ switch (codec->vendor_id) { ++ case 0x111d76b6: ++ case 0x111d76b7: ++ spec->pin_nids = stac92hd71bxx_pin_nids_4port; ++ break; ++ case 0x111d7603: ++ case 0x111d7608: ++ /* On 92HD75Bx 0x27 isn't a pin nid */ ++ spec->num_pins--; ++ /* fallthrough */ ++ default: ++ spec->pin_nids = stac92hd71bxx_pin_nids_6port; ++ } + spec->num_pwrs = ARRAY_SIZE(stac92hd71bxx_pwr_nids); +- spec->pin_nids = stac92hd71bxx_pin_nids; +- memcpy(&spec->private_dimux, &stac92hd71bxx_dmux, +- sizeof(stac92hd71bxx_dmux)); + spec->board_config = snd_hda_check_board_config(codec, + STAC_92HD71BXX_MODELS, + stac92hd71bxx_models, +@@ -4766,14 +5193,25 @@ + spec->gpio_data = 0x01; + } + ++ spec->dmic_nids = stac92hd71bxx_dmic_nids; ++ spec->dmux_nids = stac92hd71bxx_dmux_nids; ++ ++ spec->num_caps = STAC92HD71BXX_NUM_CAPS; ++ spec->capvols = stac92hd71bxx_capvols; ++ spec->capsws = stac92hd71bxx_capsws; ++ + switch (codec->vendor_id) { + case 0x111d76b6: /* 4 Port without Analog Mixer */ + case 0x111d76b7: ++ unmute_init++; ++ /* fallthru */ + case 0x111d76b4: /* 6 Port without Analog Mixer */ + case 0x111d76b5: +- spec->mixer = stac92hd71bxx_mixer; + spec->init = stac92hd71bxx_core_init; + codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; ++ spec->num_dmics = stac92hd71bxx_connected_ports(codec, ++ stac92hd71bxx_dmic_nids, ++ STAC92HD71BXX_NUM_DMICS); + break; + case 0x111d7608: /* 5 Port with Analog Mixer */ + switch (spec->board_config) { +@@ -4797,12 +5235,15 @@ + + /* no output amps */ + spec->num_pwrs = 0; +- spec->mixer = stac92hd71bxx_analog_mixer; +- spec->dinput_mux = &spec->private_dimux; +- + /* disable VSW */ +- spec->init = &stac92hd71bxx_analog_core_init[HD_DISABLE_PORTF]; +- stac92xx_set_config_reg(codec, 0xf, 0x40f000f0); ++ spec->init = stac92hd71bxx_core_init; ++ unmute_init++; ++ snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); ++ snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); ++ stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS - 1] = 0; ++ spec->num_dmics = stac92hd71bxx_connected_ports(codec, ++ stac92hd71bxx_dmic_nids, ++ STAC92HD71BXX_NUM_DMICS - 1); + break; + case 0x111d7603: /* 6 Port with Analog Mixer */ + if ((codec->revision_id & 0xf) == 1) +@@ -4812,12 +5253,17 @@ + spec->num_pwrs = 0; + /* fallthru */ + default: +- spec->dinput_mux = &spec->private_dimux; +- spec->mixer = stac92hd71bxx_analog_mixer; +- spec->init = stac92hd71bxx_analog_core_init; ++ spec->init = stac92hd71bxx_core_init; + codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; ++ spec->num_dmics = stac92hd71bxx_connected_ports(codec, ++ stac92hd71bxx_dmic_nids, ++ STAC92HD71BXX_NUM_DMICS); ++ break; + } + ++ if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) ++ snd_hda_sequence_write_cache(codec, unmute_init); ++ + /* Some HP machines seem to have unstable codec communications + * especially with ATI fglrx driver. For recovering from the + * CORB/RIRB stall, allow the BUS reset and keep always sync +@@ -4827,25 +5273,22 @@ + codec->bus->allow_bus_reset = 1; + } + +- spec->aloopback_mask = 0x50; +- spec->aloopback_shift = 0; +- + spec->powerdown_adcs = 1; + spec->digbeep_nid = 0x26; + spec->mux_nids = stac92hd71bxx_mux_nids; + spec->adc_nids = stac92hd71bxx_adc_nids; +- spec->dmic_nids = stac92hd71bxx_dmic_nids; +- spec->dmux_nids = stac92hd71bxx_dmux_nids; + spec->smux_nids = stac92hd71bxx_smux_nids; + spec->pwr_nids = stac92hd71bxx_pwr_nids; + + spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids); + spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids); ++ spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); ++ spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); + + switch (spec->board_config) { + case STAC_HP_M4: + /* enable internal microphone */ +- stac92xx_set_config_reg(codec, 0x0e, 0x01813040); ++ snd_hda_codec_set_pincfg(codec, 0x0e, 0x01813040); + stac92xx_auto_set_pinctl(codec, 0x0e, + AC_PINCTL_IN_EN | AC_PINCTL_VREF_80); + /* fallthru */ +@@ -4860,19 +5303,42 @@ + spec->num_smuxes = 0; + spec->num_dmuxes = 1; + break; +- default: +- spec->num_dmics = STAC92HD71BXX_NUM_DMICS; +- spec->num_smuxes = ARRAY_SIZE(stac92hd71bxx_smux_nids); +- spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); +- }; ++ case STAC_HP_DV4_1222NR: ++ spec->num_dmics = 1; ++ /* I don't know if it needs 1 or 2 smuxes - will wait for ++ * bug reports to fix if needed ++ */ ++ spec->num_smuxes = 1; ++ spec->num_dmuxes = 1; ++ spec->gpio_led = 0x01; ++ /* fallthrough */ ++ case STAC_HP_DV5: ++ snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); ++ stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN); ++ break; ++ case STAC_HP_HDX: ++ spec->num_dmics = 1; ++ spec->num_dmuxes = 1; ++ spec->num_smuxes = 1; ++ /* orange/white mute led on GPIO3, orange=0, white=1 */ ++ spec->gpio_led = 0x08; ++ break; ++ } ++ ++#ifdef CONFIG_SND_HDA_POWER_SAVE ++ if (spec->gpio_led) { ++ spec->gpio_mask |= spec->gpio_led; ++ spec->gpio_dir |= spec->gpio_led; ++ spec->gpio_data |= spec->gpio_led; ++ /* register check_power_status callback. */ ++ codec->patch_ops.check_power_status = ++ stac92xx_hp_check_power_status; ++ } ++#endif + + spec->multiout.dac_nids = spec->dac_nids; +- if (spec->dinput_mux) +- spec->private_dimux.num_items += +- spec->num_dmics - +- (ARRAY_SIZE(stac92hd71bxx_dmic_nids) - 1); + +- err = stac92xx_parse_auto_config(codec, 0x21, 0x23); ++ err = stac92xx_parse_auto_config(codec, 0x21, 0); + if (!err) { + if (spec->board_config < 0) { + printk(KERN_WARNING "hda_codec: No auto-config is " +@@ -4889,7 +5355,7 @@ + } + + return 0; +-}; ++} + + static int patch_stac922x(struct hda_codec *codec) + { +@@ -4967,7 +5433,10 @@ + spec->num_pwrs = 0; + + spec->init = stac922x_core_init; +- spec->mixer = stac922x_mixer; ++ ++ spec->num_caps = STAC922X_NUM_CAPS; ++ spec->capvols = stac922x_capvols; ++ spec->capsws = stac922x_capsws; + + spec->multiout.dac_nids = spec->dac_nids; + +@@ -5008,6 +5477,7 @@ + return -ENOMEM; + + codec->spec = spec; ++ codec->slave_dig_outs = stac927x_slave_dig_outs; + spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); + spec->pin_nids = stac927x_pin_nids; + spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, +@@ -5049,32 +5519,37 @@ + spec->num_dmics = 0; + + spec->init = d965_core_init; +- spec->mixer = stac927x_mixer; + break; + case STAC_DELL_BIOS: + switch (codec->subsystem_id) { + case 0x10280209: + case 0x1028022e: + /* correct the device field to SPDIF out */ +- stac92xx_set_config_reg(codec, 0x21, 0x01442070); ++ snd_hda_codec_set_pincfg(codec, 0x21, 0x01442070); + break; +- }; ++ } + /* configure the analog microphone on some laptops */ +- stac92xx_set_config_reg(codec, 0x0c, 0x90a79130); ++ snd_hda_codec_set_pincfg(codec, 0x0c, 0x90a79130); + /* correct the front output jack as a hp out */ +- stac92xx_set_config_reg(codec, 0x0f, 0x0227011f); ++ snd_hda_codec_set_pincfg(codec, 0x0f, 0x0227011f); + /* correct the front input jack as a mic */ +- stac92xx_set_config_reg(codec, 0x0e, 0x02a79130); ++ snd_hda_codec_set_pincfg(codec, 0x0e, 0x02a79130); + /* fallthru */ + case STAC_DELL_3ST: + /* GPIO2 High = Enable EAPD */ + spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; + spec->gpio_data = 0x04; ++ switch (codec->subsystem_id) { ++ case 0x1028022f: ++ /* correct EAPD to be GPIO0 */ ++ spec->eapd_mask = spec->gpio_mask = 0x01; ++ spec->gpio_dir = spec->gpio_data = 0x01; ++ break; ++ }; + spec->dmic_nids = stac927x_dmic_nids; + spec->num_dmics = STAC927X_NUM_DMICS; + + spec->init = d965_core_init; +- spec->mixer = stac927x_mixer; + spec->dmux_nids = stac927x_dmux_nids; + spec->num_dmuxes = ARRAY_SIZE(stac927x_dmux_nids); + break; +@@ -5087,12 +5562,13 @@ + spec->num_dmics = 0; + + spec->init = stac927x_core_init; +- spec->mixer = stac927x_mixer; + } + ++ spec->num_caps = STAC927X_NUM_CAPS; ++ spec->capvols = stac927x_capvols; ++ spec->capsws = stac927x_capsws; ++ + spec->num_pwrs = 0; +- spec->aloopback_mask = 0x40; +- spec->aloopback_shift = 0; + spec->eapd_switch = 1; + + err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); +@@ -5174,10 +5650,11 @@ + spec->num_pwrs = 0; + + spec->init = stac9205_core_init; +- spec->mixer = stac9205_mixer; + +- spec->aloopback_mask = 0x40; +- spec->aloopback_shift = 0; ++ spec->num_caps = STAC9205_NUM_CAPS; ++ spec->capvols = stac9205_capvols; ++ spec->capsws = stac9205_capsws; ++ + /* Turn on/off EAPD per HP plugging */ + if (spec->board_config != STAC_9205_EAPD) + spec->eapd_switch = 1; +@@ -5186,8 +5663,8 @@ + switch (spec->board_config){ + case STAC_9205_DELL_M43: + /* Enable SPDIF in/out */ +- stac92xx_set_config_reg(codec, 0x1f, 0x01441030); +- stac92xx_set_config_reg(codec, 0x20, 0x1c410030); ++ snd_hda_codec_set_pincfg(codec, 0x1f, 0x01441030); ++ snd_hda_codec_set_pincfg(codec, 0x20, 0x1c410030); + + /* Enable unsol response for GPIO4/Dock HP connection */ + err = stac_add_event(spec, codec->afg, STAC_VREF_EVENT, 0x01); +@@ -5521,6 +5998,7 @@ + { .id = 0x83847661, .name = "CXD9872RD/K", .patch = patch_stac9872 }, + { .id = 0x83847662, .name = "STAC9872AK", .patch = patch_stac9872 }, + { .id = 0x83847664, .name = "CXD9872AKD", .patch = patch_stac9872 }, ++ { .id = 0x83847698, .name = "STAC9205", .patch = patch_stac9205 }, + { .id = 0x838476a0, .name = "STAC9205", .patch = patch_stac9205 }, + { .id = 0x838476a1, .name = "STAC9205D", .patch = patch_stac9205 }, + { .id = 0x838476a2, .name = "STAC9204", .patch = patch_stac9205 }, +@@ -5532,6 +6010,7 @@ + { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, + { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, ++ { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, + { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, + { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx }, diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-lo-detect-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-lo-detect-fix new file mode 100644 index 000000000..d4d366999 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-stac-lo-detect-fix @@ -0,0 +1,30 @@ +From 1c4bdf9be010ae7c2324c0a90dd2296e0d1a775e Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 13 Aug 2009 08:23:24 +0200 +Subject: ALSA: hda - Enable line-out detection only with speakers +Patch-mainline: +References: bnc#520975 + +Enable line-out detection for IDT/STAC codecs only when speaker pins +exist. In some cases, the speaker itself is identified as line-out, +and this confuses the situation. Only the extra line-outs should do +auto-muting. + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_sigmatel.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -4158,7 +4158,8 @@ + hda_nid_t nid = cfg->hp_pins[i]; + enable_pin_detect(codec, nid, STAC_HP_EVENT); + } +- if (cfg->line_out_type == AUTO_PIN_LINE_OUT) { ++ if (cfg->line_out_type == AUTO_PIN_LINE_OUT && ++ cfg->speaker_outs > 0) { + /* enable pin-detect for line-outs as well */ + for (i = 0; i < cfg->line_outs; i++) { + hda_nid_t nid = cfg->line_out_pins[i]; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sync-verbs b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sync-verbs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hda-sync-verbs rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hda-sync-verbs diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix similarity index 95% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix index fdf3ef95a..96fe2ebf0 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix @@ -3,7 +3,7 @@ From: Takashi Iwai Date: Thu, 2 Jul 2009 16:10:23 +0200 Subject: ALSA: hda - Add GPIO1 control at muting with HP laptops Patch-mainline: -References: bnc#515266 +References: bnc#515266,bnc#522764 HP laptops with AD1984A codecs (at least mobile models) need to set GPIO1 appropriately to indicate the mute state. The BIOS checks this @@ -31,7 +31,7 @@ Signed-off-by: Takashi Iwai + int mute = (!ucontrol->value.integer.value[0] && + !ucontrol->value.integer.value[1]); + /* toggle GPIO1 according to the mute state */ -+ snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, ++ snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, + mute ? 0x02 : 0x0); + return ret; +} diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hp-dv6736-mic-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-dv6736-mic-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-hp-dv6736-mic-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-dv6736-mic-fix diff --git a/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-piaget-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-piaget-quirk new file mode 100644 index 000000000..8e58f1992 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-hp-piaget-quirk @@ -0,0 +1,22 @@ +From: Takashi Iwai +Subject: ALSA: Add quirk for new HP laptops +Patch-mainline: +References: bnc#527284 + +Signed-off-by: Takashi Iwai + +--- + sound/pci/hda/patch_sigmatel.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -1733,6 +1733,8 @@ + "HP mini 1000", STAC_HP_M4), + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b, + "HP HDX", STAC_HP_HDX), /* HDX16 */ ++ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, ++ "HP", STAC_HP_DV5), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, + "unknown Dell", STAC_DELL_M4_1), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234, diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-ideapad-44khz-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-ideapad-44khz-fix similarity index 94% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-ideapad-44khz-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-ideapad-44khz-fix index ae2412a5e..dea38d96d 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-ideapad-44khz-fix +++ b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-ideapad-44khz-fix @@ -16,7 +16,7 @@ Acked-by: Takashi Iwai --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c -@@ -12340,6 +12340,27 @@ static int alc269_auto_create_analog_inp +@@ -12339,6 +12339,27 @@ static int alc269_auto_create_analog_inp #define alc269_pcm_digital_playback alc880_pcm_digital_playback #define alc269_pcm_digital_capture alc880_pcm_digital_capture @@ -44,7 +44,7 @@ Acked-by: Takashi Iwai /* * BIOS auto configuration */ -@@ -12541,9 +12562,16 @@ static int patch_alc269(struct hda_codec +@@ -12540,9 +12561,16 @@ static int patch_alc269(struct hda_codec setup_preset(spec, &alc269_presets[board_config]); spec->stream_name_analog = "ALC269 Analog"; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-lenovo-x200-quirk b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-lenovo-x200-quirk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-lenovo-x200-quirk rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-lenovo-x200-quirk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-stac-hp-detect-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-stac-hp-detect-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-post-ga-stac-hp-detect-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-stac-hp-detect-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/alsa-powermac-ibook-g4-mic-fix b/src/patches/suse-2.6.27.31/patches.drivers/alsa-powermac-ibook-g4-mic-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/alsa-powermac-ibook-g4-mic-fix rename to src/patches/suse-2.6.27.31/patches.drivers/alsa-powermac-ibook-g4-mic-fix diff --git a/src/patches/suse-2.6.27.25/patches.drivers/atl1-add-device_set_wakeup_enable-to-atl1-_set_wol.patch b/src/patches/suse-2.6.27.31/patches.drivers/atl1-add-device_set_wakeup_enable-to-atl1-_set_wol.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/atl1-add-device_set_wakeup_enable-to-atl1-_set_wol.patch rename to src/patches/suse-2.6.27.31/patches.drivers/atl1-add-device_set_wakeup_enable-to-atl1-_set_wol.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/atl2-add-atl2-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/atl2-add-atl2-network-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/atl2-add-atl2-network-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/atl2-add-atl2-network-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-added-flush_disk b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-added-flush_disk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-added-flush_disk rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-added-flush_disk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-adjust-block-device-size b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-adjust-block-device-size similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-adjust-block-device-size rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-adjust-block-device-size diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-call-flush_disk b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-call-flush_disk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-call-flush_disk rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-call-flush_disk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-check-for-device-resize b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-check-for-device-resize similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-check-for-device-resize rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-check-for-device-resize diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-sd-driver-calls b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-sd-driver-calls similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-sd-driver-calls rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-sd-driver-calls diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-wrapper-for-revalidate_disk b/src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-wrapper-for-revalidate_disk similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-wrapper-for-revalidate_disk rename to src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-wrapper-for-revalidate_disk diff --git a/src/patches/suse-2.6.27.25/patches.drivers/blk-request-based-multipath-update b/src/patches/suse-2.6.27.31/patches.drivers/blk-request-based-multipath-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/blk-request-based-multipath-update rename to src/patches/suse-2.6.27.31/patches.drivers/blk-request-based-multipath-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-abort-queue b/src/patches/suse-2.6.27.31/patches.drivers/block-abort-queue similarity index 98% rename from src/patches/suse-2.6.27.25/patches.drivers/block-abort-queue rename to src/patches/suse-2.6.27.31/patches.drivers/block-abort-queue index 2fbd6221f..4da6fb497 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/block-abort-queue +++ b/src/patches/suse-2.6.27.31/patches.drivers/block-abort-queue @@ -48,7 +48,7 @@ Signed-off-by: Hannes Reinecke +EXPORT_SYMBOL_GPL(blk_abort_queue); --- a/block/elevator.c +++ b/block/elevator.c -@@ -914,6 +914,19 @@ int elv_may_queue(struct request_queue * +@@ -922,6 +922,19 @@ int elv_may_queue(struct request_queue * return ELV_MQUEUE_MAY; } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-abort-request-rq-complete-marking b/src/patches/suse-2.6.27.31/patches.drivers/block-abort-request-rq-complete-marking similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/block-abort-request-rq-complete-marking rename to src/patches/suse-2.6.27.31/patches.drivers/block-abort-request-rq-complete-marking diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-add-timeout-on-dequeue b/src/patches/suse-2.6.27.31/patches.drivers/block-add-timeout-on-dequeue similarity index 88% rename from src/patches/suse-2.6.27.25/patches.drivers/block-add-timeout-on-dequeue rename to src/patches/suse-2.6.27.31/patches.drivers/block-add-timeout-on-dequeue index 401d57136..6e5c8bd17 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/block-add-timeout-on-dequeue +++ b/src/patches/suse-2.6.27.31/patches.drivers/block-add-timeout-on-dequeue @@ -38,11 +38,9 @@ Signed-off-by: Tejun Heo block/elevator.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -Index: linux-2.6.27/block/elevator.c -=================================================================== ---- linux-2.6.27.orig/block/elevator.c -+++ linux-2.6.27/block/elevator.c -@@ -773,12 +773,6 @@ struct request *elv_next_request(struct +--- a/block/elevator.c ++++ b/block/elevator.c +@@ -781,12 +781,6 @@ struct request *elv_next_request(struct */ rq->cmd_flags |= REQ_STARTED; blk_add_trace_rq(q, rq, BLK_TA_ISSUE); @@ -55,7 +53,7 @@ Index: linux-2.6.27/block/elevator.c } if (!q->boundary_rq || q->boundary_rq == rq) { -@@ -850,6 +844,12 @@ void elv_dequeue_request(struct request_ +@@ -858,6 +852,12 @@ void elv_dequeue_request(struct request_ */ if (blk_account_rq(rq)) q->in_flight++; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-call-sync-on-cleanup b/src/patches/suse-2.6.27.31/patches.drivers/block-call-sync-on-cleanup similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/block-call-sync-on-cleanup rename to src/patches/suse-2.6.27.31/patches.drivers/block-call-sync-on-cleanup diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-del-timer-after-dequeue b/src/patches/suse-2.6.27.31/patches.drivers/block-del-timer-after-dequeue similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/block-del-timer-after-dequeue rename to src/patches/suse-2.6.27.31/patches.drivers/block-del-timer-after-dequeue diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-internal-dequeue-shouldnt-start-timer b/src/patches/suse-2.6.27.31/patches.drivers/block-internal-dequeue-shouldnt-start-timer similarity index 97% rename from src/patches/suse-2.6.27.25/patches.drivers/block-internal-dequeue-shouldnt-start-timer rename to src/patches/suse-2.6.27.31/patches.drivers/block-internal-dequeue-shouldnt-start-timer index 9a4ac5dd3..a8eb023d2 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/block-internal-dequeue-shouldnt-start-timer +++ b/src/patches/suse-2.6.27.31/patches.drivers/block-internal-dequeue-shouldnt-start-timer @@ -41,7 +41,7 @@ Signed-off-by: Tejun Heo q->orig_bar_rq = rq; rq = &q->bar_rq; blk_rq_init(q, rq); -@@ -219,7 +219,7 @@ int blk_do_ordered(struct request_queue +@@ -219,7 +219,7 @@ int blk_do_ordered(struct request_queue * This can happen when the queue switches to * ORDERED_NONE while this request is on it. */ @@ -92,7 +92,7 @@ Signed-off-by: Tejun Heo laptop_io_completion(); --- a/block/elevator.c +++ b/block/elevator.c -@@ -844,14 +844,7 @@ void elv_dequeue_request(struct request_ +@@ -852,14 +852,7 @@ void elv_dequeue_request(struct request_ */ if (blk_account_rq(rq)) q->in_flight++; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/block-timeout-handling b/src/patches/suse-2.6.27.31/patches.drivers/block-timeout-handling similarity index 99% rename from src/patches/suse-2.6.27.25/patches.drivers/block-timeout-handling rename to src/patches/suse-2.6.27.31/patches.drivers/block-timeout-handling index 6df29158b..619544ea0 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/block-timeout-handling +++ b/src/patches/suse-2.6.27.31/patches.drivers/block-timeout-handling @@ -58,6 +58,19 @@ Signed-off-by: Hannes Reinecke 39 files changed, 399 insertions(+), 339 deletions(-) create mode 100644 block/blk-timeout.c +--- a/block/Makefile ++++ b/block/Makefile +@@ -4,8 +4,8 @@ + + obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ + blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \ +- blk-exec.o blk-merge.o blk-softirq.o ioctl.o genhd.o \ +- scsi_ioctl.o cmd-filter.o ++ blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ ++ ioctl.o genhd.o scsi_ioctl.o cmd-filter.o + + obj-$(CONFIG_BLK_DEV_BSG) += bsg.o + obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o --- a/block/blk-core.c +++ b/block/blk-core.c @@ -109,6 +109,7 @@ void blk_rq_init(struct request_queue *q @@ -95,39 +108,6 @@ Signed-off-by: Hannes Reinecke if (blk_rq_tagged(req)) blk_queue_end_tag(req->q, req); ---- a/block/blk.h -+++ b/block/blk.h -@@ -17,6 +17,30 @@ void __blk_queue_free_tags(struct reques - - void blk_unplug_work(struct work_struct *work); - void blk_unplug_timeout(unsigned long data); -+void blk_rq_timed_out_timer(unsigned long data); -+void blk_delete_timer(struct request *); -+void blk_add_timer(struct request *); -+ -+/* -+ * Internal atomic flags for request handling -+ */ -+enum rq_atomic_flags { -+ REQ_ATOM_COMPLETE = 0, -+}; -+ -+/* -+ * EH timer and IO completion will both attempt to 'grab' the request, make -+ * sure that only one of them suceeds -+ */ -+static inline int blk_mark_rq_complete(struct request *rq) -+{ -+ return test_and_set_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); -+} -+ -+static inline void blk_clear_rq_complete(struct request *rq) -+{ -+ clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); -+} - - struct io_context *current_io_context(gfp_t gfp_flags, int node); - --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -77,6 +77,18 @@ void blk_queue_softirq_done(struct reque @@ -353,6 +333,39 @@ Signed-off-by: Hannes Reinecke + time_before(expiry, q->timeout.expires)) + mod_timer(&q->timeout, expiry); +} +--- a/block/blk.h ++++ b/block/blk.h +@@ -17,6 +17,30 @@ void __blk_queue_free_tags(struct reques + + void blk_unplug_work(struct work_struct *work); + void blk_unplug_timeout(unsigned long data); ++void blk_rq_timed_out_timer(unsigned long data); ++void blk_delete_timer(struct request *); ++void blk_add_timer(struct request *); ++ ++/* ++ * Internal atomic flags for request handling ++ */ ++enum rq_atomic_flags { ++ REQ_ATOM_COMPLETE = 0, ++}; ++ ++/* ++ * EH timer and IO completion will both attempt to 'grab' the request, make ++ * sure that only one of them suceeds ++ */ ++static inline int blk_mark_rq_complete(struct request *rq) ++{ ++ return test_and_set_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); ++} ++ ++static inline void blk_clear_rq_complete(struct request *rq) ++{ ++ clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); ++} + + struct io_context *current_io_context(gfp_t gfp_flags, int node); + --- a/block/elevator.c +++ b/block/elevator.c @@ -36,6 +36,8 @@ @@ -364,7 +377,7 @@ Signed-off-by: Hannes Reinecke static DEFINE_SPINLOCK(elv_list_lock); static LIST_HEAD(elv_list); -@@ -771,6 +773,12 @@ struct request *elv_next_request(struct +@@ -779,6 +781,12 @@ struct request *elv_next_request(struct */ rq->cmd_flags |= REQ_STARTED; blk_add_trace_rq(q, rq, BLK_TA_ISSUE); @@ -377,19 +390,6 @@ Signed-off-by: Hannes Reinecke } if (!q->boundary_rq || q->boundary_rq == rq) { ---- a/block/Makefile -+++ b/block/Makefile -@@ -4,8 +4,8 @@ - - obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ - blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \ -- blk-exec.o blk-merge.o blk-softirq.o ioctl.o genhd.o \ -- scsi_ioctl.o cmd-filter.o -+ blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ -+ ioctl.o genhd.o scsi_ioctl.o cmd-filter.o - - obj-$(CONFIG_BLK_DEV_BSG) += bsg.o - obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -33,6 +33,7 @@ @@ -689,7 +689,7 @@ Signed-off-by: Hannes Reinecke --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c -@@ -756,7 +756,7 @@ static int ibmvscsi_queuecommand(struct +@@ -756,7 +756,7 @@ static int ibmvscsi_queuecommand(struct init_event_struct(evt_struct, handle_cmd_rsp, VIOSRP_SRP_FORMAT, @@ -723,7 +723,7 @@ Signed-off-by: Hannes Reinecke if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res)) --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c -@@ -3818,7 +3818,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * +@@ -3818,7 +3818,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb->cmd.dcdb.segment_4G = 0; scb->cmd.dcdb.enhanced_sg = 0; @@ -794,7 +794,7 @@ Signed-off-by: Hannes Reinecke --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c -@@ -398,7 +398,7 @@ void sas_ata_task_abort(struct sas_task +@@ -398,7 +398,7 @@ void sas_ata_task_abort(struct sas_task /* Bounce SCSI-initiated commands to the SCSI EH */ if (qc->scsicmd) { @@ -885,7 +885,7 @@ Signed-off-by: Hannes Reinecke --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c -@@ -1167,7 +1167,7 @@ static int megasas_generic_reset(struct +@@ -1167,7 +1167,7 @@ static int megasas_generic_reset(struct * cmd has not been completed within the timeout period. */ static enum @@ -1356,7 +1356,7 @@ Signed-off-by: Hannes Reinecke } static ssize_t -@@ -576,7 +579,7 @@ sdev_store_timeout (struct device *dev, +@@ -576,7 +579,7 @@ sdev_store_timeout (struct device *dev, int timeout; sdev = to_scsi_device(dev); sscanf (buf, "%d\n", &timeout); @@ -1480,7 +1480,7 @@ Signed-off-by: Hannes Reinecke unsigned int timeout; int retries; -@@ -266,6 +269,14 @@ typedef void (prepare_flush_fn) (struct +@@ -266,6 +269,14 @@ typedef void (prepare_flush_fn) (struct typedef void (softirq_done_fn)(struct request *); typedef int (dma_drain_needed_fn)(struct request *); diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2-Add-PCI-ID-for-5716S b/src/patches/suse-2.6.27.31/patches.drivers/bnx2-Add-PCI-ID-for-5716S similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2-Add-PCI-ID-for-5716S rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2-Add-PCI-ID-for-5716S diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2-Add-bnx2_shutdown_chip b/src/patches/suse-2.6.27.31/patches.drivers/bnx2-Add-bnx2_shutdown_chip similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2-Add-bnx2_shutdown_chip rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2-Add-bnx2_shutdown_chip diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2-Fix-bug-in-bnx2_free_rx_mem_ b/src/patches/suse-2.6.27.31/patches.drivers/bnx2-Fix-bug-in-bnx2_free_rx_mem_ similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2-Fix-bug-in-bnx2_free_rx_mem_ rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2-Fix-bug-in-bnx2_free_rx_mem_ diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2-check-running.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2-check-running.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2-check-running.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2-check-running.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-1G-10G-toggling-race.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-1G-10G-toggling-race.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-1G-10G-toggling-race.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-1G-10G-toggling-race.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Adding-restriction-on-sge_buf_size.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Adding-restriction-on-sge_buf_size.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Adding-restriction-on-sge_buf_size.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Adding-restriction-on-sge_buf_size.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Barriers-for-the-compiler.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Barriers-for-the-compiler.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Barriers-for-the-compiler.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Barriers-for-the-compiler.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Calling-napi_del.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Calling-napi_del.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Calling-napi_del.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Calling-napi_del.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Carrier-off-first-call.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Carrier-off-first-call.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Carrier-off-first-call.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Carrier-off-first-call.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Casting-page-alignment.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Casting-page-alignment.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Casting-page-alignment.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Casting-page-alignment.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Disable-napi.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Disable-napi.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Disable-napi.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Disable-napi.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Driver-description-update.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Driver-description-update.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Driver-description-update.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Driver-description-update.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Endianness-issues.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Endianness-issues.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Endianness-issues.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Endianness-issues.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-First-slow-path-interrupt-race.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-First-slow-path-interrupt-race.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-First-slow-path-interrupt-race.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-First-slow-path-interrupt-race.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Fixing-the-doorbell-size.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Fixing-the-doorbell-size.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Fixing-the-doorbell-size.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Fixing-the-doorbell-size.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Flow-control-updated-before-reporting-the-lin.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Flow-control-updated-before-reporting-the-lin.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Flow-control-updated-before-reporting-the-lin.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Flow-control-updated-before-reporting-the-lin.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Free-IRQ.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Free-IRQ.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Free-IRQ.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Free-IRQ.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-PHY-FW-load-failure.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-PHY-FW-load-failure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-PHY-FW-load-failure.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-PHY-FW-load-failure.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-load-failures.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-load-failures.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-load-failures.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-load-failures.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-probe-failures.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-probe-failures.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Handling-probe-failures.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Handling-probe-failures.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Indirection-table-initialization-index.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Indirection-table-initialization-index.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Indirection-table-initialization-index.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Indirection-table-initialization-index.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Legacy-speeds-autoneg-failures.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Legacy-speeds-autoneg-failures.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Legacy-speeds-autoneg-failures.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Legacy-speeds-autoneg-failures.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-MTU-Filter.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-MTU-Filter.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-MTU-Filter.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-MTU-Filter.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-brackets.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-brackets.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-brackets.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-brackets.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-mask-when-calculating-flow-control.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-mask-when-calculating-flow-control.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-mask-when-calculating-flow-control.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-mask-when-calculating-flow-control.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-memory-barriers.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-memory-barriers.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-memory-barriers.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-memory-barriers.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-rmb-when-waiting-for-FW-response.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-rmb-when-waiting-for-FW-response.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Missing-rmb-when-waiting-for-FW-response.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Missing-rmb-when-waiting-for-FW-response.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Overstepping-array-bounds.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Overstepping-array-bounds.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Overstepping-array-bounds.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Overstepping-array-bounds.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Potential-race-after-iSCSI-boot.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Prevent-self-test-loopback-failures.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Prevent-self-test-loopback-failures.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Prevent-self-test-loopback-failures.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Prevent-self-test-loopback-failures.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Protecting-the-link-change-indication.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Protecting-the-link-change-indication.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Protecting-the-link-change-indication.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Protecting-the-link-change-indication.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Read-chip-ID.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Read-chip-ID.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Read-chip-ID.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Read-chip-ID.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Reset-HW-before-use.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Reset-HW-before-use.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Reset-HW-before-use.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Reset-HW-before-use.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-DMAE-to-initialize-the-chip.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-DMAE-to-initialize-the-chip.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-DMAE-to-initialize-the-chip.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-DMAE-to-initialize-the-chip.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-singlethread-work-queue.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-singlethread-work-queue.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-singlethread-work-queue.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-singlethread-work-queue.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-system-page-size-for-SGE.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-system-page-size-for-SGE.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Using-system-page-size-for-SGE.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Using-system-page-size-for-SGE.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-VLAN-tagged-packets-without-VLAN-offload.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-VLAN-tagged-packets-without-VLAN-offload.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-VLAN-tagged-packets-without-VLAN-offload.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-VLAN-tagged-packets-without-VLAN-offload.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Version-update.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Version-update.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Version-update.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Version-update.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Version.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Version.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Version.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Version.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Wrong-HDR-offset-in-CAM.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Wrong-HDR-offset-in-CAM.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-Wrong-HDR-offset-in-CAM.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-Wrong-HDR-offset-in-CAM.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-eeh.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-eeh.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-eeh.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-eeh.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-loopback-test-failure.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-loopback-test-failure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-loopback-test-failure.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-loopback-test-failure.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-tx_has_work-should-not-wait-for-FW.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-tx_has_work-should-not-wait-for-FW.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-tx_has_work-should-not-wait-for-FW.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-tx_has_work-should-not-wait-for-FW.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/bnx2x-version-update.patch b/src/patches/suse-2.6.27.31/patches.drivers/bnx2x-version-update.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/bnx2x-version-update.patch rename to src/patches/suse-2.6.27.31/patches.drivers/bnx2x-version-update.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/broadcom-Add-support-for-the-57780-integrated-PHY.patch b/src/patches/suse-2.6.27.31/patches.drivers/broadcom-Add-support-for-the-57780-integrated-PHY.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/broadcom-Add-support-for-the-57780-integrated-PHY.patch rename to src/patches/suse-2.6.27.31/patches.drivers/broadcom-Add-support-for-the-57780-integrated-PHY.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cciss-driver-panic-on-volume-delete b/src/patches/suse-2.6.27.31/patches.drivers/cciss-driver-panic-on-volume-delete similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cciss-driver-panic-on-volume-delete rename to src/patches/suse-2.6.27.31/patches.drivers/cciss-driver-panic-on-volume-delete diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cciss-ignore-stale-commands b/src/patches/suse-2.6.27.31/patches.drivers/cciss-ignore-stale-commands similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cciss-ignore-stale-commands rename to src/patches/suse-2.6.27.31/patches.drivers/cciss-ignore-stale-commands diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_add_cpu_number_paramater_1.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_add_cpu_number_paramater_1.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_add_cpu_number_paramater_1.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_add_cpu_number_paramater_1.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_add_idle_microaccounting_6.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_add_idle_microaccounting_6.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_add_idle_microaccounting_6.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_add_idle_microaccounting_6.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_change_load_calculation_2.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_change_load_calculation_2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_change_load_calculation_2.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_change_load_calculation_2.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_changes_to_get_cpu_idle_us_5.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_changes_to_get_cpu_idle_us_5.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_changes_to_get_cpu_idle_us_5.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_changes_to_get_cpu_idle_us_5.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_get_cpu_idle_time_changes_3.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_get_cpu_idle_time_changes_3.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_get_cpu_idle_time_changes_3.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_get_cpu_idle_time_changes_3.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cpufreq_parameterize_down_differential_4.patch b/src/patches/suse-2.6.27.31/patches.drivers/cpufreq_parameterize_down_differential_4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cpufreq_parameterize_down_differential_4.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cpufreq_parameterize_down_differential_4.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Add-1G-fiber-support b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Add-1G-fiber-support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Add-1G-fiber-support rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Add-1G-fiber-support diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Allocate-multiqueues-at-init-time b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Allocate-multiqueues-at-init-time similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Allocate-multiqueues-at-init-time rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Allocate-multiqueues-at-init-time diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-More-flexible-support-for-PHY-interrupts b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-More-flexible-support-for-PHY-interrupts similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-More-flexible-support-for-PHY-interrupts rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-More-flexible-support-for-PHY-interrupts diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Support-for-Aeluros-2005-PHY b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Support-for-Aeluros-2005-PHY similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-Support-for-Aeluros-2005-PHY rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-Support-for-Aeluros-2005-PHY diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-allow-for-PHY-reset-status b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-allow-for-PHY-reset-status similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-allow-for-PHY-reset-status rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-allow-for-PHY-reset-status diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-commnonize-LASI-phy-code b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-commnonize-LASI-phy-code similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-commnonize-LASI-phy-code rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-commnonize-LASI-phy-code diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-eeprom-read-fixes.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-eeprom-read-fixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-eeprom-read-fixes.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-eeprom-read-fixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-enable-lro-through-ethtool b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-enable-lro-through-ethtool similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-enable-lro-through-ethtool rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-enable-lro-through-ethtool diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-fix_lro_alignment.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-fix_lro_alignment.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-fix_lro_alignment.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-fix_lro_alignment.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-fix_lro_switch.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-fix_lro_switch.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-fix_lro_switch.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-fix_lro_switch.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-get_drvinfo-deadlock.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-get_drvinfo-deadlock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-get_drvinfo-deadlock.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-get_drvinfo-deadlock.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-handle-err-inject.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-handle-err-inject.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-handle-err-inject.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-handle-err-inject.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-private-iscsi-ip-addresses b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-private-iscsi-ip-addresses similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-private-iscsi-ip-addresses rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-private-iscsi-ip-addresses diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-ser.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-ser.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-ser.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-ser.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-simplify-port-type-struct-and-usage b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-simplify-port-type-struct-and-usage similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-simplify-port-type-struct-and-usage rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-simplify-port-type-struct-and-usage diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3-update-driver-version b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3-update-driver-version similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3-update-driver-version rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3-update-driver-version diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3i b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3i similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3i rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3i diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-fix-skb-overrun b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-fix-skb-overrun similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-fix-skb-overrun rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-fix-skb-overrun diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-fixed-offload-array-size b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-fixed-offload-array-size similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-fixed-offload-array-size rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-fixed-offload-array-size diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-mainline.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-mainline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3i-mainline.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3i-mainline.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/cxgb3i_ddp.patch b/src/patches/suse-2.6.27.31/patches.drivers/cxgb3i_ddp.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/cxgb3i_ddp.patch rename to src/patches/suse-2.6.27.31/patches.drivers/cxgb3i_ddp.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/disable-catas_reset-by-default-to-avoid-problems-with-eeh.patch b/src/patches/suse-2.6.27.31/patches.drivers/disable-catas_reset-by-default-to-avoid-problems-with-eeh.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/disable-catas_reset-by-default-to-avoid-problems-with-eeh.patch rename to src/patches/suse-2.6.27.31/patches.drivers/disable-catas_reset-by-default-to-avoid-problems-with-eeh.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/dm-abort-queue-on-failed-paths b/src/patches/suse-2.6.27.31/patches.drivers/dm-abort-queue-on-failed-paths similarity index 85% rename from src/patches/suse-2.6.27.25/patches.drivers/dm-abort-queue-on-failed-paths rename to src/patches/suse-2.6.27.31/patches.drivers/dm-abort-queue-on-failed-paths index 38c4537d3..8991a34ad 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/dm-abort-queue-on-failed-paths +++ b/src/patches/suse-2.6.27.31/patches.drivers/dm-abort-queue-on-failed-paths @@ -10,8 +10,10 @@ Signed-off-by: Mike Anderson Signed-off-by: Jens Axboe Signed-off-by: Hannes Reinecke -diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c -index c2fcf28..3d38481 100644 +--- + drivers/md/dm-mpath.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -33,6 +33,7 @@ struct pgpath { @@ -22,7 +24,7 @@ index c2fcf28..3d38481 100644 }; #define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path) -@@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipathd, *kmpath_handlerd; +@@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipa static void process_queued_ios(struct work_struct *work); static void trigger_event(struct work_struct *work); static void activate_path(struct work_struct *work); @@ -42,7 +44,7 @@ index c2fcf28..3d38481 100644 return pgpath; } -@@ -133,6 +137,14 @@ static void free_pgpath(struct pgpath *pgpath) +@@ -133,6 +137,14 @@ static void free_pgpath(struct pgpath *p kfree(pgpath); } @@ -57,7 +59,7 @@ index c2fcf28..3d38481 100644 static struct priority_group *alloc_priority_group(void) { struct priority_group *pg; -@@ -870,6 +882,7 @@ static int fail_path(struct pgpath *pgpath) +@@ -881,6 +893,7 @@ static int fail_path(struct pgpath *pgpa pgpath->path.dev->name, m->nr_valid_paths); queue_work(kmultipathd, &m->trigger_event); diff --git a/src/patches/suse-2.6.27.25/patches.drivers/dmi-introduce-dmi_first_match b/src/patches/suse-2.6.27.31/patches.drivers/dmi-introduce-dmi_first_match similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/dmi-introduce-dmi_first_match rename to src/patches/suse-2.6.27.31/patches.drivers/dmi-introduce-dmi_first_match diff --git a/src/patches/suse-2.6.27.25/patches.drivers/driver-core-add-newlines-to-debugging-enabled-disabled-messages.patch b/src/patches/suse-2.6.27.31/patches.drivers/driver-core-add-newlines-to-debugging-enabled-disabled-messages.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/driver-core-add-newlines-to-debugging-enabled-disabled-messages.patch rename to src/patches/suse-2.6.27.31/patches.drivers/driver-core-add-newlines-to-debugging-enabled-disabled-messages.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch b/src/patches/suse-2.6.27.31/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch rename to src/patches/suse-2.6.27.31/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch index cbc48b236..e6111dd11 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch +++ b/src/patches/suse-2.6.27.31/patches.drivers/driver-core-basic-infrastructure-for-per-module-dynamic-debug-messages.patch @@ -88,7 +88,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1735,6 +1735,11 @@ and is between 256 and 4096 characters. +@@ -1742,6 +1742,11 @@ and is between 256 and 4096 characters. autoconfiguration. Ranges are in pairs (memory base and size). @@ -121,7 +121,7 @@ Signed-off-by: Greg Kroah-Hartman *(.init.text) \ --- a/include/linux/device.h +++ b/include/linux/device.h -@@ -553,7 +553,11 @@ int printk_dev_hash(const char *, const +@@ -553,7 +553,11 @@ int printk_dev_hash(const char *, const #define dev_info(dev, format, arg...) \ dev_printk_hash(KERN_INFO , dev , format , ## arg) @@ -332,6 +332,81 @@ Signed-off-by: Greg Kroah-Hartman err = module_finalize(hdr, sechdrs, mod); if (err < 0) goto cleanup; +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -752,6 +752,61 @@ menuconfig BUILD_DOCSRC + + Say N if you are unsure. + ++config DYNAMIC_PRINTK_DEBUG ++ bool "Enable dynamic printk() call support" ++ default n ++ depends on PRINTK ++ select PRINTK_DEBUG ++ help ++ ++ Compiles debug level messages into the kernel, which would not ++ otherwise be available at runtime. These messages can then be ++ enabled/disabled on a per module basis. This mechanism implicitly ++ enables all pr_debug() and dev_dbg() calls. The impact of this ++ compile option is a larger kernel text size of about 2%. ++ ++ Usage: ++ ++ Dynamic debugging is controlled by the debugfs file, ++ dynamic_printk/modules. This file contains a list of the modules that ++ can be enabled. The format of the file is the module name, followed ++ by a set of flags that can be enabled. The first flag is always the ++ 'enabled' flag. For example: ++ ++ ++ . ++ . ++ . ++ ++ : Name of the module in which the debug call resides ++ : whether the messages are enabled or not ++ ++ From a live system: ++ ++ snd_hda_intel enabled=0 ++ fixup enabled=0 ++ driver enabled=0 ++ ++ Enable a module: ++ ++ $echo "set enabled=1 " > dynamic_printk/modules ++ ++ Disable a module: ++ ++ $echo "set enabled=0 " > dynamic_printk/modules ++ ++ Enable all modules: ++ ++ $echo "set enabled=1 all" > dynamic_printk/modules ++ ++ Disable all modules: ++ ++ $echo "set enabled=0 all" > dynamic_printk/modules ++ ++ Finally, passing "dynamic_printk" at the command line enables ++ debugging for all modules. This mode can be turned off via the above ++ disable command. ++ + source "samples/Kconfig" + + source "lib/Kconfig.kgdb" +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -81,6 +81,8 @@ obj-$(CONFIG_HAVE_LMB) += lmb.o + + obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o + ++obj-$(CONFIG_DYNAMIC_PRINTK_DEBUG) += dynamic_printk.o ++ + hostprogs-y := gen_crc32table + clean-files := crc32table.h + --- /dev/null +++ b/lib/dynamic_printk.c @@ -0,0 +1,418 @@ @@ -753,81 +828,6 @@ Signed-off-by: Greg Kroah-Hartman +} +/* Use early_param(), so we can get debug output as early as possible */ +early_param("dynamic_printk", dynamic_printk_setup); ---- a/lib/Kconfig.debug -+++ b/lib/Kconfig.debug -@@ -752,6 +752,61 @@ menuconfig BUILD_DOCSRC - - Say N if you are unsure. - -+config DYNAMIC_PRINTK_DEBUG -+ bool "Enable dynamic printk() call support" -+ default n -+ depends on PRINTK -+ select PRINTK_DEBUG -+ help -+ -+ Compiles debug level messages into the kernel, which would not -+ otherwise be available at runtime. These messages can then be -+ enabled/disabled on a per module basis. This mechanism implicitly -+ enables all pr_debug() and dev_dbg() calls. The impact of this -+ compile option is a larger kernel text size of about 2%. -+ -+ Usage: -+ -+ Dynamic debugging is controlled by the debugfs file, -+ dynamic_printk/modules. This file contains a list of the modules that -+ can be enabled. The format of the file is the module name, followed -+ by a set of flags that can be enabled. The first flag is always the -+ 'enabled' flag. For example: -+ -+ -+ . -+ . -+ . -+ -+ : Name of the module in which the debug call resides -+ : whether the messages are enabled or not -+ -+ From a live system: -+ -+ snd_hda_intel enabled=0 -+ fixup enabled=0 -+ driver enabled=0 -+ -+ Enable a module: -+ -+ $echo "set enabled=1 " > dynamic_printk/modules -+ -+ Disable a module: -+ -+ $echo "set enabled=0 " > dynamic_printk/modules -+ -+ Enable all modules: -+ -+ $echo "set enabled=1 all" > dynamic_printk/modules -+ -+ Disable all modules: -+ -+ $echo "set enabled=0 all" > dynamic_printk/modules -+ -+ Finally, passing "dynamic_printk" at the command line enables -+ debugging for all modules. This mode can be turned off via the above -+ disable command. -+ - source "samples/Kconfig" - - source "lib/Kconfig.kgdb" ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -81,6 +81,8 @@ obj-$(CONFIG_HAVE_LMB) += lmb.o - - obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o - -+obj-$(CONFIG_DYNAMIC_PRINTK_DEBUG) += dynamic_printk.o -+ - hostprogs-y := gen_crc32table - clean-files := crc32table.h - --- a/net/netfilter/nf_conntrack_pptp.c +++ b/net/netfilter/nf_conntrack_pptp.c @@ -65,7 +65,7 @@ void @@ -839,6 +839,44 @@ Signed-off-by: Greg Kroah-Hartman /* PptpControlMessageType names */ const char *const pptp_msg_name[] = { "UNKNOWN_MESSAGE", +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -96,6 +96,14 @@ basename_flags = -D"KBUILD_BASENAME=KBUI + modname_flags = $(if $(filter 1,$(words $(modname))),\ + -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") + ++#hash values ++ifdef CONFIG_DYNAMIC_PRINTK_DEBUG ++debug_flags = -D"DEBUG_HASH=$(shell ./scripts/basic/hash djb2 $(@D)$(modname))"\ ++ -D"DEBUG_HASH2=$(shell ./scripts/basic/hash r5 $(@D)$(modname))" ++else ++debug_flags = ++endif ++ + orig_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o) + _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) + _a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o) +@@ -121,7 +129,8 @@ endif + + c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ + $(__c_flags) $(modkern_cflags) \ +- -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) ++ -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) \ ++ $(debug_flags) + + a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ + $(__a_flags) $(modkern_aflags) +--- a/scripts/basic/Makefile ++++ b/scripts/basic/Makefile +@@ -9,7 +9,7 @@ + # fixdep: Used to generate dependency information during build process + # docproc: Used in Documentation/DocBook + +-hostprogs-y := fixdep docproc ++hostprogs-y := fixdep docproc hash + always := $(hostprogs-y) + + # fixdep is needed to compile other host programs --- /dev/null +++ b/scripts/basic/hash.c @@ -0,0 +1,64 @@ @@ -906,41 +944,3 @@ Signed-off-by: Greg Kroah-Hartman + exit(0); +} + ---- a/scripts/basic/Makefile -+++ b/scripts/basic/Makefile -@@ -9,7 +9,7 @@ - # fixdep: Used to generate dependency information during build process - # docproc: Used in Documentation/DocBook - --hostprogs-y := fixdep docproc -+hostprogs-y := fixdep docproc hash - always := $(hostprogs-y) - - # fixdep is needed to compile other host programs ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -96,6 +96,14 @@ basename_flags = -D"KBUILD_BASENAME=KBUI - modname_flags = $(if $(filter 1,$(words $(modname))),\ - -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") - -+#hash values -+ifdef CONFIG_DYNAMIC_PRINTK_DEBUG -+debug_flags = -D"DEBUG_HASH=$(shell ./scripts/basic/hash djb2 $(@D)$(modname))"\ -+ -D"DEBUG_HASH2=$(shell ./scripts/basic/hash r5 $(@D)$(modname))" -+else -+debug_flags = -+endif -+ - orig_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o) - _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) - _a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o) -@@ -121,7 +129,8 @@ endif - - c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ - $(__c_flags) $(modkern_cflags) \ -- -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) -+ -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) \ -+ $(debug_flags) - - a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ - $(__a_flags) $(modkern_aflags) diff --git a/src/patches/suse-2.6.27.25/patches.drivers/driver-core-fix-dynamic_debug-cmd-line-parameter.patch b/src/patches/suse-2.6.27.31/patches.drivers/driver-core-fix-dynamic_debug-cmd-line-parameter.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/driver-core-fix-dynamic_debug-cmd-line-parameter.patch rename to src/patches/suse-2.6.27.31/patches.drivers/driver-core-fix-dynamic_debug-cmd-line-parameter.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/driver-core-fix-using-ret-variable-in-unregister_dynamic_debug_module.patch b/src/patches/suse-2.6.27.31/patches.drivers/driver-core-fix-using-ret-variable-in-unregister_dynamic_debug_module.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/driver-core-fix-using-ret-variable-in-unregister_dynamic_debug_module.patch rename to src/patches/suse-2.6.27.31/patches.drivers/driver-core-fix-using-ret-variable-in-unregister_dynamic_debug_module.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch b/src/patches/suse-2.6.27.31/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch similarity index 79% rename from src/patches/suse-2.6.27.25/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch rename to src/patches/suse-2.6.27.31/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch index 22b978572..77e0dda5c 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch +++ b/src/patches/suse-2.6.27.31/patches.drivers/e100-adapt-to-the-reworked-PCI-PM.patch @@ -20,13 +20,11 @@ Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/e100.c | 16 ++++++++++------ - 1 files changed, 10 insertions(+), 6 deletions(-) + 1 file changed, 10 insertions(+), 6 deletions(-) -diff --git a/drivers/net/e100.c b/drivers/net/e100.c -index bb4b6e2..084127f 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c -@@ -2322,7 +2322,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) +@@ -2325,7 +2325,8 @@ static int e100_set_wol(struct net_devic { struct nic *nic = netdev_priv(netdev); @@ -36,7 +34,7 @@ index bb4b6e2..084127f 100644 return -EOPNOTSUPP; if(wol->wolopts) -@@ -2330,6 +2331,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) +@@ -2333,6 +2334,8 @@ static int e100_set_wol(struct net_devic else nic->flags &= ~wol_magic; @@ -45,7 +43,7 @@ index bb4b6e2..084127f 100644 e100_exec_cb(nic, NULL, e100_configure); return 0; -@@ -2733,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, +@@ -2737,8 +2740,10 @@ static int __devinit e100_probe(struct p /* Wol magic packet can be enabled from eeprom */ if((nic->mac >= mac_82558_D101_A4) && @@ -57,7 +55,7 @@ index bb4b6e2..084127f 100644 /* ack any pending wake events, disable PME */ pci_pme_active(pdev, false); -@@ -2793,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) +@@ -2797,11 +2802,10 @@ static int e100_suspend(struct pci_dev * pci_save_state(pdev); if ((nic->flags & wol_magic) | e100_asf(nic)) { @@ -72,6 +70,3 @@ index bb4b6e2..084127f 100644 } pci_disable_device(pdev); --- -1.6.2 - diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e1000e-Fixes-possible-phy-corrupton-on-82571-design.patch b/src/patches/suse-2.6.27.31/patches.drivers/e1000e-Fixes-possible-phy-corrupton-on-82571-design.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/e1000e-Fixes-possible-phy-corrupton-on-82571-design.patch rename to src/patches/suse-2.6.27.31/patches.drivers/e1000e-Fixes-possible-phy-corrupton-on-82571-design.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_82574L.patch b/src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_82574L.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_82574L.patch rename to src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_82574L.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_ECC b/src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_ECC similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_ECC rename to src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_ECC diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_ICH9_BM.patch b/src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_ICH9_BM.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_ICH9_BM.patch rename to src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_ICH9_BM.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_LOM_devices.patch b/src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_LOM_devices.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/e1000e_add_LOM_devices.patch rename to src/patches/suse-2.6.27.31/patches.drivers/e1000e_add_LOM_devices.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehca-fix-possible-nullpointer-access-v2.patch b/src/patches/suse-2.6.27.31/patches.drivers/ehca-fix-possible-nullpointer-access-v2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehca-fix-possible-nullpointer-access-v2.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ehca-fix-possible-nullpointer-access-v2.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehca-flush-cqe.patch b/src/patches/suse-2.6.27.31/patches.drivers/ehca-flush-cqe.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehca-flush-cqe.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ehca-flush-cqe.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehca-malloc-speedup b/src/patches/suse-2.6.27.31/patches.drivers/ehca-malloc-speedup similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehca-malloc-speedup rename to src/patches/suse-2.6.27.31/patches.drivers/ehca-malloc-speedup diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehca-rejecting-dynamic-mem-add-remove.patch b/src/patches/suse-2.6.27.31/patches.drivers/ehca-rejecting-dynamic-mem-add-remove.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehca-rejecting-dynamic-mem-add-remove.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ehca-rejecting-dynamic-mem-add-remove.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehea-modinfo.patch b/src/patches/suse-2.6.27.31/patches.drivers/ehea-modinfo.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehea-modinfo.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ehea-modinfo.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ehea.patch b/src/patches/suse-2.6.27.31/patches.drivers/ehea.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ehea.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ehea.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/elousb.patch b/src/patches/suse-2.6.27.31/patches.drivers/elousb.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/elousb.patch rename to src/patches/suse-2.6.27.31/patches.drivers/elousb.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-change-fcoe_sw-sg_tablesi.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-change-fcoe_sw-sg_tablesi.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-change-fcoe_sw-sg_tablesi.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-change-fcoe_sw-sg_tablesi.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-check-return-for-fc_set_m.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-check-return-for-fc_set_m.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-check-return-for-fc_set_m.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-check-return-for-fc_set_m.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-frame-length-validati.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-frame-length-validati.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-frame-length-validati.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-frame-length-validati.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-handling-of-pending-queue b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-handling-of-pending-queue similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-handling-of-pending-queue rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-handling-of-pending-queue diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-incorrect-use-of-struct-module.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-incorrect-use-of-struct-module.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-incorrect-use-of-struct-module.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-incorrect-use-of-struct-module.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-kfree-skb.patch b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-kfree-skb.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-fix-kfree-skb.patch rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-fix-kfree-skb.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-improved-load-balancing-i.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-improved-load-balancing-i.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-improved-load-balancing-i.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-improved-load-balancing-i.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-logoff-of-the-fabric-when.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-logoff-of-the-fabric-when.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-logoff-of-the-fabric-when.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-logoff-of-the-fabric-when.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-remove-warn_on-in-fc_set.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-remove-warn_on-in-fc_set.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-remove-warn_on-in-fc_set.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-remove-warn_on-in-fc_set.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/fcoe-user_mfs-is-never-used.diff b/src/patches/suse-2.6.27.31/patches.drivers/fcoe-user_mfs-is-never-used.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/fcoe-user_mfs-is-never-used.diff rename to src/patches/suse-2.6.27.31/patches.drivers/fcoe-user_mfs-is-never-used.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-abort-response.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-abort-response.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-abort-response.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-abort-response.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-add_sync.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-add_sync.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-add_sync.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-add_sync.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-async-events-oops b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-async-events-oops similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc-async-events-oops rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc-async-events-oops diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_class3.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_class3.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_class3.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_class3.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_default_timeout.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_default_timeout.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_default_timeout.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_default_timeout.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_prli_initiator_fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_prli_initiator_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_prli_initiator_fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_prli_initiator_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_relogin_fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_relogin_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_relogin_fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_relogin_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_tasklet.patch b/src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_tasklet.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ibmvfc_tasklet.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ibmvfc_tasklet.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ide-tape-flags-fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/ide-tape-flags-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ide-tape-flags-fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ide-tape-flags-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ide-tape-ignore_dsc-flags-fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/ide-tape-ignore_dsc-flags-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ide-tape-ignore_dsc-flags-fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ide-tape-ignore_dsc-flags-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/igp-fix-ring-on-suspend.patch b/src/patches/suse-2.6.27.31/patches.drivers/igp-fix-ring-on-suspend.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/igp-fix-ring-on-suspend.patch rename to src/patches/suse-2.6.27.31/patches.drivers/igp-fix-ring-on-suspend.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/input-usbtouchscreen-hw-calibration.patch b/src/patches/suse-2.6.27.31/patches.drivers/input-usbtouchscreen-hw-calibration.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/input-usbtouchscreen-hw-calibration.patch rename to src/patches/suse-2.6.27.31/patches.drivers/input-usbtouchscreen-hw-calibration.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/intel-ibex-peak-device-ids.patch b/src/patches/suse-2.6.27.31/patches.drivers/intel-ibex-peak-device-ids.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/intel-ibex-peak-device-ids.patch rename to src/patches/suse-2.6.27.31/patches.drivers/intel-ibex-peak-device-ids.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/intel-ibex-peak-device-support.patch b/src/patches/suse-2.6.27.31/patches.drivers/intel-ibex-peak-device-support.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/intel-ibex-peak-device-support.patch rename to src/patches/suse-2.6.27.31/patches.drivers/intel-ibex-peak-device-support.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ipoib_null_skb_on_free.patch b/src/patches/suse-2.6.27.31/patches.drivers/ipoib_null_skb_on_free.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ipoib_null_skb_on_free.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ipoib_null_skb_on_free.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ipr-slave-alloc-crash b/src/patches/suse-2.6.27.31/patches.drivers/ipr-slave-alloc-crash similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ipr-slave-alloc-crash rename to src/patches/suse-2.6.27.31/patches.drivers/ipr-slave-alloc-crash diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe-add-bcna-support b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe-add-bcna-support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe-add-bcna-support rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe-add-bcna-support diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe-copper_pond.patch b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe-copper_pond.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe-copper_pond.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe-copper_pond.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe-dcb-setstate.patch b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe-dcb-setstate.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe-dcb-setstate.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe-dcb-setstate.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe-fcoe-bugfixes b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe-fcoe-bugfixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe-fcoe-bugfixes rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe-fcoe-bugfixes diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe-sfp.patch b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe-sfp.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe-sfp.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe-sfp.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe_DCB_compile_err.patch b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe_DCB_compile_err.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe_DCB_compile_err.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe_DCB_compile_err.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ixgbe_pagesize_fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/ixgbe_pagesize_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ixgbe_pagesize_fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/ixgbe_pagesize_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-6gbps-message b/src/patches/suse-2.6.27.31/patches.drivers/libata-6gbps-message similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-6gbps-message rename to src/patches/suse-2.6.27.31/patches.drivers/libata-6gbps-message diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA b/src/patches/suse-2.6.27.31/patches.drivers/libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA rename to src/patches/suse-2.6.27.31/patches.drivers/libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-add-waits-for-govault b/src/patches/suse-2.6.27.31/patches.drivers/libata-add-waits-for-govault similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-add-waits-for-govault rename to src/patches/suse-2.6.27.31/patches.drivers/libata-add-waits-for-govault diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-Withdraw-IGN_SERR_INTERNAL-for-SB800 b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-Withdraw-IGN_SERR_INTERNAL-for-SB800 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-Withdraw-IGN_SERR_INTERNAL-for-SB800 rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-Withdraw-IGN_SERR_INTERNAL-for-SB800 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-blacklist-double-spin-off b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-blacklist-double-spin-off similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-blacklist-double-spin-off rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-blacklist-double-spin-off diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-correct-enclosure-LED-state-save b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-correct-enclosure-LED-state-save similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-correct-enclosure-LED-state-save rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-correct-enclosure-LED-state-save diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-enclosure-management-bios-workaround b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-enclosure-management-bios-workaround similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ahci-enclosure-management-bios-workaround rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-enclosure-management-bios-workaround diff --git a/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-sb600-srst-workaround-soften-msg b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-sb600-srst-workaround-soften-msg new file mode 100644 index 000000000..ab4632548 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/libata-ahci-sb600-srst-workaround-soften-msg @@ -0,0 +1,31 @@ +Subject: ahci: soften up the dmesg on SB600 PMP softreset failure recovery +From: Shane Huang +References: bnc#527748 + +Too strong words led to spurious bug reports: Novell bugzilla #527748, +RedHat bugzilla #468800. This patch is used to soften up the dmesg on +SB600 PMP softreset failure recovery, so as to remove the scariness and +concern from community. + +Reported-by: pgnet Dev +Signed-off-by: Shane Huang +Cc: Tejun Heo +Signed-off-by: Tejun Heo +--- + drivers/ata/ahci.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: linux-2.6.27-SLE11_BRANCH/drivers/ata/ahci.c +=================================================================== +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/ata/ahci.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/ata/ahci.c +@@ -1735,7 +1735,8 @@ static int ahci_sb600_softreset(struct a + irq_sts = readl(port_mmio + PORT_IRQ_STAT); + if (irq_sts & PORT_IRQ_BAD_PMP) { + ata_link_printk(link, KERN_WARNING, +- "failed due to HW bug, retry pmp=0\n"); ++ "applying SB600 PMP SRST workaround " ++ "and retrying\n"); + rc = ahci_do_softreset(link, class, 0, deadline, + ahci_check_ready); + } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-Hercules-EC-900-mini-to-laptop-tbl b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-Hercules-EC-900-mini-to-laptop-tbl similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-Hercules-EC-900-mini-to-laptop-tbl rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-Hercules-EC-900-mini-to-laptop-tbl diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-VGN-BX297XP-to-broken-suspend-list b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-VGN-BX297XP-to-broken-suspend-list similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-VGN-BX297XP-to-broken-suspend-list rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-VGN-BX297XP-to-broken-suspend-list diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-intel-ibex-pci-ids b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-intel-ibex-pci-ids similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-add-intel-ibex-pci-ids rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-add-intel-ibex-pci-ids diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-blacklist-double-spin-off b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-blacklist-double-spin-off similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-blacklist-double-spin-off rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-blacklist-double-spin-off diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-clear-spurious-IRQ b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-clear-spurious-IRQ similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-clear-spurious-IRQ rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-clear-spurious-IRQ diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-use-slave_link b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-use-slave_link similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-ata_piix-use-slave_link rename to src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-use-slave_link diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-clear-ering-on-resume b/src/patches/suse-2.6.27.31/patches.drivers/libata-clear-ering-on-resume similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-clear-ering-on-resume rename to src/patches/suse-2.6.27.31/patches.drivers/libata-clear-ering-on-resume diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-dont-restore-DET-on-detach b/src/patches/suse-2.6.27.31/patches.drivers/libata-dont-restore-DET-on-detach similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-dont-restore-DET-on-detach rename to src/patches/suse-2.6.27.31/patches.drivers/libata-dont-restore-DET-on-detach diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-eh-fix-slave-link-EH-action-mask-handling b/src/patches/suse-2.6.27.31/patches.drivers/libata-eh-fix-slave-link-EH-action-mask-handling similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-eh-fix-slave-link-EH-action-mask-handling rename to src/patches/suse-2.6.27.31/patches.drivers/libata-eh-fix-slave-link-EH-action-mask-handling diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-implement-NO_SPINDOWN b/src/patches/suse-2.6.27.31/patches.drivers/libata-implement-NO_SPINDOWN similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-implement-NO_SPINDOWN rename to src/patches/suse-2.6.27.31/patches.drivers/libata-implement-NO_SPINDOWN diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-implement-slave_link b/src/patches/suse-2.6.27.31/patches.drivers/libata-implement-slave_link similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-implement-slave_link rename to src/patches/suse-2.6.27.31/patches.drivers/libata-implement-slave_link diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-make-SCR-access-ops-per-link b/src/patches/suse-2.6.27.31/patches.drivers/libata-make-SCR-access-ops-per-link similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-make-SCR-access-ops-per-link rename to src/patches/suse-2.6.27.31/patches.drivers/libata-make-SCR-access-ops-per-link diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-misc-updates-to-prepare-for-slave-link b/src/patches/suse-2.6.27.31/patches.drivers/libata-misc-updates-to-prepare-for-slave-link similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-misc-updates-to-prepare-for-slave-link rename to src/patches/suse-2.6.27.31/patches.drivers/libata-misc-updates-to-prepare-for-slave-link diff --git a/src/patches/suse-2.6.27.31/patches.drivers/libata-ocz-vertex-no-hpa b/src/patches/suse-2.6.27.31/patches.drivers/libata-ocz-vertex-no-hpa new file mode 100644 index 000000000..02330c0a3 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/libata-ocz-vertex-no-hpa @@ -0,0 +1,33 @@ +From: Tejun Heo +Subject: libata: OCZ Vertex can't do HPA +References: bnc#522414 + +OCZ Vertex SSD can't do HPA and not in a usual way. It reports HPA, +allows unlocking but then fails all IOs which fall in the unlocked +area. Quirk it so that HPA unlocking is not used for the device. + +Reported by Daniel Perup in bnc#522414. + + https://bugzilla.novell.com/show_bug.cgi?id=522414 + +Signed-off-by: Tejun Heo +Reported-by: Daniel Perup +Signed-off-by: Tejun Heo +--- + drivers/ata/libata-core.c | 3 +++ + 1 file changed, 3 insertions(+) + +Index: linux-2.6.27-SLE11_BRANCH/drivers/ata/libata-core.c +=================================================================== +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/ata/libata-core.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/ata/libata-core.c +@@ -4132,6 +4132,9 @@ static const struct ata_blacklist_entry + { "WDC WD2500JD-00HBB0", "WD-WMAL71490727", ATA_HORKAGE_BROKEN_HPA }, + { "MAXTOR 6L080L4", "A93.0500", ATA_HORKAGE_BROKEN_HPA }, + ++ /* this one allows HPA unlocking but fails IOs on the area */ ++ { "OCZ-VERTEX", "1.30", ATA_HORKAGE_BROKEN_HPA }, ++ + /* Devices which report 1 sector over size HPA */ + { "ST340823A", NULL, ATA_HORKAGE_HPA_SIZE, }, + { "ST320413A", NULL, ATA_HORKAGE_HPA_SIZE, }, diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-fix-cable-detection b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-cable-detection similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-fix-cable-detection rename to src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-cable-detection diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-fix-clock-detection b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-clock-detection similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-fix-clock-detection rename to src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-fix-clock-detection diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-no-ATAPI-DMA b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-no-ATAPI-DMA similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-no-ATAPI-DMA rename to src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-no-ATAPI-DMA diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-reimplement-mode-programming b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-reimplement-mode-programming similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-pata_hpt366-reimplement-mode-programming rename to src/patches/suse-2.6.27.31/patches.drivers/libata-pata_hpt366-reimplement-mode-programming diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-pata_sch-slave-poss b/src/patches/suse-2.6.27.31/patches.drivers/libata-pata_sch-slave-poss similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-pata_sch-slave-poss rename to src/patches/suse-2.6.27.31/patches.drivers/libata-pata_sch-slave-poss diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-prefer-over-ide b/src/patches/suse-2.6.27.31/patches.drivers/libata-prefer-over-ide similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-prefer-over-ide rename to src/patches/suse-2.6.27.31/patches.drivers/libata-prefer-over-ide diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-reimplement-link-iterator b/src/patches/suse-2.6.27.31/patches.drivers/libata-reimplement-link-iterator similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-reimplement-link-iterator rename to src/patches/suse-2.6.27.31/patches.drivers/libata-reimplement-link-iterator diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_sil-blacklist-double-spin-off b/src/patches/suse-2.6.27.31/patches.drivers/libata-sata_sil-blacklist-double-spin-off similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-sata_sil-blacklist-double-spin-off rename to src/patches/suse-2.6.27.31/patches.drivers/libata-sata_sil-blacklist-double-spin-off diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-add-vt8261-support.patch b/src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-add-vt8261-support.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-add-vt8261-support.patch rename to src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-add-vt8261-support.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-fix-support-for-5287 b/src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-fix-support-for-5287 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-fix-support-for-5287 rename to src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-fix-support-for-5287 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-load-DEVICE-register-when-CTL-changes b/src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-load-DEVICE-register-when-CTL-changes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-load-DEVICE-register-when-CTL-changes rename to src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-load-DEVICE-register-when-CTL-changes diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-restore-vt-_prepare_host-error-handling b/src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-restore-vt-_prepare_host-error-handling similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-sata_via-restore-vt-_prepare_host-error-handling rename to src/patches/suse-2.6.27.31/patches.drivers/libata-sata_via-restore-vt-_prepare_host-error-handling diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline b/src/patches/suse-2.6.27.31/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline rename to src/patches/suse-2.6.27.31/patches.drivers/libata-set-device-class-to-NONE-if-phys_offline diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-transfer-EHI-control-flags-to-slave-ehc.i b/src/patches/suse-2.6.27.31/patches.drivers/libata-transfer-EHI-control-flags-to-slave-ehc.i similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-transfer-EHI-control-flags-to-slave-ehc.i rename to src/patches/suse-2.6.27.31/patches.drivers/libata-transfer-EHI-control-flags-to-slave-ehc.i diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-unlock-hpa-by-default b/src/patches/suse-2.6.27.31/patches.drivers/libata-unlock-hpa-by-default similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-unlock-hpa-by-default rename to src/patches/suse-2.6.27.31/patches.drivers/libata-unlock-hpa-by-default diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libata-whitelist-good-bridges b/src/patches/suse-2.6.27.31/patches.drivers/libata-whitelist-good-bridges similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libata-whitelist-good-bridges rename to src/patches/suse-2.6.27.31/patches.drivers/libata-whitelist-good-bridges diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-add-fc_disc-c-locking-co.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-add-fc_disc-c-locking-co.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-add-fc_disc-c-locking-co.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-add-fc_disc-c-locking-co.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-cancel_delayed_work_sync-called-improperly.patch b/src/patches/suse-2.6.27.31/patches.drivers/libfc-cancel_delayed_work_sync-called-improperly.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-cancel_delayed_work_sync-called-improperly.patch rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-cancel_delayed_work_sync-called-improperly.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-check-for-err-when-recv-state-is-incorrect.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-check-for-err-when-recv-state-is-incorrect.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-check-for-err-when-recv-state-is-incorrect.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-check-for-err-when-recv-state-is-incorrect.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-ensure-correct-device_pu.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-ensure-correct-device_pu.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-ensure-correct-device_pu.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-ensure-correct-device_pu.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-fix-read-IO-data-integrity b/src/patches/suse-2.6.27.31/patches.drivers/libfc-fix-read-IO-data-integrity similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-fix-read-IO-data-integrity rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-fix-read-IO-data-integrity diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-handle-rrq-exch-timeout.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-handle-rrq-exch-timeout.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-handle-rrq-exch-timeout.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-handle-rrq-exch-timeout.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-improve-fc_lport-c-locki.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-improve-fc_lport-c-locki.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-improve-fc_lport-c-locki.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-improve-fc_lport-c-locki.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-improve-fc_rport-c-locki.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-improve-fc_rport-c-locki.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-improve-fc_rport-c-locki.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-improve-fc_rport-c-locki.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-make-fc_disc-inline-with.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-make-fc_disc-inline-with.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-make-fc_disc-inline-with.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-make-fc_disc-inline-with.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-make-rscn-parsing-more-r.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-make-rscn-parsing-more-r.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-make-rscn-parsing-more-r.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-make-rscn-parsing-more-r.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-make-sure-we-access-the.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-make-sure-we-access-the.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-make-sure-we-access-the.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-make-sure-we-access-the.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-pass-lport-in-exch_mgr_r.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-pass-lport-in-exch_mgr_r.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-pass-lport-in-exch_mgr_r.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-pass-lport-in-exch_mgr_r.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-set-the-release-function.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-set-the-release-function.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-set-the-release-function.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-set-the-release-function.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-updated-comment-for-orde.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-updated-comment-for-orde.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-updated-comment-for-orde.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-updated-comment-for-orde.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-updated-libfc-fcoe-modul.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-updated-libfc-fcoe-modul.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-updated-libfc-fcoe-modul.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-updated-libfc-fcoe-modul.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-use-an-operations-struct.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-use-an-operations-struct.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-use-an-operations-struct.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-use-an-operations-struct.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc-when-rport-goes-away-re.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc-when-rport-goes-away-re.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc-when-rport-goes-away-re.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc-when-rport-goes-away-re.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc_locking.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc_locking.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc_locking.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc_locking.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/libfc_rport.diff b/src/patches/suse-2.6.27.31/patches.drivers/libfc_rport.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/libfc_rport.diff rename to src/patches/suse-2.6.27.31/patches.drivers/libfc_rport.diff diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.1-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.1-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.1-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.1-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.10-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.10-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.10-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.10-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.11-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.11-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.11-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.11-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.12-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.12-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.12-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.12-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.13-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.13-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.13-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.13-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.14-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.14-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.14-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.14-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.3-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.3-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.3-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.3-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.4-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.4-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.4-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.4-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.7-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.7-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.7-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.7-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.9-update b/src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.9-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.9-update rename to src/patches/suse-2.6.27.31/patches.drivers/lpfc-8.2.8.9-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/megaraid-mbox-fix-SG_IO b/src/patches/suse-2.6.27.31/patches.drivers/megaraid-mbox-fix-SG_IO similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/megaraid-mbox-fix-SG_IO rename to src/patches/suse-2.6.27.31/patches.drivers/megaraid-mbox-fix-SG_IO diff --git a/src/patches/suse-2.6.27.25/patches.drivers/mpt-fusion-4.00.43.00-update b/src/patches/suse-2.6.27.31/patches.drivers/mpt-fusion-4.00.43.00-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/mpt-fusion-4.00.43.00-update rename to src/patches/suse-2.6.27.31/patches.drivers/mpt-fusion-4.00.43.00-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/mpt-fusion-4.16.00.00-update b/src/patches/suse-2.6.27.31/patches.drivers/mpt-fusion-4.16.00.00-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/mpt-fusion-4.16.00.00-update rename to src/patches/suse-2.6.27.31/patches.drivers/mpt-fusion-4.16.00.00-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/mpt-return-all-sense-data b/src/patches/suse-2.6.27.31/patches.drivers/mpt-return-all-sense-data similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/mpt-return-all-sense-data rename to src/patches/suse-2.6.27.31/patches.drivers/mpt-return-all-sense-data diff --git a/src/patches/suse-2.6.27.25/patches.drivers/mptsas-discover-all-devices b/src/patches/suse-2.6.27.31/patches.drivers/mptsas-discover-all-devices similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/mptsas-discover-all-devices rename to src/patches/suse-2.6.27.31/patches.drivers/mptsas-discover-all-devices diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-avoid-invalid-iounmap.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-avoid-invalid-iounmap.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-avoid-invalid-iounmap.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-avoid-invalid-iounmap.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-cleanup-mac-list-on-driver-unload.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-cleanup-mac-list-on-driver-unload.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-cleanup-mac-list-on-driver-unload.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-cleanup-mac-list-on-driver-unload.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-enable-msi-x-for-quad-gig-boards.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-enable-msi-x-for-quad-gig-boards.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-enable-msi-x-for-quad-gig-boards.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-enable-msi-x-for-quad-gig-boards.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-firmware-init-fix.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-firmware-init-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-firmware-init-fix.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-firmware-init-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-endianness-in-firmware-commands.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-endianness-in-firmware-commands.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-endianness-in-firmware-commands.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-endianness-in-firmware-commands.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-ipv6-offload-and-tx-cleanup.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-ipv6-offload-and-tx-cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-ipv6-offload-and-tx-cleanup.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-ipv6-offload-and-tx-cleanup.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-link-speed-reporting-for-some-boards.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-link-speed-reporting-for-some-boards.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-link-speed-reporting-for-some-boards.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-link-speed-reporting-for-some-boards.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-memory-leak-in-drivers-net-netxen_nic_in.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-memory-leak-in-drivers-net-netxen_nic_in.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-memory-leak-in-drivers-net-netxen_nic_in.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-memory-leak-in-drivers-net-netxen_nic_in.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-vlan-tso-checksum-offload.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-vlan-tso-checksum-offload.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-fix-vlan-tso-checksum-offload.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-fix-vlan-tso-checksum-offload.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-handle-dma-mapping-failures.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-handle-dma-mapping-failures.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-handle-dma-mapping-failures.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-handle-dma-mapping-failures.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-hold-tx-lock-while-sending-firmware-commands.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-hold-tx-lock-while-sending-firmware-commands.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-hold-tx-lock-while-sending-firmware-commands.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-hold-tx-lock-while-sending-firmware-commands.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-include-ipv6.h-fixes-build-failure.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-include-ipv6.h-fixes-build-failure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-include-ipv6.h-fixes-build-failure.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-include-ipv6.h-fixes-build-failure.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-reduce-memory-footprint.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-reduce-memory-footprint.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-reduce-memory-footprint.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-reduce-memory-footprint.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/netxen-revert-jumbo-ringsize.patch b/src/patches/suse-2.6.27.31/patches.drivers/netxen-revert-jumbo-ringsize.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/netxen-revert-jumbo-ringsize.patch rename to src/patches/suse-2.6.27.31/patches.drivers/netxen-revert-jumbo-ringsize.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta3-update b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta3-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta3-update rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta3-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta4-update b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta4-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta4-update rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta4-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta5-update b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta5-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta5-update rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta5-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta6-update b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta6-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-beta6-update rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-beta6-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-dcb-support b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-dcb-support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-dcb-support rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-dcb-support diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-driver b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-driver similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-driver rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-driver diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-fnic-patches b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-fnic-patches similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-fnic-patches rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-fnic-patches diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-header-files b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-header-files similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-header-files rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-header-files diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-libfc b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-libfc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-libfc rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-libfc diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-rc1-update b/src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-rc1-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-fcoe-rc1-update rename to src/patches/suse-2.6.27.31/patches.drivers/open-fcoe-rc1-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/open-iscsi-offloading-support b/src/patches/suse-2.6.27.31/patches.drivers/open-iscsi-offloading-support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/open-iscsi-offloading-support rename to src/patches/suse-2.6.27.31/patches.drivers/open-iscsi-offloading-support diff --git a/src/patches/suse-2.6.27.25/patches.drivers/panasonic-laptop-add-panasonic-let-s-note-laptop-extras-driver-v0.94.patch b/src/patches/suse-2.6.27.31/patches.drivers/panasonic-laptop-add-panasonic-let-s-note-laptop-extras-driver-v0.94.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/panasonic-laptop-add-panasonic-let-s-note-laptop-extras-driver-v0.94.patch rename to src/patches/suse-2.6.27.31/patches.drivers/panasonic-laptop-add-panasonic-let-s-note-laptop-extras-driver-v0.94.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/power-introduce-system_entering_hibernation b/src/patches/suse-2.6.27.31/patches.drivers/power-introduce-system_entering_hibernation similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/power-introduce-system_entering_hibernation rename to src/patches/suse-2.6.27.31/patches.drivers/power-introduce-system_entering_hibernation diff --git a/src/patches/suse-2.6.27.25/patches.drivers/ppc64-adb b/src/patches/suse-2.6.27.31/patches.drivers/ppc64-adb similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/ppc64-adb rename to src/patches/suse-2.6.27.31/patches.drivers/ppc64-adb diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla1280-eh-update b/src/patches/suse-2.6.27.31/patches.drivers/qla1280-eh-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla1280-eh-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla1280-eh-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01-k8-update b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01-k8-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01-k8-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01-k8-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01-k9-update b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01-k9-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01-k9-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01-k9-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01.02.11.0-k9-update b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01.02.11.0-k9-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-8.02.01.02.11.0-k9-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-8.02.01.02.11.0-k9-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-correct-endianness-issue-during-flash b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-correct-endianness-issue-during-flash similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-correct-endianness-issue-during-flash rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-correct-endianness-issue-during-flash diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-eeh-recovery b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-eeh-recovery similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-eeh-recovery rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-eeh-recovery diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-extend-address-range-of-option-rom-update b/src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-extend-address-range-of-option-rom-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla2xxx-extend-address-range-of-option-rom-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla2xxx-extend-address-range-of-option-rom-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-5.01.00-k8_sles11-03-update b/src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-5.01.00-k8_sles11-03-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-5.01.00-k8_sles11-03-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-5.01.00-k8_sles11-03-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-5.01.00-k8_sles11-04-update b/src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-5.01.00-k8_sles11-04-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-5.01.00-k8_sles11-04-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-5.01.00-k8_sles11-04-update diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-correct-extended-sense-data-errors b/src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-correct-extended-sense-data-errors similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-correct-extended-sense-data-errors rename to src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-correct-extended-sense-data-errors diff --git a/src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-sles11-update b/src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-sles11-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/qla4xxx-sles11-update rename to src/patches/suse-2.6.27.31/patches.drivers/qla4xxx-sles11-update diff --git a/src/patches/suse-2.6.27.31/patches.drivers/quickcam_messenger.c-add-support-for-all-quickcam.patch b/src/patches/suse-2.6.27.31/patches.drivers/quickcam_messenger.c-add-support-for-all-quickcam.patch new file mode 100644 index 000000000..320264e8a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/quickcam_messenger.c-add-support-for-all-quickcam.patch @@ -0,0 +1,69 @@ +From: Brandon Philips +Subject: [PATCH] quickcam_messenger.c: add support for all quickcam + Messengers of the same family +References: bnc#441650 +Patch-Mainline: never, gspca_stv06xx.ko should be used for 2.6.30+ + +Add three devices that are supported by out of tree drivers to the +quickcam_messenger driver. Also, remove the sensor_id check since it seems to +just check the PID. + +The quickcam messenger plus (0x08F6) is supported by Christian's out of tree +driver[1] but two users have confirmed that the in tree quickcam_messenger +driver works for their devices if the IDs are added: + + https://bugzilla.novell.com/show_bug.cgi?id=441650#c3 + https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/22070/comments/33 + https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/22070/comments/34 + +[1] http://home.mag.cx/messenger/source/ + +Information on removal of the driver: + http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/8982/ + +Signed-off-by: Brandon Philips +Acked-by: Jaya Kumar + +--- + drivers/media/video/usbvideo/quickcam_messenger.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +Index: linux-2.6/drivers/media/video/usbvideo/quickcam_messenger.c +=================================================================== +--- linux-2.6.orig/drivers/media/video/usbvideo/quickcam_messenger.c ++++ linux-2.6/drivers/media/video/usbvideo/quickcam_messenger.c +@@ -56,9 +56,6 @@ static const int debug; + #define DRIVER_VERSION "v0.01" + #define DRIVER_DESC "Logitech Quickcam Messenger USB" + +-#define USB_LOGITECH_VENDOR_ID 0x046D +-#define USB_QCM_PRODUCT_ID 0x08F0 +- + #define MAX_CAMERAS 1 + + #define MAX_COLOUR 32768 +@@ -77,7 +74,10 @@ static int whiteness = MAX_WHITENESS; + static struct usbvideo *cams; + + static struct usb_device_id qcm_table [] = { +- { USB_DEVICE(USB_LOGITECH_VENDOR_ID, USB_QCM_PRODUCT_ID) }, ++ { USB_DEVICE(0x046D, 0x08F0) }, /* QuickCam Messenger */ ++ { USB_DEVICE(0x046D, 0x08F5) }, /* QuickCam Communicate */ ++ { USB_DEVICE(0x046D, 0x08F6) }, /* QuickCam Messenger (new) */ ++ { USB_DEVICE(0x046D, 0x08DA) }, /* QuickCam Messenger (new) */ + { } + }; + MODULE_DEVICE_TABLE(usb, qcm_table); +@@ -998,11 +998,6 @@ good_videoep: + err("Couldn't read sensor values. Err %d\n",err); + return err; + } +- if (sensor_id != cpu_to_le16(0x08F0)) { +- err("Sensor ID %x != %x. Unsupported. Sorry\n", +- le16_to_cpu(sensor_id), (0x08F0)); +- return -ENODEV; +- } + + uvd = usbvideo_AllocateDevice(cams); + if (!uvd) + diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-Tx-performance-tweak-helper b/src/patches/suse-2.6.27.31/patches.drivers/r8169-Tx-performance-tweak-helper similarity index 90% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-Tx-performance-tweak-helper rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-Tx-performance-tweak-helper index 02904b5d8..e95150368 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-Tx-performance-tweak-helper +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-Tx-performance-tweak-helper @@ -14,7 +14,7 @@ Cc: Edward Hsu --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c -@@ -2079,12 +2079,20 @@ static void rtl_hw_start_8169(struct net +@@ -2078,12 +2078,20 @@ static void rtl_hw_start_8169(struct net RTL_W16(IntrMask, tp->intr_event); } @@ -36,7 +36,7 @@ Cc: Edward Hsu RTL_W8(Cfg9346, Cfg9346_Unlock); -@@ -2098,10 +2106,7 @@ static void rtl_hw_start_8168(struct net +@@ -2097,10 +2105,7 @@ static void rtl_hw_start_8168(struct net RTL_W16(CPlusCmd, tp->cp_cmd); diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-add-8168-8101-registers-description b/src/patches/suse-2.6.27.31/patches.drivers/r8169-add-8168-8101-registers-description similarity index 85% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-add-8168-8101-registers-description rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-add-8168-8101-registers-description index e7fe36486..7e5075545 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-add-8168-8101-registers-description +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-add-8168-8101-registers-description @@ -8,11 +8,13 @@ Subject: [PATCH] r8169: add 8168/8101 registers description Signed-off-by: Francois Romieu Cc: Edward Hsu -Index: linux-2.6.27/drivers/net/r8169.c -=================================================================== ---- linux-2.6.27.orig/drivers/net/r8169.c -+++ linux-2.6.27/drivers/net/r8169.c -@@ -197,9 +197,6 @@ enum rtl_registers { +--- + drivers/net/r8169.c | 47 +++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 43 insertions(+), 4 deletions(-) + +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -196,9 +196,6 @@ enum rtl_registers { Config5 = 0x56, MultiIntr = 0x5c, PHYAR = 0x60, @@ -22,7 +24,7 @@ Index: linux-2.6.27/drivers/net/r8169.c PHYstatus = 0x6c, RxMaxSize = 0xda, CPlusCmd = 0xe0, -@@ -213,6 +210,32 @@ enum rtl_registers { +@@ -212,6 +209,32 @@ enum rtl_registers { FuncForceEvent = 0xfc, }; @@ -55,7 +57,7 @@ Index: linux-2.6.27/drivers/net/r8169.c enum rtl_register_content { /* InterruptStatusBits */ SYSErr = 0x8000, -@@ -266,7 +289,13 @@ enum rtl_register_content { +@@ -265,7 +288,13 @@ enum rtl_register_content { TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ /* Config1 register p.24 */ @@ -69,7 +71,7 @@ Index: linux-2.6.27/drivers/net/r8169.c PMEnable = (1 << 0), /* Power Management Enable */ /* Config2 register p. 25 */ -@@ -276,6 +305,7 @@ enum rtl_register_content { +@@ -275,6 +304,7 @@ enum rtl_register_content { /* Config3 register p.25 */ MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */ LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */ @@ -77,7 +79,7 @@ Index: linux-2.6.27/drivers/net/r8169.c /* Config5 register p.27 */ BWF = (1 << 6), /* Accept Broadcast wakeup frame */ -@@ -293,7 +323,16 @@ enum rtl_register_content { +@@ -292,7 +322,16 @@ enum rtl_register_content { TBINwComplete = 0x01000000, /* CPlusCmd p.31 */ diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 b/src/patches/suse-2.6.27.31/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 similarity index 94% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 index ca1f20f85..3b8dfab7e 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-add-hw-start-helpers-for-the-8168-and-the-8101 @@ -18,7 +18,7 @@ Cc: Edward Hsu --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c -@@ -543,6 +543,11 @@ static int mdio_read(void __iomem *ioadd +@@ -542,6 +542,11 @@ static int mdio_read(void __iomem *ioadd return value; } @@ -30,7 +30,7 @@ Cc: Edward Hsu static void rtl_mdio_write(struct net_device *dev, int phy_id, int location, int val) { -@@ -560,6 +565,72 @@ static int rtl_mdio_read(struct net_devi +@@ -559,6 +564,72 @@ static int rtl_mdio_read(struct net_devi return mdio_read(ioaddr, location); } @@ -103,7 +103,7 @@ Cc: Edward Hsu static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr) { RTL_W16(IntrMask, 0x0000); -@@ -2139,6 +2210,31 @@ static void rtl_tx_performance_tweak(str +@@ -2138,6 +2209,31 @@ static void rtl_tx_performance_tweak(str } } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-additional-8101-and-8102-support b/src/patches/suse-2.6.27.31/patches.drivers/r8169-additional-8101-and-8102-support similarity index 92% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-additional-8101-and-8102-support rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-additional-8101-and-8102-support index 302be5346..89d6e45f9 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-additional-8101-and-8102-support +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-additional-8101-and-8102-support @@ -15,7 +15,7 @@ Cc: Edward Hsu --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c -@@ -96,6 +96,10 @@ enum mac_version { +@@ -95,6 +95,10 @@ enum mac_version { RTL_GIGA_MAC_VER_04 = 0x04, // 8169SB RTL_GIGA_MAC_VER_05 = 0x05, // 8110SCd RTL_GIGA_MAC_VER_06 = 0x06, // 8110SCe @@ -26,7 +26,7 @@ Cc: Edward Hsu RTL_GIGA_MAC_VER_11 = 0x0b, // 8168Bb RTL_GIGA_MAC_VER_12 = 0x0c, // 8168Be RTL_GIGA_MAC_VER_13 = 0x0d, // 8101Eb -@@ -122,6 +126,10 @@ static const struct { +@@ -121,6 +125,10 @@ static const struct { _R("RTL8169sb/8110sb", RTL_GIGA_MAC_VER_04, 0xff7e1880), // 8169SB _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_05, 0xff7e1880), // 8110SCd _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_06, 0xff7e1880), // 8110SCe @@ -37,7 +37,7 @@ Cc: Edward Hsu _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_11, 0xff7e1880), // PCI-E _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_12, 0xff7e1880), // PCI-E _R("RTL8101e", RTL_GIGA_MAC_VER_13, 0xff7e1880), // PCI-E 8139 -@@ -854,8 +862,12 @@ static int rtl8169_set_speed_xmii(struct +@@ -853,8 +861,12 @@ static int rtl8169_set_speed_xmii(struct } } @@ -52,7 +52,7 @@ Cc: Edward Hsu (tp->mac_version == RTL_GIGA_MAC_VER_14) || (tp->mac_version == RTL_GIGA_MAC_VER_15) || (tp->mac_version == RTL_GIGA_MAC_VER_16)) { -@@ -1236,8 +1248,17 @@ static void rtl8169_get_mac_version(stru +@@ -1235,8 +1247,17 @@ static void rtl8169_get_mac_version(stru { 0x7c800000, 0x30000000, RTL_GIGA_MAC_VER_11 }, /* 8101 family. */ @@ -70,7 +70,7 @@ Cc: Edward Hsu { 0x7c800000, 0x34000000, RTL_GIGA_MAC_VER_16 }, /* FIXME: where did these entries come from ? -- FR */ { 0xfc800000, 0x38800000, RTL_GIGA_MAC_VER_15 }, -@@ -1399,6 +1420,22 @@ static void rtl8168cx_hw_phy_config(void +@@ -1398,6 +1419,22 @@ static void rtl8168cx_hw_phy_config(void rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); } @@ -93,7 +93,7 @@ Cc: Edward Hsu static void rtl_hw_phy_config(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); -@@ -1416,6 +1453,11 @@ static void rtl_hw_phy_config(struct net +@@ -1415,6 +1452,11 @@ static void rtl_hw_phy_config(struct net case RTL_GIGA_MAC_VER_04: rtl8169sb_hw_phy_config(ioaddr); break; @@ -105,7 +105,7 @@ Cc: Edward Hsu case RTL_GIGA_MAC_VER_18: rtl8168cp_hw_phy_config(ioaddr); break; -@@ -2278,6 +2320,70 @@ static void rtl_hw_start_8168(struct net +@@ -2277,6 +2319,70 @@ static void rtl_hw_start_8168(struct net RTL_W16(IntrMask, tp->intr_event); } @@ -176,7 +176,7 @@ Cc: Edward Hsu static void rtl_hw_start_8101(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); -@@ -2294,6 +2400,20 @@ static void rtl_hw_start_8101(struct net +@@ -2293,6 +2399,20 @@ static void rtl_hw_start_8101(struct net } } diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-allow-true-forced-mode-setting.patch b/src/patches/suse-2.6.27.31/patches.drivers/r8169-allow-true-forced-mode-setting.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-allow-true-forced-mode-setting.patch rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-allow-true-forced-mode-setting.patch index b2c5f6ee3..aad073648 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-allow-true-forced-mode-setting.patch +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-allow-true-forced-mode-setting.patch @@ -25,7 +25,7 @@ Acked-by: Jean Delvare 1 file changed, 61 insertions(+), 54 deletions(-) --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c -@@ -828,76 +828,83 @@ static int rtl8169_set_speed_xmii(struct +@@ -827,76 +827,83 @@ static int rtl8169_set_speed_xmii(struct { struct rtl8169_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; @@ -52,11 +52,11 @@ Acked-by: Jean Delvare - auto_nego |= ADVERTISE_100HALF | ADVERTISE_100FULL; - else if (speed == SPEED_1000) - giga_ctrl |= ADVERTISE_1000FULL | ADVERTISE_1000HALF; -- -- if (duplex == DUPLEX_HALF) -- auto_nego &= ~(ADVERTISE_10FULL | ADVERTISE_100FULL); + auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; +- if (duplex == DUPLEX_HALF) +- auto_nego &= ~(ADVERTISE_10FULL | ADVERTISE_100FULL); +- - if (duplex == DUPLEX_FULL) - auto_nego &= ~(ADVERTISE_10HALF | ADVERTISE_100HALF); - diff --git a/src/patches/suse-2.6.27.25/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features b/src/patches/suse-2.6.27.31/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features similarity index 89% rename from src/patches/suse-2.6.27.25/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features rename to src/patches/suse-2.6.27.31/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features index 198f31492..5236600fd 100644 --- a/src/patches/suse-2.6.27.25/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features +++ b/src/patches/suse-2.6.27.31/patches.drivers/r8169-use-pci_find_capability-for-the-PCI-E-features @@ -22,7 +22,7 @@ Cc: Edward Hsu #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ -@@ -428,6 +429,7 @@ struct rtl8169_private { +@@ -427,6 +428,7 @@ struct rtl8169_private { void (*hw_start)(struct net_device *); unsigned int (*phy_reset_pending)(void __iomem *); unsigned int (*link_ok)(void __iomem *); @@ -30,7 +30,7 @@ Cc: Edward Hsu struct delayed_work task; unsigned features; -@@ -1687,6 +1689,10 @@ rtl8169_init_one(struct pci_dev *pdev, c +@@ -1686,6 +1688,10 @@ rtl8169_init_one(struct pci_dev *pdev, c goto err_out_free_res_4; } @@ -41,7 +41,7 @@ Cc: Edward Hsu RTL_W16(IntrMask, 0x0000); /* Soft reset the chip. */ -@@ -2079,13 +2085,19 @@ static void rtl_hw_start_8169(struct net +@@ -2078,13 +2084,19 @@ static void rtl_hw_start_8169(struct net RTL_W16(IntrMask, tp->intr_event); } @@ -66,7 +66,7 @@ Cc: Edward Hsu } static void rtl_hw_start_8168(struct net_device *dev) -@@ -2106,7 +2118,7 @@ static void rtl_hw_start_8168(struct net +@@ -2105,7 +2117,7 @@ static void rtl_hw_start_8168(struct net RTL_W16(CPlusCmd, tp->cp_cmd); @@ -75,7 +75,7 @@ Cc: Edward Hsu RTL_W16(IntrMitigate, 0x5151); -@@ -2139,8 +2151,12 @@ static void rtl_hw_start_8101(struct net +@@ -2138,8 +2150,12 @@ static void rtl_hw_start_8101(struct net if ((tp->mac_version == RTL_GIGA_MAC_VER_13) || (tp->mac_version == RTL_GIGA_MAC_VER_16)) { diff --git a/src/patches/suse-2.6.27.25/patches.drivers/sgi-ioc4-request-submodules b/src/patches/suse-2.6.27.31/patches.drivers/sgi-ioc4-request-submodules similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/sgi-ioc4-request-submodules rename to src/patches/suse-2.6.27.31/patches.drivers/sgi-ioc4-request-submodules diff --git a/src/patches/suse-2.6.27.25/patches.drivers/sgi-xp-no-uv b/src/patches/suse-2.6.27.31/patches.drivers/sgi-xp-no-uv similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/sgi-xp-no-uv rename to src/patches/suse-2.6.27.31/patches.drivers/sgi-xp-no-uv diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-agnx-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-agnx-wireless-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-agnx-wireless-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-agnx-wireless-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-add-realtek-8192-pci-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-realtek-8192-pci-wireless-driver.patch new file mode 100644 index 000000000..4e5ac76e0 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-realtek-8192-pci-wireless-driver.patch @@ -0,0 +1,54619 @@ +From 182d8c60e20c48eadc68a1e83432dd0680b9e6cd Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Tue, 4 Aug 2009 15:57:55 -0700 +Subject: Staging: add Realtek 8192 PCI wireless driver +Patch-mainline: 2.6.32 +References: bnc#525903 + +From: Greg Kroah-Hartman + +This wireless driver should work for the Realtek 8192 PCI devices. + +It comes directly from Realtek and has been tested to work on at least +one laptop in the wild. + +Cc: Anthony Wong +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/Kconfig | 2 + drivers/staging/Makefile | 1 + drivers/staging/rtl8192e/Kconfig | 6 + drivers/staging/rtl8192e/Makefile | 34 + drivers/staging/rtl8192e/dot11d.h | 102 + drivers/staging/rtl8192e/ieee80211.h | 2802 +++++ + drivers/staging/rtl8192e/ieee80211/EndianFree.h | 199 + drivers/staging/rtl8192e/ieee80211/aes.c | 469 + drivers/staging/rtl8192e/ieee80211/api.c | 246 + drivers/staging/rtl8192e/ieee80211/arc4.c | 103 + drivers/staging/rtl8192e/ieee80211/autoload.c | 40 + drivers/staging/rtl8192e/ieee80211/cipher.c | 299 + drivers/staging/rtl8192e/ieee80211/compress.c | 64 + drivers/staging/rtl8192e/ieee80211/crypto_compat.h | 90 + drivers/staging/rtl8192e/ieee80211/digest.c | 108 + drivers/staging/rtl8192e/ieee80211/dot11d.c | 239 + drivers/staging/rtl8192e/ieee80211/dot11d.h | 102 + drivers/staging/rtl8192e/ieee80211/ieee80211.h | 2802 +++++ + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c | 273 + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.h | 93 + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c | 534 + + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c | 1034 ++ + drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c | 397 + drivers/staging/rtl8192e/ieee80211/ieee80211_module.c | 432 + drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c | 2802 +++++ + drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c | 3548 +++++++ + drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c | 692 + + drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c | 933 + + drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c | 1032 ++ + drivers/staging/rtl8192e/ieee80211/internal.h | 115 + drivers/staging/rtl8192e/ieee80211/kmap_types.h | 20 + drivers/staging/rtl8192e/ieee80211/michael_mic.c | 194 + drivers/staging/rtl8192e/ieee80211/proc.c | 116 + drivers/staging/rtl8192e/ieee80211/rtl819x_BA.h | 69 + drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c | 779 + + drivers/staging/rtl8192e/ieee80211/rtl819x_HT.h | 481 + drivers/staging/rtl8192e/ieee80211/rtl819x_HTProc.c | 1719 +++ + drivers/staging/rtl8192e/ieee80211/rtl819x_Qos.h | 749 + + drivers/staging/rtl8192e/ieee80211/rtl819x_TS.h | 56 + drivers/staging/rtl8192e/ieee80211/rtl819x_TSProc.c | 659 + + drivers/staging/rtl8192e/ieee80211/rtl_crypto.h | 399 + drivers/staging/rtl8192e/ieee80211/scatterwalk.c | 126 + drivers/staging/rtl8192e/ieee80211/scatterwalk.h | 51 + drivers/staging/rtl8192e/ieee80211_crypt.h | 86 + drivers/staging/rtl8192e/r8180_93cx6.c | 146 + drivers/staging/rtl8192e/r8180_93cx6.h | 40 + drivers/staging/rtl8192e/r8190_rtl8256.c | 1161 ++ + drivers/staging/rtl8192e/r8190_rtl8256.h | 28 + drivers/staging/rtl8192e/r8192E.h | 1554 +++ + drivers/staging/rtl8192e/r8192E_core.c | 6928 ++++++++++++++ + drivers/staging/rtl8192e/r8192E_dm.c | 4115 ++++++++ + drivers/staging/rtl8192e/r8192E_dm.h | 320 + drivers/staging/rtl8192e/r8192E_hw.h | 811 + + drivers/staging/rtl8192e/r8192E_wx.c | 1409 ++ + drivers/staging/rtl8192e/r8192E_wx.h | 22 + drivers/staging/rtl8192e/r8192_pm.c | 181 + drivers/staging/rtl8192e/r8192_pm.h | 28 + drivers/staging/rtl8192e/r819xE_cmdpkt.c | 820 + + drivers/staging/rtl8192e/r819xE_cmdpkt.h | 207 + drivers/staging/rtl8192e/r819xE_firmware.c | 620 + + drivers/staging/rtl8192e/r819xE_firmware.h | 68 + drivers/staging/rtl8192e/r819xE_firmware_img.h | 2778 +++++ + drivers/staging/rtl8192e/r819xE_phy.c | 3352 ++++++ + drivers/staging/rtl8192e/r819xE_phy.h | 125 + drivers/staging/rtl8192e/r819xE_phyreg.h | 878 + + drivers/staging/rtl8192e/r819xP_firmware_img.h | 3637 +++++++ + 66 files changed, 54325 insertions(+) + +--- a/drivers/staging/Kconfig ++++ b/drivers/staging/Kconfig +@@ -57,6 +57,8 @@ source "drivers/staging/benet/Kconfig" + + source "drivers/staging/rtl8187se/Kconfig" + ++source "drivers/staging/rtl8192e/Kconfig" ++ + source "drivers/staging/hv/Kconfig" + + endif # STAGING +--- a/drivers/staging/Makefile ++++ b/drivers/staging/Makefile +@@ -20,4 +20,5 @@ obj-$(CONFIG_RT2870) += rt2870/ + obj-$(CONFIG_RT3070) += rt3070/ + obj-$(CONFIG_BENET) += benet/ + obj-$(CONFIG_RTL8187SE) += rtl8187se/ ++obj-$(CONFIG_RTL8192E) += rtl8192e/ + obj-$(CONFIG_HYPERV) += hv/ +--- /dev/null ++++ b/drivers/staging/rtl8192e/Kconfig +@@ -0,0 +1,6 @@ ++config RTL8192E ++ tristate "RealTek RTL8192E Wireless LAN NIC driver" ++ depends on PCI ++ depends on WIRELESS_EXT ++ default N ++ ---help--- +--- /dev/null ++++ b/drivers/staging/rtl8192e/Makefile +@@ -0,0 +1,34 @@ ++NIC_SELECT = RTL8192E ++ ++ ++EXTRA_CFLAGS += -DRTL8192E ++EXTRA_CFLAGS += -std=gnu89 ++EXTRA_CFLAGS += -O2 ++EXTRA_CFLAGS += -DTHOMAS_TURBO ++EXTRA_CFLAGS += -DENABLE_DOT11D ++ ++r8192_pci-objs := \ ++ r8192E_core.o \ ++ r8180_93cx6.o \ ++ r8192E_wx.o \ ++ r8190_rtl8256.o \ ++ r819xE_phy.o \ ++ r819xE_firmware.o \ ++ r819xE_cmdpkt.o \ ++ r8192E_dm.o \ ++ ieee80211/ieee80211_rx.o \ ++ ieee80211/ieee80211_softmac.o \ ++ ieee80211/ieee80211_tx.o \ ++ ieee80211/ieee80211_wx.o \ ++ ieee80211/ieee80211_module.o \ ++ ieee80211/ieee80211_softmac_wx.o \ ++ ieee80211/rtl819x_HTProc.o \ ++ ieee80211/rtl819x_TSProc.o \ ++ ieee80211/rtl819x_BAProc.o \ ++ ieee80211/dot11d.o \ ++ ieee80211/ieee80211_crypt.o \ ++ ieee80211/ieee80211_crypt_tkip.o \ ++ ieee80211/ieee80211_crypt_ccmp.o \ ++ ieee80211/ieee80211_crypt_wep.o ++ ++obj-$(CONFIG_RTL8192E) += r8192_pci.o +--- /dev/null ++++ b/drivers/staging/rtl8192e/dot11d.h +@@ -0,0 +1,102 @@ ++#ifndef __INC_DOT11D_H ++#define __INC_DOT11D_H ++ ++#ifdef ENABLE_DOT11D ++#include "ieee80211.h" ++ ++//#define ENABLE_DOT11D ++ ++//#define DOT11D_MAX_CHNL_NUM 83 ++ ++typedef struct _CHNL_TXPOWER_TRIPLE { ++ u8 FirstChnl; ++ u8 NumChnls; ++ u8 MaxTxPowerInDbm; ++}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; ++ ++typedef enum _DOT11D_STATE { ++ DOT11D_STATE_NONE = 0, ++ DOT11D_STATE_LEARNED, ++ DOT11D_STATE_DONE, ++}DOT11D_STATE; ++ ++typedef struct _RT_DOT11D_INFO { ++ //DECLARE_RT_OBJECT(RT_DOT11D_INFO); ++ ++ bool bEnabled; // dot11MultiDomainCapabilityEnabled ++ ++ u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. ++ u8 CountryIeBuf[MAX_IE_LEN]; ++ u8 CountryIeSrcAddr[6]; // Source AP of the country IE. ++ u8 CountryIeWatchdog; ++ ++ u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) ++ //u8 ChnlListLen; // #Bytes valid in ChnlList[]. ++ //u8 ChnlList[DOT11D_MAX_CHNL_NUM]; ++ u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; ++ ++ DOT11D_STATE State; ++}RT_DOT11D_INFO, *PRT_DOT11D_INFO; ++#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) ++#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) ++#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) ++ ++#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled ++#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) ++ ++#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) ++#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) ++ ++#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ ++ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ ++ FALSE : \ ++ (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) ++ ++#define CIE_WATCHDOG_TH 1 ++#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog ++#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 ++#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) ++ ++#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) ++ ++ ++void ++Dot11d_Init( ++ struct ieee80211_device *dev ++ ); ++ ++void ++Dot11d_Reset( ++ struct ieee80211_device *dev ++ ); ++ ++void ++Dot11d_UpdateCountryIe( ++ struct ieee80211_device *dev, ++ u8 * pTaddr, ++ u16 CoutryIeLen, ++ u8 * pCoutryIe ++ ); ++ ++u8 ++DOT11D_GetMaxTxPwrInDbm( ++ struct ieee80211_device *dev, ++ u8 Channel ++ ); ++ ++void ++DOT11D_ScanComplete( ++ struct ieee80211_device * dev ++ ); ++ ++int IsLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++); ++ ++int ToLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++); ++#endif //ENABLE_DOT11D ++#endif // #ifndef __INC_DOT11D_H +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211.h +@@ -0,0 +1,2802 @@ ++/* ++ * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11 ++ * remains copyright by the original authors ++ * ++ * Portions of the merged code are based on Host AP (software wireless ++ * LAN access point) driver for Intersil Prism2/2.5/3. ++ * ++ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * ++ * Adaption to a generic IEEE 802.11 stack by James Ketrenos ++ * ++ * Copyright (c) 2004, Intel Corporation ++ * ++ * Modified for Realtek's wi-fi cards by Andrea Merello ++ * ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++#ifndef IEEE80211_H ++#define IEEE80211_H ++#include /* ETH_ALEN */ ++#include /* ARRAY_SIZE */ ++#include ++#include ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++#include ++#else ++#include ++#include ++#endif ++#include ++#include ++ ++#include ++#include ++ ++#include "ieee80211/rtl819x_HT.h" ++#include "ieee80211/rtl819x_BA.h" ++#include "ieee80211/rtl819x_TS.h" ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) ++#ifndef bool ++typedef enum{false = 0, true} bool; ++#endif ++#endif ++ ++#ifndef IW_MODE_MONITOR ++#define IW_MODE_MONITOR 6 ++#endif ++ ++#ifndef IWEVCUSTOM ++#define IWEVCUSTOM 0x8c02 ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#ifndef __bitwise ++#define __bitwise __attribute__((bitwise)) ++#endif ++typedef __u16 __le16; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) ++struct iw_spy_data{ ++ /* --- Standard spy support --- */ ++ int spy_number; ++ u_char spy_address[IW_MAX_SPY][ETH_ALEN]; ++ struct iw_quality spy_stat[IW_MAX_SPY]; ++ /* --- Enhanced spy support (event) */ ++ struct iw_quality spy_thr_low; /* Low threshold */ ++ struct iw_quality spy_thr_high; /* High threshold */ ++ u_char spy_thr_under[IW_MAX_SPY]; ++}; ++#endif ++#endif ++ ++#ifndef container_of ++/** ++ * container_of - cast a member of a structure out to the containing structure ++ * ++ * @ptr: the pointer to the member. ++ * @type: the type of the container struct this is embedded in. ++ * @member: the name of the member within the struct. ++ * ++ */ ++#define container_of(ptr, type, member) ({ \ ++ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ++ (type *)( (char *)__mptr - offsetof(type,member) );}) ++#endif ++ ++#define KEY_TYPE_NA 0x0 ++#define KEY_TYPE_WEP40 0x1 ++#define KEY_TYPE_TKIP 0x2 ++#define KEY_TYPE_CCMP 0x4 ++#define KEY_TYPE_WEP104 0x5 ++ ++/* added for rtl819x tx procedure */ ++#define MAX_QUEUE_SIZE 0x10 ++ ++// ++// 8190 queue mapping ++// ++#define BK_QUEUE 0 ++#define BE_QUEUE 1 ++#define VI_QUEUE 2 ++#define VO_QUEUE 3 ++#define HCCA_QUEUE 4 ++#define TXCMD_QUEUE 5 ++#define MGNT_QUEUE 6 ++#define HIGH_QUEUE 7 ++#define BEACON_QUEUE 8 ++ ++#define LOW_QUEUE BE_QUEUE ++#define NORMAL_QUEUE MGNT_QUEUE ++ ++//added by amy for ps ++#define SWRF_TIMEOUT 50 ++ ++//added by amy for LEAP related ++#define IE_CISCO_FLAG_POSITION 0x08 // Flag byte: byte 8, numbered from 0. ++#define SUPPORT_CKIP_MIC 0x08 // bit3 ++#define SUPPORT_CKIP_PK 0x10 // bit4 ++/* defined for skb cb field */ ++/* At most 28 byte */ ++typedef struct cb_desc { ++ /* Tx Desc Related flags (8-9) */ ++ u8 bLastIniPkt:1; ++ u8 bCmdOrInit:1; ++ u8 bFirstSeg:1; ++ u8 bLastSeg:1; ++ u8 bEncrypt:1; ++ u8 bTxDisableRateFallBack:1; ++ u8 bTxUseDriverAssingedRate:1; ++ u8 bHwSec:1; //indicate whether use Hw security. WB ++ ++ u8 reserved1; ++ ++ /* Tx Firmware Relaged flags (10-11)*/ ++ u8 bCTSEnable:1; ++ u8 bRTSEnable:1; ++ u8 bUseShortGI:1; ++ u8 bUseShortPreamble:1; ++ u8 bTxEnableFwCalcDur:1; ++ u8 bAMPDUEnable:1; ++ u8 bRTSSTBC:1; ++ u8 RTSSC:1; ++ ++ u8 bRTSBW:1; ++ u8 bPacketBW:1; ++ u8 bRTSUseShortPreamble:1; ++ u8 bRTSUseShortGI:1; ++ u8 bMulticast:1; ++ u8 bBroadcast:1; ++ //u8 reserved2:2; ++ u8 drv_agg_enable:1; ++ u8 reserved2:1; ++ ++ /* Tx Desc related element(12-19) */ ++ u8 rata_index; ++ u8 queue_index; ++ //u8 reserved3; ++ //u8 reserved4; ++ u16 txbuf_size; ++ //u8 reserved5; ++ u8 RATRIndex; ++ u8 reserved6; ++ u8 reserved7; ++ u8 reserved8; ++ ++ /* Tx firmware related element(20-27) */ ++ u8 data_rate; ++ u8 rts_rate; ++ u8 ampdu_factor; ++ u8 ampdu_density; ++ //u8 reserved9; ++ //u8 reserved10; ++ //u8 reserved11; ++ u8 DrvAggrNum; ++ u16 pkt_size; ++ u8 reserved12; ++}cb_desc, *pcb_desc; ++ ++/*--------------------------Define -------------------------------------------*/ ++#define MGN_1M 0x02 ++#define MGN_2M 0x04 ++#define MGN_5_5M 0x0b ++#define MGN_11M 0x16 ++ ++#define MGN_6M 0x0c ++#define MGN_9M 0x12 ++#define MGN_12M 0x18 ++#define MGN_18M 0x24 ++#define MGN_24M 0x30 ++#define MGN_36M 0x48 ++#define MGN_48M 0x60 ++#define MGN_54M 0x6c ++ ++#define MGN_MCS0 0x80 ++#define MGN_MCS1 0x81 ++#define MGN_MCS2 0x82 ++#define MGN_MCS3 0x83 ++#define MGN_MCS4 0x84 ++#define MGN_MCS5 0x85 ++#define MGN_MCS6 0x86 ++#define MGN_MCS7 0x87 ++#define MGN_MCS8 0x88 ++#define MGN_MCS9 0x89 ++#define MGN_MCS10 0x8a ++#define MGN_MCS11 0x8b ++#define MGN_MCS12 0x8c ++#define MGN_MCS13 0x8d ++#define MGN_MCS14 0x8e ++#define MGN_MCS15 0x8f ++ ++//---------------------------------------------------------------------------- ++// 802.11 Management frame Reason Code field ++//---------------------------------------------------------------------------- ++enum _ReasonCode{ ++ unspec_reason = 0x1, ++ auth_not_valid = 0x2, ++ deauth_lv_ss = 0x3, ++ inactivity = 0x4, ++ ap_overload = 0x5, ++ class2_err = 0x6, ++ class3_err = 0x7, ++ disas_lv_ss = 0x8, ++ asoc_not_auth = 0x9, ++ ++ //----MIC_CHECK ++ mic_failure = 0xe, ++ //----END MIC_CHECK ++ ++ // Reason code defined in 802.11i D10.0 p.28. ++ invalid_IE = 0x0d, ++ four_way_tmout = 0x0f, ++ two_way_tmout = 0x10, ++ IE_dismatch = 0x11, ++ invalid_Gcipher = 0x12, ++ invalid_Pcipher = 0x13, ++ invalid_AKMP = 0x14, ++ unsup_RSNIEver = 0x15, ++ invalid_RSNIE = 0x16, ++ auth_802_1x_fail= 0x17, ++ ciper_reject = 0x18, ++ ++ // Reason code defined in 7.3.1.7, 802.1e D13.0, p.42. Added by Annie, 2005-11-15. ++ QoS_unspec = 0x20, // 32 ++ QAP_bandwidth = 0x21, // 33 ++ poor_condition = 0x22, // 34 ++ no_facility = 0x23, // 35 ++ // Where is 36??? ++ req_declined = 0x25, // 37 ++ invalid_param = 0x26, // 38 ++ req_not_honored= 0x27, // 39 ++ TS_not_created = 0x2F, // 47 ++ DL_not_allowed = 0x30, // 48 ++ dest_not_exist = 0x31, // 49 ++ dest_not_QSTA = 0x32, // 50 ++}; ++ ++ ++ ++#define aSifsTime (((priv->ieee80211->current_network.mode == IEEE_A)||(priv->ieee80211->current_network.mode == IEEE_N_24G)||(priv->ieee80211->current_network.mode == IEEE_N_5G))? 16 : 10) ++ ++#define MGMT_QUEUE_NUM 5 ++ ++#define IEEE_CMD_SET_WPA_PARAM 1 ++#define IEEE_CMD_SET_WPA_IE 2 ++#define IEEE_CMD_SET_ENCRYPTION 3 ++#define IEEE_CMD_MLME 4 ++ ++#define IEEE_PARAM_WPA_ENABLED 1 ++#define IEEE_PARAM_TKIP_COUNTERMEASURES 2 ++#define IEEE_PARAM_DROP_UNENCRYPTED 3 ++#define IEEE_PARAM_PRIVACY_INVOKED 4 ++#define IEEE_PARAM_AUTH_ALGS 5 ++#define IEEE_PARAM_IEEE_802_1X 6 ++//It should consistent with the driver_XXX.c ++// David, 2006.9.26 ++#define IEEE_PARAM_WPAX_SELECT 7 ++//Added for notify the encryption type selection ++// David, 2006.9.26 ++#define IEEE_PROTO_WPA 1 ++#define IEEE_PROTO_RSN 2 ++//Added for notify the encryption type selection ++// David, 2006.9.26 ++#define IEEE_WPAX_USEGROUP 0 ++#define IEEE_WPAX_WEP40 1 ++#define IEEE_WPAX_TKIP 2 ++#define IEEE_WPAX_WRAP 3 ++#define IEEE_WPAX_CCMP 4 ++#define IEEE_WPAX_WEP104 5 ++ ++#define IEEE_KEY_MGMT_IEEE8021X 1 ++#define IEEE_KEY_MGMT_PSK 2 ++ ++#define IEEE_MLME_STA_DEAUTH 1 ++#define IEEE_MLME_STA_DISASSOC 2 ++ ++ ++#define IEEE_CRYPT_ERR_UNKNOWN_ALG 2 ++#define IEEE_CRYPT_ERR_UNKNOWN_ADDR 3 ++#define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED 4 ++#define IEEE_CRYPT_ERR_KEY_SET_FAILED 5 ++#define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6 ++#define IEEE_CRYPT_ERR_CARD_CONF_FAILED 7 ++ ++ ++#define IEEE_CRYPT_ALG_NAME_LEN 16 ++ ++#define MAX_IE_LEN 0xff ++ ++// added for kernel conflict ++#define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl ++#define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl ++#define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl ++#define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl ++#define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl ++#define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl ++ ++#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl ++ ++#define ieee80211_tkip_null ieee80211_tkip_null_rsl ++ ++#define ieee80211_wep_null ieee80211_wep_null_rsl ++ ++#define free_ieee80211 free_ieee80211_rsl ++#define alloc_ieee80211 alloc_ieee80211_rsl ++ ++#define ieee80211_rx ieee80211_rx_rsl ++#define ieee80211_rx_mgt ieee80211_rx_mgt_rsl ++ ++#define ieee80211_get_beacon ieee80211_get_beacon_rsl ++#define ieee80211_wake_queue ieee80211_wake_queue_rsl ++#define ieee80211_stop_queue ieee80211_stop_queue_rsl ++#define ieee80211_reset_queue ieee80211_reset_queue_rsl ++#define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl ++#define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl ++#define ieee80211_is_shortslot ieee80211_is_shortslot_rsl ++#define ieee80211_is_54g ieee80211_is_54g_rsl ++#define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl ++#define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl ++#define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl ++#define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl ++#define notify_wx_assoc_event notify_wx_assoc_event_rsl ++#define SendDisassociation SendDisassociation_rsl ++#define ieee80211_disassociate ieee80211_disassociate_rsl ++#define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl ++#define ieee80211_stop_scan ieee80211_stop_scan_rsl ++#define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl ++#define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl ++#define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl ++ ++#define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl ++#define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl ++#define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl ++#define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl ++#define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl ++#define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl ++#define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl ++#define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl ++#define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl ++#define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl ++#define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl ++#define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl ++#define ieee80211_wx_get_name ieee80211_wx_get_name_rsl ++#define ieee80211_wx_set_power ieee80211_wx_set_power_rsl ++#define ieee80211_wx_get_power ieee80211_wx_get_power_rsl ++#define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl ++#define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl ++#define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl ++ ++#define ieee80211_txb_free ieee80211_txb_free_rsl ++ ++#define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl ++#define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl ++#define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl ++#define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl ++#if WIRELESS_EXT >= 18 ++#define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl ++#define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl ++#define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl ++#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl ++#endif ++ ++ ++typedef struct ieee_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_code; ++ } mlme; ++ struct { ++ u8 alg[IEEE_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; ++}ieee_param; ++ ++ ++#if WIRELESS_EXT < 17 ++#define IW_QUAL_QUAL_INVALID 0x10 ++#define IW_QUAL_LEVEL_INVALID 0x20 ++#define IW_QUAL_NOISE_INVALID 0x40 ++#define IW_QUAL_QUAL_UPDATED 0x1 ++#define IW_QUAL_LEVEL_UPDATED 0x2 ++#define IW_QUAL_NOISE_UPDATED 0x4 ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data) ++{ ++ task->routine = func; ++ task->data = data; ++ //task->next = NULL; ++ INIT_LIST_HEAD(&task->list); ++ task->sync = 0; ++} ++#endif ++ ++// linux under 2.6.9 release may not support it, so modify it for common use ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) ++//#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) ++#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) ++static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) ++{ ++ unsigned long timeout = MSECS(msecs) + 1; ++ ++ while (timeout) { ++ set_current_state(TASK_INTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++ return timeout; ++} ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) ++static inline void msleep(unsigned int msecs) ++{ ++ unsigned long timeout = MSECS(msecs) + 1; ++ ++ while (timeout) { ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++} ++#endif ++#else ++#define MSECS(t) msecs_to_jiffies(t) ++#define msleep_interruptible_rsl msleep_interruptible ++#endif ++ ++#define IEEE80211_DATA_LEN 2304 ++/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section ++ 6.2.1.1.2. ++ ++ The figure in section 7.1.2 suggests a body size of up to 2312 ++ bytes is allowed, which is a bit confusing, I suspect this ++ represents the 2304 bytes of real data, plus a possible 8 bytes of ++ WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ ++#define IEEE80211_1ADDR_LEN 10 ++#define IEEE80211_2ADDR_LEN 16 ++#define IEEE80211_3ADDR_LEN 24 ++#define IEEE80211_4ADDR_LEN 30 ++#define IEEE80211_FCS_LEN 4 ++#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) ++#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) ++#define IEEE80211_MGMT_HDR_LEN 24 ++#define IEEE80211_DATA_HDR3_LEN 24 ++#define IEEE80211_DATA_HDR4_LEN 30 ++ ++#define MIN_FRAG_THRESHOLD 256U ++#define MAX_FRAG_THRESHOLD 2346U ++ ++ ++/* Frame control field constants */ ++#define IEEE80211_FCTL_VERS 0x0003 ++#define IEEE80211_FCTL_FTYPE 0x000c ++#define IEEE80211_FCTL_STYPE 0x00f0 ++#define IEEE80211_FCTL_FRAMETYPE 0x00fc ++#define IEEE80211_FCTL_TODS 0x0100 ++#define IEEE80211_FCTL_FROMDS 0x0200 ++#define IEEE80211_FCTL_DSTODS 0x0300 //added by david ++#define IEEE80211_FCTL_MOREFRAGS 0x0400 ++#define IEEE80211_FCTL_RETRY 0x0800 ++#define IEEE80211_FCTL_PM 0x1000 ++#define IEEE80211_FCTL_MOREDATA 0x2000 ++#define IEEE80211_FCTL_WEP 0x4000 ++#define IEEE80211_FCTL_ORDER 0x8000 ++ ++#define IEEE80211_FTYPE_MGMT 0x0000 ++#define IEEE80211_FTYPE_CTL 0x0004 ++#define IEEE80211_FTYPE_DATA 0x0008 ++ ++/* management */ ++#define IEEE80211_STYPE_ASSOC_REQ 0x0000 ++#define IEEE80211_STYPE_ASSOC_RESP 0x0010 ++#define IEEE80211_STYPE_REASSOC_REQ 0x0020 ++#define IEEE80211_STYPE_REASSOC_RESP 0x0030 ++#define IEEE80211_STYPE_PROBE_REQ 0x0040 ++#define IEEE80211_STYPE_PROBE_RESP 0x0050 ++#define IEEE80211_STYPE_BEACON 0x0080 ++#define IEEE80211_STYPE_ATIM 0x0090 ++#define IEEE80211_STYPE_DISASSOC 0x00A0 ++#define IEEE80211_STYPE_AUTH 0x00B0 ++#define IEEE80211_STYPE_DEAUTH 0x00C0 ++#define IEEE80211_STYPE_MANAGE_ACT 0x00D0 ++ ++/* control */ ++#define IEEE80211_STYPE_PSPOLL 0x00A0 ++#define IEEE80211_STYPE_RTS 0x00B0 ++#define IEEE80211_STYPE_CTS 0x00C0 ++#define IEEE80211_STYPE_ACK 0x00D0 ++#define IEEE80211_STYPE_CFEND 0x00E0 ++#define IEEE80211_STYPE_CFENDACK 0x00F0 ++#define IEEE80211_STYPE_BLOCKACK 0x0094 ++ ++/* data */ ++#define IEEE80211_STYPE_DATA 0x0000 ++#define IEEE80211_STYPE_DATA_CFACK 0x0010 ++#define IEEE80211_STYPE_DATA_CFPOLL 0x0020 ++#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 ++#define IEEE80211_STYPE_NULLFUNC 0x0040 ++#define IEEE80211_STYPE_CFACK 0x0050 ++#define IEEE80211_STYPE_CFPOLL 0x0060 ++#define IEEE80211_STYPE_CFACKPOLL 0x0070 ++#define IEEE80211_STYPE_QOS_DATA 0x0080 //added for WMM 2006/8/2 ++#define IEEE80211_STYPE_QOS_NULL 0x00C0 ++ ++#define IEEE80211_SCTL_FRAG 0x000F ++#define IEEE80211_SCTL_SEQ 0xFFF0 ++ ++/* QOS control */ ++#define IEEE80211_QCTL_TID 0x000F ++ ++#define FC_QOS_BIT BIT7 ++#define IsDataFrame(pdu) ( ((pdu[0] & 0x0C)==0x08) ? true : false ) ++#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)) ) ++//added by wb. Is this right? ++#define IsQoSDataFrame(pframe) ((*(u16*)pframe&(IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) ++#define Frame_Order(pframe) (*(u16*)pframe&IEEE80211_FCTL_ORDER) ++#define SN_LESS(a, b) (((a-b)&0x800)!=0) ++#define SN_EQUAL(a, b) (a == b) ++#define MAX_DEV_ADDR_SIZE 8 ++typedef enum _ACT_CATEGORY{ ++ ACT_CAT_QOS = 1, ++ ACT_CAT_DLS = 2, ++ ACT_CAT_BA = 3, ++ ACT_CAT_HT = 7, ++ ACT_CAT_WMM = 17, ++} ACT_CATEGORY, *PACT_CATEGORY; ++ ++typedef enum _TS_ACTION{ ++ ACT_ADDTSREQ = 0, ++ ACT_ADDTSRSP = 1, ++ ACT_DELTS = 2, ++ ACT_SCHEDULE = 3, ++} TS_ACTION, *PTS_ACTION; ++ ++typedef enum _BA_ACTION{ ++ ACT_ADDBAREQ = 0, ++ ACT_ADDBARSP = 1, ++ ACT_DELBA = 2, ++} BA_ACTION, *PBA_ACTION; ++ ++typedef enum _InitialGainOpType{ ++ IG_Backup=0, ++ IG_Restore, ++ IG_Max ++}InitialGainOpType; ++ ++/* debug macros */ ++#define CONFIG_IEEE80211_DEBUG ++#ifdef CONFIG_IEEE80211_DEBUG ++extern u32 ieee80211_debug_level; ++#define IEEE80211_DEBUG(level, fmt, args...) \ ++do { if (ieee80211_debug_level & (level)) \ ++ printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0) ++//wb added to debug out data buf ++//if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA ++#define IEEE80211_DEBUG_DATA(level, data, datalen) \ ++ do{ if ((ieee80211_debug_level & (level)) == (level)) \ ++ { \ ++ int i; \ ++ u8* pdata = (u8*) data; \ ++ printk(KERN_DEBUG "ieee80211: %s()\n", __FUNCTION__); \ ++ for(i=0; i<(int)(datalen); i++) \ ++ { \ ++ printk("%2x ", pdata[i]); \ ++ if ((i+1)%16 == 0) printk("\n"); \ ++ } \ ++ printk("\n"); \ ++ } \ ++ } while (0) ++#else ++#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) ++#define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while(0) ++#endif /* CONFIG_IEEE80211_DEBUG */ ++ ++/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ ++ ++#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" ++#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5] ++ ++/* ++ * 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 IEEE80211_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 IEEE80211_xxxx_DEBUG() macro definition for your ++ * classification, or use IEEE80211_DEBUG(IEEE80211_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_IEEE80211_DEBUG defined in your kernel configuration ++ * ++ */ ++ ++#define IEEE80211_DL_INFO (1<<0) ++#define IEEE80211_DL_WX (1<<1) ++#define IEEE80211_DL_SCAN (1<<2) ++#define IEEE80211_DL_STATE (1<<3) ++#define IEEE80211_DL_MGMT (1<<4) ++#define IEEE80211_DL_FRAG (1<<5) ++#define IEEE80211_DL_EAP (1<<6) ++#define IEEE80211_DL_DROP (1<<7) ++ ++#define IEEE80211_DL_TX (1<<8) ++#define IEEE80211_DL_RX (1<<9) ++ ++#define IEEE80211_DL_HT (1<<10) //HT ++#define IEEE80211_DL_BA (1<<11) //ba ++#define IEEE80211_DL_TS (1<<12) //TS ++#define IEEE80211_DL_QOS (1<<13) ++#define IEEE80211_DL_REORDER (1<<14) ++#define IEEE80211_DL_IOT (1<<15) ++#define IEEE80211_DL_IPS (1<<16) ++#define IEEE80211_DL_TRACE (1<<29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen ++#define IEEE80211_DL_DATA (1<<30) //use this flag to control whether print data buf out. ++#define IEEE80211_DL_ERR (1<<31) //always open ++#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) ++#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) ++#define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a) ++ ++#define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a) ++#define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a) ++#define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a) ++#define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a) ++#define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a) ++#define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a) ++#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) ++#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) ++#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) ++#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++/* Added by Annie, 2005-11-22. */ ++#define MAX_STR_LEN 64 ++/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/ ++#define PRINTABLE(_ch) (_ch>'!' && _ch<'~') ++#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \ ++ if((_Comp) & level) \ ++ { \ ++ int __i; \ ++ u8 buffer[MAX_STR_LEN]; \ ++ int length = (_Len\n", _Len, buffer); \ ++ } ++#else ++#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0) ++#endif ++ ++#include ++#include /* ARPHRD_ETHER */ ++ ++#ifndef WIRELESS_SPY ++#define WIRELESS_SPY // enable iwspy support ++#endif ++#include // new driver API ++ ++#ifndef ETH_P_PAE ++#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ ++#endif /* ETH_P_PAE */ ++ ++#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ ++ ++#ifndef ETH_P_80211_RAW ++#define ETH_P_80211_RAW (ETH_P_ECONET + 1) ++#endif ++ ++/* IEEE 802.11 defines */ ++ ++#define P80211_OUI_LEN 3 ++ ++struct ieee80211_snap_hdr { ++ ++ u8 dsap; /* always 0xAA */ ++ u8 ssap; /* always 0xAA */ ++ u8 ctrl; /* always 0x03 */ ++ u8 oui[P80211_OUI_LEN]; /* organizational universal id */ ++ ++} __attribute__ ((packed)); ++ ++#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) ++ ++#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) ++#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) ++#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) ++ ++#define WLAN_FC_GET_FRAMETYPE(fc) ((fc) & IEEE80211_FCTL_FRAMETYPE) ++#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) ++#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) ++ ++/* Authentication algorithms */ ++#define WLAN_AUTH_OPEN 0 ++#define WLAN_AUTH_SHARED_KEY 1 ++#define WLAN_AUTH_LEAP 2 ++ ++#define WLAN_AUTH_CHALLENGE_LEN 128 ++ ++#define WLAN_CAPABILITY_BSS (1<<0) ++#define WLAN_CAPABILITY_IBSS (1<<1) ++#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) ++#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) ++#define WLAN_CAPABILITY_PRIVACY (1<<4) ++#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) ++#define WLAN_CAPABILITY_PBCC (1<<6) ++#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) ++#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) ++#define WLAN_CAPABILITY_QOS (1<<9) ++#define WLAN_CAPABILITY_SHORT_SLOT (1<<10) ++#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) ++ ++/* 802.11g ERP information element */ ++#define WLAN_ERP_NON_ERP_PRESENT (1<<0) ++#define WLAN_ERP_USE_PROTECTION (1<<1) ++#define WLAN_ERP_BARKER_PREAMBLE (1<<2) ++ ++/* Status codes */ ++enum ieee80211_statuscode { ++ WLAN_STATUS_SUCCESS = 0, ++ WLAN_STATUS_UNSPECIFIED_FAILURE = 1, ++ WLAN_STATUS_CAPS_UNSUPPORTED = 10, ++ WLAN_STATUS_REASSOC_NO_ASSOC = 11, ++ WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, ++ WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, ++ WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, ++ WLAN_STATUS_CHALLENGE_FAIL = 15, ++ WLAN_STATUS_AUTH_TIMEOUT = 16, ++ WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, ++ WLAN_STATUS_ASSOC_DENIED_RATES = 18, ++ /* 802.11b */ ++ WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, ++ WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, ++ WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, ++ /* 802.11h */ ++ WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, ++ WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, ++ WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, ++ /* 802.11g */ ++ WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, ++ WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, ++ /* 802.11i */ ++ WLAN_STATUS_INVALID_IE = 40, ++ WLAN_STATUS_INVALID_GROUP_CIPHER = 41, ++ WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, ++ WLAN_STATUS_INVALID_AKMP = 43, ++ WLAN_STATUS_UNSUPP_RSN_VERSION = 44, ++ WLAN_STATUS_INVALID_RSN_IE_CAP = 45, ++ WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, ++}; ++ ++/* Reason codes */ ++enum ieee80211_reasoncode { ++ WLAN_REASON_UNSPECIFIED = 1, ++ WLAN_REASON_PREV_AUTH_NOT_VALID = 2, ++ WLAN_REASON_DEAUTH_LEAVING = 3, ++ WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, ++ WLAN_REASON_DISASSOC_AP_BUSY = 5, ++ WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, ++ WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, ++ WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, ++ WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, ++ /* 802.11h */ ++ WLAN_REASON_DISASSOC_BAD_POWER = 10, ++ WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, ++ /* 802.11i */ ++ WLAN_REASON_INVALID_IE = 13, ++ WLAN_REASON_MIC_FAILURE = 14, ++ WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, ++ WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, ++ WLAN_REASON_IE_DIFFERENT = 17, ++ WLAN_REASON_INVALID_GROUP_CIPHER = 18, ++ WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, ++ WLAN_REASON_INVALID_AKMP = 20, ++ WLAN_REASON_UNSUPP_RSN_VERSION = 21, ++ WLAN_REASON_INVALID_RSN_IE_CAP = 22, ++ WLAN_REASON_IEEE8021X_FAILED = 23, ++ WLAN_REASON_CIPHER_SUITE_REJECTED = 24, ++}; ++ ++#define IEEE80211_STATMASK_SIGNAL (1<<0) ++#define IEEE80211_STATMASK_RSSI (1<<1) ++#define IEEE80211_STATMASK_NOISE (1<<2) ++#define IEEE80211_STATMASK_RATE (1<<3) ++#define IEEE80211_STATMASK_WEMASK 0x7 ++ ++#define IEEE80211_CCK_MODULATION (1<<0) ++#define IEEE80211_OFDM_MODULATION (1<<1) ++ ++#define IEEE80211_24GHZ_BAND (1<<0) ++#define IEEE80211_52GHZ_BAND (1<<1) ++ ++#define IEEE80211_CCK_RATE_LEN 4 ++#define IEEE80211_CCK_RATE_1MB 0x02 ++#define IEEE80211_CCK_RATE_2MB 0x04 ++#define IEEE80211_CCK_RATE_5MB 0x0B ++#define IEEE80211_CCK_RATE_11MB 0x16 ++#define IEEE80211_OFDM_RATE_LEN 8 ++#define IEEE80211_OFDM_RATE_6MB 0x0C ++#define IEEE80211_OFDM_RATE_9MB 0x12 ++#define IEEE80211_OFDM_RATE_12MB 0x18 ++#define IEEE80211_OFDM_RATE_18MB 0x24 ++#define IEEE80211_OFDM_RATE_24MB 0x30 ++#define IEEE80211_OFDM_RATE_36MB 0x48 ++#define IEEE80211_OFDM_RATE_48MB 0x60 ++#define IEEE80211_OFDM_RATE_54MB 0x6C ++#define IEEE80211_BASIC_RATE_MASK 0x80 ++ ++#define IEEE80211_CCK_RATE_1MB_MASK (1<<0) ++#define IEEE80211_CCK_RATE_2MB_MASK (1<<1) ++#define IEEE80211_CCK_RATE_5MB_MASK (1<<2) ++#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) ++#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) ++#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) ++#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) ++#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) ++#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) ++#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) ++#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) ++#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) ++ ++#define IEEE80211_CCK_RATES_MASK 0x0000000F ++#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ ++ IEEE80211_CCK_RATE_2MB_MASK) ++#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ ++ IEEE80211_CCK_RATE_5MB_MASK | \ ++ IEEE80211_CCK_RATE_11MB_MASK) ++ ++#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 ++#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ ++ IEEE80211_OFDM_RATE_12MB_MASK | \ ++ IEEE80211_OFDM_RATE_24MB_MASK) ++#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \ ++ IEEE80211_OFDM_RATE_9MB_MASK | \ ++ IEEE80211_OFDM_RATE_18MB_MASK | \ ++ IEEE80211_OFDM_RATE_36MB_MASK | \ ++ IEEE80211_OFDM_RATE_48MB_MASK | \ ++ IEEE80211_OFDM_RATE_54MB_MASK) ++#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ ++ IEEE80211_CCK_DEFAULT_RATES_MASK) ++ ++#define IEEE80211_NUM_OFDM_RATES 8 ++#define IEEE80211_NUM_CCK_RATES 4 ++#define IEEE80211_OFDM_SHIFT_MASK_A 4 ++ ++ ++/* this is stolen and modified from the madwifi driver*/ ++#define IEEE80211_FC0_TYPE_MASK 0x0c ++#define IEEE80211_FC0_TYPE_DATA 0x08 ++#define IEEE80211_FC0_SUBTYPE_MASK 0xB0 ++#define IEEE80211_FC0_SUBTYPE_QOS 0x80 ++ ++#define IEEE80211_QOS_HAS_SEQ(fc) \ ++ (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \ ++ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) ++ ++/* this is stolen from ipw2200 driver */ ++#define IEEE_IBSS_MAC_HASH_SIZE 31 ++struct ieee_ibss_seq { ++ u8 mac[ETH_ALEN]; ++ u16 seq_num[17]; ++ u16 frag_num[17]; ++ unsigned long packet_time[17]; ++ struct list_head list; ++}; ++ ++/* NOTE: This data is for statistical purposes; not all hardware provides this ++ * information for frames received. Not setting these will not cause ++ * any adverse affects. */ ++struct ieee80211_rx_stats { ++#if 1 ++ u32 mac_time[2]; ++ s8 rssi; ++ u8 signal; ++ u8 noise; ++ u16 rate; /* in 100 kbps */ ++ u8 received_channel; ++ u8 control; ++ u8 mask; ++ u8 freq; ++ u16 len; ++ u64 tsf; ++ u32 beacon_time; ++ u8 nic_type; ++ u16 Length; ++ // u8 DataRate; // In 0.5 Mbps ++ u8 SignalQuality; // in 0-100 index. ++ s32 RecvSignalPower; // Real power in dBm for this packet, no beautification and aggregation. ++ s8 RxPower; // in dBm Translate from PWdB ++ u8 SignalStrength; // in 0-100 index. ++ u16 bHwError:1; ++ u16 bCRC:1; ++ u16 bICV:1; ++ u16 bShortPreamble:1; ++ u16 Antenna:1; //for rtl8185 ++ u16 Decrypted:1; //for rtl8185, rtl8187 ++ u16 Wakeup:1; //for rtl8185 ++ u16 Reserved0:1; //for rtl8185 ++ u8 AGC; ++ u32 TimeStampLow; ++ u32 TimeStampHigh; ++ bool bShift; ++ bool bIsQosData; // Added by Annie, 2005-12-22. ++ u8 UserPriority; ++ ++ //1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ //1Attention Please!!!<11n or 8190 specific code should be put below this line> ++ //1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ ++ u8 RxDrvInfoSize; ++ u8 RxBufShift; ++ bool bIsAMPDU; ++ bool bFirstMPDU; ++ bool bContainHTC; ++ bool RxIs40MHzPacket; ++ u32 RxPWDBAll; ++ u8 RxMIMOSignalStrength[4]; // in 0~100 index ++ s8 RxMIMOSignalQuality[2]; ++ bool bPacketMatchBSSID; ++ bool bIsCCK; ++ bool bPacketToSelf; ++ //added by amy ++ u8* virtual_address; ++ u16 packetlength; // Total packet length: Must equal to sum of all FragLength ++ u16 fraglength; // FragLength should equal to PacketLength in non-fragment case ++ u16 fragoffset; // Data offset for this fragment ++ u16 ntotalfrag; ++ bool bisrxaggrsubframe; ++ bool bPacketBeacon; //cosa add for rssi ++ bool bToSelfBA; //cosa add for rssi ++ char cck_adc_pwdb[4]; //cosa add for rx path selection ++ u16 Seq_Num; ++#endif ++ ++}; ++ ++/* IEEE 802.11 requires that STA supports concurrent reception of at least ++ * three fragmented frames. This define can be increased to support more ++ * concurrent frames, but it should be noted that each entry can consume about ++ * 2 kB of RAM and increasing cache size will slow down frame reassembly. */ ++#define IEEE80211_FRAG_CACHE_LEN 4 ++ ++struct ieee80211_frag_entry { ++ unsigned long first_frag_time; ++ unsigned int seq; ++ unsigned int last_frag; ++ struct sk_buff *skb; ++ u8 src_addr[ETH_ALEN]; ++ u8 dst_addr[ETH_ALEN]; ++}; ++ ++struct ieee80211_stats { ++ unsigned int tx_unicast_frames; ++ unsigned int tx_multicast_frames; ++ unsigned int tx_fragments; ++ unsigned int tx_unicast_octets; ++ unsigned int tx_multicast_octets; ++ unsigned int tx_deferred_transmissions; ++ unsigned int tx_single_retry_frames; ++ unsigned int tx_multiple_retry_frames; ++ unsigned int tx_retry_limit_exceeded; ++ unsigned int tx_discards; ++ unsigned int rx_unicast_frames; ++ unsigned int rx_multicast_frames; ++ unsigned int rx_fragments; ++ unsigned int rx_unicast_octets; ++ unsigned int rx_multicast_octets; ++ unsigned int rx_fcs_errors; ++ unsigned int rx_discards_no_buffer; ++ unsigned int tx_discards_wrong_sa; ++ unsigned int rx_discards_undecryptable; ++ unsigned int rx_message_in_msg_fragments; ++ unsigned int rx_message_in_bad_msg_fragments; ++}; ++ ++struct ieee80211_device; ++ ++#include "ieee80211_crypt.h" ++ ++#define SEC_KEY_1 (1<<0) ++#define SEC_KEY_2 (1<<1) ++#define SEC_KEY_3 (1<<2) ++#define SEC_KEY_4 (1<<3) ++#define SEC_ACTIVE_KEY (1<<4) ++#define SEC_AUTH_MODE (1<<5) ++#define SEC_UNICAST_GROUP (1<<6) ++#define SEC_LEVEL (1<<7) ++#define SEC_ENABLED (1<<8) ++#define SEC_ENCRYPT (1<<9) ++ ++#define SEC_LEVEL_0 0 /* None */ ++#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ ++#define SEC_LEVEL_2 2 /* Level 1 + TKIP */ ++#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ ++#define SEC_LEVEL_3 4 /* Level 2 + CCMP */ ++ ++#define SEC_ALG_NONE 0 ++#define SEC_ALG_WEP 1 ++#define SEC_ALG_TKIP 2 ++#define SEC_ALG_CCMP 3 ++ ++#define WEP_KEYS 4 ++#define WEP_KEY_LEN 13 ++#define SCM_KEY_LEN 32 ++#define SCM_TEMPORAL_KEY_LENGTH 16 ++ ++struct ieee80211_security { ++ u16 active_key:2, ++ enabled:1, ++ auth_mode:2, ++ auth_algo:4, ++ unicast_uses_group:1, ++ encrypt:1; ++ u8 key_sizes[WEP_KEYS]; ++ u8 keys[WEP_KEYS][SCM_KEY_LEN]; ++ u8 level; ++ u16 flags; ++} __attribute__ ((packed)); ++ ++ ++/* ++ 802.11 data frame from AP ++ ,-------------------------------------------------------------------. ++Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | ++ |------|------|---------|---------|---------|------|---------|------| ++Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs | ++ | | tion | (BSSID) | | | ence | data | | ++ `-------------------------------------------------------------------' ++Total: 28-2340 bytes ++*/ ++ ++/* Management Frame Information Element Types */ ++enum ieee80211_mfie { ++ MFIE_TYPE_SSID = 0, ++ MFIE_TYPE_RATES = 1, ++ MFIE_TYPE_FH_SET = 2, ++ MFIE_TYPE_DS_SET = 3, ++ MFIE_TYPE_CF_SET = 4, ++ MFIE_TYPE_TIM = 5, ++ MFIE_TYPE_IBSS_SET = 6, ++ MFIE_TYPE_COUNTRY = 7, ++ MFIE_TYPE_HOP_PARAMS = 8, ++ MFIE_TYPE_HOP_TABLE = 9, ++ MFIE_TYPE_REQUEST = 10, ++ MFIE_TYPE_CHALLENGE = 16, ++ MFIE_TYPE_POWER_CONSTRAINT = 32, ++ MFIE_TYPE_POWER_CAPABILITY = 33, ++ MFIE_TYPE_TPC_REQUEST = 34, ++ MFIE_TYPE_TPC_REPORT = 35, ++ MFIE_TYPE_SUPP_CHANNELS = 36, ++ MFIE_TYPE_CSA = 37, ++ MFIE_TYPE_MEASURE_REQUEST = 38, ++ MFIE_TYPE_MEASURE_REPORT = 39, ++ MFIE_TYPE_QUIET = 40, ++ MFIE_TYPE_IBSS_DFS = 41, ++ MFIE_TYPE_ERP = 42, ++ MFIE_TYPE_RSN = 48, ++ MFIE_TYPE_RATES_EX = 50, ++ MFIE_TYPE_HT_CAP= 45, ++ MFIE_TYPE_HT_INFO= 61, ++ MFIE_TYPE_AIRONET=133, ++ MFIE_TYPE_GENERIC = 221, ++ MFIE_TYPE_QOS_PARAMETER = 222, ++}; ++ ++/* Minimal header; can be used for passing 802.11 frames with sufficient ++ * information to determine what type of underlying data type is actually ++ * stored in the data. */ ++struct ieee80211_hdr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_1addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_2addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_3addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_4addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 addr4[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_3addrqos { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 payload[0]; ++ __le16 qos_ctl; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_4addrqos { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 addr4[ETH_ALEN]; ++ u8 payload[0]; ++ __le16 qos_ctl; ++} __attribute__ ((packed)); ++ ++struct ieee80211_info_element { ++ u8 id; ++ u8 len; ++ u8 data[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_authentication { ++ struct ieee80211_hdr_3addr header; ++ __le16 algorithm; ++ __le16 transaction; ++ __le16 status; ++ /*challenge*/ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_disassoc { ++ struct ieee80211_hdr_3addr header; ++ __le16 reason; ++} __attribute__ ((packed)); ++ ++struct ieee80211_probe_request { ++ struct ieee80211_hdr_3addr header; ++ /* SSID, supported rates */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_probe_response { ++ struct ieee80211_hdr_3addr header; ++ u32 time_stamp[2]; ++ __le16 beacon_interval; ++ __le16 capability; ++ /* SSID, supported rates, FH params, DS params, ++ * CF params, IBSS params, TIM (if beacon), RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++/* Alias beacon for probe_response */ ++#define ieee80211_beacon ieee80211_probe_response ++ ++struct ieee80211_assoc_request_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 listen_interval; ++ /* SSID, supported rates, RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_reassoc_request_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 listen_interval; ++ u8 current_ap[ETH_ALEN]; ++ /* SSID, supported rates, RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_assoc_response_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 status; ++ __le16 aid; ++ struct ieee80211_info_element info_element[0]; /* supported rates */ ++} __attribute__ ((packed)); ++ ++struct ieee80211_txb { ++ u8 nr_frags; ++ u8 encrypted; ++ u8 queue_index; ++ u8 rts_included; ++ u16 reserved; ++ __le16 frag_size; ++ __le16 payload_size; ++ struct sk_buff *fragments[0]; ++}; ++ ++#define MAX_TX_AGG_COUNT 16 ++struct ieee80211_drv_agg_txb { ++ u8 nr_drv_agg_frames; ++ struct sk_buff *tx_agg_frames[MAX_TX_AGG_COUNT]; ++}__attribute__((packed)); ++ ++#define MAX_SUBFRAME_COUNT 64 ++struct ieee80211_rxb { ++ u8 nr_subframes; ++ struct sk_buff *subframes[MAX_SUBFRAME_COUNT]; ++ u8 dst[ETH_ALEN]; ++ u8 src[ETH_ALEN]; ++}__attribute__((packed)); ++ ++typedef union _frameqos { ++ u16 shortdata; ++ u8 chardata[2]; ++ struct { ++ u16 tid:4; ++ u16 eosp:1; ++ u16 ack_policy:2; ++ u16 reserved:1; ++ u16 txop:8; ++ }field; ++}frameqos,*pframeqos; ++ ++/* SWEEP TABLE ENTRIES NUMBER*/ ++#define MAX_SWEEP_TAB_ENTRIES 42 ++#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 ++/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs ++ * only use 8, and then use extended rates for the remaining supported ++ * rates. Other APs, however, stick all of their supported rates on the ++ * main rates information element... */ ++#define MAX_RATES_LENGTH ((u8)12) ++#define MAX_RATES_EX_LENGTH ((u8)16) ++#define MAX_NETWORK_COUNT 128 ++ ++#define MAX_CHANNEL_NUMBER 161 ++#define IEEE80211_SOFTMAC_SCAN_TIME 100 ++//(HZ / 2) ++#define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2) ++ ++#define CRC_LENGTH 4U ++ ++#define MAX_WPA_IE_LEN 64 ++ ++#define NETWORK_EMPTY_ESSID (1<<0) ++#define NETWORK_HAS_OFDM (1<<1) ++#define NETWORK_HAS_CCK (1<<2) ++ ++/* QoS structure */ ++#define NETWORK_HAS_QOS_PARAMETERS (1<<3) ++#define NETWORK_HAS_QOS_INFORMATION (1<<4) ++#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \ ++ NETWORK_HAS_QOS_INFORMATION) ++/* 802.11h */ ++#define NETWORK_HAS_POWER_CONSTRAINT (1<<5) ++#define NETWORK_HAS_CSA (1<<6) ++#define NETWORK_HAS_QUIET (1<<7) ++#define NETWORK_HAS_IBSS_DFS (1<<8) ++#define NETWORK_HAS_TPC_REPORT (1<<9) ++ ++#define NETWORK_HAS_ERP_VALUE (1<<10) ++ ++#define QOS_QUEUE_NUM 4 ++#define QOS_OUI_LEN 3 ++#define QOS_OUI_TYPE 2 ++#define QOS_ELEMENT_ID 221 ++#define QOS_OUI_INFO_SUB_TYPE 0 ++#define QOS_OUI_PARAM_SUB_TYPE 1 ++#define QOS_VERSION_1 1 ++#define QOS_AIFSN_MIN_VALUE 2 ++#if 1 ++struct ieee80211_qos_information_element { ++ u8 elementID; ++ u8 length; ++ u8 qui[QOS_OUI_LEN]; ++ u8 qui_type; ++ u8 qui_subtype; ++ u8 version; ++ u8 ac_info; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_ac_parameter { ++ u8 aci_aifsn; ++ u8 ecw_min_max; ++ __le16 tx_op_limit; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_parameter_info { ++ struct ieee80211_qos_information_element info_element; ++ u8 reserved; ++ struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_parameters { ++ __le16 cw_min[QOS_QUEUE_NUM]; ++ __le16 cw_max[QOS_QUEUE_NUM]; ++ u8 aifs[QOS_QUEUE_NUM]; ++ u8 flag[QOS_QUEUE_NUM]; ++ __le16 tx_op_limit[QOS_QUEUE_NUM]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_data { ++ struct ieee80211_qos_parameters parameters; ++ int active; ++ int supported; ++ u8 param_count; ++ u8 old_param_count; ++}; ++ ++struct ieee80211_tim_parameters { ++ u8 tim_count; ++ u8 tim_period; ++} __attribute__ ((packed)); ++ ++//#else ++struct ieee80211_wmm_ac_param { ++ u8 ac_aci_acm_aifsn; ++ u8 ac_ecwmin_ecwmax; ++ u16 ac_txop_limit; ++}; ++ ++struct ieee80211_wmm_ts_info { ++ u8 ac_dir_tid; ++ u8 ac_up_psb; ++ u8 reserved; ++} __attribute__ ((packed)); ++ ++struct ieee80211_wmm_tspec_elem { ++ struct ieee80211_wmm_ts_info ts_info; ++ u16 norm_msdu_size; ++ u16 max_msdu_size; ++ u32 min_serv_inter; ++ u32 max_serv_inter; ++ u32 inact_inter; ++ u32 suspen_inter; ++ u32 serv_start_time; ++ u32 min_data_rate; ++ u32 mean_data_rate; ++ u32 peak_data_rate; ++ u32 max_burst_size; ++ u32 delay_bound; ++ u32 min_phy_rate; ++ u16 surp_band_allow; ++ u16 medium_time; ++}__attribute__((packed)); ++#endif ++enum eap_type { ++ EAP_PACKET = 0, ++ EAPOL_START, ++ EAPOL_LOGOFF, ++ EAPOL_KEY, ++ EAPOL_ENCAP_ASF_ALERT ++}; ++ ++static const char *eap_types[] = { ++ [EAP_PACKET] = "EAP-Packet", ++ [EAPOL_START] = "EAPOL-Start", ++ [EAPOL_LOGOFF] = "EAPOL-Logoff", ++ [EAPOL_KEY] = "EAPOL-Key", ++ [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert" ++}; ++ ++static inline const char *eap_get_type(int type) ++{ ++ return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type]; ++} ++//added by amy for reorder ++static inline u8 Frame_QoSTID(u8* buf) ++{ ++ struct ieee80211_hdr_3addr *hdr; ++ u16 fc; ++ hdr = (struct ieee80211_hdr_3addr *)buf; ++ fc = le16_to_cpu(hdr->frame_ctl); ++ return (u8)((frameqos*)(buf + (((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24)))->field.tid; ++} ++ ++//added by amy for reorder ++ ++struct eapol { ++ u8 snap[6]; ++ u16 ethertype; ++ u8 version; ++ u8 type; ++ u16 length; ++} __attribute__ ((packed)); ++ ++struct ieee80211_softmac_stats{ ++ unsigned int rx_ass_ok; ++ unsigned int rx_ass_err; ++ unsigned int rx_probe_rq; ++ unsigned int tx_probe_rs; ++ unsigned int tx_beacons; ++ unsigned int rx_auth_rq; ++ unsigned int rx_auth_rs_ok; ++ unsigned int rx_auth_rs_err; ++ unsigned int tx_auth_rq; ++ unsigned int no_auth_rs; ++ unsigned int no_ass_rs; ++ unsigned int tx_ass_rq; ++ unsigned int rx_ass_rq; ++ unsigned int tx_probe_rq; ++ unsigned int reassoc; ++ unsigned int swtxstop; ++ unsigned int swtxawake; ++ unsigned char CurrentShowTxate; ++ unsigned char last_packet_rate; ++ unsigned int txretrycount; ++}; ++ ++#define BEACON_PROBE_SSID_ID_POSITION 12 ++ ++struct ieee80211_info_element_hdr { ++ u8 id; ++ u8 len; ++} __attribute__ ((packed)); ++ ++/* ++ * These are the data types that can make up management packets ++ * ++ u16 auth_algorithm; ++ u16 auth_sequence; ++ u16 beacon_interval; ++ u16 capability; ++ u8 current_ap[ETH_ALEN]; ++ u16 listen_interval; ++ struct { ++ u16 association_id:14, reserved:2; ++ } __attribute__ ((packed)); ++ u32 time_stamp[2]; ++ u16 reason; ++ u16 status; ++*/ ++ ++#define IEEE80211_DEFAULT_TX_ESSID "Penguin" ++#define IEEE80211_DEFAULT_BASIC_RATE 2 //1Mbps ++ ++enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame}; ++#define MAX_SP_Len (WMM_all_frame << 4) ++#define IEEE80211_QOS_TID 0x0f ++#define QOS_CTL_NOTCONTAIN_ACK (0x01 << 5) ++ ++#define IEEE80211_DTIM_MBCAST 4 ++#define IEEE80211_DTIM_UCAST 2 ++#define IEEE80211_DTIM_VALID 1 ++#define IEEE80211_DTIM_INVALID 0 ++ ++#define IEEE80211_PS_DISABLED 0 ++#define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST ++#define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST ++ ++//added by David for QoS 2006/6/30 ++//#define WMM_Hang_8187 ++#ifdef WMM_Hang_8187 ++#undef WMM_Hang_8187 ++#endif ++ ++#define WME_AC_BK 0x00 ++#define WME_AC_BE 0x01 ++#define WME_AC_VI 0x02 ++#define WME_AC_VO 0x03 ++#define WME_ACI_MASK 0x03 ++#define WME_AIFSN_MASK 0x03 ++#define WME_AC_PRAM_LEN 16 ++ ++#define MAX_RECEIVE_BUFFER_SIZE 9100 ++ ++//UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP ++//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) ++#if 1 ++#define UP2AC(up) ( \ ++ ((up) < 1) ? WME_AC_BE : \ ++ ((up) < 3) ? WME_AC_BK : \ ++ ((up) < 4) ? WME_AC_BE : \ ++ ((up) < 6) ? WME_AC_VI : \ ++ WME_AC_VO) ++#endif ++//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue ++#define AC2UP(_ac) ( \ ++ ((_ac) == WME_AC_VO) ? 6 : \ ++ ((_ac) == WME_AC_VI) ? 5 : \ ++ ((_ac) == WME_AC_BK) ? 1 : \ ++ 0) ++ ++#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */ ++#define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address plus ether type*/ ++ ++struct ether_header { ++ u8 ether_dhost[ETHER_ADDR_LEN]; ++ u8 ether_shost[ETHER_ADDR_LEN]; ++ u16 ether_type; ++} __attribute__((packed)); ++ ++#ifndef ETHERTYPE_PAE ++#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ ++#endif ++#ifndef ETHERTYPE_IP ++#define ETHERTYPE_IP 0x0800 /* IP protocol */ ++#endif ++ ++typedef struct _bss_ht{ ++ ++ bool support_ht; ++ ++ // HT related elements ++ u8 ht_cap_buf[32]; ++ u16 ht_cap_len; ++ u8 ht_info_buf[32]; ++ u16 ht_info_len; ++ ++ HT_SPEC_VER ht_spec_ver; ++ //HT_CAPABILITY_ELE bdHTCapEle; ++ //HT_INFORMATION_ELE bdHTInfoEle; ++ ++ bool aggregation; ++ bool long_slot_time; ++}bss_ht, *pbss_ht; ++ ++typedef enum _erp_t{ ++ ERP_NonERPpresent = 0x01, ++ ERP_UseProtection = 0x02, ++ ERP_BarkerPreambleMode = 0x04, ++} erp_t; ++ ++ ++struct ieee80211_network { ++ /* These entries are used to identify a unique network */ ++ u8 bssid[ETH_ALEN]; ++ u8 channel; ++ /* Ensure null-terminated for any debug msgs */ ++ u8 ssid[IW_ESSID_MAX_SIZE + 1]; ++ u8 ssid_len; ++#if 1 ++ struct ieee80211_qos_data qos_data; ++#else ++ // Qos related. Added by Annie, 2005-11-01. ++ BSS_QOS BssQos; ++#endif ++ ++ //added by amy for LEAP ++ bool bWithAironetIE; ++ bool bCkipSupported; ++ bool bCcxRmEnable; ++ u16 CcxRmState[2]; ++ // CCXv4 S59, MBSSID. ++ bool bMBssidValid; ++ u8 MBssidMask; ++ u8 MBssid[6]; ++ // CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20. ++ bool bWithCcxVerNum; ++ u8 BssCcxVerNumber; ++ /* These are network statistics */ ++ struct ieee80211_rx_stats stats; ++ u16 capability; ++ u8 rates[MAX_RATES_LENGTH]; ++ u8 rates_len; ++ u8 rates_ex[MAX_RATES_EX_LENGTH]; ++ u8 rates_ex_len; ++ unsigned long last_scanned; ++ u8 mode; ++ u32 flags; ++ u32 last_associate; ++ u32 time_stamp[2]; ++ u16 beacon_interval; ++ u16 listen_interval; ++ u16 atim_window; ++ u8 erp_value; ++ u8 wpa_ie[MAX_WPA_IE_LEN]; ++ size_t wpa_ie_len; ++ u8 rsn_ie[MAX_WPA_IE_LEN]; ++ size_t rsn_ie_len; ++ ++ struct ieee80211_tim_parameters tim; ++ u8 dtim_period; ++ u8 dtim_data; ++ u32 last_dtim_sta_time[2]; ++ ++ //appeded for QoS ++ u8 wmm_info; ++ struct ieee80211_wmm_ac_param wmm_param[4]; ++ u8 QoS_Enable; ++#ifdef THOMAS_TURBO ++ u8 Turbo_Enable;//enable turbo mode, added by thomas ++#endif ++#ifdef ENABLE_DOT11D ++ u16 CountryIeLen; ++ u8 CountryIeBuf[MAX_IE_LEN]; ++#endif ++ // HT Related, by amy, 2008.04.29 ++ BSS_HT bssht; ++ // Add to handle broadcom AP management frame CCK rate. ++ bool broadcom_cap_exist; ++ bool ralink_cap_exist; ++ bool atheros_cap_exist; ++ bool cisco_cap_exist; ++ bool unknown_cap_exist; ++// u8 berp_info; ++ bool berp_info_valid; ++ bool buseprotection; ++ //put at the end of the structure. ++ struct list_head list; ++}; ++ ++#if 1 ++enum ieee80211_state { ++ ++ /* the card is not linked at all */ ++ IEEE80211_NOLINK = 0, ++ ++ /* IEEE80211_ASSOCIATING* are for BSS client mode ++ * the driver shall not perform RX filtering unless ++ * the state is LINKED. ++ * The driver shall just check for the state LINKED and ++ * defaults to NOLINK for ALL the other states (including ++ * LINKED_SCANNING) ++ */ ++ ++ /* the association procedure will start (wq scheduling)*/ ++ IEEE80211_ASSOCIATING, ++ IEEE80211_ASSOCIATING_RETRY, ++ ++ /* the association procedure is sending AUTH request*/ ++ IEEE80211_ASSOCIATING_AUTHENTICATING, ++ ++ /* the association procedure has successfully authentcated ++ * and is sending association request ++ */ ++ IEEE80211_ASSOCIATING_AUTHENTICATED, ++ ++ /* the link is ok. the card associated to a BSS or linked ++ * to a ibss cell or acting as an AP and creating the bss ++ */ ++ IEEE80211_LINKED, ++ ++ /* same as LINKED, but the driver shall apply RX filter ++ * rules as we are in NO_LINK mode. As the card is still ++ * logically linked, but it is doing a syncro site survey ++ * then it will be back to LINKED state. ++ */ ++ IEEE80211_LINKED_SCANNING, ++ ++}; ++#else ++enum ieee80211_state { ++ IEEE80211_UNINITIALIZED = 0, ++ IEEE80211_INITIALIZED, ++ IEEE80211_ASSOCIATING, ++ IEEE80211_ASSOCIATED, ++ IEEE80211_AUTHENTICATING, ++ IEEE80211_AUTHENTICATED, ++ IEEE80211_SHUTDOWN ++}; ++#endif ++ ++#define DEFAULT_MAX_SCAN_AGE (15 * HZ) ++#define DEFAULT_FTS 2346 ++ ++#define CFG_IEEE80211_RESERVE_FCS (1<<0) ++#define CFG_IEEE80211_COMPUTE_FCS (1<<1) ++#define CFG_IEEE80211_RTS (1<<2) ++ ++#define IEEE80211_24GHZ_MIN_CHANNEL 1 ++#define IEEE80211_24GHZ_MAX_CHANNEL 14 ++#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ ++ IEEE80211_24GHZ_MIN_CHANNEL + 1) ++ ++#define IEEE80211_52GHZ_MIN_CHANNEL 34 ++#define IEEE80211_52GHZ_MAX_CHANNEL 165 ++#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ ++ IEEE80211_52GHZ_MIN_CHANNEL + 1) ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) ++extern inline int is_multicast_ether_addr(const u8 *addr) ++{ ++ return ((addr[0] != 0xff) && (0x01 & addr[0])); ++} ++#endif ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)) ++extern inline int is_broadcast_ether_addr(const u8 *addr) ++{ ++ return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ ++ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); ++} ++#endif ++ ++typedef struct tx_pending_t{ ++ int frag; ++ struct ieee80211_txb *txb; ++}tx_pending_t; ++ ++typedef struct _bandwidth_autoswitch ++{ ++ long threshold_20Mhzto40Mhz; ++ long threshold_40Mhzto20Mhz; ++ bool bforced_tx20Mhz; ++ bool bautoswitch_enable; ++}bandwidth_autoswitch,*pbandwidth_autoswitch; ++ ++ ++//added by amy for order ++ ++#define REORDER_WIN_SIZE 128 ++#define REORDER_ENTRY_NUM 128 ++typedef struct _RX_REORDER_ENTRY ++{ ++ struct list_head List; ++ u16 SeqNum; ++ struct ieee80211_rxb* prxb; ++} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY; ++//added by amy for order ++typedef enum _Fsync_State{ ++ Default_Fsync, ++ HW_Fsync, ++ SW_Fsync ++}Fsync_State; ++ ++// Power save mode configured. ++typedef enum _RT_PS_MODE ++{ ++ eActive, // Active/Continuous access. ++ eMaxPs, // Max power save mode. ++ eFastPs // Fast power save mode. ++}RT_PS_MODE; ++ ++typedef enum _IPS_CALLBACK_FUNCION ++{ ++ IPS_CALLBACK_NONE = 0, ++ IPS_CALLBACK_MGNT_LINK_REQUEST = 1, ++ IPS_CALLBACK_JOIN_REQUEST = 2, ++}IPS_CALLBACK_FUNCION; ++ ++typedef enum _RT_JOIN_ACTION{ ++ RT_JOIN_INFRA = 1, ++ RT_JOIN_IBSS = 2, ++ RT_START_IBSS = 3, ++ RT_NO_ACTION = 4, ++}RT_JOIN_ACTION; ++ ++typedef struct _IbssParms{ ++ u16 atimWin; ++}IbssParms, *PIbssParms; ++#define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko. ++ ++// RF state. ++typedef enum _RT_RF_POWER_STATE ++{ ++ eRfOn, ++ eRfSleep, ++ eRfOff ++}RT_RF_POWER_STATE; ++ ++typedef struct _RT_POWER_SAVE_CONTROL ++{ ++ ++ // ++ // Inactive Power Save(IPS) : Disable RF when disconnected ++ // ++ bool bInactivePs; ++ bool bIPSModeBackup; ++ bool bSwRfProcessing; ++ RT_RF_POWER_STATE eInactivePowerState; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct work_struct InactivePsWorkItem; ++#else ++ struct tq_struct InactivePsWorkItem; ++#endif ++ struct timer_list InactivePsTimer; ++ ++ // Return point for join action ++ IPS_CALLBACK_FUNCION ReturnPoint; ++ ++ // Recored Parameters for rescheduled JoinRequest ++ bool bTmpBssDesc; ++ RT_JOIN_ACTION tmpJoinAction; ++ struct ieee80211_network tmpBssDesc; ++ ++ // Recored Parameters for rescheduled MgntLinkRequest ++ bool bTmpScanOnly; ++ bool bTmpActiveScan; ++ bool bTmpFilterHiddenAP; ++ bool bTmpUpdateParms; ++ u8 tmpSsidBuf[33]; ++ OCTET_STRING tmpSsid2Scan; ++ bool bTmpSsid2Scan; ++ u8 tmpNetworkType; ++ u8 tmpChannelNumber; ++ u16 tmpBcnPeriod; ++ u8 tmpDtimPeriod; ++ u16 tmpmCap; ++ OCTET_STRING tmpSuppRateSet; ++ u8 tmpSuppRateBuf[MAX_NUM_RATES]; ++ bool bTmpSuppRate; ++ IbssParms tmpIbpm; ++ bool bTmpIbpm; ++ ++ // ++ // Leisre Poswer Save : Disable RF if connected but traffic is not busy ++ // ++ bool bLeisurePs; ++ ++}RT_POWER_SAVE_CONTROL,*PRT_POWER_SAVE_CONTROL; ++ ++typedef u32 RT_RF_CHANGE_SOURCE; ++#define RF_CHANGE_BY_SW BIT31 ++#define RF_CHANGE_BY_HW BIT30 ++#define RF_CHANGE_BY_PS BIT29 ++#define RF_CHANGE_BY_IPS BIT28 ++#define RF_CHANGE_BY_INIT 0 // Do not change the RFOff reason. Defined by Bruce, 2008-01-17. ++ ++#ifdef ENABLE_DOT11D ++typedef enum ++{ ++ COUNTRY_CODE_FCC = 0, ++ COUNTRY_CODE_IC = 1, ++ COUNTRY_CODE_ETSI = 2, ++ COUNTRY_CODE_SPAIN = 3, ++ COUNTRY_CODE_FRANCE = 4, ++ COUNTRY_CODE_MKK = 5, ++ COUNTRY_CODE_MKK1 = 6, ++ COUNTRY_CODE_ISRAEL = 7, ++ COUNTRY_CODE_TELEC, ++ COUNTRY_CODE_MIC, ++ COUNTRY_CODE_GLOBAL_DOMAIN ++}country_code_type_t; ++#endif ++ ++#define RT_MAX_LD_SLOT_NUM 10 ++typedef struct _RT_LINK_DETECT_T{ ++ ++ u32 NumRecvBcnInPeriod; ++ u32 NumRecvDataInPeriod; ++ ++ u32 RxBcnNum[RT_MAX_LD_SLOT_NUM]; // number of Rx beacon / CheckForHang_period to determine link status ++ u32 RxDataNum[RT_MAX_LD_SLOT_NUM]; // number of Rx data / CheckForHang_period to determine link status ++ u16 SlotNum; // number of CheckForHang period to determine link status ++ u16 SlotIndex; ++ ++ u32 NumTxOkInPeriod; ++ u32 NumRxOkInPeriod; ++ bool bBusyTraffic; ++}RT_LINK_DETECT_T, *PRT_LINK_DETECT_T; ++ ++ ++struct ieee80211_device { ++ struct net_device *dev; ++ struct ieee80211_security sec; ++ ++ //hw security related ++// u8 hwsec_support; //support? ++ u8 hwsec_active; //hw security active. ++ bool is_silent_reset; ++ bool is_roaming; ++ bool ieee_up; ++ //added by amy ++ bool bSupportRemoteWakeUp; ++ RT_PS_MODE dot11PowerSaveMode; // Power save mode configured. ++ bool actscanning; ++ bool beinretry; ++ RT_RF_POWER_STATE eRFPowerState; ++ RT_RF_CHANGE_SOURCE RfOffReason; ++ bool is_set_key; ++ //11n spec related I wonder if These info structure need to be moved out of ieee80211_device ++ ++ //11n HT below ++ PRT_HIGH_THROUGHPUT pHTInfo; ++ //struct timer_list SwBwTimer; ++// spinlock_t chnlop_spinlock; ++ spinlock_t bw_spinlock; ++ ++ spinlock_t reorder_spinlock; ++ // for HT operation rate set. we use this one for HT data rate to seperate different descriptors ++ //the way fill this is the same as in the IE ++ u8 Regdot11HTOperationalRateSet[16]; //use RATR format ++ u8 dot11HTOperationalRateSet[16]; //use RATR format ++ u8 RegHTSuppRateSet[16]; ++ u8 HTCurrentOperaRate; ++ u8 HTHighestOperaRate; ++ //wb added for rate operation mode to firmware ++ u8 bTxDisableRateFallBack; ++ u8 bTxUseDriverAssingedRate; ++ atomic_t atm_chnlop; ++ atomic_t atm_swbw; ++// u8 HTHighestOperaRate; ++// u8 HTCurrentOperaRate; ++ ++ // 802.11e and WMM Traffic Stream Info (TX) ++ struct list_head Tx_TS_Admit_List; ++ struct list_head Tx_TS_Pending_List; ++ struct list_head Tx_TS_Unused_List; ++ TX_TS_RECORD TxTsRecord[TOTAL_TS_NUM]; ++ // 802.11e and WMM Traffic Stream Info (RX) ++ struct list_head Rx_TS_Admit_List; ++ struct list_head Rx_TS_Pending_List; ++ struct list_head Rx_TS_Unused_List; ++ RX_TS_RECORD RxTsRecord[TOTAL_TS_NUM]; ++//#ifdef TO_DO_LIST ++ RX_REORDER_ENTRY RxReorderEntry[128]; ++ struct list_head RxReorder_Unused_List; ++//#endif ++ // Qos related. Added by Annie, 2005-11-01. ++// PSTA_QOS pStaQos; ++ u8 ForcedPriority; // Force per-packet priority 1~7. (default: 0, not to force it.) ++ ++ ++ /* Bookkeeping structures */ ++ struct net_device_stats stats; ++ struct ieee80211_stats ieee_stats; ++ struct ieee80211_softmac_stats softmac_stats; ++ ++ /* Probe / Beacon management */ ++ struct list_head network_free_list; ++ struct list_head network_list; ++ struct ieee80211_network *networks; ++ int scans; ++ int scan_age; ++ ++ int iw_mode; /* operating mode (IW_MODE_*) */ ++ struct iw_spy_data spy_data; ++ ++ spinlock_t lock; ++ spinlock_t wpax_suitlist_lock; ++ ++ int tx_headroom; /* Set to size of any additional room needed at front ++ * of allocated Tx SKBs */ ++ u32 config; ++ ++ /* WEP and other encryption related settings at the device level */ ++ int open_wep; /* Set to 1 to allow unencrypted frames */ ++ int auth_mode; ++ int reset_on_keychange; /* Set to 1 if the HW needs to be reset on ++ * WEP key changes */ ++ ++ /* If the host performs {en,de}cryption, then set to 1 */ ++ int host_encrypt; ++ int host_encrypt_msdu; ++ int host_decrypt; ++ /* host performs multicast decryption */ ++ int host_mc_decrypt; ++ ++ /* host should strip IV and ICV from protected frames */ ++ /* meaningful only when hardware decryption is being used */ ++ int host_strip_iv_icv; ++ ++ int host_open_frag; ++ int host_build_iv; ++ int ieee802_1x; /* is IEEE 802.1X used */ ++ ++ /* WPA data */ ++ bool bHalfWirelessN24GMode; ++ int wpa_enabled; ++ int drop_unencrypted; ++ int tkip_countermeasures; ++ int privacy_invoked; ++ size_t wpa_ie_len; ++ u8 *wpa_ie; ++ u8 ap_mac_addr[6]; ++ u16 pairwise_key_type; ++ u16 group_key_type; ++ struct list_head crypt_deinit_list; ++ struct ieee80211_crypt_data *crypt[WEP_KEYS]; ++ int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ ++ struct timer_list crypt_deinit_timer; ++ int crypt_quiesced; ++ ++ int bcrx_sta_key; /* use individual keys to override default keys even ++ * with RX of broad/multicast frames */ ++ ++ /* Fragmentation structures */ ++ // each streaming contain a entry ++ struct ieee80211_frag_entry frag_cache[17][IEEE80211_FRAG_CACHE_LEN]; ++ unsigned int frag_next_idx[17]; ++ u16 fts; /* Fragmentation Threshold */ ++#define DEFAULT_RTS_THRESHOLD 2346U ++#define MIN_RTS_THRESHOLD 1 ++#define MAX_RTS_THRESHOLD 2346U ++ u16 rts; /* RTS threshold */ ++ ++ /* Association info */ ++ u8 bssid[ETH_ALEN]; ++ ++ /* This stores infos for the current network. ++ * Either the network we are associated in INFRASTRUCTURE ++ * or the network that we are creating in MASTER mode. ++ * ad-hoc is a mixture ;-). ++ * Note that in infrastructure mode, even when not associated, ++ * fields bssid and essid may be valid (if wpa_set and essid_set ++ * are true) as thy carry the value set by the user via iwconfig ++ */ ++ struct ieee80211_network current_network; ++ ++ enum ieee80211_state state; ++ ++ int short_slot; ++ int reg_mode; ++ int mode; /* A, B, G */ ++ int modulation; /* CCK, OFDM */ ++ int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ ++ int abg_true; /* ABG flag */ ++ ++ /* used for forcing the ibss workqueue to terminate ++ * without wait for the syncro scan to terminate ++ */ ++ short sync_scan_hurryup; ++ ++ int perfect_rssi; ++ int worst_rssi; ++ ++ u16 prev_seq_ctl; /* used to drop duplicate frames */ ++ ++ /* map of allowed channels. 0 is dummy */ ++ // FIXME: remeber to default to a basic channel plan depending of the PHY type ++#ifdef ENABLE_DOT11D ++ void* pDot11dInfo; ++ bool bGlobalDomain; ++#else ++ int channel_map[MAX_CHANNEL_NUMBER+1]; ++#endif ++ int rate; /* current rate */ ++ int basic_rate; ++ //FIXME: pleace callback, see if redundant with softmac_features ++ short active_scan; ++ ++ /* this contains flags for selectively enable softmac support */ ++ u16 softmac_features; ++ ++ /* if the sequence control field is not filled by HW */ ++ u16 seq_ctrl[5]; ++ ++ /* association procedure transaction sequence number */ ++ u16 associate_seq; ++ ++ /* AID for RTXed association responses */ ++ u16 assoc_id; ++ ++ /* power save mode related*/ ++ u8 ack_tx_to_ieee; ++ short ps; ++ short sta_sleep; ++ int ps_timeout; ++ int ps_period; ++ struct tasklet_struct ps_task; ++ u32 ps_th; ++ u32 ps_tl; ++ ++ short raw_tx; ++ /* used if IEEE_SOFTMAC_TX_QUEUE is set */ ++ short queue_stop; ++ short scanning; ++ short proto_started; ++ ++ struct semaphore wx_sem; ++ struct semaphore scan_sem; ++ ++ spinlock_t mgmt_tx_lock; ++ spinlock_t beacon_lock; ++ ++ short beacon_txing; ++ ++ short wap_set; ++ short ssid_set; ++ ++ u8 wpax_type_set; //{added by David, 2006.9.28} ++ u32 wpax_type_notify; //{added by David, 2006.9.26} ++ ++ /* QoS related flag */ ++ char init_wmmparam_flag; ++ /* set on initialization */ ++ u8 qos_support; ++ ++ /* for discarding duplicated packets in IBSS */ ++ struct list_head ibss_mac_hash[IEEE_IBSS_MAC_HASH_SIZE]; ++ ++ /* for discarding duplicated packets in BSS */ ++ u16 last_rxseq_num[17]; /* rx seq previous per-tid */ ++ u16 last_rxfrag_num[17];/* tx frag previous per-tid */ ++ unsigned long last_packet_time[17]; ++ ++ /* for PS mode */ ++ unsigned long last_rx_ps_time; ++ ++ /* used if IEEE_SOFTMAC_SINGLE_QUEUE is set */ ++ struct sk_buff *mgmt_queue_ring[MGMT_QUEUE_NUM]; ++ int mgmt_queue_head; ++ int mgmt_queue_tail; ++//{ added for rtl819x ++#define IEEE80211_QUEUE_LIMIT 128 ++ u8 AsocRetryCount; ++ unsigned int hw_header; ++ struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; ++ struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE]; ++ struct sk_buff_head skb_drv_aggQ[MAX_QUEUE_SIZE]; ++ u32 sta_edca_param[4]; ++ bool aggregation; ++ // Enable/Disable Rx immediate BA capability. ++ bool enable_rx_imm_BA; ++ bool bibsscoordinator; ++ ++ //+by amy for DM ,080515 ++ //Dynamic Tx power for near/far range enable/Disable , by amy , 2008-05-15 ++ bool bdynamic_txpower_enable; ++ ++ bool bCTSToSelfEnable; ++ u8 CTSToSelfTH; ++ ++ u32 fsync_time_interval; ++ u32 fsync_rate_bitmap; ++ u8 fsync_rssi_threshold; ++ bool bfsync_enable; ++ ++ u8 fsync_multiple_timeinterval; // FsyncMultipleTimeInterval * FsyncTimeInterval ++ u32 fsync_firstdiff_ratethreshold; // low threshold ++ u32 fsync_seconddiff_ratethreshold; // decrease threshold ++ Fsync_State fsync_state; ++ bool bis_any_nonbepkts; ++ //20Mhz 40Mhz AutoSwitch Threshold ++ bandwidth_autoswitch bandwidth_auto_switch; ++ //for txpower tracking ++ bool FwRWRF; ++ ++ //added by amy for AP roaming ++ RT_LINK_DETECT_T LinkDetectInfo; ++ //added by amy for ps ++ RT_POWER_SAVE_CONTROL PowerSaveControl; ++//} ++ /* used if IEEE_SOFTMAC_TX_QUEUE is set */ ++ struct tx_pending_t tx_pending; ++ ++ /* used if IEEE_SOFTMAC_ASSOCIATE is set */ ++ struct timer_list associate_timer; ++ ++ /* used if IEEE_SOFTMAC_BEACONS is set */ ++ struct timer_list beacon_timer; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct work_struct associate_complete_wq; ++ struct work_struct associate_procedure_wq; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ struct delayed_work softmac_scan_wq; ++ struct delayed_work associate_retry_wq; ++ struct delayed_work start_ibss_wq; ++ struct delayed_work hw_wakeup_wq; ++ struct delayed_work hw_sleep_wq; ++#else ++ struct work_struct softmac_scan_wq; ++ struct work_struct associate_retry_wq; ++ struct work_struct start_ibss_wq; ++ struct work_struct hw_wakeup_wq; ++ struct work_struct hw_sleep_wq; ++#endif ++ struct work_struct wx_sync_scan_wq; ++ struct workqueue_struct *wq; ++#else ++ /* used for periodly scan */ ++ struct timer_list scan_timer; ++ ++ struct tq_struct associate_complete_wq; ++ struct tq_struct associate_retry_wq; ++ struct tq_struct start_ibss_wq; ++ struct tq_struct associate_procedure_wq; ++ struct tq_struct softmac_scan_wq; ++ struct tq_struct wx_sync_scan_wq; ++ ++#endif ++ // Qos related. Added by Annie, 2005-11-01. ++ //STA_QOS StaQos; ++ ++ //u32 STA_EDCA_PARAM[4]; ++ //CHANNEL_ACCESS_SETTING ChannelAccessSetting; ++ ++ ++ /* Callback functions */ ++ void (*set_security)(struct net_device *dev, ++ struct ieee80211_security *sec); ++ ++ /* Used to TX data frame by using txb structs. ++ * this is not used if in the softmac_features ++ * is set the flag IEEE_SOFTMAC_TX_QUEUE ++ */ ++ int (*hard_start_xmit)(struct ieee80211_txb *txb, ++ struct net_device *dev); ++ ++ int (*reset_port)(struct net_device *dev); ++ int (*is_queue_full) (struct net_device * dev, int pri); ++ ++ int (*handle_management) (struct net_device * dev, ++ struct ieee80211_network * network, u16 type); ++ int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); ++ ++ /* Softmac-generated frames (mamagement) are TXed via this ++ * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is ++ * not set. As some cards may have different HW queues that ++ * one might want to use for data and management frames ++ * the option to have two callbacks might be useful. ++ * This fucntion can't sleep. ++ */ ++ int (*softmac_hard_start_xmit)(struct sk_buff *skb, ++ struct net_device *dev); ++ ++ /* used instead of hard_start_xmit (not softmac_hard_start_xmit) ++ * if the IEEE_SOFTMAC_TX_QUEUE feature is used to TX data ++ * frames. I the option IEEE_SOFTMAC_SINGLE_QUEUE is also set ++ * then also management frames are sent via this callback. ++ * This function can't sleep. ++ */ ++ void (*softmac_data_hard_start_xmit)(struct sk_buff *skb, ++ struct net_device *dev,int rate); ++ ++ /* stops the HW queue for DATA frames. Useful to avoid ++ * waste time to TX data frame when we are reassociating ++ * This function can sleep. ++ */ ++ void (*data_hard_stop)(struct net_device *dev); ++ ++ /* OK this is complementar to data_poll_hard_stop */ ++ void (*data_hard_resume)(struct net_device *dev); ++ ++ /* ask to the driver to retune the radio . ++ * This function can sleep. the driver should ensure ++ * the radio has been swithced before return. ++ */ ++ void (*set_chan)(struct net_device *dev,short ch); ++ ++ /* These are not used if the ieee stack takes care of ++ * scanning (IEEE_SOFTMAC_SCAN feature set). ++ * In this case only the set_chan is used. ++ * ++ * The syncro version is similar to the start_scan but ++ * does not return until all channels has been scanned. ++ * this is called in user context and should sleep, ++ * it is called in a work_queue when swithcing to ad-hoc mode ++ * or in behalf of iwlist scan when the card is associated ++ * and root user ask for a scan. ++ * the fucntion stop_scan should stop both the syncro and ++ * background scanning and can sleep. ++ * The fucntion start_scan should initiate the background ++ * scanning and can't sleep. ++ */ ++ void (*scan_syncro)(struct net_device *dev); ++ void (*start_scan)(struct net_device *dev); ++ void (*stop_scan)(struct net_device *dev); ++ ++ /* indicate the driver that the link state is changed ++ * for example it may indicate the card is associated now. ++ * Driver might be interested in this to apply RX filter ++ * rules or simply light the LINK led ++ */ ++ void (*link_change)(struct net_device *dev); ++ ++ /* these two function indicates to the HW when to start ++ * and stop to send beacons. This is used when the ++ * IEEE_SOFTMAC_BEACONS is not set. For now the ++ * stop_send_bacons is NOT guaranteed to be called only ++ * after start_send_beacons. ++ */ ++ void (*start_send_beacons) (struct net_device *dev); ++ void (*stop_send_beacons) (struct net_device *dev); ++ ++ /* power save mode related */ ++ void (*sta_wake_up) (struct net_device *dev); ++// void (*ps_request_tx_ack) (struct net_device *dev); ++ void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); ++ short (*ps_is_queue_empty) (struct net_device *dev); ++#if 0 ++ /* Typical STA methods */ ++ int (*handle_auth) (struct net_device * dev, ++ struct ieee80211_auth * auth); ++ int (*handle_deauth) (struct net_device * dev, ++ struct ieee80211_deauth * auth); ++ int (*handle_action) (struct net_device * dev, ++ struct ieee80211_action * action, ++ struct ieee80211_rx_stats * stats); ++ int (*handle_disassoc) (struct net_device * dev, ++ struct ieee80211_disassoc * assoc); ++#endif ++ int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); ++#if 0 ++ int (*handle_probe_response) (struct net_device * dev, ++ struct ieee80211_probe_response * resp, ++ struct ieee80211_network * network); ++ int (*handle_probe_request) (struct net_device * dev, ++ struct ieee80211_probe_request * req, ++ struct ieee80211_rx_stats * stats); ++#endif ++ int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); ++ ++#if 0 ++ /* Typical AP methods */ ++ int (*handle_assoc_request) (struct net_device * dev); ++ int (*handle_reassoc_request) (struct net_device * dev, ++ struct ieee80211_reassoc_request * req); ++#endif ++ ++ /* check whether Tx hw resouce available */ ++ short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); ++ //added by wb for HT related ++// void (*SwChnlByTimerHandler)(struct net_device *dev, int channel); ++ void (*SetBWModeHandler)(struct net_device *dev, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++// void (*UpdateHalRATRTableHandler)(struct net_device* dev, u8* pMcsRate); ++ bool (*GetNmodeSupportBySecCfg)(struct net_device* dev); ++ void (*SetWirelessMode)(struct net_device* dev, u8 wireless_mode); ++ bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device* dev); ++ void (*InitialGainHandler)(struct net_device *dev, u8 Operation); ++ ++ /* This must be the last item so that it points to the data ++ * allocated beyond this structure by alloc_ieee80211 */ ++ u8 priv[0]; ++}; ++ ++#define IEEE_A (1<<0) ++#define IEEE_B (1<<1) ++#define IEEE_G (1<<2) ++#define IEEE_N_24G (1<<4) ++#define IEEE_N_5G (1<<5) ++#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) ++ ++/* Generate a 802.11 header */ ++ ++/* Uses the channel change callback directly ++ * instead of [start/stop] scan callbacks ++ */ ++#define IEEE_SOFTMAC_SCAN (1<<2) ++ ++/* Perform authentication and association handshake */ ++#define IEEE_SOFTMAC_ASSOCIATE (1<<3) ++ ++/* Generate probe requests */ ++#define IEEE_SOFTMAC_PROBERQ (1<<4) ++ ++/* Generate respones to probe requests */ ++#define IEEE_SOFTMAC_PROBERS (1<<5) ++ ++/* The ieee802.11 stack will manages the netif queue ++ * wake/stop for the driver, taking care of 802.11 ++ * fragmentation. See softmac.c for details. */ ++#define IEEE_SOFTMAC_TX_QUEUE (1<<7) ++ ++/* Uses only the softmac_data_hard_start_xmit ++ * even for TX management frames. ++ */ ++#define IEEE_SOFTMAC_SINGLE_QUEUE (1<<8) ++ ++/* Generate beacons. The stack will enqueue beacons ++ * to the card ++ */ ++#define IEEE_SOFTMAC_BEACONS (1<<6) ++ ++static inline void *ieee80211_priv(struct net_device *dev) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ return ((struct ieee80211_device *)netdev_priv(dev))->priv; ++#else ++ return ((struct ieee80211_device *)dev->priv)->priv; ++#endif ++} ++ ++extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++{ ++ /* Single white space is for Linksys APs */ ++ if (essid_len == 1 && essid[0] == ' ') ++ return 1; ++ ++ /* Otherwise, if the entire essid is 0, we assume it is hidden */ ++ while (essid_len) { ++ essid_len--; ++ if (essid[essid_len] != '\0') ++ return 0; ++ } ++ ++ return 1; ++} ++ ++extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) ++{ ++ /* ++ * It is possible for both access points and our device to support ++ * combinations of modes, so as long as there is one valid combination ++ * of ap/device supported modes, then return success ++ * ++ */ ++ if ((mode & IEEE_A) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION) && ++ (ieee->freq_band & IEEE80211_52GHZ_BAND)) ++ return 1; ++ ++ if ((mode & IEEE_G) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION) && ++ (ieee->freq_band & IEEE80211_24GHZ_BAND)) ++ return 1; ++ ++ if ((mode & IEEE_B) && ++ (ieee->modulation & IEEE80211_CCK_MODULATION) && ++ (ieee->freq_band & IEEE80211_24GHZ_BAND)) ++ return 1; ++ ++ return 0; ++} ++ ++extern inline int ieee80211_get_hdrlen(u16 fc) ++{ ++ int hdrlen = IEEE80211_3ADDR_LEN; ++ ++ switch (WLAN_FC_GET_TYPE(fc)) { ++ case IEEE80211_FTYPE_DATA: ++ if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) ++ hdrlen = IEEE80211_4ADDR_LEN; /* Addr4 */ ++ if(IEEE80211_QOS_HAS_SEQ(fc)) ++ hdrlen += 2; /* QOS ctrl*/ ++ break; ++ case IEEE80211_FTYPE_CTL: ++ switch (WLAN_FC_GET_STYPE(fc)) { ++ case IEEE80211_STYPE_CTS: ++ case IEEE80211_STYPE_ACK: ++ hdrlen = IEEE80211_1ADDR_LEN; ++ break; ++ default: ++ hdrlen = IEEE80211_2ADDR_LEN; ++ break; ++ } ++ break; ++ } ++ ++ return hdrlen; ++} ++ ++static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) ++{ ++ switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { ++ case IEEE80211_1ADDR_LEN: ++ return ((struct ieee80211_hdr_1addr *)hdr)->payload; ++ case IEEE80211_2ADDR_LEN: ++ return ((struct ieee80211_hdr_2addr *)hdr)->payload; ++ case IEEE80211_3ADDR_LEN: ++ return ((struct ieee80211_hdr_3addr *)hdr)->payload; ++ case IEEE80211_4ADDR_LEN: ++ return ((struct ieee80211_hdr_4addr *)hdr)->payload; ++ } ++ return NULL; ++} ++ ++static inline int ieee80211_is_ofdm_rate(u8 rate) ++{ ++ switch (rate & ~IEEE80211_BASIC_RATE_MASK) { ++ case IEEE80211_OFDM_RATE_6MB: ++ case IEEE80211_OFDM_RATE_9MB: ++ case IEEE80211_OFDM_RATE_12MB: ++ case IEEE80211_OFDM_RATE_18MB: ++ case IEEE80211_OFDM_RATE_24MB: ++ case IEEE80211_OFDM_RATE_36MB: ++ case IEEE80211_OFDM_RATE_48MB: ++ case IEEE80211_OFDM_RATE_54MB: ++ return 1; ++ } ++ return 0; ++} ++ ++static inline int ieee80211_is_cck_rate(u8 rate) ++{ ++ switch (rate & ~IEEE80211_BASIC_RATE_MASK) { ++ case IEEE80211_CCK_RATE_1MB: ++ case IEEE80211_CCK_RATE_2MB: ++ case IEEE80211_CCK_RATE_5MB: ++ case IEEE80211_CCK_RATE_11MB: ++ return 1; ++ } ++ return 0; ++} ++ ++ ++/* ieee80211.c */ ++extern void free_ieee80211(struct net_device *dev); ++extern struct net_device *alloc_ieee80211(int sizeof_priv); ++ ++extern int ieee80211_set_encryption(struct ieee80211_device *ieee); ++ ++/* ieee80211_tx.c */ ++ ++extern int ieee80211_encrypt_fragment( ++ struct ieee80211_device *ieee, ++ struct sk_buff *frag, ++ int hdr_len); ++ ++extern int ieee80211_xmit(struct sk_buff *skb, ++ struct net_device *dev); ++extern void ieee80211_txb_free(struct ieee80211_txb *); ++ ++ ++/* ieee80211_rx.c */ ++extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats); ++extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *header, ++ struct ieee80211_rx_stats *stats); ++ ++/* ieee80211_wx.c */ ++extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++#if WIRELESS_EXT >= 18 ++extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data* wrqu, char *extra); ++extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data* wrqu, char *extra); ++extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ struct iw_param *data, char *extra); ++extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++#endif ++extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len); ++ ++/* ieee80211_softmac.c */ ++extern short ieee80211_is_54g(struct ieee80211_network net); ++extern short ieee80211_is_shortslot(struct ieee80211_network net); ++extern int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats, u16 type, ++ u16 stype); ++extern void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee80211_network *net); ++ ++void SendDisassociation(struct ieee80211_device *ieee, u8* asSta, u8 asRsn); ++extern void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *ieee); ++ ++extern void ieee80211_stop_send_beacons(struct ieee80211_device *ieee); ++extern void notify_wx_assoc_event(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee); ++extern void ieee80211_start_bss(struct ieee80211_device *ieee); ++extern void ieee80211_start_master_bss(struct ieee80211_device *ieee); ++extern void ieee80211_start_ibss(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_init(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_free(struct ieee80211_device *ieee); ++extern void ieee80211_associate_abort(struct ieee80211_device *ieee); ++extern void ieee80211_disassociate(struct ieee80211_device *ieee); ++extern void ieee80211_stop_scan(struct ieee80211_device *ieee); ++extern void ieee80211_start_scan_syncro(struct ieee80211_device *ieee); ++extern void ieee80211_check_all_nets(struct ieee80211_device *ieee); ++extern void ieee80211_start_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_stop_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_reset_queue(struct ieee80211_device *ieee); ++extern void ieee80211_wake_queue(struct ieee80211_device *ieee); ++extern void ieee80211_stop_queue(struct ieee80211_device *ieee); ++extern struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee); ++extern void ieee80211_start_send_beacons(struct ieee80211_device *ieee); ++extern void ieee80211_stop_send_beacons(struct ieee80211_device *ieee); ++extern int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee, struct iw_point *p); ++extern void notify_wx_assoc_event(struct ieee80211_device *ieee); ++extern void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success); ++ ++extern void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); ++ ++/* ieee80211_crypt_ccmp&tkip&wep.c */ ++extern void ieee80211_tkip_null(void); ++extern void ieee80211_wep_null(void); ++extern void ieee80211_ccmp_null(void); ++ ++/* ieee80211_softmac_wx.c */ ++ ++extern int ieee80211_wx_get_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *ext); ++ ++extern int ieee80211_wx_set_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *awrq, ++ char *extra); ++ ++extern int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b); ++ ++extern int ieee80211_wx_set_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++//extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); ++#else ++ extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); ++#endif ++ ++ ++extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_name(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++//HT ++#define MAX_RECEIVE_BUFFER_SIZE 9100 // ++extern void HTDebugHTCapability(u8* CapIE, u8* TitleString ); ++extern void HTDebugHTInfo(u8* InfoIE, u8* TitleString); ++ ++void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++extern void HTUpdateDefaultSetting(struct ieee80211_device* ieee); ++extern void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u8* len, u8 isEncrypt); ++extern void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* len, u8 isEncrypt); ++extern void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg, u8* len); ++extern void HTOnAssocRsp(struct ieee80211_device *ieee); ++extern void HTInitializeHTInfo(struct ieee80211_device* ieee); ++extern void HTInitializeBssDesc(PBSS_HT pBssHT); ++extern void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork); ++extern void HTUpdateSelfAndPeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork); ++extern u8 HTGetHighestMCSRate(struct ieee80211_device* ieee, u8* pMCSRateSet, u8* pMCSFilter); ++extern u8 MCS_FILTER_ALL[]; ++extern u16 MCS_DATA_RATE[2][2][77] ; ++extern u8 HTCCheck(struct ieee80211_device* ieee, u8* pFrame); ++//extern void HTSetConnectBwModeCallback(unsigned long data); ++extern void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); ++extern bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee); ++extern u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate); ++extern u16 HTMcsToDataRate( struct ieee80211_device* ieee, u8 nMcsRate); ++extern u16 TxCountToDataRate( struct ieee80211_device* ieee, u8 nDataRate); ++//function in BAPROC.c ++extern int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb); ++extern int ieee80211_rx_ADDBARsp( struct ieee80211_device* ieee, struct sk_buff *skb); ++extern int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb); ++extern void TsInitAddBA( struct ieee80211_device* ieee, PTX_TS_RECORD pTS, u8 Policy, u8 bOverwritePending); ++extern void TsInitDelBA( struct ieee80211_device* ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect); ++extern void BaSetupTimeOut(unsigned long data); ++extern void TxBaInactTimeout(unsigned long data); ++extern void RxBaInactTimeout(unsigned long data); ++extern void ResetBaEntry( PBA_RECORD pBA); ++//function in TS.c ++extern bool GetTs( ++ struct ieee80211_device* ieee, ++ PTS_COMMON_INFO *ppTS, ++ u8* Addr, ++ u8 TID, ++ TR_SELECT TxRxSelect, //Rx:1, Tx:0 ++ bool bAddNewTs ++ ); ++extern void TSInitialize(struct ieee80211_device *ieee); ++extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS); ++extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr); ++extern void RemoveAllTS(struct ieee80211_device* ieee); ++void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee); ++ ++extern const long ieee80211_wlan_frequencies[]; ++ ++extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) ++{ ++ ieee->scans++; ++} ++ ++extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) ++{ ++ return ieee->scans; ++} ++ ++static inline const char *escape_essid(const char *essid, u8 essid_len) { ++ static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; ++ const char *s = essid; ++ char *d = escaped; ++ ++ if (ieee80211_is_empty_essid(essid, essid_len)) { ++ memcpy(escaped, "", sizeof("")); ++ return escaped; ++ } ++ ++ essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); ++ while (essid_len--) { ++ if (*s == '\0') { ++ *d++ = '\\'; ++ *d++ = '0'; ++ s++; ++ } else { ++ *d++ = *s++; ++ } ++ } ++ *d = '\0'; ++ return escaped; ++} ++ ++/* For the function is more related to hardware setting, it's better to use the ++ * ieee handler to refer to it. ++ */ ++extern short check_nic_enough_desc(struct net_device *dev, int queue_index); ++extern int ieee80211_data_xmit(struct sk_buff *skb, struct net_device *dev); ++extern int ieee80211_parse_info_param(struct ieee80211_device *ieee, ++ struct ieee80211_info_element *info_element, ++ u16 length, ++ struct ieee80211_network *network, ++ struct ieee80211_rx_stats *stats); ++ ++void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_rxb** prxbIndicateArray,u8 index); ++#define RT_ASOC_RETRY_LIMIT 5 ++#endif /* IEEE80211_H */ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/EndianFree.h +@@ -0,0 +1,199 @@ ++#ifndef __INC_ENDIANFREE_H ++#define __INC_ENDIANFREE_H ++ ++/* ++ * Call endian free function when ++ * 1. Read/write packet content. ++ * 2. Before write integer to IO. ++ * 3. After read integer from IO. ++ */ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) ++#ifndef bool ++typedef enum{false = 0, true} bool; ++#endif ++#endif ++ ++#define __MACHINE_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ ++#define __MACHINE_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */ ++ ++#define BYTE_ORDER __MACHINE_LITTLE_ENDIAN ++ ++#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN ++// Convert data ++#define EF1Byte(_val) ((u8)(_val)) ++#define EF2Byte(_val) ((u16)(_val)) ++#define EF4Byte(_val) ((u32)(_val)) ++ ++#else ++// Convert data ++#define EF1Byte(_val) ((u8)(_val)) ++#define EF2Byte(_val) (((((u16)(_val))&0x00ff)<<8)|((((u16)(_val))&0xff00)>>8)) ++#define EF4Byte(_val) (((((u32)(_val))&0x000000ff)<<24)|\ ++ ((((u32)(_val))&0x0000ff00)<<8)|\ ++ ((((u32)(_val))&0x00ff0000)>>8)|\ ++ ((((u32)(_val))&0xff000000)>>24)) ++#endif ++ ++// Read data from memory ++#define ReadEF1Byte(_ptr) EF1Byte(*((u8 *)(_ptr))) ++#define ReadEF2Byte(_ptr) EF2Byte(*((u16 *)(_ptr))) ++#define ReadEF4Byte(_ptr) EF4Byte(*((u32 *)(_ptr))) ++ ++// Write data to memory ++#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr)))=EF1Byte(_val) ++#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr)))=EF2Byte(_val) ++#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val) ++// Convert Host system specific byte ording (litten or big endia) to Network byte ording (big endian). ++// 2006.05.07, by rcnjko. ++#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN ++#define H2N1BYTE(_val) ((u8)(_val)) ++#define H2N2BYTE(_val) (((((u16)(_val))&0x00ff)<<8)|\ ++ ((((u16)(_val))&0xff00)>>8)) ++#define H2N4BYTE(_val) (((((u32)(_val))&0x000000ff)<<24)|\ ++ ((((u32)(_val))&0x0000ff00)<<8) |\ ++ ((((u32)(_val))&0x00ff0000)>>8) |\ ++ ((((u32)(_val))&0xff000000)>>24)) ++#else ++#define H2N1BYTE(_val) ((u8)(_val)) ++#define H2N2BYTE(_val) ((u16)(_val)) ++#define H2N4BYTE(_val) ((u32)(_val)) ++#endif ++ ++// Convert from Network byte ording (big endian) to Host system specific byte ording (litten or big endia). ++// 2006.05.07, by rcnjko. ++#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN ++#define N2H1BYTE(_val) ((u8)(_val)) ++#define N2H2BYTE(_val) (((((u16)(_val))&0x00ff)<<8)|\ ++ ((((u16)(_val))&0xff00)>>8)) ++#define N2H4BYTE(_val) (((((u32)(_val))&0x000000ff)<<24)|\ ++ ((((u32)(_val))&0x0000ff00)<<8) |\ ++ ((((u32)(_val))&0x00ff0000)>>8) |\ ++ ((((u32)(_val))&0xff000000)>>24)) ++#else ++#define N2H1BYTE(_val) ((u8)(_val)) ++#define N2H2BYTE(_val) ((u16)(_val)) ++#define N2H4BYTE(_val) ((u32)(_val)) ++#endif ++ ++// ++// Example: ++// BIT_LEN_MASK_32(0) => 0x00000000 ++// BIT_LEN_MASK_32(1) => 0x00000001 ++// BIT_LEN_MASK_32(2) => 0x00000003 ++// BIT_LEN_MASK_32(32) => 0xFFFFFFFF ++// ++#define BIT_LEN_MASK_32(__BitLen) (0xFFFFFFFF >> (32 - (__BitLen))) ++// ++// Example: ++// BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003 ++// BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000 ++// ++#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) (BIT_LEN_MASK_32(__BitLen) << (__BitOffset)) ++ ++// ++// Description: ++// Return 4-byte value in host byte ordering from ++// 4-byte pointer in litten-endian system. ++// ++#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) (EF4Byte(*((u32 *)(__pStart)))) ++ ++// ++// Description: ++// Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to ++// 4-byte value in host byte ordering. ++// ++#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ ( LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset) ) \ ++ & \ ++ BIT_LEN_MASK_32(__BitLen) \ ++ ) ++ ++// ++// Description: ++// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering ++// and return the result in 4-byte value in host byte ordering. ++// ++#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ LE_P4BYTE_TO_HOST_4BYTE(__pStart) \ ++ & \ ++ ( ~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) ) \ ++ ) ++ ++// ++// Description: ++// Set subfield of little-endian 4-byte value to specified value. ++// ++#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \ ++ *((u32 *)(__pStart)) = \ ++ EF4Byte( \ ++ LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \ ++ | \ ++ ( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \ ++ ); ++ ++ ++#define BIT_LEN_MASK_16(__BitLen) \ ++ (0xFFFF >> (16 - (__BitLen))) ++ ++#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \ ++ (BIT_LEN_MASK_16(__BitLen) << (__BitOffset)) ++ ++#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ ++ (EF2Byte(*((u16 *)(__pStart)))) ++ ++#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ ( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \ ++ & \ ++ BIT_LEN_MASK_16(__BitLen) \ ++ ) ++ ++#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ LE_P2BYTE_TO_HOST_2BYTE(__pStart) \ ++ & \ ++ ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \ ++ ) ++ ++#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \ ++ *((u16 *)(__pStart)) = \ ++ EF2Byte( \ ++ LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \ ++ | \ ++ ( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \ ++ ); ++ ++#define BIT_LEN_MASK_8(__BitLen) \ ++ (0xFF >> (8 - (__BitLen))) ++ ++#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \ ++ (BIT_LEN_MASK_8(__BitLen) << (__BitOffset)) ++ ++#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ ++ (EF1Byte(*((u8 *)(__pStart)))) ++ ++#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ ( LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset) ) \ ++ & \ ++ BIT_LEN_MASK_8(__BitLen) \ ++ ) ++ ++#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ ++ ( \ ++ LE_P1BYTE_TO_HOST_1BYTE(__pStart) \ ++ & \ ++ ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \ ++ ) ++ ++#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \ ++ *((u8 *)(__pStart)) = \ ++ EF1Byte( \ ++ LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \ ++ | \ ++ ( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \ ++ ); ++ ++#endif // #ifndef __INC_ENDIANFREE_H +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/aes.c +@@ -0,0 +1,469 @@ ++/* ++ * Cryptographic API. ++ * ++ * AES Cipher Algorithm. ++ * ++ * Based on Brian Gladman's code. ++ * ++ * Linux developers: ++ * Alexander Kjeldaas ++ * Herbert Valerio Riedel ++ * Kyle McMartin ++ * Adam J. Richter (conversion to 2.5 API). ++ * ++ * 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. ++ * ++ * --------------------------------------------------------------------------- ++ * Copyright (c) 2002, Dr Brian Gladman , Worcester, UK. ++ * All rights reserved. ++ * ++ * LICENSE TERMS ++ * ++ * The free distribution and use of this software in both source and binary ++ * form is allowed (with or without changes) provided that: ++ * ++ * 1. distributions of this source code include the above copyright ++ * notice, this list of conditions and the following disclaimer; ++ * ++ * 2. distributions in binary form include the above copyright ++ * notice, this list of conditions and the following disclaimer ++ * in the documentation and/or other associated materials; ++ * ++ * 3. the copyright holder's name is not used to endorse products ++ * built using this software without specific written permission. ++ * ++ * ALTERNATIVELY, provided that this notice is retained in full, this product ++ * may be distributed under the terms of the GNU General Public License (GPL), ++ * in which case the provisions of the GPL apply INSTEAD OF those given above. ++ * ++ * DISCLAIMER ++ * ++ * This software is provided 'as is' with no explicit or implied warranties ++ * in respect of its properties, including, but not limited to, correctness ++ * and/or fitness for purpose. ++ * --------------------------------------------------------------------------- ++ */ ++ ++/* Some changes from the Gladman version: ++ s/RIJNDAEL(e_key)/E_KEY/g ++ s/RIJNDAEL(d_key)/D_KEY/g ++*/ ++ ++#include ++#include ++#include ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++ ++#define AES_MIN_KEY_SIZE 16 ++#define AES_MAX_KEY_SIZE 32 ++ ++#define AES_BLOCK_SIZE 16 ++ ++static inline ++u32 generic_rotr32 (const u32 x, const unsigned bits) ++{ ++ const unsigned n = bits % 32; ++ return (x >> n) | (x << (32 - n)); ++} ++ ++static inline ++u32 generic_rotl32 (const u32 x, const unsigned bits) ++{ ++ const unsigned n = bits % 32; ++ return (x << n) | (x >> (32 - n)); ++} ++ ++#define rotl generic_rotl32 ++#define rotr generic_rotr32 ++ ++/* ++ * #define byte(x, nr) ((unsigned char)((x) >> (nr*8))) ++ */ ++inline static u8 ++byte(const u32 x, const unsigned n) ++{ ++ return x >> (n << 3); ++} ++ ++#define u32_in(x) le32_to_cpu(*(const u32 *)(x)) ++#define u32_out(to, from) (*(u32 *)(to) = cpu_to_le32(from)) ++ ++struct aes_ctx { ++ int key_length; ++ u32 E[60]; ++ u32 D[60]; ++}; ++ ++#define E_KEY ctx->E ++#define D_KEY ctx->D ++ ++static u8 pow_tab[256] __initdata; ++static u8 log_tab[256] __initdata; ++static u8 sbx_tab[256] __initdata; ++static u8 isb_tab[256] __initdata; ++static u32 rco_tab[10]; ++static u32 ft_tab[4][256]; ++static u32 it_tab[4][256]; ++ ++static u32 fl_tab[4][256]; ++static u32 il_tab[4][256]; ++ ++static inline u8 __init ++f_mult (u8 a, u8 b) ++{ ++ u8 aa = log_tab[a], cc = aa + log_tab[b]; ++ ++ return pow_tab[cc + (cc < aa ? 1 : 0)]; ++} ++ ++#define ff_mult(a,b) (a && b ? f_mult(a, b) : 0) ++ ++#define f_rn(bo, bi, n, k) \ ++ bo[n] = ft_tab[0][byte(bi[n],0)] ^ \ ++ ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ ++ ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ ++ ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) ++ ++#define i_rn(bo, bi, n, k) \ ++ bo[n] = it_tab[0][byte(bi[n],0)] ^ \ ++ it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ ++ it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ ++ it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) ++ ++#define ls_box(x) \ ++ ( fl_tab[0][byte(x, 0)] ^ \ ++ fl_tab[1][byte(x, 1)] ^ \ ++ fl_tab[2][byte(x, 2)] ^ \ ++ fl_tab[3][byte(x, 3)] ) ++ ++#define f_rl(bo, bi, n, k) \ ++ bo[n] = fl_tab[0][byte(bi[n],0)] ^ \ ++ fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ ++ fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ ++ fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) ++ ++#define i_rl(bo, bi, n, k) \ ++ bo[n] = il_tab[0][byte(bi[n],0)] ^ \ ++ il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ ++ il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ ++ il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) ++ ++static void __init ++gen_tabs (void) ++{ ++ u32 i, t; ++ u8 p, q; ++ ++ /* log and power tables for GF(2**8) finite field with ++ 0x011b as modular polynomial - the simplest primitive ++ root is 0x03, used here to generate the tables */ ++ ++ for (i = 0, p = 1; i < 256; ++i) { ++ pow_tab[i] = (u8) p; ++ log_tab[p] = (u8) i; ++ ++ p ^= (p << 1) ^ (p & 0x80 ? 0x01b : 0); ++ } ++ ++ log_tab[1] = 0; ++ ++ for (i = 0, p = 1; i < 10; ++i) { ++ rco_tab[i] = p; ++ ++ p = (p << 1) ^ (p & 0x80 ? 0x01b : 0); ++ } ++ ++ for (i = 0; i < 256; ++i) { ++ p = (i ? pow_tab[255 - log_tab[i]] : 0); ++ q = ((p >> 7) | (p << 1)) ^ ((p >> 6) | (p << 2)); ++ p ^= 0x63 ^ q ^ ((q >> 6) | (q << 2)); ++ sbx_tab[i] = p; ++ isb_tab[p] = (u8) i; ++ } ++ ++ for (i = 0; i < 256; ++i) { ++ p = sbx_tab[i]; ++ ++ t = p; ++ fl_tab[0][i] = t; ++ fl_tab[1][i] = rotl (t, 8); ++ fl_tab[2][i] = rotl (t, 16); ++ fl_tab[3][i] = rotl (t, 24); ++ ++ t = ((u32) ff_mult (2, p)) | ++ ((u32) p << 8) | ++ ((u32) p << 16) | ((u32) ff_mult (3, p) << 24); ++ ++ ft_tab[0][i] = t; ++ ft_tab[1][i] = rotl (t, 8); ++ ft_tab[2][i] = rotl (t, 16); ++ ft_tab[3][i] = rotl (t, 24); ++ ++ p = isb_tab[i]; ++ ++ t = p; ++ il_tab[0][i] = t; ++ il_tab[1][i] = rotl (t, 8); ++ il_tab[2][i] = rotl (t, 16); ++ il_tab[3][i] = rotl (t, 24); ++ ++ t = ((u32) ff_mult (14, p)) | ++ ((u32) ff_mult (9, p) << 8) | ++ ((u32) ff_mult (13, p) << 16) | ++ ((u32) ff_mult (11, p) << 24); ++ ++ it_tab[0][i] = t; ++ it_tab[1][i] = rotl (t, 8); ++ it_tab[2][i] = rotl (t, 16); ++ it_tab[3][i] = rotl (t, 24); ++ } ++} ++ ++#define star_x(x) (((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x1b) ++ ++#define imix_col(y,x) \ ++ u = star_x(x); \ ++ v = star_x(u); \ ++ w = star_x(v); \ ++ t = w ^ (x); \ ++ (y) = u ^ v ^ w; \ ++ (y) ^= rotr(u ^ t, 8) ^ \ ++ rotr(v ^ t, 16) ^ \ ++ rotr(t,24) ++ ++/* initialise the key schedule from the user supplied key */ ++ ++#define loop4(i) \ ++{ t = rotr(t, 8); t = ls_box(t) ^ rco_tab[i]; \ ++ t ^= E_KEY[4 * i]; E_KEY[4 * i + 4] = t; \ ++ t ^= E_KEY[4 * i + 1]; E_KEY[4 * i + 5] = t; \ ++ t ^= E_KEY[4 * i + 2]; E_KEY[4 * i + 6] = t; \ ++ t ^= E_KEY[4 * i + 3]; E_KEY[4 * i + 7] = t; \ ++} ++ ++#define loop6(i) \ ++{ t = rotr(t, 8); t = ls_box(t) ^ rco_tab[i]; \ ++ t ^= E_KEY[6 * i]; E_KEY[6 * i + 6] = t; \ ++ t ^= E_KEY[6 * i + 1]; E_KEY[6 * i + 7] = t; \ ++ t ^= E_KEY[6 * i + 2]; E_KEY[6 * i + 8] = t; \ ++ t ^= E_KEY[6 * i + 3]; E_KEY[6 * i + 9] = t; \ ++ t ^= E_KEY[6 * i + 4]; E_KEY[6 * i + 10] = t; \ ++ t ^= E_KEY[6 * i + 5]; E_KEY[6 * i + 11] = t; \ ++} ++ ++#define loop8(i) \ ++{ t = rotr(t, 8); ; t = ls_box(t) ^ rco_tab[i]; \ ++ t ^= E_KEY[8 * i]; E_KEY[8 * i + 8] = t; \ ++ t ^= E_KEY[8 * i + 1]; E_KEY[8 * i + 9] = t; \ ++ t ^= E_KEY[8 * i + 2]; E_KEY[8 * i + 10] = t; \ ++ t ^= E_KEY[8 * i + 3]; E_KEY[8 * i + 11] = t; \ ++ t = E_KEY[8 * i + 4] ^ ls_box(t); \ ++ E_KEY[8 * i + 12] = t; \ ++ t ^= E_KEY[8 * i + 5]; E_KEY[8 * i + 13] = t; \ ++ t ^= E_KEY[8 * i + 6]; E_KEY[8 * i + 14] = t; \ ++ t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \ ++} ++ ++static int ++aes_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u32 *flags) ++{ ++ struct aes_ctx *ctx = ctx_arg; ++ u32 i, t, u, v, w; ++ ++ if (key_len != 16 && key_len != 24 && key_len != 32) { ++ *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; ++ return -EINVAL; ++ } ++ ++ ctx->key_length = key_len; ++ ++ E_KEY[0] = u32_in (in_key); ++ E_KEY[1] = u32_in (in_key + 4); ++ E_KEY[2] = u32_in (in_key + 8); ++ E_KEY[3] = u32_in (in_key + 12); ++ ++ switch (key_len) { ++ case 16: ++ t = E_KEY[3]; ++ for (i = 0; i < 10; ++i) ++ loop4 (i); ++ break; ++ ++ case 24: ++ E_KEY[4] = u32_in (in_key + 16); ++ t = E_KEY[5] = u32_in (in_key + 20); ++ for (i = 0; i < 8; ++i) ++ loop6 (i); ++ break; ++ ++ case 32: ++ E_KEY[4] = u32_in (in_key + 16); ++ E_KEY[5] = u32_in (in_key + 20); ++ E_KEY[6] = u32_in (in_key + 24); ++ t = E_KEY[7] = u32_in (in_key + 28); ++ for (i = 0; i < 7; ++i) ++ loop8 (i); ++ break; ++ } ++ ++ D_KEY[0] = E_KEY[0]; ++ D_KEY[1] = E_KEY[1]; ++ D_KEY[2] = E_KEY[2]; ++ D_KEY[3] = E_KEY[3]; ++ ++ for (i = 4; i < key_len + 24; ++i) { ++ imix_col (D_KEY[i], E_KEY[i]); ++ } ++ ++ return 0; ++} ++ ++/* encrypt a block of text */ ++ ++#define f_nround(bo, bi, k) \ ++ f_rn(bo, bi, 0, k); \ ++ f_rn(bo, bi, 1, k); \ ++ f_rn(bo, bi, 2, k); \ ++ f_rn(bo, bi, 3, k); \ ++ k += 4 ++ ++#define f_lround(bo, bi, k) \ ++ f_rl(bo, bi, 0, k); \ ++ f_rl(bo, bi, 1, k); \ ++ f_rl(bo, bi, 2, k); \ ++ f_rl(bo, bi, 3, k) ++ ++static void aes_encrypt(void *ctx_arg, u8 *out, const u8 *in) ++{ ++ const struct aes_ctx *ctx = ctx_arg; ++ u32 b0[4], b1[4]; ++ const u32 *kp = E_KEY + 4; ++ ++ b0[0] = u32_in (in) ^ E_KEY[0]; ++ b0[1] = u32_in (in + 4) ^ E_KEY[1]; ++ b0[2] = u32_in (in + 8) ^ E_KEY[2]; ++ b0[3] = u32_in (in + 12) ^ E_KEY[3]; ++ ++ if (ctx->key_length > 24) { ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ } ++ ++ if (ctx->key_length > 16) { ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ } ++ ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ f_nround (b1, b0, kp); ++ f_nround (b0, b1, kp); ++ f_nround (b1, b0, kp); ++ f_lround (b0, b1, kp); ++ ++ u32_out (out, b0[0]); ++ u32_out (out + 4, b0[1]); ++ u32_out (out + 8, b0[2]); ++ u32_out (out + 12, b0[3]); ++} ++ ++/* decrypt a block of text */ ++ ++#define i_nround(bo, bi, k) \ ++ i_rn(bo, bi, 0, k); \ ++ i_rn(bo, bi, 1, k); \ ++ i_rn(bo, bi, 2, k); \ ++ i_rn(bo, bi, 3, k); \ ++ k -= 4 ++ ++#define i_lround(bo, bi, k) \ ++ i_rl(bo, bi, 0, k); \ ++ i_rl(bo, bi, 1, k); \ ++ i_rl(bo, bi, 2, k); \ ++ i_rl(bo, bi, 3, k) ++ ++static void aes_decrypt(void *ctx_arg, u8 *out, const u8 *in) ++{ ++ const struct aes_ctx *ctx = ctx_arg; ++ u32 b0[4], b1[4]; ++ const int key_len = ctx->key_length; ++ const u32 *kp = D_KEY + key_len + 20; ++ ++ b0[0] = u32_in (in) ^ E_KEY[key_len + 24]; ++ b0[1] = u32_in (in + 4) ^ E_KEY[key_len + 25]; ++ b0[2] = u32_in (in + 8) ^ E_KEY[key_len + 26]; ++ b0[3] = u32_in (in + 12) ^ E_KEY[key_len + 27]; ++ ++ if (key_len > 24) { ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ } ++ ++ if (key_len > 16) { ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ } ++ ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ i_nround (b1, b0, kp); ++ i_nround (b0, b1, kp); ++ i_nround (b1, b0, kp); ++ i_lround (b0, b1, kp); ++ ++ u32_out (out, b0[0]); ++ u32_out (out + 4, b0[1]); ++ u32_out (out + 8, b0[2]); ++ u32_out (out + 12, b0[3]); ++} ++ ++ ++static struct crypto_alg aes_alg = { ++ .cra_name = "aes", ++ .cra_flags = CRYPTO_ALG_TYPE_CIPHER, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct aes_ctx), ++ .cra_module = THIS_MODULE, ++ .cra_list = LIST_HEAD_INIT(aes_alg.cra_list), ++ .cra_u = { ++ .cipher = { ++ .cia_min_keysize = AES_MIN_KEY_SIZE, ++ .cia_max_keysize = AES_MAX_KEY_SIZE, ++ .cia_setkey = aes_set_key, ++ .cia_encrypt = aes_encrypt, ++ .cia_decrypt = aes_decrypt ++ } ++ } ++}; ++ ++static int __init aes_init(void) ++{ ++ gen_tabs(); ++ return crypto_register_alg(&aes_alg); ++} ++ ++static void __exit aes_fini(void) ++{ ++ crypto_unregister_alg(&aes_alg); ++} ++ ++module_init(aes_init); ++module_exit(aes_fini); ++ ++MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); ++MODULE_LICENSE("Dual BSD/GPL"); ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/api.c +@@ -0,0 +1,246 @@ ++/* ++ * Scatterlist Cryptographic API. ++ * ++ * Copyright (c) 2002 James Morris ++ * Copyright (c) 2002 David S. Miller (davem@redhat.com) ++ * ++ * Portions derived from Cryptoapi, by Alexander Kjeldaas ++ * and Nettle, by Niels M鰈ler. ++ * ++ * 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. ++ * ++ */ ++#include "kmap_types.h" ++ ++#include ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include "internal.h" ++ ++LIST_HEAD(crypto_alg_list); ++DECLARE_RWSEM(crypto_alg_sem); ++ ++static inline int crypto_alg_get(struct crypto_alg *alg) ++{ ++ return try_inc_mod_count(alg->cra_module); ++} ++ ++static inline void crypto_alg_put(struct crypto_alg *alg) ++{ ++ if (alg->cra_module) ++ __MOD_DEC_USE_COUNT(alg->cra_module); ++} ++ ++struct crypto_alg *crypto_alg_lookup(const char *name) ++{ ++ struct crypto_alg *q, *alg = NULL; ++ ++ if (!name) ++ return NULL; ++ ++ down_read(&crypto_alg_sem); ++ ++ list_for_each_entry(q, &crypto_alg_list, cra_list) { ++ if (!(strcmp(q->cra_name, name))) { ++ if (crypto_alg_get(q)) ++ alg = q; ++ break; ++ } ++ } ++ ++ up_read(&crypto_alg_sem); ++ return alg; ++} ++ ++static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags) ++{ ++ tfm->crt_flags = 0; ++ ++ switch (crypto_tfm_alg_type(tfm)) { ++ case CRYPTO_ALG_TYPE_CIPHER: ++ return crypto_init_cipher_flags(tfm, flags); ++ ++ case CRYPTO_ALG_TYPE_DIGEST: ++ return crypto_init_digest_flags(tfm, flags); ++ ++ case CRYPTO_ALG_TYPE_COMPRESS: ++ return crypto_init_compress_flags(tfm, flags); ++ ++ default: ++ break; ++ } ++ ++ BUG(); ++ return -EINVAL; ++} ++ ++static int crypto_init_ops(struct crypto_tfm *tfm) ++{ ++ switch (crypto_tfm_alg_type(tfm)) { ++ case CRYPTO_ALG_TYPE_CIPHER: ++ return crypto_init_cipher_ops(tfm); ++ ++ case CRYPTO_ALG_TYPE_DIGEST: ++ return crypto_init_digest_ops(tfm); ++ ++ case CRYPTO_ALG_TYPE_COMPRESS: ++ return crypto_init_compress_ops(tfm); ++ ++ default: ++ break; ++ } ++ ++ BUG(); ++ return -EINVAL; ++} ++ ++static void crypto_exit_ops(struct crypto_tfm *tfm) ++{ ++ switch (crypto_tfm_alg_type(tfm)) { ++ case CRYPTO_ALG_TYPE_CIPHER: ++ crypto_exit_cipher_ops(tfm); ++ break; ++ ++ case CRYPTO_ALG_TYPE_DIGEST: ++ crypto_exit_digest_ops(tfm); ++ break; ++ ++ case CRYPTO_ALG_TYPE_COMPRESS: ++ crypto_exit_compress_ops(tfm); ++ break; ++ ++ default: ++ BUG(); ++ ++ } ++} ++ ++struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags) ++{ ++ struct crypto_tfm *tfm = NULL; ++ struct crypto_alg *alg; ++ ++ alg = crypto_alg_mod_lookup(name); ++ if (alg == NULL) ++ goto out; ++ ++ tfm = kmalloc(sizeof(*tfm) + alg->cra_ctxsize, GFP_KERNEL); ++ if (tfm == NULL) ++ goto out_put; ++ ++ memset(tfm, 0, sizeof(*tfm) + alg->cra_ctxsize); ++ ++ tfm->__crt_alg = alg; ++ ++ if (crypto_init_flags(tfm, flags)) ++ goto out_free_tfm; ++ ++ if (crypto_init_ops(tfm)) { ++ crypto_exit_ops(tfm); ++ goto out_free_tfm; ++ } ++ ++ goto out; ++ ++out_free_tfm: ++ kfree(tfm); ++ tfm = NULL; ++out_put: ++ crypto_alg_put(alg); ++out: ++ return tfm; ++} ++ ++void crypto_free_tfm(struct crypto_tfm *tfm) ++{ ++ struct crypto_alg *alg = tfm->__crt_alg; ++ int size = sizeof(*tfm) + alg->cra_ctxsize; ++ ++ crypto_exit_ops(tfm); ++ crypto_alg_put(alg); ++ memset(tfm, 0, size); ++ kfree(tfm); ++} ++ ++int crypto_register_alg(struct crypto_alg *alg) ++{ ++ int ret = 0; ++ struct crypto_alg *q; ++ ++ down_write(&crypto_alg_sem); ++ ++ list_for_each_entry(q, &crypto_alg_list, cra_list) { ++ if (!(strcmp(q->cra_name, alg->cra_name))) { ++ ret = -EEXIST; ++ goto out; ++ } ++ } ++ ++ list_add_tail(&alg->cra_list, &crypto_alg_list); ++out: ++ up_write(&crypto_alg_sem); ++ return ret; ++} ++ ++int crypto_unregister_alg(struct crypto_alg *alg) ++{ ++ int ret = -ENOENT; ++ struct crypto_alg *q; ++ ++ BUG_ON(!alg->cra_module); ++ ++ down_write(&crypto_alg_sem); ++ list_for_each_entry(q, &crypto_alg_list, cra_list) { ++ if (alg == q) { ++ list_del(&alg->cra_list); ++ ret = 0; ++ goto out; ++ } ++ } ++out: ++ up_write(&crypto_alg_sem); ++ return ret; ++} ++ ++int crypto_alg_available(const char *name, u32 flags) ++{ ++ int ret = 0; ++ struct crypto_alg *alg = crypto_alg_mod_lookup(name); ++ ++ if (alg) { ++ crypto_alg_put(alg); ++ ret = 1; ++ } ++ ++ return ret; ++} ++ ++static int __init init_crypto(void) ++{ ++ printk(KERN_INFO "Initializing Cryptographic API\n"); ++ crypto_init_proc(); ++ return 0; ++} ++ ++__initcall(init_crypto); ++ ++/* ++EXPORT_SYMBOL_GPL(crypto_register_alg); ++EXPORT_SYMBOL_GPL(crypto_unregister_alg); ++EXPORT_SYMBOL_GPL(crypto_alloc_tfm); ++EXPORT_SYMBOL_GPL(crypto_free_tfm); ++EXPORT_SYMBOL_GPL(crypto_alg_available); ++*/ ++ ++EXPORT_SYMBOL_NOVERS(crypto_register_alg); ++EXPORT_SYMBOL_NOVERS(crypto_unregister_alg); ++EXPORT_SYMBOL_NOVERS(crypto_alloc_tfm); ++EXPORT_SYMBOL_NOVERS(crypto_free_tfm); ++EXPORT_SYMBOL_NOVERS(crypto_alg_available); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/arc4.c +@@ -0,0 +1,103 @@ ++/* ++ * Cryptographic API ++ * ++ * ARC4 Cipher Algorithm ++ * ++ * Jon Oberheide ++ * ++ * 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. ++ * ++ */ ++#include ++#include ++#include "rtl_crypto.h" ++ ++#define ARC4_MIN_KEY_SIZE 1 ++#define ARC4_MAX_KEY_SIZE 256 ++#define ARC4_BLOCK_SIZE 1 ++ ++struct arc4_ctx { ++ u8 S[256]; ++ u8 x, y; ++}; ++ ++static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u32 *flags) ++{ ++ struct arc4_ctx *ctx = ctx_arg; ++ int i, j = 0, k = 0; ++ ++ ctx->x = 1; ++ ctx->y = 0; ++ ++ for(i = 0; i < 256; i++) ++ ctx->S[i] = i; ++ ++ for(i = 0; i < 256; i++) ++ { ++ u8 a = ctx->S[i]; ++ j = (j + in_key[k] + a) & 0xff; ++ ctx->S[i] = ctx->S[j]; ++ ctx->S[j] = a; ++ if((unsigned int)++k >= key_len) ++ k = 0; ++ } ++ ++ return 0; ++} ++ ++static void arc4_crypt(void *ctx_arg, u8 *out, const u8 *in) ++{ ++ struct arc4_ctx *ctx = ctx_arg; ++ ++ u8 *const S = ctx->S; ++ u8 x = ctx->x; ++ u8 y = ctx->y; ++ u8 a, b; ++ ++ a = S[x]; ++ y = (y + a) & 0xff; ++ b = S[y]; ++ S[x] = b; ++ S[y] = a; ++ x = (x + 1) & 0xff; ++ *out++ = *in ^ S[(a + b) & 0xff]; ++ ++ ctx->x = x; ++ ctx->y = y; ++} ++ ++static struct crypto_alg arc4_alg = { ++ .cra_name = "arc4", ++ .cra_flags = CRYPTO_ALG_TYPE_CIPHER, ++ .cra_blocksize = ARC4_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct arc4_ctx), ++ .cra_module = THIS_MODULE, ++ .cra_list = LIST_HEAD_INIT(arc4_alg.cra_list), ++ .cra_u = { .cipher = { ++ .cia_min_keysize = ARC4_MIN_KEY_SIZE, ++ .cia_max_keysize = ARC4_MAX_KEY_SIZE, ++ .cia_setkey = arc4_set_key, ++ .cia_encrypt = arc4_crypt, ++ .cia_decrypt = arc4_crypt } } ++}; ++ ++static int __init arc4_init(void) ++{ ++ return crypto_register_alg(&arc4_alg); ++} ++ ++ ++static void __exit arc4_exit(void) ++{ ++ crypto_unregister_alg(&arc4_alg); ++} ++ ++module_init(arc4_init); ++module_exit(arc4_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("ARC4 Cipher Algorithm"); ++MODULE_AUTHOR("Jon Oberheide "); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/autoload.c +@@ -0,0 +1,40 @@ ++/* ++ * Cryptographic API. ++ * ++ * Algorithm autoloader. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++#include "kmap_types.h" ++ ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include "internal.h" ++ ++/* ++ * A far more intelligent version of this is planned. For now, just ++ * try an exact match on the name of the algorithm. ++ */ ++void crypto_alg_autoload(const char *name) ++{ ++ request_module(name); ++} ++ ++struct crypto_alg *crypto_alg_mod_lookup(const char *name) ++{ ++ struct crypto_alg *alg = crypto_alg_lookup(name); ++ if (alg == NULL) { ++ crypto_alg_autoload(name); ++ alg = crypto_alg_lookup(name); ++ } ++ return alg; ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/cipher.c +@@ -0,0 +1,299 @@ ++/* ++ * Cryptographic API. ++ * ++ * Cipher operations. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include ++#include "internal.h" ++#include "scatterwalk.h" ++ ++typedef void (cryptfn_t)(void *, u8 *, const u8 *); ++typedef void (procfn_t)(struct crypto_tfm *, u8 *, ++ u8*, cryptfn_t, int enc, void *, int); ++ ++static inline void xor_64(u8 *a, const u8 *b) ++{ ++ ((u32 *)a)[0] ^= ((u32 *)b)[0]; ++ ((u32 *)a)[1] ^= ((u32 *)b)[1]; ++} ++ ++static inline void xor_128(u8 *a, const u8 *b) ++{ ++ ((u32 *)a)[0] ^= ((u32 *)b)[0]; ++ ((u32 *)a)[1] ^= ((u32 *)b)[1]; ++ ((u32 *)a)[2] ^= ((u32 *)b)[2]; ++ ((u32 *)a)[3] ^= ((u32 *)b)[3]; ++} ++ ++ ++/* ++ * Generic encrypt/decrypt wrapper for ciphers, handles operations across ++ * multiple page boundaries by using temporary blocks. In user context, ++ * the kernel is given a chance to schedule us once per block. ++ */ ++static int crypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, cryptfn_t crfn, ++ procfn_t prfn, int enc, void *info) ++{ ++ struct scatter_walk walk_in, walk_out; ++ const unsigned int bsize = crypto_tfm_alg_blocksize(tfm); ++ u8 tmp_src[bsize]; ++ u8 tmp_dst[bsize]; ++ ++ if (!nbytes) ++ return 0; ++ ++ if (nbytes % bsize) { ++ tfm->crt_flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; ++ return -EINVAL; ++ } ++ ++ scatterwalk_start(&walk_in, src); ++ scatterwalk_start(&walk_out, dst); ++ ++ for(;;) { ++ u8 *src_p, *dst_p; ++ int in_place; ++ ++ scatterwalk_map(&walk_in, 0); ++ scatterwalk_map(&walk_out, 1); ++ src_p = scatterwalk_whichbuf(&walk_in, bsize, tmp_src); ++ dst_p = scatterwalk_whichbuf(&walk_out, bsize, tmp_dst); ++ in_place = scatterwalk_samebuf(&walk_in, &walk_out, ++ src_p, dst_p); ++ ++ nbytes -= bsize; ++ ++ scatterwalk_copychunks(src_p, &walk_in, bsize, 0); ++ ++ prfn(tfm, dst_p, src_p, crfn, enc, info, in_place); ++ ++ scatterwalk_done(&walk_in, 0, nbytes); ++ ++ scatterwalk_copychunks(dst_p, &walk_out, bsize, 1); ++ scatterwalk_done(&walk_out, 1, nbytes); ++ ++ if (!nbytes) ++ return 0; ++ ++ crypto_yield(tfm); ++ } ++} ++ ++static void cbc_process(struct crypto_tfm *tfm, u8 *dst, u8 *src, ++ cryptfn_t fn, int enc, void *info, int in_place) ++{ ++ u8 *iv = info; ++ ++ /* Null encryption */ ++ if (!iv) ++ return; ++ ++ if (enc) { ++ tfm->crt_u.cipher.cit_xor_block(iv, src); ++ fn(crypto_tfm_ctx(tfm), dst, iv); ++ memcpy(iv, dst, crypto_tfm_alg_blocksize(tfm)); ++ } else { ++ u8 stack[in_place ? crypto_tfm_alg_blocksize(tfm) : 0]; ++ u8 *buf = in_place ? stack : dst; ++ ++ fn(crypto_tfm_ctx(tfm), buf, src); ++ tfm->crt_u.cipher.cit_xor_block(buf, iv); ++ memcpy(iv, src, crypto_tfm_alg_blocksize(tfm)); ++ if (buf != dst) ++ memcpy(dst, buf, crypto_tfm_alg_blocksize(tfm)); ++ } ++} ++ ++static void ecb_process(struct crypto_tfm *tfm, u8 *dst, u8 *src, ++ cryptfn_t fn, int enc, void *info, int in_place) ++{ ++ fn(crypto_tfm_ctx(tfm), dst, src); ++} ++ ++static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) ++{ ++ struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; ++ ++ if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) { ++ tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; ++ return -EINVAL; ++ } else ++ return cia->cia_setkey(crypto_tfm_ctx(tfm), key, keylen, ++ &tfm->crt_flags); ++} ++ ++static int ecb_encrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, unsigned int nbytes) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_encrypt, ++ ecb_process, 1, NULL); ++} ++ ++static int ecb_decrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_decrypt, ++ ecb_process, 1, NULL); ++} ++ ++static int cbc_encrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_encrypt, ++ cbc_process, 1, tfm->crt_cipher.cit_iv); ++} ++ ++static int cbc_encrypt_iv(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_encrypt, ++ cbc_process, 1, iv); ++} ++ ++static int cbc_decrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_decrypt, ++ cbc_process, 0, tfm->crt_cipher.cit_iv); ++} ++ ++static int cbc_decrypt_iv(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv) ++{ ++ return crypt(tfm, dst, src, nbytes, ++ tfm->__crt_alg->cra_cipher.cia_decrypt, ++ cbc_process, 0, iv); ++} ++ ++static int nocrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ return -ENOSYS; ++} ++ ++static int nocrypt_iv(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv) ++{ ++ return -ENOSYS; ++} ++ ++int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags) ++{ ++ u32 mode = flags & CRYPTO_TFM_MODE_MASK; ++ ++ tfm->crt_cipher.cit_mode = mode ? mode : CRYPTO_TFM_MODE_ECB; ++ if (flags & CRYPTO_TFM_REQ_WEAK_KEY) ++ tfm->crt_flags = CRYPTO_TFM_REQ_WEAK_KEY; ++ ++ return 0; ++} ++ ++int crypto_init_cipher_ops(struct crypto_tfm *tfm) ++{ ++ int ret = 0; ++ struct cipher_tfm *ops = &tfm->crt_cipher; ++ ++ ops->cit_setkey = setkey; ++ ++ switch (tfm->crt_cipher.cit_mode) { ++ case CRYPTO_TFM_MODE_ECB: ++ ops->cit_encrypt = ecb_encrypt; ++ ops->cit_decrypt = ecb_decrypt; ++ break; ++ ++ case CRYPTO_TFM_MODE_CBC: ++ ops->cit_encrypt = cbc_encrypt; ++ ops->cit_decrypt = cbc_decrypt; ++ ops->cit_encrypt_iv = cbc_encrypt_iv; ++ ops->cit_decrypt_iv = cbc_decrypt_iv; ++ break; ++ ++ case CRYPTO_TFM_MODE_CFB: ++ ops->cit_encrypt = nocrypt; ++ ops->cit_decrypt = nocrypt; ++ ops->cit_encrypt_iv = nocrypt_iv; ++ ops->cit_decrypt_iv = nocrypt_iv; ++ break; ++ ++ case CRYPTO_TFM_MODE_CTR: ++ ops->cit_encrypt = nocrypt; ++ ops->cit_decrypt = nocrypt; ++ ops->cit_encrypt_iv = nocrypt_iv; ++ ops->cit_decrypt_iv = nocrypt_iv; ++ break; ++ ++ default: ++ BUG(); ++ } ++ ++ if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) { ++ ++ switch (crypto_tfm_alg_blocksize(tfm)) { ++ case 8: ++ ops->cit_xor_block = xor_64; ++ break; ++ ++ case 16: ++ ops->cit_xor_block = xor_128; ++ break; ++ ++ default: ++ printk(KERN_WARNING "%s: block size %u not supported\n", ++ crypto_tfm_alg_name(tfm), ++ crypto_tfm_alg_blocksize(tfm)); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ ops->cit_ivsize = crypto_tfm_alg_blocksize(tfm); ++ ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL); ++ if (ops->cit_iv == NULL) ++ ret = -ENOMEM; ++ } ++ ++out: ++ return ret; ++} ++ ++void crypto_exit_cipher_ops(struct crypto_tfm *tfm) ++{ ++ if (tfm->crt_cipher.cit_iv) ++ kfree(tfm->crt_cipher.cit_iv); ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/compress.c +@@ -0,0 +1,64 @@ ++/* ++ * Cryptographic API. ++ * ++ * Compression operations. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include "internal.h" ++ ++static int crypto_compress(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen) ++{ ++ return tfm->__crt_alg->cra_compress.coa_compress(crypto_tfm_ctx(tfm), ++ src, slen, dst, ++ dlen); ++} ++ ++static int crypto_decompress(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen) ++{ ++ return tfm->__crt_alg->cra_compress.coa_decompress(crypto_tfm_ctx(tfm), ++ src, slen, dst, ++ dlen); ++} ++ ++int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags) ++{ ++ return flags ? -EINVAL : 0; ++} ++ ++int crypto_init_compress_ops(struct crypto_tfm *tfm) ++{ ++ int ret = 0; ++ struct compress_tfm *ops = &tfm->crt_compress; ++ ++ ret = tfm->__crt_alg->cra_compress.coa_init(crypto_tfm_ctx(tfm)); ++ if (ret) ++ goto out; ++ ++ ops->cot_compress = crypto_compress; ++ ops->cot_decompress = crypto_decompress; ++ ++out: ++ return ret; ++} ++ ++void crypto_exit_compress_ops(struct crypto_tfm *tfm) ++{ ++ tfm->__crt_alg->cra_compress.coa_exit(crypto_tfm_ctx(tfm)); ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/crypto_compat.h +@@ -0,0 +1,90 @@ ++/* ++ * Header file to maintain compatibility among different kernel versions. ++ * ++ * Copyright (c) 2004-2006 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++#include ++ ++static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); ++} ++ ++ ++static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); ++} ++ ++#if 0 ++/* ++ * crypto_free_tfm - Free crypto transform ++ * @tfm: Transform to free ++ * ++ * crypto_free_tfm() frees up the transform and any associated resources, ++ * then drops the refcount on the associated algorithm. ++ */ ++void crypto_free_tfm(struct crypto_tfm *tfm) ++{ ++ struct crypto_alg *alg; ++ int size; ++ ++ if (unlikely(!tfm)) ++ return; ++ ++ alg = tfm->__crt_alg; ++ size = sizeof(*tfm) + alg->cra_ctxsize; ++ ++ if (alg->cra_exit) ++ alg->cra_exit(tfm); ++ crypto_exit_ops(tfm); ++ crypto_mod_put(alg); ++ memset(tfm, 0, size); ++ kfree(tfm); ++} ++ ++#endif ++#if 1 ++ struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags) ++{ ++ struct crypto_tfm *tfm = NULL; ++ int err; ++ printk("call crypto_alloc_tfm!!!\n"); ++ do { ++ struct crypto_alg *alg; ++ ++ alg = crypto_alg_mod_lookup(name, 0, CRYPTO_ALG_ASYNC); ++ err = PTR_ERR(alg); ++ if (IS_ERR(alg)) ++ continue; ++ ++ tfm = __crypto_alloc_tfm(alg, flags); ++ err = 0; ++ if (IS_ERR(tfm)) { ++ crypto_mod_put(alg); ++ err = PTR_ERR(tfm); ++ tfm = NULL; ++ } ++ } while (err == -EAGAIN && !signal_pending(current)); ++ ++ return tfm; ++} ++#endif ++//EXPORT_SYMBOL_GPL(crypto_alloc_tfm); ++//EXPORT_SYMBOL_GPL(crypto_free_tfm); ++ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/digest.c +@@ -0,0 +1,108 @@ ++/* ++ * Cryptographic API. ++ * ++ * Digest operations. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include ++#include "internal.h" ++ ++static void init(struct crypto_tfm *tfm) ++{ ++ tfm->__crt_alg->cra_digest.dia_init(crypto_tfm_ctx(tfm)); ++} ++ ++static void update(struct crypto_tfm *tfm, ++ struct scatterlist *sg, unsigned int nsg) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < nsg; i++) { ++ ++ struct page *pg = sg[i].page; ++ unsigned int offset = sg[i].offset; ++ unsigned int l = sg[i].length; ++ ++ do { ++ unsigned int bytes_from_page = min(l, ((unsigned int) ++ (PAGE_SIZE)) - ++ offset); ++ char *p = crypto_kmap(pg, 0) + offset; ++ ++ tfm->__crt_alg->cra_digest.dia_update ++ (crypto_tfm_ctx(tfm), p, ++ bytes_from_page); ++ crypto_kunmap(p, 0); ++ crypto_yield(tfm); ++ offset = 0; ++ pg++; ++ l -= bytes_from_page; ++ } while (l > 0); ++ } ++} ++ ++static void final(struct crypto_tfm *tfm, u8 *out) ++{ ++ tfm->__crt_alg->cra_digest.dia_final(crypto_tfm_ctx(tfm), out); ++} ++ ++static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) ++{ ++ u32 flags; ++ if (tfm->__crt_alg->cra_digest.dia_setkey == NULL) ++ return -ENOSYS; ++ return tfm->__crt_alg->cra_digest.dia_setkey(crypto_tfm_ctx(tfm), ++ key, keylen, &flags); ++} ++ ++static void digest(struct crypto_tfm *tfm, ++ struct scatterlist *sg, unsigned int nsg, u8 *out) ++{ ++ unsigned int i; ++ ++ tfm->crt_digest.dit_init(tfm); ++ ++ for (i = 0; i < nsg; i++) { ++ char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset; ++ tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm), ++ p, sg[i].length); ++ crypto_kunmap(p, 0); ++ crypto_yield(tfm); ++ } ++ crypto_digest_final(tfm, out); ++} ++ ++int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags) ++{ ++ return flags ? -EINVAL : 0; ++} ++ ++int crypto_init_digest_ops(struct crypto_tfm *tfm) ++{ ++ struct digest_tfm *ops = &tfm->crt_digest; ++ ++ ops->dit_init = init; ++ ops->dit_update = update; ++ ops->dit_final = final; ++ ops->dit_digest = digest; ++ ops->dit_setkey = setkey; ++ ++ return crypto_alloc_hmac_block(tfm); ++} ++ ++void crypto_exit_digest_ops(struct crypto_tfm *tfm) ++{ ++ crypto_free_hmac_block(tfm); ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/dot11d.c +@@ -0,0 +1,239 @@ ++#ifdef ENABLE_DOT11D ++//----------------------------------------------------------------------------- ++// File: ++// Dot11d.c ++// ++// Description: ++// Implement 802.11d. ++// ++//----------------------------------------------------------------------------- ++ ++#include "dot11d.h" ++ ++void ++Dot11d_Init(struct ieee80211_device *ieee) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); ++ ++ pDot11dInfo->bEnabled = 0; ++ ++ pDot11dInfo->State = DOT11D_STATE_NONE; ++ pDot11dInfo->CountryIeLen = 0; ++ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); ++ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); ++ RESET_CIE_WATCHDOG(ieee); ++ ++ printk("Dot11d_Init()\n"); ++} ++ ++// ++// Description: ++// Reset to the state as we are just entering a regulatory domain. ++// ++void ++Dot11d_Reset(struct ieee80211_device *ieee) ++{ ++ u32 i; ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); ++#if 0 ++ if(!pDot11dInfo->bEnabled) ++ return; ++#endif ++ // Clear old channel map ++ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); ++ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); ++ // Set new channel map ++ for (i=1; i<=11; i++) { ++ (pDot11dInfo->channel_map)[i] = 1; ++ } ++ for (i=12; i<=14; i++) { ++ (pDot11dInfo->channel_map)[i] = 2; ++ } ++ ++ pDot11dInfo->State = DOT11D_STATE_NONE; ++ pDot11dInfo->CountryIeLen = 0; ++ RESET_CIE_WATCHDOG(ieee); ++ ++ //printk("Dot11d_Reset()\n"); ++} ++ ++// ++// Description: ++// Update country IE from Beacon or Probe Resopnse ++// and configure PHY for operation in the regulatory domain. ++// ++// TODO: ++// Configure Tx power. ++// ++// Assumption: ++// 1. IS_DOT11D_ENABLE() is TRUE. ++// 2. Input IE is an valid one. ++// ++void ++Dot11d_UpdateCountryIe( ++ struct ieee80211_device *dev, ++ u8 * pTaddr, ++ u16 CoutryIeLen, ++ u8 * pCoutryIe ++ ) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); ++ u8 i, j, NumTriples, MaxChnlNum; ++ PCHNL_TXPOWER_TRIPLE pTriple; ++ ++ memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); ++ memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); ++ MaxChnlNum = 0; ++ NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string. ++ pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3); ++ for(i = 0; i < NumTriples; i++) ++ { ++ if(MaxChnlNum >= pTriple->FirstChnl) ++ { // It is not in a monotonically increasing order, so stop processing. ++ printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n"); ++ return; ++ } ++ if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) ++ { // It is not a valid set of channel id, so stop processing. ++ printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n"); ++ return; ++ } ++ ++ for(j = 0 ; j < pTriple->NumChnls; j++) ++ { ++ pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1; ++ pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm; ++ MaxChnlNum = pTriple->FirstChnl + j; ++ } ++ ++ pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3); ++ } ++#if 1 ++ //printk("Dot11d_UpdateCountryIe(): Channel List:\n"); ++ printk("Channel List:"); ++ for(i=1; i<= MAX_CHANNEL_NUMBER; i++) ++ if(pDot11dInfo->channel_map[i] > 0) ++ printk(" %d", i); ++ printk("\n"); ++#endif ++ ++ UPDATE_CIE_SRC(dev, pTaddr); ++ ++ pDot11dInfo->CountryIeLen = CoutryIeLen; ++ memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen); ++ pDot11dInfo->State = DOT11D_STATE_LEARNED; ++} ++ ++ ++u8 ++DOT11D_GetMaxTxPwrInDbm( ++ struct ieee80211_device *dev, ++ u8 Channel ++ ) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); ++ u8 MaxTxPwrInDbm = 255; ++ ++ if(MAX_CHANNEL_NUMBER < Channel) ++ { ++ printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); ++ return MaxTxPwrInDbm; ++ } ++ if(pDot11dInfo->channel_map[Channel]) ++ { ++ MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel]; ++ } ++ ++ return MaxTxPwrInDbm; ++} ++ ++ ++void ++DOT11D_ScanComplete( ++ struct ieee80211_device * dev ++ ) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); ++ ++ switch(pDot11dInfo->State) ++ { ++ case DOT11D_STATE_LEARNED: ++ pDot11dInfo->State = DOT11D_STATE_DONE; ++ break; ++ ++ case DOT11D_STATE_DONE: ++ if( GET_CIE_WATCHDOG(dev) == 0 ) ++ { // Reset country IE if previous one is gone. ++ Dot11d_Reset(dev); ++ } ++ break; ++ case DOT11D_STATE_NONE: ++ break; ++ } ++} ++ ++int IsLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); ++ ++ if(MAX_CHANNEL_NUMBER < channel) ++ { ++ printk("IsLegalChannel(): Invalid Channel\n"); ++ return 0; ++ } ++ if(pDot11dInfo->channel_map[channel] > 0) ++ return 1; ++ return 0; ++} ++ ++int ToLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++) ++{ ++ PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev); ++ u8 default_chn = 0; ++ u32 i = 0; ++ ++ for (i=1; i<= MAX_CHANNEL_NUMBER; i++) ++ { ++ if(pDot11dInfo->channel_map[i] > 0) ++ { ++ default_chn = i; ++ break; ++ } ++ } ++ ++ if(MAX_CHANNEL_NUMBER < channel) ++ { ++ printk("IsLegalChannel(): Invalid Channel\n"); ++ return default_chn; ++ } ++ ++ if(pDot11dInfo->channel_map[channel] > 0) ++ return channel; ++ ++ return default_chn; ++} ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(Dot11d_Init); ++//EXPORT_SYMBOL(Dot11d_Reset); ++//EXPORT_SYMBOL(Dot11d_UpdateCountryIe); ++//EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); ++//EXPORT_SYMBOL(DOT11D_ScanComplete); ++//EXPORT_SYMBOL(IsLegalChannel); ++//EXPORT_SYMBOL(ToLegalChannel); ++#else ++EXPORT_SYMBOL_NOVERS(Dot11d_Init); ++EXPORT_SYMBOL_NOVERS(Dot11d_Reset); ++EXPORT_SYMBOL_NOVERS(Dot11d_UpdateCountryIe); ++EXPORT_SYMBOL_NOVERS(DOT11D_GetMaxTxPwrInDbm); ++EXPORT_SYMBOL_NOVERS(DOT11D_ScanComplete); ++EXPORT_SYMBOL_NOVERS(IsLegalChannel); ++EXPORT_SYMBOL_NOVERS(ToLegalChannel); ++#endif ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/dot11d.h +@@ -0,0 +1,102 @@ ++#ifndef __INC_DOT11D_H ++#define __INC_DOT11D_H ++ ++#ifdef ENABLE_DOT11D ++#include "ieee80211.h" ++ ++//#define ENABLE_DOT11D ++ ++//#define DOT11D_MAX_CHNL_NUM 83 ++ ++typedef struct _CHNL_TXPOWER_TRIPLE { ++ u8 FirstChnl; ++ u8 NumChnls; ++ u8 MaxTxPowerInDbm; ++}CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; ++ ++typedef enum _DOT11D_STATE { ++ DOT11D_STATE_NONE = 0, ++ DOT11D_STATE_LEARNED, ++ DOT11D_STATE_DONE, ++}DOT11D_STATE; ++ ++typedef struct _RT_DOT11D_INFO { ++ //DECLARE_RT_OBJECT(RT_DOT11D_INFO); ++ ++ bool bEnabled; // dot11MultiDomainCapabilityEnabled ++ ++ u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. ++ u8 CountryIeBuf[MAX_IE_LEN]; ++ u8 CountryIeSrcAddr[6]; // Source AP of the country IE. ++ u8 CountryIeWatchdog; ++ ++ u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) ++ //u8 ChnlListLen; // #Bytes valid in ChnlList[]. ++ //u8 ChnlList[DOT11D_MAX_CHNL_NUM]; ++ u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; ++ ++ DOT11D_STATE State; ++}RT_DOT11D_INFO, *PRT_DOT11D_INFO; ++#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) ++#define cpMacAddr(des,src) ((des)[0]=(src)[0],(des)[1]=(src)[1],(des)[2]=(src)[2],(des)[3]=(src)[3],(des)[4]=(src)[4],(des)[5]=(src)[5]) ++#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) ++ ++#define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled ++#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) ++ ++#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) ++#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) ++ ++#define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ ++ (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ ++ FALSE : \ ++ (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) ++ ++#define CIE_WATCHDOG_TH 1 ++#define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog ++#define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 ++#define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) ++ ++#define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) ++ ++ ++void ++Dot11d_Init( ++ struct ieee80211_device *dev ++ ); ++ ++void ++Dot11d_Reset( ++ struct ieee80211_device *dev ++ ); ++ ++void ++Dot11d_UpdateCountryIe( ++ struct ieee80211_device *dev, ++ u8 * pTaddr, ++ u16 CoutryIeLen, ++ u8 * pCoutryIe ++ ); ++ ++u8 ++DOT11D_GetMaxTxPwrInDbm( ++ struct ieee80211_device *dev, ++ u8 Channel ++ ); ++ ++void ++DOT11D_ScanComplete( ++ struct ieee80211_device * dev ++ ); ++ ++int IsLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++); ++ ++int ToLegalChannel( ++ struct ieee80211_device * dev, ++ u8 channel ++); ++#endif //ENABLE_DOT11D ++#endif // #ifndef __INC_DOT11D_H +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h +@@ -0,0 +1,2802 @@ ++/* ++ * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11 ++ * remains copyright by the original authors ++ * ++ * Portions of the merged code are based on Host AP (software wireless ++ * LAN access point) driver for Intersil Prism2/2.5/3. ++ * ++ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * ++ * Adaption to a generic IEEE 802.11 stack by James Ketrenos ++ * ++ * Copyright (c) 2004, Intel Corporation ++ * ++ * Modified for Realtek's wi-fi cards by Andrea Merello ++ * ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++#ifndef IEEE80211_H ++#define IEEE80211_H ++#include /* ETH_ALEN */ ++#include /* ARRAY_SIZE */ ++#include ++#include ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++#include ++#else ++#include ++#include ++#endif ++#include ++#include ++ ++#include ++#include ++ ++#include "rtl819x_HT.h" ++#include "rtl819x_BA.h" ++#include "rtl819x_TS.h" ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) ++#ifndef bool ++typedef enum{false = 0, true} bool; ++#endif ++#endif ++ ++#ifndef IW_MODE_MONITOR ++#define IW_MODE_MONITOR 6 ++#endif ++ ++#ifndef IWEVCUSTOM ++#define IWEVCUSTOM 0x8c02 ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#ifndef __bitwise ++#define __bitwise __attribute__((bitwise)) ++#endif ++typedef __u16 __le16; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) ++struct iw_spy_data{ ++ /* --- Standard spy support --- */ ++ int spy_number; ++ u_char spy_address[IW_MAX_SPY][ETH_ALEN]; ++ struct iw_quality spy_stat[IW_MAX_SPY]; ++ /* --- Enhanced spy support (event) */ ++ struct iw_quality spy_thr_low; /* Low threshold */ ++ struct iw_quality spy_thr_high; /* High threshold */ ++ u_char spy_thr_under[IW_MAX_SPY]; ++}; ++#endif ++#endif ++ ++#ifndef container_of ++/** ++ * container_of - cast a member of a structure out to the containing structure ++ * ++ * @ptr: the pointer to the member. ++ * @type: the type of the container struct this is embedded in. ++ * @member: the name of the member within the struct. ++ * ++ */ ++#define container_of(ptr, type, member) ({ \ ++ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ++ (type *)( (char *)__mptr - offsetof(type,member) );}) ++#endif ++ ++#define KEY_TYPE_NA 0x0 ++#define KEY_TYPE_WEP40 0x1 ++#define KEY_TYPE_TKIP 0x2 ++#define KEY_TYPE_CCMP 0x4 ++#define KEY_TYPE_WEP104 0x5 ++ ++/* added for rtl819x tx procedure */ ++#define MAX_QUEUE_SIZE 0x10 ++ ++// ++// 8190 queue mapping ++// ++#define BK_QUEUE 0 ++#define BE_QUEUE 1 ++#define VI_QUEUE 2 ++#define VO_QUEUE 3 ++#define HCCA_QUEUE 4 ++#define TXCMD_QUEUE 5 ++#define MGNT_QUEUE 6 ++#define HIGH_QUEUE 7 ++#define BEACON_QUEUE 8 ++ ++#define LOW_QUEUE BE_QUEUE ++#define NORMAL_QUEUE MGNT_QUEUE ++ ++//added by amy for ps ++#define SWRF_TIMEOUT 50 ++ ++//added by amy for LEAP related ++#define IE_CISCO_FLAG_POSITION 0x08 // Flag byte: byte 8, numbered from 0. ++#define SUPPORT_CKIP_MIC 0x08 // bit3 ++#define SUPPORT_CKIP_PK 0x10 // bit4 ++/* defined for skb cb field */ ++/* At most 28 byte */ ++typedef struct cb_desc { ++ /* Tx Desc Related flags (8-9) */ ++ u8 bLastIniPkt:1; ++ u8 bCmdOrInit:1; ++ u8 bFirstSeg:1; ++ u8 bLastSeg:1; ++ u8 bEncrypt:1; ++ u8 bTxDisableRateFallBack:1; ++ u8 bTxUseDriverAssingedRate:1; ++ u8 bHwSec:1; //indicate whether use Hw security. WB ++ ++ u8 reserved1; ++ ++ /* Tx Firmware Relaged flags (10-11)*/ ++ u8 bCTSEnable:1; ++ u8 bRTSEnable:1; ++ u8 bUseShortGI:1; ++ u8 bUseShortPreamble:1; ++ u8 bTxEnableFwCalcDur:1; ++ u8 bAMPDUEnable:1; ++ u8 bRTSSTBC:1; ++ u8 RTSSC:1; ++ ++ u8 bRTSBW:1; ++ u8 bPacketBW:1; ++ u8 bRTSUseShortPreamble:1; ++ u8 bRTSUseShortGI:1; ++ u8 bMulticast:1; ++ u8 bBroadcast:1; ++ //u8 reserved2:2; ++ u8 drv_agg_enable:1; ++ u8 reserved2:1; ++ ++ /* Tx Desc related element(12-19) */ ++ u8 rata_index; ++ u8 queue_index; ++ //u8 reserved3; ++ //u8 reserved4; ++ u16 txbuf_size; ++ //u8 reserved5; ++ u8 RATRIndex; ++ u8 reserved6; ++ u8 reserved7; ++ u8 reserved8; ++ ++ /* Tx firmware related element(20-27) */ ++ u8 data_rate; ++ u8 rts_rate; ++ u8 ampdu_factor; ++ u8 ampdu_density; ++ //u8 reserved9; ++ //u8 reserved10; ++ //u8 reserved11; ++ u8 DrvAggrNum; ++ u16 pkt_size; ++ u8 reserved12; ++}cb_desc, *pcb_desc; ++ ++/*--------------------------Define -------------------------------------------*/ ++#define MGN_1M 0x02 ++#define MGN_2M 0x04 ++#define MGN_5_5M 0x0b ++#define MGN_11M 0x16 ++ ++#define MGN_6M 0x0c ++#define MGN_9M 0x12 ++#define MGN_12M 0x18 ++#define MGN_18M 0x24 ++#define MGN_24M 0x30 ++#define MGN_36M 0x48 ++#define MGN_48M 0x60 ++#define MGN_54M 0x6c ++ ++#define MGN_MCS0 0x80 ++#define MGN_MCS1 0x81 ++#define MGN_MCS2 0x82 ++#define MGN_MCS3 0x83 ++#define MGN_MCS4 0x84 ++#define MGN_MCS5 0x85 ++#define MGN_MCS6 0x86 ++#define MGN_MCS7 0x87 ++#define MGN_MCS8 0x88 ++#define MGN_MCS9 0x89 ++#define MGN_MCS10 0x8a ++#define MGN_MCS11 0x8b ++#define MGN_MCS12 0x8c ++#define MGN_MCS13 0x8d ++#define MGN_MCS14 0x8e ++#define MGN_MCS15 0x8f ++ ++//---------------------------------------------------------------------------- ++// 802.11 Management frame Reason Code field ++//---------------------------------------------------------------------------- ++enum _ReasonCode{ ++ unspec_reason = 0x1, ++ auth_not_valid = 0x2, ++ deauth_lv_ss = 0x3, ++ inactivity = 0x4, ++ ap_overload = 0x5, ++ class2_err = 0x6, ++ class3_err = 0x7, ++ disas_lv_ss = 0x8, ++ asoc_not_auth = 0x9, ++ ++ //----MIC_CHECK ++ mic_failure = 0xe, ++ //----END MIC_CHECK ++ ++ // Reason code defined in 802.11i D10.0 p.28. ++ invalid_IE = 0x0d, ++ four_way_tmout = 0x0f, ++ two_way_tmout = 0x10, ++ IE_dismatch = 0x11, ++ invalid_Gcipher = 0x12, ++ invalid_Pcipher = 0x13, ++ invalid_AKMP = 0x14, ++ unsup_RSNIEver = 0x15, ++ invalid_RSNIE = 0x16, ++ auth_802_1x_fail= 0x17, ++ ciper_reject = 0x18, ++ ++ // Reason code defined in 7.3.1.7, 802.1e D13.0, p.42. Added by Annie, 2005-11-15. ++ QoS_unspec = 0x20, // 32 ++ QAP_bandwidth = 0x21, // 33 ++ poor_condition = 0x22, // 34 ++ no_facility = 0x23, // 35 ++ // Where is 36??? ++ req_declined = 0x25, // 37 ++ invalid_param = 0x26, // 38 ++ req_not_honored= 0x27, // 39 ++ TS_not_created = 0x2F, // 47 ++ DL_not_allowed = 0x30, // 48 ++ dest_not_exist = 0x31, // 49 ++ dest_not_QSTA = 0x32, // 50 ++}; ++ ++ ++ ++#define aSifsTime (((priv->ieee80211->current_network.mode == IEEE_A)||(priv->ieee80211->current_network.mode == IEEE_N_24G)||(priv->ieee80211->current_network.mode == IEEE_N_5G))? 16 : 10) ++ ++#define MGMT_QUEUE_NUM 5 ++ ++#define IEEE_CMD_SET_WPA_PARAM 1 ++#define IEEE_CMD_SET_WPA_IE 2 ++#define IEEE_CMD_SET_ENCRYPTION 3 ++#define IEEE_CMD_MLME 4 ++ ++#define IEEE_PARAM_WPA_ENABLED 1 ++#define IEEE_PARAM_TKIP_COUNTERMEASURES 2 ++#define IEEE_PARAM_DROP_UNENCRYPTED 3 ++#define IEEE_PARAM_PRIVACY_INVOKED 4 ++#define IEEE_PARAM_AUTH_ALGS 5 ++#define IEEE_PARAM_IEEE_802_1X 6 ++//It should consistent with the driver_XXX.c ++// David, 2006.9.26 ++#define IEEE_PARAM_WPAX_SELECT 7 ++//Added for notify the encryption type selection ++// David, 2006.9.26 ++#define IEEE_PROTO_WPA 1 ++#define IEEE_PROTO_RSN 2 ++//Added for notify the encryption type selection ++// David, 2006.9.26 ++#define IEEE_WPAX_USEGROUP 0 ++#define IEEE_WPAX_WEP40 1 ++#define IEEE_WPAX_TKIP 2 ++#define IEEE_WPAX_WRAP 3 ++#define IEEE_WPAX_CCMP 4 ++#define IEEE_WPAX_WEP104 5 ++ ++#define IEEE_KEY_MGMT_IEEE8021X 1 ++#define IEEE_KEY_MGMT_PSK 2 ++ ++#define IEEE_MLME_STA_DEAUTH 1 ++#define IEEE_MLME_STA_DISASSOC 2 ++ ++ ++#define IEEE_CRYPT_ERR_UNKNOWN_ALG 2 ++#define IEEE_CRYPT_ERR_UNKNOWN_ADDR 3 ++#define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED 4 ++#define IEEE_CRYPT_ERR_KEY_SET_FAILED 5 ++#define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6 ++#define IEEE_CRYPT_ERR_CARD_CONF_FAILED 7 ++ ++ ++#define IEEE_CRYPT_ALG_NAME_LEN 16 ++ ++#define MAX_IE_LEN 0xff ++ ++// added for kernel conflict ++#define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl ++#define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl ++#define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl ++#define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl ++#define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl ++#define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl ++ ++#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl ++ ++#define ieee80211_tkip_null ieee80211_tkip_null_rsl ++ ++#define ieee80211_wep_null ieee80211_wep_null_rsl ++ ++#define free_ieee80211 free_ieee80211_rsl ++#define alloc_ieee80211 alloc_ieee80211_rsl ++ ++#define ieee80211_rx ieee80211_rx_rsl ++#define ieee80211_rx_mgt ieee80211_rx_mgt_rsl ++ ++#define ieee80211_get_beacon ieee80211_get_beacon_rsl ++#define ieee80211_wake_queue ieee80211_wake_queue_rsl ++#define ieee80211_stop_queue ieee80211_stop_queue_rsl ++#define ieee80211_reset_queue ieee80211_reset_queue_rsl ++#define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl ++#define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl ++#define ieee80211_is_shortslot ieee80211_is_shortslot_rsl ++#define ieee80211_is_54g ieee80211_is_54g_rsl ++#define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl ++#define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl ++#define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl ++#define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl ++#define notify_wx_assoc_event notify_wx_assoc_event_rsl ++#define SendDisassociation SendDisassociation_rsl ++#define ieee80211_disassociate ieee80211_disassociate_rsl ++#define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl ++#define ieee80211_stop_scan ieee80211_stop_scan_rsl ++#define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl ++#define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl ++#define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl ++ ++#define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl ++#define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl ++#define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl ++#define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl ++#define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl ++#define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl ++#define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl ++#define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl ++#define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl ++#define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl ++#define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl ++#define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl ++#define ieee80211_wx_get_name ieee80211_wx_get_name_rsl ++#define ieee80211_wx_set_power ieee80211_wx_set_power_rsl ++#define ieee80211_wx_get_power ieee80211_wx_get_power_rsl ++#define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl ++#define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl ++#define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl ++ ++#define ieee80211_txb_free ieee80211_txb_free_rsl ++ ++#define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl ++#define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl ++#define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl ++#define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl ++#if WIRELESS_EXT >= 18 ++#define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl ++#define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl ++#define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl ++#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl ++#endif ++ ++ ++typedef struct ieee_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_code; ++ } mlme; ++ struct { ++ u8 alg[IEEE_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; ++}ieee_param; ++ ++ ++#if WIRELESS_EXT < 17 ++#define IW_QUAL_QUAL_INVALID 0x10 ++#define IW_QUAL_LEVEL_INVALID 0x20 ++#define IW_QUAL_NOISE_INVALID 0x40 ++#define IW_QUAL_QUAL_UPDATED 0x1 ++#define IW_QUAL_LEVEL_UPDATED 0x2 ++#define IW_QUAL_NOISE_UPDATED 0x4 ++#endif ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data) ++{ ++ task->routine = func; ++ task->data = data; ++ //task->next = NULL; ++ INIT_LIST_HEAD(&task->list); ++ task->sync = 0; ++} ++#endif ++ ++// linux under 2.6.9 release may not support it, so modify it for common use ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) ++//#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) ++#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) ++static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) ++{ ++ unsigned long timeout = MSECS(msecs) + 1; ++ ++ while (timeout) { ++ set_current_state(TASK_INTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++ return timeout; ++} ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) ++static inline void msleep(unsigned int msecs) ++{ ++ unsigned long timeout = MSECS(msecs) + 1; ++ ++ while (timeout) { ++ set_current_state(TASK_UNINTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ } ++} ++#endif ++#else ++#define MSECS(t) msecs_to_jiffies(t) ++#define msleep_interruptible_rsl msleep_interruptible ++#endif ++ ++#define IEEE80211_DATA_LEN 2304 ++/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section ++ 6.2.1.1.2. ++ ++ The figure in section 7.1.2 suggests a body size of up to 2312 ++ bytes is allowed, which is a bit confusing, I suspect this ++ represents the 2304 bytes of real data, plus a possible 8 bytes of ++ WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ ++#define IEEE80211_1ADDR_LEN 10 ++#define IEEE80211_2ADDR_LEN 16 ++#define IEEE80211_3ADDR_LEN 24 ++#define IEEE80211_4ADDR_LEN 30 ++#define IEEE80211_FCS_LEN 4 ++#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) ++#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) ++#define IEEE80211_MGMT_HDR_LEN 24 ++#define IEEE80211_DATA_HDR3_LEN 24 ++#define IEEE80211_DATA_HDR4_LEN 30 ++ ++#define MIN_FRAG_THRESHOLD 256U ++#define MAX_FRAG_THRESHOLD 2346U ++ ++ ++/* Frame control field constants */ ++#define IEEE80211_FCTL_VERS 0x0003 ++#define IEEE80211_FCTL_FTYPE 0x000c ++#define IEEE80211_FCTL_STYPE 0x00f0 ++#define IEEE80211_FCTL_FRAMETYPE 0x00fc ++#define IEEE80211_FCTL_TODS 0x0100 ++#define IEEE80211_FCTL_FROMDS 0x0200 ++#define IEEE80211_FCTL_DSTODS 0x0300 //added by david ++#define IEEE80211_FCTL_MOREFRAGS 0x0400 ++#define IEEE80211_FCTL_RETRY 0x0800 ++#define IEEE80211_FCTL_PM 0x1000 ++#define IEEE80211_FCTL_MOREDATA 0x2000 ++#define IEEE80211_FCTL_WEP 0x4000 ++#define IEEE80211_FCTL_ORDER 0x8000 ++ ++#define IEEE80211_FTYPE_MGMT 0x0000 ++#define IEEE80211_FTYPE_CTL 0x0004 ++#define IEEE80211_FTYPE_DATA 0x0008 ++ ++/* management */ ++#define IEEE80211_STYPE_ASSOC_REQ 0x0000 ++#define IEEE80211_STYPE_ASSOC_RESP 0x0010 ++#define IEEE80211_STYPE_REASSOC_REQ 0x0020 ++#define IEEE80211_STYPE_REASSOC_RESP 0x0030 ++#define IEEE80211_STYPE_PROBE_REQ 0x0040 ++#define IEEE80211_STYPE_PROBE_RESP 0x0050 ++#define IEEE80211_STYPE_BEACON 0x0080 ++#define IEEE80211_STYPE_ATIM 0x0090 ++#define IEEE80211_STYPE_DISASSOC 0x00A0 ++#define IEEE80211_STYPE_AUTH 0x00B0 ++#define IEEE80211_STYPE_DEAUTH 0x00C0 ++#define IEEE80211_STYPE_MANAGE_ACT 0x00D0 ++ ++/* control */ ++#define IEEE80211_STYPE_PSPOLL 0x00A0 ++#define IEEE80211_STYPE_RTS 0x00B0 ++#define IEEE80211_STYPE_CTS 0x00C0 ++#define IEEE80211_STYPE_ACK 0x00D0 ++#define IEEE80211_STYPE_CFEND 0x00E0 ++#define IEEE80211_STYPE_CFENDACK 0x00F0 ++#define IEEE80211_STYPE_BLOCKACK 0x0094 ++ ++/* data */ ++#define IEEE80211_STYPE_DATA 0x0000 ++#define IEEE80211_STYPE_DATA_CFACK 0x0010 ++#define IEEE80211_STYPE_DATA_CFPOLL 0x0020 ++#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 ++#define IEEE80211_STYPE_NULLFUNC 0x0040 ++#define IEEE80211_STYPE_CFACK 0x0050 ++#define IEEE80211_STYPE_CFPOLL 0x0060 ++#define IEEE80211_STYPE_CFACKPOLL 0x0070 ++#define IEEE80211_STYPE_QOS_DATA 0x0080 //added for WMM 2006/8/2 ++#define IEEE80211_STYPE_QOS_NULL 0x00C0 ++ ++#define IEEE80211_SCTL_FRAG 0x000F ++#define IEEE80211_SCTL_SEQ 0xFFF0 ++ ++/* QOS control */ ++#define IEEE80211_QCTL_TID 0x000F ++ ++#define FC_QOS_BIT BIT7 ++#define IsDataFrame(pdu) ( ((pdu[0] & 0x0C)==0x08) ? true : false ) ++#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)) ) ++//added by wb. Is this right? ++#define IsQoSDataFrame(pframe) ((*(u16*)pframe&(IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) ++#define Frame_Order(pframe) (*(u16*)pframe&IEEE80211_FCTL_ORDER) ++#define SN_LESS(a, b) (((a-b)&0x800)!=0) ++#define SN_EQUAL(a, b) (a == b) ++#define MAX_DEV_ADDR_SIZE 8 ++typedef enum _ACT_CATEGORY{ ++ ACT_CAT_QOS = 1, ++ ACT_CAT_DLS = 2, ++ ACT_CAT_BA = 3, ++ ACT_CAT_HT = 7, ++ ACT_CAT_WMM = 17, ++} ACT_CATEGORY, *PACT_CATEGORY; ++ ++typedef enum _TS_ACTION{ ++ ACT_ADDTSREQ = 0, ++ ACT_ADDTSRSP = 1, ++ ACT_DELTS = 2, ++ ACT_SCHEDULE = 3, ++} TS_ACTION, *PTS_ACTION; ++ ++typedef enum _BA_ACTION{ ++ ACT_ADDBAREQ = 0, ++ ACT_ADDBARSP = 1, ++ ACT_DELBA = 2, ++} BA_ACTION, *PBA_ACTION; ++ ++typedef enum _InitialGainOpType{ ++ IG_Backup=0, ++ IG_Restore, ++ IG_Max ++}InitialGainOpType; ++ ++/* debug macros */ ++#define CONFIG_IEEE80211_DEBUG ++#ifdef CONFIG_IEEE80211_DEBUG ++extern u32 ieee80211_debug_level; ++#define IEEE80211_DEBUG(level, fmt, args...) \ ++do { if (ieee80211_debug_level & (level)) \ ++ printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0) ++//wb added to debug out data buf ++//if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA ++#define IEEE80211_DEBUG_DATA(level, data, datalen) \ ++ do{ if ((ieee80211_debug_level & (level)) == (level)) \ ++ { \ ++ int i; \ ++ u8* pdata = (u8*) data; \ ++ printk(KERN_DEBUG "ieee80211: %s()\n", __FUNCTION__); \ ++ for(i=0; i<(int)(datalen); i++) \ ++ { \ ++ printk("%2x ", pdata[i]); \ ++ if ((i+1)%16 == 0) printk("\n"); \ ++ } \ ++ printk("\n"); \ ++ } \ ++ } while (0) ++#else ++#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) ++#define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while(0) ++#endif /* CONFIG_IEEE80211_DEBUG */ ++ ++/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ ++ ++#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" ++#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5] ++ ++/* ++ * 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 IEEE80211_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 IEEE80211_xxxx_DEBUG() macro definition for your ++ * classification, or use IEEE80211_DEBUG(IEEE80211_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_IEEE80211_DEBUG defined in your kernel configuration ++ * ++ */ ++ ++#define IEEE80211_DL_INFO (1<<0) ++#define IEEE80211_DL_WX (1<<1) ++#define IEEE80211_DL_SCAN (1<<2) ++#define IEEE80211_DL_STATE (1<<3) ++#define IEEE80211_DL_MGMT (1<<4) ++#define IEEE80211_DL_FRAG (1<<5) ++#define IEEE80211_DL_EAP (1<<6) ++#define IEEE80211_DL_DROP (1<<7) ++ ++#define IEEE80211_DL_TX (1<<8) ++#define IEEE80211_DL_RX (1<<9) ++ ++#define IEEE80211_DL_HT (1<<10) //HT ++#define IEEE80211_DL_BA (1<<11) //ba ++#define IEEE80211_DL_TS (1<<12) //TS ++#define IEEE80211_DL_QOS (1<<13) ++#define IEEE80211_DL_REORDER (1<<14) ++#define IEEE80211_DL_IOT (1<<15) ++#define IEEE80211_DL_IPS (1<<16) ++#define IEEE80211_DL_TRACE (1<<29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen ++#define IEEE80211_DL_DATA (1<<30) //use this flag to control whether print data buf out. ++#define IEEE80211_DL_ERR (1<<31) //always open ++#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) ++#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) ++#define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a) ++ ++#define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a) ++#define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a) ++#define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a) ++#define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a) ++#define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a) ++#define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a) ++#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) ++#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) ++#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) ++#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++/* Added by Annie, 2005-11-22. */ ++#define MAX_STR_LEN 64 ++/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/ ++#define PRINTABLE(_ch) (_ch>'!' && _ch<'~') ++#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \ ++ if((_Comp) & level) \ ++ { \ ++ int __i; \ ++ u8 buffer[MAX_STR_LEN]; \ ++ int length = (_Len\n", _Len, buffer); \ ++ } ++#else ++#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0) ++#endif ++ ++#include ++#include /* ARPHRD_ETHER */ ++ ++#ifndef WIRELESS_SPY ++#define WIRELESS_SPY // enable iwspy support ++#endif ++#include // new driver API ++ ++#ifndef ETH_P_PAE ++#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ ++#endif /* ETH_P_PAE */ ++ ++#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ ++ ++#ifndef ETH_P_80211_RAW ++#define ETH_P_80211_RAW (ETH_P_ECONET + 1) ++#endif ++ ++/* IEEE 802.11 defines */ ++ ++#define P80211_OUI_LEN 3 ++ ++struct ieee80211_snap_hdr { ++ ++ u8 dsap; /* always 0xAA */ ++ u8 ssap; /* always 0xAA */ ++ u8 ctrl; /* always 0x03 */ ++ u8 oui[P80211_OUI_LEN]; /* organizational universal id */ ++ ++} __attribute__ ((packed)); ++ ++#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) ++ ++#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) ++#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) ++#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) ++ ++#define WLAN_FC_GET_FRAMETYPE(fc) ((fc) & IEEE80211_FCTL_FRAMETYPE) ++#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) ++#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) ++ ++/* Authentication algorithms */ ++#define WLAN_AUTH_OPEN 0 ++#define WLAN_AUTH_SHARED_KEY 1 ++#define WLAN_AUTH_LEAP 2 ++ ++#define WLAN_AUTH_CHALLENGE_LEN 128 ++ ++#define WLAN_CAPABILITY_BSS (1<<0) ++#define WLAN_CAPABILITY_IBSS (1<<1) ++#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) ++#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) ++#define WLAN_CAPABILITY_PRIVACY (1<<4) ++#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) ++#define WLAN_CAPABILITY_PBCC (1<<6) ++#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) ++#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) ++#define WLAN_CAPABILITY_QOS (1<<9) ++#define WLAN_CAPABILITY_SHORT_SLOT (1<<10) ++#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) ++ ++/* 802.11g ERP information element */ ++#define WLAN_ERP_NON_ERP_PRESENT (1<<0) ++#define WLAN_ERP_USE_PROTECTION (1<<1) ++#define WLAN_ERP_BARKER_PREAMBLE (1<<2) ++ ++/* Status codes */ ++enum ieee80211_statuscode { ++ WLAN_STATUS_SUCCESS = 0, ++ WLAN_STATUS_UNSPECIFIED_FAILURE = 1, ++ WLAN_STATUS_CAPS_UNSUPPORTED = 10, ++ WLAN_STATUS_REASSOC_NO_ASSOC = 11, ++ WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, ++ WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, ++ WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, ++ WLAN_STATUS_CHALLENGE_FAIL = 15, ++ WLAN_STATUS_AUTH_TIMEOUT = 16, ++ WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, ++ WLAN_STATUS_ASSOC_DENIED_RATES = 18, ++ /* 802.11b */ ++ WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, ++ WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, ++ WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, ++ /* 802.11h */ ++ WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, ++ WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, ++ WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, ++ /* 802.11g */ ++ WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, ++ WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, ++ /* 802.11i */ ++ WLAN_STATUS_INVALID_IE = 40, ++ WLAN_STATUS_INVALID_GROUP_CIPHER = 41, ++ WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, ++ WLAN_STATUS_INVALID_AKMP = 43, ++ WLAN_STATUS_UNSUPP_RSN_VERSION = 44, ++ WLAN_STATUS_INVALID_RSN_IE_CAP = 45, ++ WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, ++}; ++ ++/* Reason codes */ ++enum ieee80211_reasoncode { ++ WLAN_REASON_UNSPECIFIED = 1, ++ WLAN_REASON_PREV_AUTH_NOT_VALID = 2, ++ WLAN_REASON_DEAUTH_LEAVING = 3, ++ WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, ++ WLAN_REASON_DISASSOC_AP_BUSY = 5, ++ WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, ++ WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, ++ WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, ++ WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, ++ /* 802.11h */ ++ WLAN_REASON_DISASSOC_BAD_POWER = 10, ++ WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, ++ /* 802.11i */ ++ WLAN_REASON_INVALID_IE = 13, ++ WLAN_REASON_MIC_FAILURE = 14, ++ WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, ++ WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, ++ WLAN_REASON_IE_DIFFERENT = 17, ++ WLAN_REASON_INVALID_GROUP_CIPHER = 18, ++ WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, ++ WLAN_REASON_INVALID_AKMP = 20, ++ WLAN_REASON_UNSUPP_RSN_VERSION = 21, ++ WLAN_REASON_INVALID_RSN_IE_CAP = 22, ++ WLAN_REASON_IEEE8021X_FAILED = 23, ++ WLAN_REASON_CIPHER_SUITE_REJECTED = 24, ++}; ++ ++#define IEEE80211_STATMASK_SIGNAL (1<<0) ++#define IEEE80211_STATMASK_RSSI (1<<1) ++#define IEEE80211_STATMASK_NOISE (1<<2) ++#define IEEE80211_STATMASK_RATE (1<<3) ++#define IEEE80211_STATMASK_WEMASK 0x7 ++ ++#define IEEE80211_CCK_MODULATION (1<<0) ++#define IEEE80211_OFDM_MODULATION (1<<1) ++ ++#define IEEE80211_24GHZ_BAND (1<<0) ++#define IEEE80211_52GHZ_BAND (1<<1) ++ ++#define IEEE80211_CCK_RATE_LEN 4 ++#define IEEE80211_CCK_RATE_1MB 0x02 ++#define IEEE80211_CCK_RATE_2MB 0x04 ++#define IEEE80211_CCK_RATE_5MB 0x0B ++#define IEEE80211_CCK_RATE_11MB 0x16 ++#define IEEE80211_OFDM_RATE_LEN 8 ++#define IEEE80211_OFDM_RATE_6MB 0x0C ++#define IEEE80211_OFDM_RATE_9MB 0x12 ++#define IEEE80211_OFDM_RATE_12MB 0x18 ++#define IEEE80211_OFDM_RATE_18MB 0x24 ++#define IEEE80211_OFDM_RATE_24MB 0x30 ++#define IEEE80211_OFDM_RATE_36MB 0x48 ++#define IEEE80211_OFDM_RATE_48MB 0x60 ++#define IEEE80211_OFDM_RATE_54MB 0x6C ++#define IEEE80211_BASIC_RATE_MASK 0x80 ++ ++#define IEEE80211_CCK_RATE_1MB_MASK (1<<0) ++#define IEEE80211_CCK_RATE_2MB_MASK (1<<1) ++#define IEEE80211_CCK_RATE_5MB_MASK (1<<2) ++#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) ++#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) ++#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) ++#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) ++#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) ++#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) ++#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) ++#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) ++#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) ++ ++#define IEEE80211_CCK_RATES_MASK 0x0000000F ++#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ ++ IEEE80211_CCK_RATE_2MB_MASK) ++#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ ++ IEEE80211_CCK_RATE_5MB_MASK | \ ++ IEEE80211_CCK_RATE_11MB_MASK) ++ ++#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 ++#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ ++ IEEE80211_OFDM_RATE_12MB_MASK | \ ++ IEEE80211_OFDM_RATE_24MB_MASK) ++#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \ ++ IEEE80211_OFDM_RATE_9MB_MASK | \ ++ IEEE80211_OFDM_RATE_18MB_MASK | \ ++ IEEE80211_OFDM_RATE_36MB_MASK | \ ++ IEEE80211_OFDM_RATE_48MB_MASK | \ ++ IEEE80211_OFDM_RATE_54MB_MASK) ++#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ ++ IEEE80211_CCK_DEFAULT_RATES_MASK) ++ ++#define IEEE80211_NUM_OFDM_RATES 8 ++#define IEEE80211_NUM_CCK_RATES 4 ++#define IEEE80211_OFDM_SHIFT_MASK_A 4 ++ ++ ++/* this is stolen and modified from the madwifi driver*/ ++#define IEEE80211_FC0_TYPE_MASK 0x0c ++#define IEEE80211_FC0_TYPE_DATA 0x08 ++#define IEEE80211_FC0_SUBTYPE_MASK 0xB0 ++#define IEEE80211_FC0_SUBTYPE_QOS 0x80 ++ ++#define IEEE80211_QOS_HAS_SEQ(fc) \ ++ (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \ ++ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) ++ ++/* this is stolen from ipw2200 driver */ ++#define IEEE_IBSS_MAC_HASH_SIZE 31 ++struct ieee_ibss_seq { ++ u8 mac[ETH_ALEN]; ++ u16 seq_num[17]; ++ u16 frag_num[17]; ++ unsigned long packet_time[17]; ++ struct list_head list; ++}; ++ ++/* NOTE: This data is for statistical purposes; not all hardware provides this ++ * information for frames received. Not setting these will not cause ++ * any adverse affects. */ ++struct ieee80211_rx_stats { ++#if 1 ++ u32 mac_time[2]; ++ s8 rssi; ++ u8 signal; ++ u8 noise; ++ u16 rate; /* in 100 kbps */ ++ u8 received_channel; ++ u8 control; ++ u8 mask; ++ u8 freq; ++ u16 len; ++ u64 tsf; ++ u32 beacon_time; ++ u8 nic_type; ++ u16 Length; ++ // u8 DataRate; // In 0.5 Mbps ++ u8 SignalQuality; // in 0-100 index. ++ s32 RecvSignalPower; // Real power in dBm for this packet, no beautification and aggregation. ++ s8 RxPower; // in dBm Translate from PWdB ++ u8 SignalStrength; // in 0-100 index. ++ u16 bHwError:1; ++ u16 bCRC:1; ++ u16 bICV:1; ++ u16 bShortPreamble:1; ++ u16 Antenna:1; //for rtl8185 ++ u16 Decrypted:1; //for rtl8185, rtl8187 ++ u16 Wakeup:1; //for rtl8185 ++ u16 Reserved0:1; //for rtl8185 ++ u8 AGC; ++ u32 TimeStampLow; ++ u32 TimeStampHigh; ++ bool bShift; ++ bool bIsQosData; // Added by Annie, 2005-12-22. ++ u8 UserPriority; ++ ++ //1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ //1Attention Please!!!<11n or 8190 specific code should be put below this line> ++ //1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ ++ u8 RxDrvInfoSize; ++ u8 RxBufShift; ++ bool bIsAMPDU; ++ bool bFirstMPDU; ++ bool bContainHTC; ++ bool RxIs40MHzPacket; ++ u32 RxPWDBAll; ++ u8 RxMIMOSignalStrength[4]; // in 0~100 index ++ s8 RxMIMOSignalQuality[2]; ++ bool bPacketMatchBSSID; ++ bool bIsCCK; ++ bool bPacketToSelf; ++ //added by amy ++ u8* virtual_address; ++ u16 packetlength; // Total packet length: Must equal to sum of all FragLength ++ u16 fraglength; // FragLength should equal to PacketLength in non-fragment case ++ u16 fragoffset; // Data offset for this fragment ++ u16 ntotalfrag; ++ bool bisrxaggrsubframe; ++ bool bPacketBeacon; //cosa add for rssi ++ bool bToSelfBA; //cosa add for rssi ++ char cck_adc_pwdb[4]; //cosa add for rx path selection ++ u16 Seq_Num; ++#endif ++ ++}; ++ ++/* IEEE 802.11 requires that STA supports concurrent reception of at least ++ * three fragmented frames. This define can be increased to support more ++ * concurrent frames, but it should be noted that each entry can consume about ++ * 2 kB of RAM and increasing cache size will slow down frame reassembly. */ ++#define IEEE80211_FRAG_CACHE_LEN 4 ++ ++struct ieee80211_frag_entry { ++ unsigned long first_frag_time; ++ unsigned int seq; ++ unsigned int last_frag; ++ struct sk_buff *skb; ++ u8 src_addr[ETH_ALEN]; ++ u8 dst_addr[ETH_ALEN]; ++}; ++ ++struct ieee80211_stats { ++ unsigned int tx_unicast_frames; ++ unsigned int tx_multicast_frames; ++ unsigned int tx_fragments; ++ unsigned int tx_unicast_octets; ++ unsigned int tx_multicast_octets; ++ unsigned int tx_deferred_transmissions; ++ unsigned int tx_single_retry_frames; ++ unsigned int tx_multiple_retry_frames; ++ unsigned int tx_retry_limit_exceeded; ++ unsigned int tx_discards; ++ unsigned int rx_unicast_frames; ++ unsigned int rx_multicast_frames; ++ unsigned int rx_fragments; ++ unsigned int rx_unicast_octets; ++ unsigned int rx_multicast_octets; ++ unsigned int rx_fcs_errors; ++ unsigned int rx_discards_no_buffer; ++ unsigned int tx_discards_wrong_sa; ++ unsigned int rx_discards_undecryptable; ++ unsigned int rx_message_in_msg_fragments; ++ unsigned int rx_message_in_bad_msg_fragments; ++}; ++ ++struct ieee80211_device; ++ ++#include "ieee80211_crypt.h" ++ ++#define SEC_KEY_1 (1<<0) ++#define SEC_KEY_2 (1<<1) ++#define SEC_KEY_3 (1<<2) ++#define SEC_KEY_4 (1<<3) ++#define SEC_ACTIVE_KEY (1<<4) ++#define SEC_AUTH_MODE (1<<5) ++#define SEC_UNICAST_GROUP (1<<6) ++#define SEC_LEVEL (1<<7) ++#define SEC_ENABLED (1<<8) ++#define SEC_ENCRYPT (1<<9) ++ ++#define SEC_LEVEL_0 0 /* None */ ++#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ ++#define SEC_LEVEL_2 2 /* Level 1 + TKIP */ ++#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ ++#define SEC_LEVEL_3 4 /* Level 2 + CCMP */ ++ ++#define SEC_ALG_NONE 0 ++#define SEC_ALG_WEP 1 ++#define SEC_ALG_TKIP 2 ++#define SEC_ALG_CCMP 3 ++ ++#define WEP_KEYS 4 ++#define WEP_KEY_LEN 13 ++#define SCM_KEY_LEN 32 ++#define SCM_TEMPORAL_KEY_LENGTH 16 ++ ++struct ieee80211_security { ++ u16 active_key:2, ++ enabled:1, ++ auth_mode:2, ++ auth_algo:4, ++ unicast_uses_group:1, ++ encrypt:1; ++ u8 key_sizes[WEP_KEYS]; ++ u8 keys[WEP_KEYS][SCM_KEY_LEN]; ++ u8 level; ++ u16 flags; ++} __attribute__ ((packed)); ++ ++ ++/* ++ 802.11 data frame from AP ++ ,-------------------------------------------------------------------. ++Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | ++ |------|------|---------|---------|---------|------|---------|------| ++Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs | ++ | | tion | (BSSID) | | | ence | data | | ++ `-------------------------------------------------------------------' ++Total: 28-2340 bytes ++*/ ++ ++/* Management Frame Information Element Types */ ++enum ieee80211_mfie { ++ MFIE_TYPE_SSID = 0, ++ MFIE_TYPE_RATES = 1, ++ MFIE_TYPE_FH_SET = 2, ++ MFIE_TYPE_DS_SET = 3, ++ MFIE_TYPE_CF_SET = 4, ++ MFIE_TYPE_TIM = 5, ++ MFIE_TYPE_IBSS_SET = 6, ++ MFIE_TYPE_COUNTRY = 7, ++ MFIE_TYPE_HOP_PARAMS = 8, ++ MFIE_TYPE_HOP_TABLE = 9, ++ MFIE_TYPE_REQUEST = 10, ++ MFIE_TYPE_CHALLENGE = 16, ++ MFIE_TYPE_POWER_CONSTRAINT = 32, ++ MFIE_TYPE_POWER_CAPABILITY = 33, ++ MFIE_TYPE_TPC_REQUEST = 34, ++ MFIE_TYPE_TPC_REPORT = 35, ++ MFIE_TYPE_SUPP_CHANNELS = 36, ++ MFIE_TYPE_CSA = 37, ++ MFIE_TYPE_MEASURE_REQUEST = 38, ++ MFIE_TYPE_MEASURE_REPORT = 39, ++ MFIE_TYPE_QUIET = 40, ++ MFIE_TYPE_IBSS_DFS = 41, ++ MFIE_TYPE_ERP = 42, ++ MFIE_TYPE_RSN = 48, ++ MFIE_TYPE_RATES_EX = 50, ++ MFIE_TYPE_HT_CAP= 45, ++ MFIE_TYPE_HT_INFO= 61, ++ MFIE_TYPE_AIRONET=133, ++ MFIE_TYPE_GENERIC = 221, ++ MFIE_TYPE_QOS_PARAMETER = 222, ++}; ++ ++/* Minimal header; can be used for passing 802.11 frames with sufficient ++ * information to determine what type of underlying data type is actually ++ * stored in the data. */ ++struct ieee80211_hdr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_1addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_2addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_3addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_4addr { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 addr4[ETH_ALEN]; ++ u8 payload[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_3addrqos { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 payload[0]; ++ __le16 qos_ctl; ++} __attribute__ ((packed)); ++ ++struct ieee80211_hdr_4addrqos { ++ __le16 frame_ctl; ++ __le16 duration_id; ++ u8 addr1[ETH_ALEN]; ++ u8 addr2[ETH_ALEN]; ++ u8 addr3[ETH_ALEN]; ++ __le16 seq_ctl; ++ u8 addr4[ETH_ALEN]; ++ u8 payload[0]; ++ __le16 qos_ctl; ++} __attribute__ ((packed)); ++ ++struct ieee80211_info_element { ++ u8 id; ++ u8 len; ++ u8 data[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_authentication { ++ struct ieee80211_hdr_3addr header; ++ __le16 algorithm; ++ __le16 transaction; ++ __le16 status; ++ /*challenge*/ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_disassoc { ++ struct ieee80211_hdr_3addr header; ++ __le16 reason; ++} __attribute__ ((packed)); ++ ++struct ieee80211_probe_request { ++ struct ieee80211_hdr_3addr header; ++ /* SSID, supported rates */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_probe_response { ++ struct ieee80211_hdr_3addr header; ++ u32 time_stamp[2]; ++ __le16 beacon_interval; ++ __le16 capability; ++ /* SSID, supported rates, FH params, DS params, ++ * CF params, IBSS params, TIM (if beacon), RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++/* Alias beacon for probe_response */ ++#define ieee80211_beacon ieee80211_probe_response ++ ++struct ieee80211_assoc_request_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 listen_interval; ++ /* SSID, supported rates, RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_reassoc_request_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 listen_interval; ++ u8 current_ap[ETH_ALEN]; ++ /* SSID, supported rates, RSN */ ++ struct ieee80211_info_element info_element[0]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_assoc_response_frame { ++ struct ieee80211_hdr_3addr header; ++ __le16 capability; ++ __le16 status; ++ __le16 aid; ++ struct ieee80211_info_element info_element[0]; /* supported rates */ ++} __attribute__ ((packed)); ++ ++struct ieee80211_txb { ++ u8 nr_frags; ++ u8 encrypted; ++ u8 queue_index; ++ u8 rts_included; ++ u16 reserved; ++ __le16 frag_size; ++ __le16 payload_size; ++ struct sk_buff *fragments[0]; ++}; ++ ++#define MAX_TX_AGG_COUNT 16 ++struct ieee80211_drv_agg_txb { ++ u8 nr_drv_agg_frames; ++ struct sk_buff *tx_agg_frames[MAX_TX_AGG_COUNT]; ++}__attribute__((packed)); ++ ++#define MAX_SUBFRAME_COUNT 64 ++struct ieee80211_rxb { ++ u8 nr_subframes; ++ struct sk_buff *subframes[MAX_SUBFRAME_COUNT]; ++ u8 dst[ETH_ALEN]; ++ u8 src[ETH_ALEN]; ++}__attribute__((packed)); ++ ++typedef union _frameqos { ++ u16 shortdata; ++ u8 chardata[2]; ++ struct { ++ u16 tid:4; ++ u16 eosp:1; ++ u16 ack_policy:2; ++ u16 reserved:1; ++ u16 txop:8; ++ }field; ++}frameqos,*pframeqos; ++ ++/* SWEEP TABLE ENTRIES NUMBER*/ ++#define MAX_SWEEP_TAB_ENTRIES 42 ++#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 ++/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs ++ * only use 8, and then use extended rates for the remaining supported ++ * rates. Other APs, however, stick all of their supported rates on the ++ * main rates information element... */ ++#define MAX_RATES_LENGTH ((u8)12) ++#define MAX_RATES_EX_LENGTH ((u8)16) ++#define MAX_NETWORK_COUNT 128 ++ ++#define MAX_CHANNEL_NUMBER 161 ++#define IEEE80211_SOFTMAC_SCAN_TIME 100 ++//(HZ / 2) ++#define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2) ++ ++#define CRC_LENGTH 4U ++ ++#define MAX_WPA_IE_LEN 64 ++ ++#define NETWORK_EMPTY_ESSID (1<<0) ++#define NETWORK_HAS_OFDM (1<<1) ++#define NETWORK_HAS_CCK (1<<2) ++ ++/* QoS structure */ ++#define NETWORK_HAS_QOS_PARAMETERS (1<<3) ++#define NETWORK_HAS_QOS_INFORMATION (1<<4) ++#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \ ++ NETWORK_HAS_QOS_INFORMATION) ++/* 802.11h */ ++#define NETWORK_HAS_POWER_CONSTRAINT (1<<5) ++#define NETWORK_HAS_CSA (1<<6) ++#define NETWORK_HAS_QUIET (1<<7) ++#define NETWORK_HAS_IBSS_DFS (1<<8) ++#define NETWORK_HAS_TPC_REPORT (1<<9) ++ ++#define NETWORK_HAS_ERP_VALUE (1<<10) ++ ++#define QOS_QUEUE_NUM 4 ++#define QOS_OUI_LEN 3 ++#define QOS_OUI_TYPE 2 ++#define QOS_ELEMENT_ID 221 ++#define QOS_OUI_INFO_SUB_TYPE 0 ++#define QOS_OUI_PARAM_SUB_TYPE 1 ++#define QOS_VERSION_1 1 ++#define QOS_AIFSN_MIN_VALUE 2 ++#if 1 ++struct ieee80211_qos_information_element { ++ u8 elementID; ++ u8 length; ++ u8 qui[QOS_OUI_LEN]; ++ u8 qui_type; ++ u8 qui_subtype; ++ u8 version; ++ u8 ac_info; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_ac_parameter { ++ u8 aci_aifsn; ++ u8 ecw_min_max; ++ __le16 tx_op_limit; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_parameter_info { ++ struct ieee80211_qos_information_element info_element; ++ u8 reserved; ++ struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_parameters { ++ __le16 cw_min[QOS_QUEUE_NUM]; ++ __le16 cw_max[QOS_QUEUE_NUM]; ++ u8 aifs[QOS_QUEUE_NUM]; ++ u8 flag[QOS_QUEUE_NUM]; ++ __le16 tx_op_limit[QOS_QUEUE_NUM]; ++} __attribute__ ((packed)); ++ ++struct ieee80211_qos_data { ++ struct ieee80211_qos_parameters parameters; ++ int active; ++ int supported; ++ u8 param_count; ++ u8 old_param_count; ++}; ++ ++struct ieee80211_tim_parameters { ++ u8 tim_count; ++ u8 tim_period; ++} __attribute__ ((packed)); ++ ++//#else ++struct ieee80211_wmm_ac_param { ++ u8 ac_aci_acm_aifsn; ++ u8 ac_ecwmin_ecwmax; ++ u16 ac_txop_limit; ++}; ++ ++struct ieee80211_wmm_ts_info { ++ u8 ac_dir_tid; ++ u8 ac_up_psb; ++ u8 reserved; ++} __attribute__ ((packed)); ++ ++struct ieee80211_wmm_tspec_elem { ++ struct ieee80211_wmm_ts_info ts_info; ++ u16 norm_msdu_size; ++ u16 max_msdu_size; ++ u32 min_serv_inter; ++ u32 max_serv_inter; ++ u32 inact_inter; ++ u32 suspen_inter; ++ u32 serv_start_time; ++ u32 min_data_rate; ++ u32 mean_data_rate; ++ u32 peak_data_rate; ++ u32 max_burst_size; ++ u32 delay_bound; ++ u32 min_phy_rate; ++ u16 surp_band_allow; ++ u16 medium_time; ++}__attribute__((packed)); ++#endif ++enum eap_type { ++ EAP_PACKET = 0, ++ EAPOL_START, ++ EAPOL_LOGOFF, ++ EAPOL_KEY, ++ EAPOL_ENCAP_ASF_ALERT ++}; ++ ++static const char *eap_types[] = { ++ [EAP_PACKET] = "EAP-Packet", ++ [EAPOL_START] = "EAPOL-Start", ++ [EAPOL_LOGOFF] = "EAPOL-Logoff", ++ [EAPOL_KEY] = "EAPOL-Key", ++ [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert" ++}; ++ ++static inline const char *eap_get_type(int type) ++{ ++ return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type]; ++} ++//added by amy for reorder ++static inline u8 Frame_QoSTID(u8* buf) ++{ ++ struct ieee80211_hdr_3addr *hdr; ++ u16 fc; ++ hdr = (struct ieee80211_hdr_3addr *)buf; ++ fc = le16_to_cpu(hdr->frame_ctl); ++ return (u8)((frameqos*)(buf + (((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24)))->field.tid; ++} ++ ++//added by amy for reorder ++ ++struct eapol { ++ u8 snap[6]; ++ u16 ethertype; ++ u8 version; ++ u8 type; ++ u16 length; ++} __attribute__ ((packed)); ++ ++struct ieee80211_softmac_stats{ ++ unsigned int rx_ass_ok; ++ unsigned int rx_ass_err; ++ unsigned int rx_probe_rq; ++ unsigned int tx_probe_rs; ++ unsigned int tx_beacons; ++ unsigned int rx_auth_rq; ++ unsigned int rx_auth_rs_ok; ++ unsigned int rx_auth_rs_err; ++ unsigned int tx_auth_rq; ++ unsigned int no_auth_rs; ++ unsigned int no_ass_rs; ++ unsigned int tx_ass_rq; ++ unsigned int rx_ass_rq; ++ unsigned int tx_probe_rq; ++ unsigned int reassoc; ++ unsigned int swtxstop; ++ unsigned int swtxawake; ++ unsigned char CurrentShowTxate; ++ unsigned char last_packet_rate; ++ unsigned int txretrycount; ++}; ++ ++#define BEACON_PROBE_SSID_ID_POSITION 12 ++ ++struct ieee80211_info_element_hdr { ++ u8 id; ++ u8 len; ++} __attribute__ ((packed)); ++ ++/* ++ * These are the data types that can make up management packets ++ * ++ u16 auth_algorithm; ++ u16 auth_sequence; ++ u16 beacon_interval; ++ u16 capability; ++ u8 current_ap[ETH_ALEN]; ++ u16 listen_interval; ++ struct { ++ u16 association_id:14, reserved:2; ++ } __attribute__ ((packed)); ++ u32 time_stamp[2]; ++ u16 reason; ++ u16 status; ++*/ ++ ++#define IEEE80211_DEFAULT_TX_ESSID "Penguin" ++#define IEEE80211_DEFAULT_BASIC_RATE 2 //1Mbps ++ ++enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame}; ++#define MAX_SP_Len (WMM_all_frame << 4) ++#define IEEE80211_QOS_TID 0x0f ++#define QOS_CTL_NOTCONTAIN_ACK (0x01 << 5) ++ ++#define IEEE80211_DTIM_MBCAST 4 ++#define IEEE80211_DTIM_UCAST 2 ++#define IEEE80211_DTIM_VALID 1 ++#define IEEE80211_DTIM_INVALID 0 ++ ++#define IEEE80211_PS_DISABLED 0 ++#define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST ++#define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST ++ ++//added by David for QoS 2006/6/30 ++//#define WMM_Hang_8187 ++#ifdef WMM_Hang_8187 ++#undef WMM_Hang_8187 ++#endif ++ ++#define WME_AC_BK 0x00 ++#define WME_AC_BE 0x01 ++#define WME_AC_VI 0x02 ++#define WME_AC_VO 0x03 ++#define WME_ACI_MASK 0x03 ++#define WME_AIFSN_MASK 0x03 ++#define WME_AC_PRAM_LEN 16 ++ ++#define MAX_RECEIVE_BUFFER_SIZE 9100 ++ ++//UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP ++//#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) ++#if 1 ++#define UP2AC(up) ( \ ++ ((up) < 1) ? WME_AC_BE : \ ++ ((up) < 3) ? WME_AC_BK : \ ++ ((up) < 4) ? WME_AC_BE : \ ++ ((up) < 6) ? WME_AC_VI : \ ++ WME_AC_VO) ++#endif ++//AC Mapping to UP, using in Tx part for selecting the corresponding TX queue ++#define AC2UP(_ac) ( \ ++ ((_ac) == WME_AC_VO) ? 6 : \ ++ ((_ac) == WME_AC_VI) ? 5 : \ ++ ((_ac) == WME_AC_BK) ? 1 : \ ++ 0) ++ ++#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */ ++#define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address plus ether type*/ ++ ++struct ether_header { ++ u8 ether_dhost[ETHER_ADDR_LEN]; ++ u8 ether_shost[ETHER_ADDR_LEN]; ++ u16 ether_type; ++} __attribute__((packed)); ++ ++#ifndef ETHERTYPE_PAE ++#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ ++#endif ++#ifndef ETHERTYPE_IP ++#define ETHERTYPE_IP 0x0800 /* IP protocol */ ++#endif ++ ++typedef struct _bss_ht{ ++ ++ bool support_ht; ++ ++ // HT related elements ++ u8 ht_cap_buf[32]; ++ u16 ht_cap_len; ++ u8 ht_info_buf[32]; ++ u16 ht_info_len; ++ ++ HT_SPEC_VER ht_spec_ver; ++ //HT_CAPABILITY_ELE bdHTCapEle; ++ //HT_INFORMATION_ELE bdHTInfoEle; ++ ++ bool aggregation; ++ bool long_slot_time; ++}bss_ht, *pbss_ht; ++ ++typedef enum _erp_t{ ++ ERP_NonERPpresent = 0x01, ++ ERP_UseProtection = 0x02, ++ ERP_BarkerPreambleMode = 0x04, ++} erp_t; ++ ++ ++struct ieee80211_network { ++ /* These entries are used to identify a unique network */ ++ u8 bssid[ETH_ALEN]; ++ u8 channel; ++ /* Ensure null-terminated for any debug msgs */ ++ u8 ssid[IW_ESSID_MAX_SIZE + 1]; ++ u8 ssid_len; ++#if 1 ++ struct ieee80211_qos_data qos_data; ++#else ++ // Qos related. Added by Annie, 2005-11-01. ++ BSS_QOS BssQos; ++#endif ++ ++ //added by amy for LEAP ++ bool bWithAironetIE; ++ bool bCkipSupported; ++ bool bCcxRmEnable; ++ u16 CcxRmState[2]; ++ // CCXv4 S59, MBSSID. ++ bool bMBssidValid; ++ u8 MBssidMask; ++ u8 MBssid[6]; ++ // CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20. ++ bool bWithCcxVerNum; ++ u8 BssCcxVerNumber; ++ /* These are network statistics */ ++ struct ieee80211_rx_stats stats; ++ u16 capability; ++ u8 rates[MAX_RATES_LENGTH]; ++ u8 rates_len; ++ u8 rates_ex[MAX_RATES_EX_LENGTH]; ++ u8 rates_ex_len; ++ unsigned long last_scanned; ++ u8 mode; ++ u32 flags; ++ u32 last_associate; ++ u32 time_stamp[2]; ++ u16 beacon_interval; ++ u16 listen_interval; ++ u16 atim_window; ++ u8 erp_value; ++ u8 wpa_ie[MAX_WPA_IE_LEN]; ++ size_t wpa_ie_len; ++ u8 rsn_ie[MAX_WPA_IE_LEN]; ++ size_t rsn_ie_len; ++ ++ struct ieee80211_tim_parameters tim; ++ u8 dtim_period; ++ u8 dtim_data; ++ u32 last_dtim_sta_time[2]; ++ ++ //appeded for QoS ++ u8 wmm_info; ++ struct ieee80211_wmm_ac_param wmm_param[4]; ++ u8 QoS_Enable; ++#ifdef THOMAS_TURBO ++ u8 Turbo_Enable;//enable turbo mode, added by thomas ++#endif ++#ifdef ENABLE_DOT11D ++ u16 CountryIeLen; ++ u8 CountryIeBuf[MAX_IE_LEN]; ++#endif ++ // HT Related, by amy, 2008.04.29 ++ BSS_HT bssht; ++ // Add to handle broadcom AP management frame CCK rate. ++ bool broadcom_cap_exist; ++ bool ralink_cap_exist; ++ bool atheros_cap_exist; ++ bool cisco_cap_exist; ++ bool unknown_cap_exist; ++// u8 berp_info; ++ bool berp_info_valid; ++ bool buseprotection; ++ //put at the end of the structure. ++ struct list_head list; ++}; ++ ++#if 1 ++enum ieee80211_state { ++ ++ /* the card is not linked at all */ ++ IEEE80211_NOLINK = 0, ++ ++ /* IEEE80211_ASSOCIATING* are for BSS client mode ++ * the driver shall not perform RX filtering unless ++ * the state is LINKED. ++ * The driver shall just check for the state LINKED and ++ * defaults to NOLINK for ALL the other states (including ++ * LINKED_SCANNING) ++ */ ++ ++ /* the association procedure will start (wq scheduling)*/ ++ IEEE80211_ASSOCIATING, ++ IEEE80211_ASSOCIATING_RETRY, ++ ++ /* the association procedure is sending AUTH request*/ ++ IEEE80211_ASSOCIATING_AUTHENTICATING, ++ ++ /* the association procedure has successfully authentcated ++ * and is sending association request ++ */ ++ IEEE80211_ASSOCIATING_AUTHENTICATED, ++ ++ /* the link is ok. the card associated to a BSS or linked ++ * to a ibss cell or acting as an AP and creating the bss ++ */ ++ IEEE80211_LINKED, ++ ++ /* same as LINKED, but the driver shall apply RX filter ++ * rules as we are in NO_LINK mode. As the card is still ++ * logically linked, but it is doing a syncro site survey ++ * then it will be back to LINKED state. ++ */ ++ IEEE80211_LINKED_SCANNING, ++ ++}; ++#else ++enum ieee80211_state { ++ IEEE80211_UNINITIALIZED = 0, ++ IEEE80211_INITIALIZED, ++ IEEE80211_ASSOCIATING, ++ IEEE80211_ASSOCIATED, ++ IEEE80211_AUTHENTICATING, ++ IEEE80211_AUTHENTICATED, ++ IEEE80211_SHUTDOWN ++}; ++#endif ++ ++#define DEFAULT_MAX_SCAN_AGE (15 * HZ) ++#define DEFAULT_FTS 2346 ++ ++#define CFG_IEEE80211_RESERVE_FCS (1<<0) ++#define CFG_IEEE80211_COMPUTE_FCS (1<<1) ++#define CFG_IEEE80211_RTS (1<<2) ++ ++#define IEEE80211_24GHZ_MIN_CHANNEL 1 ++#define IEEE80211_24GHZ_MAX_CHANNEL 14 ++#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ ++ IEEE80211_24GHZ_MIN_CHANNEL + 1) ++ ++#define IEEE80211_52GHZ_MIN_CHANNEL 34 ++#define IEEE80211_52GHZ_MAX_CHANNEL 165 ++#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ ++ IEEE80211_52GHZ_MIN_CHANNEL + 1) ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) ++extern inline int is_multicast_ether_addr(const u8 *addr) ++{ ++ return ((addr[0] != 0xff) && (0x01 & addr[0])); ++} ++#endif ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)) ++extern inline int is_broadcast_ether_addr(const u8 *addr) ++{ ++ return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ ++ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); ++} ++#endif ++ ++typedef struct tx_pending_t{ ++ int frag; ++ struct ieee80211_txb *txb; ++}tx_pending_t; ++ ++typedef struct _bandwidth_autoswitch ++{ ++ long threshold_20Mhzto40Mhz; ++ long threshold_40Mhzto20Mhz; ++ bool bforced_tx20Mhz; ++ bool bautoswitch_enable; ++}bandwidth_autoswitch,*pbandwidth_autoswitch; ++ ++ ++//added by amy for order ++ ++#define REORDER_WIN_SIZE 128 ++#define REORDER_ENTRY_NUM 128 ++typedef struct _RX_REORDER_ENTRY ++{ ++ struct list_head List; ++ u16 SeqNum; ++ struct ieee80211_rxb* prxb; ++} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY; ++//added by amy for order ++typedef enum _Fsync_State{ ++ Default_Fsync, ++ HW_Fsync, ++ SW_Fsync ++}Fsync_State; ++ ++// Power save mode configured. ++typedef enum _RT_PS_MODE ++{ ++ eActive, // Active/Continuous access. ++ eMaxPs, // Max power save mode. ++ eFastPs // Fast power save mode. ++}RT_PS_MODE; ++ ++typedef enum _IPS_CALLBACK_FUNCION ++{ ++ IPS_CALLBACK_NONE = 0, ++ IPS_CALLBACK_MGNT_LINK_REQUEST = 1, ++ IPS_CALLBACK_JOIN_REQUEST = 2, ++}IPS_CALLBACK_FUNCION; ++ ++typedef enum _RT_JOIN_ACTION{ ++ RT_JOIN_INFRA = 1, ++ RT_JOIN_IBSS = 2, ++ RT_START_IBSS = 3, ++ RT_NO_ACTION = 4, ++}RT_JOIN_ACTION; ++ ++typedef struct _IbssParms{ ++ u16 atimWin; ++}IbssParms, *PIbssParms; ++#define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko. ++ ++// RF state. ++typedef enum _RT_RF_POWER_STATE ++{ ++ eRfOn, ++ eRfSleep, ++ eRfOff ++}RT_RF_POWER_STATE; ++ ++typedef struct _RT_POWER_SAVE_CONTROL ++{ ++ ++ // ++ // Inactive Power Save(IPS) : Disable RF when disconnected ++ // ++ bool bInactivePs; ++ bool bIPSModeBackup; ++ bool bSwRfProcessing; ++ RT_RF_POWER_STATE eInactivePowerState; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct work_struct InactivePsWorkItem; ++#else ++ struct tq_struct InactivePsWorkItem; ++#endif ++ struct timer_list InactivePsTimer; ++ ++ // Return point for join action ++ IPS_CALLBACK_FUNCION ReturnPoint; ++ ++ // Recored Parameters for rescheduled JoinRequest ++ bool bTmpBssDesc; ++ RT_JOIN_ACTION tmpJoinAction; ++ struct ieee80211_network tmpBssDesc; ++ ++ // Recored Parameters for rescheduled MgntLinkRequest ++ bool bTmpScanOnly; ++ bool bTmpActiveScan; ++ bool bTmpFilterHiddenAP; ++ bool bTmpUpdateParms; ++ u8 tmpSsidBuf[33]; ++ OCTET_STRING tmpSsid2Scan; ++ bool bTmpSsid2Scan; ++ u8 tmpNetworkType; ++ u8 tmpChannelNumber; ++ u16 tmpBcnPeriod; ++ u8 tmpDtimPeriod; ++ u16 tmpmCap; ++ OCTET_STRING tmpSuppRateSet; ++ u8 tmpSuppRateBuf[MAX_NUM_RATES]; ++ bool bTmpSuppRate; ++ IbssParms tmpIbpm; ++ bool bTmpIbpm; ++ ++ // ++ // Leisre Poswer Save : Disable RF if connected but traffic is not busy ++ // ++ bool bLeisurePs; ++ ++}RT_POWER_SAVE_CONTROL,*PRT_POWER_SAVE_CONTROL; ++ ++typedef u32 RT_RF_CHANGE_SOURCE; ++#define RF_CHANGE_BY_SW BIT31 ++#define RF_CHANGE_BY_HW BIT30 ++#define RF_CHANGE_BY_PS BIT29 ++#define RF_CHANGE_BY_IPS BIT28 ++#define RF_CHANGE_BY_INIT 0 // Do not change the RFOff reason. Defined by Bruce, 2008-01-17. ++ ++#ifdef ENABLE_DOT11D ++typedef enum ++{ ++ COUNTRY_CODE_FCC = 0, ++ COUNTRY_CODE_IC = 1, ++ COUNTRY_CODE_ETSI = 2, ++ COUNTRY_CODE_SPAIN = 3, ++ COUNTRY_CODE_FRANCE = 4, ++ COUNTRY_CODE_MKK = 5, ++ COUNTRY_CODE_MKK1 = 6, ++ COUNTRY_CODE_ISRAEL = 7, ++ COUNTRY_CODE_TELEC, ++ COUNTRY_CODE_MIC, ++ COUNTRY_CODE_GLOBAL_DOMAIN ++}country_code_type_t; ++#endif ++ ++#define RT_MAX_LD_SLOT_NUM 10 ++typedef struct _RT_LINK_DETECT_T{ ++ ++ u32 NumRecvBcnInPeriod; ++ u32 NumRecvDataInPeriod; ++ ++ u32 RxBcnNum[RT_MAX_LD_SLOT_NUM]; // number of Rx beacon / CheckForHang_period to determine link status ++ u32 RxDataNum[RT_MAX_LD_SLOT_NUM]; // number of Rx data / CheckForHang_period to determine link status ++ u16 SlotNum; // number of CheckForHang period to determine link status ++ u16 SlotIndex; ++ ++ u32 NumTxOkInPeriod; ++ u32 NumRxOkInPeriod; ++ bool bBusyTraffic; ++}RT_LINK_DETECT_T, *PRT_LINK_DETECT_T; ++ ++ ++struct ieee80211_device { ++ struct net_device *dev; ++ struct ieee80211_security sec; ++ ++ //hw security related ++// u8 hwsec_support; //support? ++ u8 hwsec_active; //hw security active. ++ bool is_silent_reset; ++ bool is_roaming; ++ bool ieee_up; ++ //added by amy ++ bool bSupportRemoteWakeUp; ++ RT_PS_MODE dot11PowerSaveMode; // Power save mode configured. ++ bool actscanning; ++ bool beinretry; ++ RT_RF_POWER_STATE eRFPowerState; ++ RT_RF_CHANGE_SOURCE RfOffReason; ++ bool is_set_key; ++ //11n spec related I wonder if These info structure need to be moved out of ieee80211_device ++ ++ //11n HT below ++ PRT_HIGH_THROUGHPUT pHTInfo; ++ //struct timer_list SwBwTimer; ++// spinlock_t chnlop_spinlock; ++ spinlock_t bw_spinlock; ++ ++ spinlock_t reorder_spinlock; ++ // for HT operation rate set. we use this one for HT data rate to seperate different descriptors ++ //the way fill this is the same as in the IE ++ u8 Regdot11HTOperationalRateSet[16]; //use RATR format ++ u8 dot11HTOperationalRateSet[16]; //use RATR format ++ u8 RegHTSuppRateSet[16]; ++ u8 HTCurrentOperaRate; ++ u8 HTHighestOperaRate; ++ //wb added for rate operation mode to firmware ++ u8 bTxDisableRateFallBack; ++ u8 bTxUseDriverAssingedRate; ++ atomic_t atm_chnlop; ++ atomic_t atm_swbw; ++// u8 HTHighestOperaRate; ++// u8 HTCurrentOperaRate; ++ ++ // 802.11e and WMM Traffic Stream Info (TX) ++ struct list_head Tx_TS_Admit_List; ++ struct list_head Tx_TS_Pending_List; ++ struct list_head Tx_TS_Unused_List; ++ TX_TS_RECORD TxTsRecord[TOTAL_TS_NUM]; ++ // 802.11e and WMM Traffic Stream Info (RX) ++ struct list_head Rx_TS_Admit_List; ++ struct list_head Rx_TS_Pending_List; ++ struct list_head Rx_TS_Unused_List; ++ RX_TS_RECORD RxTsRecord[TOTAL_TS_NUM]; ++//#ifdef TO_DO_LIST ++ RX_REORDER_ENTRY RxReorderEntry[128]; ++ struct list_head RxReorder_Unused_List; ++//#endif ++ // Qos related. Added by Annie, 2005-11-01. ++// PSTA_QOS pStaQos; ++ u8 ForcedPriority; // Force per-packet priority 1~7. (default: 0, not to force it.) ++ ++ ++ /* Bookkeeping structures */ ++ struct net_device_stats stats; ++ struct ieee80211_stats ieee_stats; ++ struct ieee80211_softmac_stats softmac_stats; ++ ++ /* Probe / Beacon management */ ++ struct list_head network_free_list; ++ struct list_head network_list; ++ struct ieee80211_network *networks; ++ int scans; ++ int scan_age; ++ ++ int iw_mode; /* operating mode (IW_MODE_*) */ ++ struct iw_spy_data spy_data; ++ ++ spinlock_t lock; ++ spinlock_t wpax_suitlist_lock; ++ ++ int tx_headroom; /* Set to size of any additional room needed at front ++ * of allocated Tx SKBs */ ++ u32 config; ++ ++ /* WEP and other encryption related settings at the device level */ ++ int open_wep; /* Set to 1 to allow unencrypted frames */ ++ int auth_mode; ++ int reset_on_keychange; /* Set to 1 if the HW needs to be reset on ++ * WEP key changes */ ++ ++ /* If the host performs {en,de}cryption, then set to 1 */ ++ int host_encrypt; ++ int host_encrypt_msdu; ++ int host_decrypt; ++ /* host performs multicast decryption */ ++ int host_mc_decrypt; ++ ++ /* host should strip IV and ICV from protected frames */ ++ /* meaningful only when hardware decryption is being used */ ++ int host_strip_iv_icv; ++ ++ int host_open_frag; ++ int host_build_iv; ++ int ieee802_1x; /* is IEEE 802.1X used */ ++ ++ /* WPA data */ ++ bool bHalfWirelessN24GMode; ++ int wpa_enabled; ++ int drop_unencrypted; ++ int tkip_countermeasures; ++ int privacy_invoked; ++ size_t wpa_ie_len; ++ u8 *wpa_ie; ++ u8 ap_mac_addr[6]; ++ u16 pairwise_key_type; ++ u16 group_key_type; ++ struct list_head crypt_deinit_list; ++ struct ieee80211_crypt_data *crypt[WEP_KEYS]; ++ int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ ++ struct timer_list crypt_deinit_timer; ++ int crypt_quiesced; ++ ++ int bcrx_sta_key; /* use individual keys to override default keys even ++ * with RX of broad/multicast frames */ ++ ++ /* Fragmentation structures */ ++ // each streaming contain a entry ++ struct ieee80211_frag_entry frag_cache[17][IEEE80211_FRAG_CACHE_LEN]; ++ unsigned int frag_next_idx[17]; ++ u16 fts; /* Fragmentation Threshold */ ++#define DEFAULT_RTS_THRESHOLD 2346U ++#define MIN_RTS_THRESHOLD 1 ++#define MAX_RTS_THRESHOLD 2346U ++ u16 rts; /* RTS threshold */ ++ ++ /* Association info */ ++ u8 bssid[ETH_ALEN]; ++ ++ /* This stores infos for the current network. ++ * Either the network we are associated in INFRASTRUCTURE ++ * or the network that we are creating in MASTER mode. ++ * ad-hoc is a mixture ;-). ++ * Note that in infrastructure mode, even when not associated, ++ * fields bssid and essid may be valid (if wpa_set and essid_set ++ * are true) as thy carry the value set by the user via iwconfig ++ */ ++ struct ieee80211_network current_network; ++ ++ enum ieee80211_state state; ++ ++ int short_slot; ++ int reg_mode; ++ int mode; /* A, B, G */ ++ int modulation; /* CCK, OFDM */ ++ int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ ++ int abg_true; /* ABG flag */ ++ ++ /* used for forcing the ibss workqueue to terminate ++ * without wait for the syncro scan to terminate ++ */ ++ short sync_scan_hurryup; ++ ++ int perfect_rssi; ++ int worst_rssi; ++ ++ u16 prev_seq_ctl; /* used to drop duplicate frames */ ++ ++ /* map of allowed channels. 0 is dummy */ ++ // FIXME: remeber to default to a basic channel plan depending of the PHY type ++#ifdef ENABLE_DOT11D ++ void* pDot11dInfo; ++ bool bGlobalDomain; ++#else ++ int channel_map[MAX_CHANNEL_NUMBER+1]; ++#endif ++ int rate; /* current rate */ ++ int basic_rate; ++ //FIXME: pleace callback, see if redundant with softmac_features ++ short active_scan; ++ ++ /* this contains flags for selectively enable softmac support */ ++ u16 softmac_features; ++ ++ /* if the sequence control field is not filled by HW */ ++ u16 seq_ctrl[5]; ++ ++ /* association procedure transaction sequence number */ ++ u16 associate_seq; ++ ++ /* AID for RTXed association responses */ ++ u16 assoc_id; ++ ++ /* power save mode related*/ ++ u8 ack_tx_to_ieee; ++ short ps; ++ short sta_sleep; ++ int ps_timeout; ++ int ps_period; ++ struct tasklet_struct ps_task; ++ u32 ps_th; ++ u32 ps_tl; ++ ++ short raw_tx; ++ /* used if IEEE_SOFTMAC_TX_QUEUE is set */ ++ short queue_stop; ++ short scanning; ++ short proto_started; ++ ++ struct semaphore wx_sem; ++ struct semaphore scan_sem; ++ ++ spinlock_t mgmt_tx_lock; ++ spinlock_t beacon_lock; ++ ++ short beacon_txing; ++ ++ short wap_set; ++ short ssid_set; ++ ++ u8 wpax_type_set; //{added by David, 2006.9.28} ++ u32 wpax_type_notify; //{added by David, 2006.9.26} ++ ++ /* QoS related flag */ ++ char init_wmmparam_flag; ++ /* set on initialization */ ++ u8 qos_support; ++ ++ /* for discarding duplicated packets in IBSS */ ++ struct list_head ibss_mac_hash[IEEE_IBSS_MAC_HASH_SIZE]; ++ ++ /* for discarding duplicated packets in BSS */ ++ u16 last_rxseq_num[17]; /* rx seq previous per-tid */ ++ u16 last_rxfrag_num[17];/* tx frag previous per-tid */ ++ unsigned long last_packet_time[17]; ++ ++ /* for PS mode */ ++ unsigned long last_rx_ps_time; ++ ++ /* used if IEEE_SOFTMAC_SINGLE_QUEUE is set */ ++ struct sk_buff *mgmt_queue_ring[MGMT_QUEUE_NUM]; ++ int mgmt_queue_head; ++ int mgmt_queue_tail; ++//{ added for rtl819x ++#define IEEE80211_QUEUE_LIMIT 128 ++ u8 AsocRetryCount; ++ unsigned int hw_header; ++ struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; ++ struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE]; ++ struct sk_buff_head skb_drv_aggQ[MAX_QUEUE_SIZE]; ++ u32 sta_edca_param[4]; ++ bool aggregation; ++ // Enable/Disable Rx immediate BA capability. ++ bool enable_rx_imm_BA; ++ bool bibsscoordinator; ++ ++ //+by amy for DM ,080515 ++ //Dynamic Tx power for near/far range enable/Disable , by amy , 2008-05-15 ++ bool bdynamic_txpower_enable; ++ ++ bool bCTSToSelfEnable; ++ u8 CTSToSelfTH; ++ ++ u32 fsync_time_interval; ++ u32 fsync_rate_bitmap; ++ u8 fsync_rssi_threshold; ++ bool bfsync_enable; ++ ++ u8 fsync_multiple_timeinterval; // FsyncMultipleTimeInterval * FsyncTimeInterval ++ u32 fsync_firstdiff_ratethreshold; // low threshold ++ u32 fsync_seconddiff_ratethreshold; // decrease threshold ++ Fsync_State fsync_state; ++ bool bis_any_nonbepkts; ++ //20Mhz 40Mhz AutoSwitch Threshold ++ bandwidth_autoswitch bandwidth_auto_switch; ++ //for txpower tracking ++ bool FwRWRF; ++ ++ //added by amy for AP roaming ++ RT_LINK_DETECT_T LinkDetectInfo; ++ //added by amy for ps ++ RT_POWER_SAVE_CONTROL PowerSaveControl; ++//} ++ /* used if IEEE_SOFTMAC_TX_QUEUE is set */ ++ struct tx_pending_t tx_pending; ++ ++ /* used if IEEE_SOFTMAC_ASSOCIATE is set */ ++ struct timer_list associate_timer; ++ ++ /* used if IEEE_SOFTMAC_BEACONS is set */ ++ struct timer_list beacon_timer; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct work_struct associate_complete_wq; ++ struct work_struct associate_procedure_wq; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ struct delayed_work softmac_scan_wq; ++ struct delayed_work associate_retry_wq; ++ struct delayed_work start_ibss_wq; ++ struct delayed_work hw_wakeup_wq; ++ struct delayed_work hw_sleep_wq; ++#else ++ struct work_struct softmac_scan_wq; ++ struct work_struct associate_retry_wq; ++ struct work_struct start_ibss_wq; ++ struct work_struct hw_wakeup_wq; ++ struct work_struct hw_sleep_wq; ++#endif ++ struct work_struct wx_sync_scan_wq; ++ struct workqueue_struct *wq; ++#else ++ /* used for periodly scan */ ++ struct timer_list scan_timer; ++ ++ struct tq_struct associate_complete_wq; ++ struct tq_struct associate_retry_wq; ++ struct tq_struct start_ibss_wq; ++ struct tq_struct associate_procedure_wq; ++ struct tq_struct softmac_scan_wq; ++ struct tq_struct wx_sync_scan_wq; ++ ++#endif ++ // Qos related. Added by Annie, 2005-11-01. ++ //STA_QOS StaQos; ++ ++ //u32 STA_EDCA_PARAM[4]; ++ //CHANNEL_ACCESS_SETTING ChannelAccessSetting; ++ ++ ++ /* Callback functions */ ++ void (*set_security)(struct net_device *dev, ++ struct ieee80211_security *sec); ++ ++ /* Used to TX data frame by using txb structs. ++ * this is not used if in the softmac_features ++ * is set the flag IEEE_SOFTMAC_TX_QUEUE ++ */ ++ int (*hard_start_xmit)(struct ieee80211_txb *txb, ++ struct net_device *dev); ++ ++ int (*reset_port)(struct net_device *dev); ++ int (*is_queue_full) (struct net_device * dev, int pri); ++ ++ int (*handle_management) (struct net_device * dev, ++ struct ieee80211_network * network, u16 type); ++ int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); ++ ++ /* Softmac-generated frames (mamagement) are TXed via this ++ * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is ++ * not set. As some cards may have different HW queues that ++ * one might want to use for data and management frames ++ * the option to have two callbacks might be useful. ++ * This fucntion can't sleep. ++ */ ++ int (*softmac_hard_start_xmit)(struct sk_buff *skb, ++ struct net_device *dev); ++ ++ /* used instead of hard_start_xmit (not softmac_hard_start_xmit) ++ * if the IEEE_SOFTMAC_TX_QUEUE feature is used to TX data ++ * frames. I the option IEEE_SOFTMAC_SINGLE_QUEUE is also set ++ * then also management frames are sent via this callback. ++ * This function can't sleep. ++ */ ++ void (*softmac_data_hard_start_xmit)(struct sk_buff *skb, ++ struct net_device *dev,int rate); ++ ++ /* stops the HW queue for DATA frames. Useful to avoid ++ * waste time to TX data frame when we are reassociating ++ * This function can sleep. ++ */ ++ void (*data_hard_stop)(struct net_device *dev); ++ ++ /* OK this is complementar to data_poll_hard_stop */ ++ void (*data_hard_resume)(struct net_device *dev); ++ ++ /* ask to the driver to retune the radio . ++ * This function can sleep. the driver should ensure ++ * the radio has been swithced before return. ++ */ ++ void (*set_chan)(struct net_device *dev,short ch); ++ ++ /* These are not used if the ieee stack takes care of ++ * scanning (IEEE_SOFTMAC_SCAN feature set). ++ * In this case only the set_chan is used. ++ * ++ * The syncro version is similar to the start_scan but ++ * does not return until all channels has been scanned. ++ * this is called in user context and should sleep, ++ * it is called in a work_queue when swithcing to ad-hoc mode ++ * or in behalf of iwlist scan when the card is associated ++ * and root user ask for a scan. ++ * the fucntion stop_scan should stop both the syncro and ++ * background scanning and can sleep. ++ * The fucntion start_scan should initiate the background ++ * scanning and can't sleep. ++ */ ++ void (*scan_syncro)(struct net_device *dev); ++ void (*start_scan)(struct net_device *dev); ++ void (*stop_scan)(struct net_device *dev); ++ ++ /* indicate the driver that the link state is changed ++ * for example it may indicate the card is associated now. ++ * Driver might be interested in this to apply RX filter ++ * rules or simply light the LINK led ++ */ ++ void (*link_change)(struct net_device *dev); ++ ++ /* these two function indicates to the HW when to start ++ * and stop to send beacons. This is used when the ++ * IEEE_SOFTMAC_BEACONS is not set. For now the ++ * stop_send_bacons is NOT guaranteed to be called only ++ * after start_send_beacons. ++ */ ++ void (*start_send_beacons) (struct net_device *dev,u16 tx_rate); ++ void (*stop_send_beacons) (struct net_device *dev); ++ ++ /* power save mode related */ ++ void (*sta_wake_up) (struct net_device *dev); ++// void (*ps_request_tx_ack) (struct net_device *dev); ++ void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); ++ short (*ps_is_queue_empty) (struct net_device *dev); ++#if 0 ++ /* Typical STA methods */ ++ int (*handle_auth) (struct net_device * dev, ++ struct ieee80211_auth * auth); ++ int (*handle_deauth) (struct net_device * dev, ++ struct ieee80211_deauth * auth); ++ int (*handle_action) (struct net_device * dev, ++ struct ieee80211_action * action, ++ struct ieee80211_rx_stats * stats); ++ int (*handle_disassoc) (struct net_device * dev, ++ struct ieee80211_disassoc * assoc); ++#endif ++ int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); ++#if 0 ++ int (*handle_probe_response) (struct net_device * dev, ++ struct ieee80211_probe_response * resp, ++ struct ieee80211_network * network); ++ int (*handle_probe_request) (struct net_device * dev, ++ struct ieee80211_probe_request * req, ++ struct ieee80211_rx_stats * stats); ++#endif ++ int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); ++ ++#if 0 ++ /* Typical AP methods */ ++ int (*handle_assoc_request) (struct net_device * dev); ++ int (*handle_reassoc_request) (struct net_device * dev, ++ struct ieee80211_reassoc_request * req); ++#endif ++ ++ /* check whether Tx hw resouce available */ ++ short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); ++ //added by wb for HT related ++// void (*SwChnlByTimerHandler)(struct net_device *dev, int channel); ++ void (*SetBWModeHandler)(struct net_device *dev, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++// void (*UpdateHalRATRTableHandler)(struct net_device* dev, u8* pMcsRate); ++ bool (*GetNmodeSupportBySecCfg)(struct net_device* dev); ++ void (*SetWirelessMode)(struct net_device* dev, u8 wireless_mode); ++ bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device* dev); ++ void (*InitialGainHandler)(struct net_device *dev, u8 Operation); ++ ++ /* This must be the last item so that it points to the data ++ * allocated beyond this structure by alloc_ieee80211 */ ++ u8 priv[0]; ++}; ++ ++#define IEEE_A (1<<0) ++#define IEEE_B (1<<1) ++#define IEEE_G (1<<2) ++#define IEEE_N_24G (1<<4) ++#define IEEE_N_5G (1<<5) ++#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) ++ ++/* Generate a 802.11 header */ ++ ++/* Uses the channel change callback directly ++ * instead of [start/stop] scan callbacks ++ */ ++#define IEEE_SOFTMAC_SCAN (1<<2) ++ ++/* Perform authentication and association handshake */ ++#define IEEE_SOFTMAC_ASSOCIATE (1<<3) ++ ++/* Generate probe requests */ ++#define IEEE_SOFTMAC_PROBERQ (1<<4) ++ ++/* Generate respones to probe requests */ ++#define IEEE_SOFTMAC_PROBERS (1<<5) ++ ++/* The ieee802.11 stack will manages the netif queue ++ * wake/stop for the driver, taking care of 802.11 ++ * fragmentation. See softmac.c for details. */ ++#define IEEE_SOFTMAC_TX_QUEUE (1<<7) ++ ++/* Uses only the softmac_data_hard_start_xmit ++ * even for TX management frames. ++ */ ++#define IEEE_SOFTMAC_SINGLE_QUEUE (1<<8) ++ ++/* Generate beacons. The stack will enqueue beacons ++ * to the card ++ */ ++#define IEEE_SOFTMAC_BEACONS (1<<6) ++ ++static inline void *ieee80211_priv(struct net_device *dev) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ return ((struct ieee80211_device *)netdev_priv(dev))->priv; ++#else ++ return ((struct ieee80211_device *)dev->priv)->priv; ++#endif ++} ++ ++extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++{ ++ /* Single white space is for Linksys APs */ ++ if (essid_len == 1 && essid[0] == ' ') ++ return 1; ++ ++ /* Otherwise, if the entire essid is 0, we assume it is hidden */ ++ while (essid_len) { ++ essid_len--; ++ if (essid[essid_len] != '\0') ++ return 0; ++ } ++ ++ return 1; ++} ++ ++extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) ++{ ++ /* ++ * It is possible for both access points and our device to support ++ * combinations of modes, so as long as there is one valid combination ++ * of ap/device supported modes, then return success ++ * ++ */ ++ if ((mode & IEEE_A) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION) && ++ (ieee->freq_band & IEEE80211_52GHZ_BAND)) ++ return 1; ++ ++ if ((mode & IEEE_G) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION) && ++ (ieee->freq_band & IEEE80211_24GHZ_BAND)) ++ return 1; ++ ++ if ((mode & IEEE_B) && ++ (ieee->modulation & IEEE80211_CCK_MODULATION) && ++ (ieee->freq_band & IEEE80211_24GHZ_BAND)) ++ return 1; ++ ++ return 0; ++} ++ ++extern inline int ieee80211_get_hdrlen(u16 fc) ++{ ++ int hdrlen = IEEE80211_3ADDR_LEN; ++ ++ switch (WLAN_FC_GET_TYPE(fc)) { ++ case IEEE80211_FTYPE_DATA: ++ if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) ++ hdrlen = IEEE80211_4ADDR_LEN; /* Addr4 */ ++ if(IEEE80211_QOS_HAS_SEQ(fc)) ++ hdrlen += 2; /* QOS ctrl*/ ++ break; ++ case IEEE80211_FTYPE_CTL: ++ switch (WLAN_FC_GET_STYPE(fc)) { ++ case IEEE80211_STYPE_CTS: ++ case IEEE80211_STYPE_ACK: ++ hdrlen = IEEE80211_1ADDR_LEN; ++ break; ++ default: ++ hdrlen = IEEE80211_2ADDR_LEN; ++ break; ++ } ++ break; ++ } ++ ++ return hdrlen; ++} ++ ++static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) ++{ ++ switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { ++ case IEEE80211_1ADDR_LEN: ++ return ((struct ieee80211_hdr_1addr *)hdr)->payload; ++ case IEEE80211_2ADDR_LEN: ++ return ((struct ieee80211_hdr_2addr *)hdr)->payload; ++ case IEEE80211_3ADDR_LEN: ++ return ((struct ieee80211_hdr_3addr *)hdr)->payload; ++ case IEEE80211_4ADDR_LEN: ++ return ((struct ieee80211_hdr_4addr *)hdr)->payload; ++ } ++ return NULL; ++} ++ ++static inline int ieee80211_is_ofdm_rate(u8 rate) ++{ ++ switch (rate & ~IEEE80211_BASIC_RATE_MASK) { ++ case IEEE80211_OFDM_RATE_6MB: ++ case IEEE80211_OFDM_RATE_9MB: ++ case IEEE80211_OFDM_RATE_12MB: ++ case IEEE80211_OFDM_RATE_18MB: ++ case IEEE80211_OFDM_RATE_24MB: ++ case IEEE80211_OFDM_RATE_36MB: ++ case IEEE80211_OFDM_RATE_48MB: ++ case IEEE80211_OFDM_RATE_54MB: ++ return 1; ++ } ++ return 0; ++} ++ ++static inline int ieee80211_is_cck_rate(u8 rate) ++{ ++ switch (rate & ~IEEE80211_BASIC_RATE_MASK) { ++ case IEEE80211_CCK_RATE_1MB: ++ case IEEE80211_CCK_RATE_2MB: ++ case IEEE80211_CCK_RATE_5MB: ++ case IEEE80211_CCK_RATE_11MB: ++ return 1; ++ } ++ return 0; ++} ++ ++ ++/* ieee80211.c */ ++extern void free_ieee80211(struct net_device *dev); ++extern struct net_device *alloc_ieee80211(int sizeof_priv); ++ ++extern int ieee80211_set_encryption(struct ieee80211_device *ieee); ++ ++/* ieee80211_tx.c */ ++ ++extern int ieee80211_encrypt_fragment( ++ struct ieee80211_device *ieee, ++ struct sk_buff *frag, ++ int hdr_len); ++ ++extern int ieee80211_xmit(struct sk_buff *skb, ++ struct net_device *dev); ++extern void ieee80211_txb_free(struct ieee80211_txb *); ++ ++ ++/* ieee80211_rx.c */ ++extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats); ++extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *header, ++ struct ieee80211_rx_stats *stats); ++ ++/* ieee80211_wx.c */ ++extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key); ++#if WIRELESS_EXT >= 18 ++extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data* wrqu, char *extra); ++extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data* wrqu, char *extra); ++extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ struct iw_param *data, char *extra); ++extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++#endif ++extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len); ++ ++/* ieee80211_softmac.c */ ++extern short ieee80211_is_54g(struct ieee80211_network net); ++extern short ieee80211_is_shortslot(struct ieee80211_network net); ++extern int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats, u16 type, ++ u16 stype); ++extern void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee80211_network *net); ++ ++void SendDisassociation(struct ieee80211_device *ieee, u8* asSta, u8 asRsn); ++extern void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *ieee); ++ ++extern void ieee80211_stop_send_beacons(struct ieee80211_device *ieee); ++extern void notify_wx_assoc_event(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee); ++extern void ieee80211_start_bss(struct ieee80211_device *ieee); ++extern void ieee80211_start_master_bss(struct ieee80211_device *ieee); ++extern void ieee80211_start_ibss(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_init(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_free(struct ieee80211_device *ieee); ++extern void ieee80211_associate_abort(struct ieee80211_device *ieee); ++extern void ieee80211_disassociate(struct ieee80211_device *ieee); ++extern void ieee80211_stop_scan(struct ieee80211_device *ieee); ++extern void ieee80211_start_scan_syncro(struct ieee80211_device *ieee); ++extern void ieee80211_check_all_nets(struct ieee80211_device *ieee); ++extern void ieee80211_start_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_stop_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee); ++extern void ieee80211_reset_queue(struct ieee80211_device *ieee); ++extern void ieee80211_wake_queue(struct ieee80211_device *ieee); ++extern void ieee80211_stop_queue(struct ieee80211_device *ieee); ++extern struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee); ++extern void ieee80211_start_send_beacons(struct ieee80211_device *ieee); ++extern void ieee80211_stop_send_beacons(struct ieee80211_device *ieee); ++extern int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee, struct iw_point *p); ++extern void notify_wx_assoc_event(struct ieee80211_device *ieee); ++extern void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success); ++ ++extern void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); ++ ++/* ieee80211_crypt_ccmp&tkip&wep.c */ ++extern void ieee80211_tkip_null(void); ++extern void ieee80211_wep_null(void); ++extern void ieee80211_ccmp_null(void); ++ ++/* ieee80211_softmac_wx.c */ ++ ++extern int ieee80211_wx_get_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *ext); ++ ++extern int ieee80211_wx_set_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *awrq, ++ char *extra); ++ ++extern int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b); ++ ++extern int ieee80211_wx_set_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b); ++ ++//extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); ++#else ++ extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); ++#endif ++ ++ ++extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_name(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_set_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++ ++extern int ieee80211_wx_get_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra); ++//HT ++#define MAX_RECEIVE_BUFFER_SIZE 9100 // ++extern void HTDebugHTCapability(u8* CapIE, u8* TitleString ); ++extern void HTDebugHTInfo(u8* InfoIE, u8* TitleString); ++ ++void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++extern void HTUpdateDefaultSetting(struct ieee80211_device* ieee); ++extern void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u8* len, u8 isEncrypt); ++extern void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* len, u8 isEncrypt); ++extern void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg, u8* len); ++extern void HTOnAssocRsp(struct ieee80211_device *ieee); ++extern void HTInitializeHTInfo(struct ieee80211_device* ieee); ++extern void HTInitializeBssDesc(PBSS_HT pBssHT); ++extern void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork); ++extern void HTUpdateSelfAndPeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork); ++extern u8 HTGetHighestMCSRate(struct ieee80211_device* ieee, u8* pMCSRateSet, u8* pMCSFilter); ++extern u8 MCS_FILTER_ALL[]; ++extern u16 MCS_DATA_RATE[2][2][77] ; ++extern u8 HTCCheck(struct ieee80211_device* ieee, u8* pFrame); ++//extern void HTSetConnectBwModeCallback(unsigned long data); ++extern void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); ++extern bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee); ++extern u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate); ++extern u16 HTMcsToDataRate( struct ieee80211_device* ieee, u8 nMcsRate); ++extern u16 TxCountToDataRate( struct ieee80211_device* ieee, u8 nDataRate); ++//function in BAPROC.c ++extern int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb); ++extern int ieee80211_rx_ADDBARsp( struct ieee80211_device* ieee, struct sk_buff *skb); ++extern int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb); ++extern void TsInitAddBA( struct ieee80211_device* ieee, PTX_TS_RECORD pTS, u8 Policy, u8 bOverwritePending); ++extern void TsInitDelBA( struct ieee80211_device* ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect); ++extern void BaSetupTimeOut(unsigned long data); ++extern void TxBaInactTimeout(unsigned long data); ++extern void RxBaInactTimeout(unsigned long data); ++extern void ResetBaEntry( PBA_RECORD pBA); ++//function in TS.c ++extern bool GetTs( ++ struct ieee80211_device* ieee, ++ PTS_COMMON_INFO *ppTS, ++ u8* Addr, ++ u8 TID, ++ TR_SELECT TxRxSelect, //Rx:1, Tx:0 ++ bool bAddNewTs ++ ); ++extern void TSInitialize(struct ieee80211_device *ieee); ++extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS); ++extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr); ++extern void RemoveAllTS(struct ieee80211_device* ieee); ++void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee); ++ ++extern const long ieee80211_wlan_frequencies[]; ++ ++extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) ++{ ++ ieee->scans++; ++} ++ ++extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) ++{ ++ return ieee->scans; ++} ++ ++static inline const char *escape_essid(const char *essid, u8 essid_len) { ++ static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; ++ const char *s = essid; ++ char *d = escaped; ++ ++ if (ieee80211_is_empty_essid(essid, essid_len)) { ++ memcpy(escaped, "", sizeof("")); ++ return escaped; ++ } ++ ++ essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); ++ while (essid_len--) { ++ if (*s == '\0') { ++ *d++ = '\\'; ++ *d++ = '0'; ++ s++; ++ } else { ++ *d++ = *s++; ++ } ++ } ++ *d = '\0'; ++ return escaped; ++} ++ ++/* For the function is more related to hardware setting, it's better to use the ++ * ieee handler to refer to it. ++ */ ++extern short check_nic_enough_desc(struct net_device *dev, int queue_index); ++extern int ieee80211_data_xmit(struct sk_buff *skb, struct net_device *dev); ++extern int ieee80211_parse_info_param(struct ieee80211_device *ieee, ++ struct ieee80211_info_element *info_element, ++ u16 length, ++ struct ieee80211_network *network, ++ struct ieee80211_rx_stats *stats); ++ ++void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_rxb** prxbIndicateArray,u8 index); ++#define RT_ASOC_RETRY_LIMIT 5 ++#endif /* IEEE80211_H */ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.c +@@ -0,0 +1,273 @@ ++/* ++ * Host AP crypto routines ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * Portions Copyright (C) 2004, Intel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ * ++ */ ++ ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++ ++//MODULE_AUTHOR("Jouni Malinen"); ++//MODULE_DESCRIPTION("HostAP crypto"); ++//MODULE_LICENSE("GPL"); ++ ++struct ieee80211_crypto_alg { ++ struct list_head list; ++ struct ieee80211_crypto_ops *ops; ++}; ++ ++ ++struct ieee80211_crypto { ++ struct list_head algs; ++ spinlock_t lock; ++}; ++ ++static struct ieee80211_crypto *hcrypt; ++ ++void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, ++ int force) ++{ ++ struct list_head *ptr, *n; ++ struct ieee80211_crypt_data *entry; ++ ++ for (ptr = ieee->crypt_deinit_list.next, n = ptr->next; ++ ptr != &ieee->crypt_deinit_list; ptr = n, n = ptr->next) { ++ entry = list_entry(ptr, struct ieee80211_crypt_data, list); ++ ++ if (atomic_read(&entry->refcnt) != 0 && !force) ++ continue; ++ ++ list_del(ptr); ++ ++ if (entry->ops) { ++ entry->ops->deinit(entry->priv); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ++ module_put(entry->ops->owner); ++#else ++ __MOD_DEC_USE_COUNT(entry->ops->owner); ++#endif ++ } ++ kfree(entry); ++ } ++} ++ ++void ieee80211_crypt_deinit_handler(unsigned long data) ++{ ++ struct ieee80211_device *ieee = (struct ieee80211_device *)data; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ieee80211_crypt_deinit_entries(ieee, 0); ++ if (!list_empty(&ieee->crypt_deinit_list)) { ++ printk(KERN_DEBUG "%s: entries remaining in delayed crypt " ++ "deletion list\n", ieee->dev->name); ++ ieee->crypt_deinit_timer.expires = jiffies + HZ; ++ add_timer(&ieee->crypt_deinit_timer); ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++} ++ ++void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, ++ struct ieee80211_crypt_data **crypt) ++{ ++ struct ieee80211_crypt_data *tmp; ++ unsigned long flags; ++ ++ if (*crypt == NULL) ++ return; ++ ++ tmp = *crypt; ++ *crypt = NULL; ++ ++ /* must not run ops->deinit() while there may be pending encrypt or ++ * decrypt operations. Use a list of delayed deinits to avoid needing ++ * locking. */ ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ list_add(&tmp->list, &ieee->crypt_deinit_list); ++ if (!timer_pending(&ieee->crypt_deinit_timer)) { ++ ieee->crypt_deinit_timer.expires = jiffies + HZ; ++ add_timer(&ieee->crypt_deinit_timer); ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++} ++ ++int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops) ++{ ++ unsigned long flags; ++ struct ieee80211_crypto_alg *alg; ++ ++ if (hcrypt == NULL) ++ return -1; ++ ++ alg = kmalloc(sizeof(*alg), GFP_KERNEL); ++ if (alg == NULL) ++ return -ENOMEM; ++ ++ memset(alg, 0, sizeof(*alg)); ++ alg->ops = ops; ++ ++ spin_lock_irqsave(&hcrypt->lock, flags); ++ list_add(&alg->list, &hcrypt->algs); ++ spin_unlock_irqrestore(&hcrypt->lock, flags); ++ ++ printk(KERN_DEBUG "ieee80211_crypt: registered algorithm '%s'\n", ++ ops->name); ++ ++ return 0; ++} ++ ++int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops) ++{ ++ unsigned long flags; ++ struct list_head *ptr; ++ struct ieee80211_crypto_alg *del_alg = NULL; ++ ++ if (hcrypt == NULL) ++ return -1; ++ ++ spin_lock_irqsave(&hcrypt->lock, flags); ++ for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) { ++ struct ieee80211_crypto_alg *alg = ++ (struct ieee80211_crypto_alg *) ptr; ++ if (alg->ops == ops) { ++ list_del(&alg->list); ++ del_alg = alg; ++ break; ++ } ++ } ++ spin_unlock_irqrestore(&hcrypt->lock, flags); ++ ++ if (del_alg) { ++ printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " ++ "'%s'\n", ops->name); ++ kfree(del_alg); ++ } ++ ++ return del_alg ? 0 : -1; ++} ++ ++ ++struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name) ++{ ++ unsigned long flags; ++ struct list_head *ptr; ++ struct ieee80211_crypto_alg *found_alg = NULL; ++ ++ if (hcrypt == NULL) ++ return NULL; ++ ++ spin_lock_irqsave(&hcrypt->lock, flags); ++ for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) { ++ struct ieee80211_crypto_alg *alg = ++ (struct ieee80211_crypto_alg *) ptr; ++ if (strcmp(alg->ops->name, name) == 0) { ++ found_alg = alg; ++ break; ++ } ++ } ++ spin_unlock_irqrestore(&hcrypt->lock, flags); ++ ++ if (found_alg) ++ return found_alg->ops; ++ else ++ return NULL; ++} ++ ++ ++static void * ieee80211_crypt_null_init(int keyidx) { return (void *) 1; } ++static void ieee80211_crypt_null_deinit(void *priv) {} ++ ++static struct ieee80211_crypto_ops ieee80211_crypt_null = { ++ .name = "NULL", ++ .init = ieee80211_crypt_null_init, ++ .deinit = ieee80211_crypt_null_deinit, ++ .encrypt_mpdu = NULL, ++ .decrypt_mpdu = NULL, ++ .encrypt_msdu = NULL, ++ .decrypt_msdu = NULL, ++ .set_key = NULL, ++ .get_key = NULL, ++ .extra_prefix_len = 0, ++ .extra_postfix_len = 0, ++ .owner = THIS_MODULE, ++}; ++ ++ ++int __init ieee80211_crypto_init(void) ++{ ++ int ret = -ENOMEM; ++ ++ hcrypt = kmalloc(sizeof(*hcrypt), GFP_KERNEL); ++ if (!hcrypt) ++ goto out; ++ ++ memset(hcrypt, 0, sizeof(*hcrypt)); ++ INIT_LIST_HEAD(&hcrypt->algs); ++ spin_lock_init(&hcrypt->lock); ++ ++ ret = ieee80211_register_crypto_ops(&ieee80211_crypt_null); ++ if (ret < 0) { ++ kfree(hcrypt); ++ hcrypt = NULL; ++ } ++out: ++ return ret; ++} ++ ++ ++void __exit ieee80211_crypto_deinit(void) ++{ ++ struct list_head *ptr, *n; ++ ++ if (hcrypt == NULL) ++ return; ++ ++ for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; ++ ptr = n, n = ptr->next) { ++ struct ieee80211_crypto_alg *alg = ++ (struct ieee80211_crypto_alg *) ptr; ++ list_del(ptr); ++ printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " ++ "'%s' (deinit)\n", alg->ops->name); ++ kfree(alg); ++ } ++ ++ kfree(hcrypt); ++} ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_crypt_deinit_entries); ++//EXPORT_SYMBOL(ieee80211_crypt_deinit_handler); ++//EXPORT_SYMBOL(ieee80211_crypt_delayed_deinit); ++ ++//EXPORT_SYMBOL(ieee80211_register_crypto_ops); ++//EXPORT_SYMBOL(ieee80211_unregister_crypto_ops); ++//EXPORT_SYMBOL(ieee80211_get_crypto_ops); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_crypt_deinit_entries); ++EXPORT_SYMBOL_NOVERS(ieee80211_crypt_deinit_handler); ++EXPORT_SYMBOL_NOVERS(ieee80211_crypt_delayed_deinit); ++ ++EXPORT_SYMBOL_NOVERS(ieee80211_register_crypto_ops); ++EXPORT_SYMBOL_NOVERS(ieee80211_unregister_crypto_ops); ++EXPORT_SYMBOL_NOVERS(ieee80211_get_crypto_ops); ++#endif ++ ++//module_init(ieee80211_crypto_init); ++//module_exit(ieee80211_crypto_deinit); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt.h +@@ -0,0 +1,93 @@ ++/* ++ * Original code based on Host AP (software wireless LAN access point) driver ++ * for Intersil Prism2/2.5/3. ++ * ++ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * ++ * Adaption to a generic IEEE 802.11 stack by James Ketrenos ++ * ++ * ++ * Copyright (c) 2004, Intel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++/* ++ * This file defines the interface to the ieee80211 crypto module. ++ */ ++#ifndef IEEE80211_CRYPT_H ++#define IEEE80211_CRYPT_H ++ ++#include ++ ++struct ieee80211_crypto_ops { ++ const char *name; ++ ++ /* init new crypto context (e.g., allocate private data space, ++ * select IV, etc.); returns NULL on failure or pointer to allocated ++ * private data on success */ ++ void * (*init)(int keyidx); ++ ++ /* deinitialize crypto context and free allocated private data */ ++ void (*deinit)(void *priv); ++ ++ /* encrypt/decrypt return < 0 on error or >= 0 on success. The return ++ * value from decrypt_mpdu is passed as the keyidx value for ++ * decrypt_msdu. skb must have enough head and tail room for the ++ * encryption; if not, error will be returned; these functions are ++ * called for all MPDUs (i.e., fragments). ++ */ ++ int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ ++ /* These functions are called for full MSDUs, i.e. full frames. ++ * These can be NULL if full MSDU operations are not needed. */ ++ int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, ++ void *priv); ++ ++ int (*set_key)(void *key, int len, u8 *seq, void *priv); ++ int (*get_key)(void *key, int len, u8 *seq, void *priv); ++ ++ /* procfs handler for printing out key information and possible ++ * statistics */ ++ char * (*print_stats)(char *p, void *priv); ++ ++ /* maximum number of bytes added by encryption; encrypt buf is ++ * allocated with extra_prefix_len bytes, copy of in_buf, and ++ * extra_postfix_len; encrypt need not use all this space, but ++ * the result must start at the beginning of the buffer and correct ++ * length must be returned */ ++ int extra_prefix_len, extra_postfix_len; ++ ++ struct module *owner; ++}; ++ ++struct ieee80211_crypt_data { ++ struct list_head list; /* delayed deletion list */ ++ struct ieee80211_crypto_ops *ops; ++ void *priv; ++ atomic_t refcnt; ++}; ++ ++int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); ++int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); ++struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); ++void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); ++void ieee80211_crypt_deinit_handler(unsigned long); ++void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, ++ struct ieee80211_crypt_data **crypt); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) ++#endif ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) ++#define crypto_alloc_tfm crypto_alloc_tfm_rsl ++#define crypto_free_tfm crypto_free_tfm_rsl ++#endif ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_ccmp.c +@@ -0,0 +1,534 @@ ++/* ++ * Host AP crypt: host-based CCMP encryption implementation for Host AP driver ++ * ++ * Copyright (c) 2003-2004, Jouni Malinen ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#include "rtl_crypto.h" ++#else ++#include ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++ #include ++#else ++ #include ++#endif ++//#include ++ ++MODULE_AUTHOR("Jouni Malinen"); ++MODULE_DESCRIPTION("Host AP crypt: CCMP"); ++MODULE_LICENSE("GPL"); ++ ++#ifndef OPENSUSE_SLED ++#define OPENSUSE_SLED 0 ++#endif ++ ++#define AES_BLOCK_LEN 16 ++#define CCMP_HDR_LEN 8 ++#define CCMP_MIC_LEN 8 ++#define CCMP_TK_LEN 16 ++#define CCMP_PN_LEN 6 ++ ++struct ieee80211_ccmp_data { ++ u8 key[CCMP_TK_LEN]; ++ int key_set; ++ ++ u8 tx_pn[CCMP_PN_LEN]; ++ u8 rx_pn[CCMP_PN_LEN]; ++ ++ u32 dot11RSNAStatsCCMPFormatErrors; ++ u32 dot11RSNAStatsCCMPReplays; ++ u32 dot11RSNAStatsCCMPDecryptErrors; ++ ++ int key_idx; ++ ++ struct crypto_tfm *tfm; ++ ++ /* scratch buffers for virt_to_page() (crypto API) */ ++ u8 tx_b0[AES_BLOCK_LEN], tx_b[AES_BLOCK_LEN], ++ tx_e[AES_BLOCK_LEN], tx_s0[AES_BLOCK_LEN]; ++ u8 rx_b0[AES_BLOCK_LEN], rx_b[AES_BLOCK_LEN], rx_a[AES_BLOCK_LEN]; ++}; ++ ++void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, ++ const u8 pt[16], u8 ct[16]) ++{ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ struct scatterlist src, dst; ++ ++ src.page = virt_to_page(pt); ++ src.offset = offset_in_page(pt); ++ src.length = AES_BLOCK_LEN; ++ ++ dst.page = virt_to_page(ct); ++ dst.offset = offset_in_page(ct); ++ dst.length = AES_BLOCK_LEN; ++ ++ crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); ++#else ++ crypto_cipher_encrypt_one((void*)tfm, ct, pt); ++#endif ++} ++ ++static void * ieee80211_ccmp_init(int key_idx) ++{ ++ struct ieee80211_ccmp_data *priv; ++ ++ priv = kmalloc(sizeof(*priv), GFP_ATOMIC); ++ if (priv == NULL) ++ goto fail; ++ memset(priv, 0, sizeof(*priv)); ++ priv->key_idx = key_idx; ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ priv->tfm = crypto_alloc_tfm("aes", 0); ++ if (priv->tfm == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate " ++ "crypto API aes\n"); ++ goto fail; ++ } ++ #else ++ priv->tfm = (void*)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->tfm)) { ++ printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate " ++ "crypto API aes\n"); ++ priv->tfm = NULL; ++ goto fail; ++ } ++ #endif ++ return priv; ++ ++fail: ++ if (priv) { ++ if (priv->tfm) ++ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) ++ crypto_free_tfm(priv->tfm); ++ #else ++ crypto_free_cipher((void*)priv->tfm); ++ #endif ++ kfree(priv); ++ } ++ ++ return NULL; ++} ++ ++ ++static void ieee80211_ccmp_deinit(void *priv) ++{ ++ struct ieee80211_ccmp_data *_priv = priv; ++ if (_priv && _priv->tfm) ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) ++ crypto_free_tfm(_priv->tfm); ++#else ++ crypto_free_cipher((void*)_priv->tfm); ++#endif ++ kfree(priv); ++} ++ ++ ++static inline void xor_block(u8 *b, u8 *a, size_t len) ++{ ++ int i; ++ for (i = 0; i < len; i++) ++ b[i] ^= a[i]; ++} ++ ++ ++ ++static void ccmp_init_blocks(struct crypto_tfm *tfm, ++ struct ieee80211_hdr_4addr *hdr, ++ u8 *pn, size_t dlen, u8 *b0, u8 *auth, ++ u8 *s0) ++{ ++ u8 *pos, qc = 0; ++ size_t aad_len; ++ u16 fc; ++ int a4_included, qc_included; ++ u8 aad[2 * AES_BLOCK_LEN]; ++ ++ fc = le16_to_cpu(hdr->frame_ctl); ++ a4_included = ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == ++ (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)); ++ /* ++ qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && ++ (WLAN_FC_GET_STYPE(fc) & 0x08)); ++ */ ++ // fixed by David :2006.9.6 ++ qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && ++ (WLAN_FC_GET_STYPE(fc) & 0x80)); ++ aad_len = 22; ++ if (a4_included) ++ aad_len += 6; ++ if (qc_included) { ++ pos = (u8 *) &hdr->addr4; ++ if (a4_included) ++ pos += 6; ++ qc = *pos & 0x0f; ++ aad_len += 2; ++ } ++ /* CCM Initial Block: ++ * Flag (Include authentication header, M=3 (8-octet MIC), ++ * L=1 (2-octet Dlen)) ++ * Nonce: 0x00 | A2 | PN ++ * Dlen */ ++ b0[0] = 0x59; ++ b0[1] = qc; ++ memcpy(b0 + 2, hdr->addr2, ETH_ALEN); ++ memcpy(b0 + 8, pn, CCMP_PN_LEN); ++ b0[14] = (dlen >> 8) & 0xff; ++ b0[15] = dlen & 0xff; ++ ++ /* AAD: ++ * FC with bits 4..6 and 11..13 masked to zero; 14 is always one ++ * A1 | A2 | A3 ++ * SC with bits 4..15 (seq#) masked to zero ++ * A4 (if present) ++ * QC (if present) ++ */ ++ pos = (u8 *) hdr; ++ aad[0] = 0; /* aad_len >> 8 */ ++ aad[1] = aad_len & 0xff; ++ aad[2] = pos[0] & 0x8f; ++ aad[3] = pos[1] & 0xc7; ++ memcpy(aad + 4, hdr->addr1, 3 * ETH_ALEN); ++ pos = (u8 *) &hdr->seq_ctl; ++ aad[22] = pos[0] & 0x0f; ++ aad[23] = 0; /* all bits masked */ ++ memset(aad + 24, 0, 8); ++ if (a4_included) ++ memcpy(aad + 24, hdr->addr4, ETH_ALEN); ++ if (qc_included) { ++ aad[a4_included ? 30 : 24] = qc; ++ /* rest of QC masked */ ++ } ++ ++ /* Start with the first block and AAD */ ++ ieee80211_ccmp_aes_encrypt(tfm, b0, auth); ++ xor_block(auth, aad, AES_BLOCK_LEN); ++ ieee80211_ccmp_aes_encrypt(tfm, auth, auth); ++ xor_block(auth, &aad[AES_BLOCK_LEN], AES_BLOCK_LEN); ++ ieee80211_ccmp_aes_encrypt(tfm, auth, auth); ++ b0[0] &= 0x07; ++ b0[14] = b0[15] = 0; ++ ieee80211_ccmp_aes_encrypt(tfm, b0, s0); ++} ++ ++ ++ ++static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct ieee80211_ccmp_data *key = priv; ++ int data_len, i; ++ u8 *pos; ++ struct ieee80211_hdr_4addr *hdr; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ ++ if (skb_headroom(skb) < CCMP_HDR_LEN || ++ skb_tailroom(skb) < CCMP_MIC_LEN || ++ skb->len < hdr_len) ++ return -1; ++ ++ data_len = skb->len - hdr_len; ++ pos = skb_push(skb, CCMP_HDR_LEN); ++ memmove(pos, pos + CCMP_HDR_LEN, hdr_len); ++ pos += hdr_len; ++// mic = skb_put(skb, CCMP_MIC_LEN); ++ ++ i = CCMP_PN_LEN - 1; ++ while (i >= 0) { ++ key->tx_pn[i]++; ++ if (key->tx_pn[i] != 0) ++ break; ++ i--; ++ } ++ ++ *pos++ = key->tx_pn[5]; ++ *pos++ = key->tx_pn[4]; ++ *pos++ = 0; ++ *pos++ = (key->key_idx << 6) | (1 << 5) /* Ext IV included */; ++ *pos++ = key->tx_pn[3]; ++ *pos++ = key->tx_pn[2]; ++ *pos++ = key->tx_pn[1]; ++ *pos++ = key->tx_pn[0]; ++ ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ if (!tcb_desc->bHwSec) ++ { ++ int blocks, last, len; ++ u8 *mic; ++ u8 *b0 = key->tx_b0; ++ u8 *b = key->tx_b; ++ u8 *e = key->tx_e; ++ u8 *s0 = key->tx_s0; ++ ++ //mic is moved to here by john ++ mic = skb_put(skb, CCMP_MIC_LEN); ++ ++ ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); ++ ++ blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; ++ last = data_len % AES_BLOCK_LEN; ++ ++ for (i = 1; i <= blocks; i++) { ++ len = (i == blocks && last) ? last : AES_BLOCK_LEN; ++ /* Authentication */ ++ xor_block(b, pos, len); ++ ieee80211_ccmp_aes_encrypt(key->tfm, b, b); ++ /* Encryption, with counter */ ++ b0[14] = (i >> 8) & 0xff; ++ b0[15] = i & 0xff; ++ ieee80211_ccmp_aes_encrypt(key->tfm, b0, e); ++ xor_block(pos, e, len); ++ pos += len; ++ } ++ ++ for (i = 0; i < CCMP_MIC_LEN; i++) ++ mic[i] = b[i] ^ s0[i]; ++ } ++ return 0; ++} ++ ++ ++static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct ieee80211_ccmp_data *key = priv; ++ u8 keyidx, *pos; ++ struct ieee80211_hdr_4addr *hdr; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ u8 pn[6]; ++ ++ if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) { ++ key->dot11RSNAStatsCCMPFormatErrors++; ++ return -1; ++ } ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ pos = skb->data + hdr_len; ++ keyidx = pos[3]; ++ if (!(keyidx & (1 << 5))) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "CCMP: received packet without ExtIV" ++ " flag from " MAC_FMT "\n", MAC_ARG(hdr->addr2)); ++ } ++ key->dot11RSNAStatsCCMPFormatErrors++; ++ return -2; ++ } ++ keyidx >>= 6; ++ if (key->key_idx != keyidx) { ++ printk(KERN_DEBUG "CCMP: RX tkey->key_idx=%d frame " ++ "keyidx=%d priv=%p\n", key->key_idx, keyidx, priv); ++ return -6; ++ } ++ if (!key->key_set) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "CCMP: received packet from " MAC_FMT ++ " with keyid=%d that does not have a configured" ++ " key\n", MAC_ARG(hdr->addr2), keyidx); ++ } ++ return -3; ++ } ++ ++ pn[0] = pos[7]; ++ pn[1] = pos[6]; ++ pn[2] = pos[5]; ++ pn[3] = pos[4]; ++ pn[4] = pos[1]; ++ pn[5] = pos[0]; ++ pos += 8; ++ ++ if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "CCMP: replay detected: STA=" MAC_FMT ++ " previous PN %02x%02x%02x%02x%02x%02x " ++ "received PN %02x%02x%02x%02x%02x%02x\n", ++ MAC_ARG(hdr->addr2), MAC_ARG(key->rx_pn), ++ MAC_ARG(pn)); ++ } ++ key->dot11RSNAStatsCCMPReplays++; ++ return -4; ++ } ++ if (!tcb_desc->bHwSec) ++ { ++ size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN; ++ u8 *mic = skb->data + skb->len - CCMP_MIC_LEN; ++ u8 *b0 = key->rx_b0; ++ u8 *b = key->rx_b; ++ u8 *a = key->rx_a; ++ int i, blocks, last, len; ++ ++ ++ ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); ++ xor_block(mic, b, CCMP_MIC_LEN); ++ ++ blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; ++ last = data_len % AES_BLOCK_LEN; ++ ++ for (i = 1; i <= blocks; i++) { ++ len = (i == blocks && last) ? last : AES_BLOCK_LEN; ++ /* Decrypt, with counter */ ++ b0[14] = (i >> 8) & 0xff; ++ b0[15] = i & 0xff; ++ ieee80211_ccmp_aes_encrypt(key->tfm, b0, b); ++ xor_block(pos, b, len); ++ /* Authentication */ ++ xor_block(a, pos, len); ++ ieee80211_ccmp_aes_encrypt(key->tfm, a, a); ++ pos += len; ++ } ++ ++ if (memcmp(mic, a, CCMP_MIC_LEN) != 0) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "CCMP: decrypt failed: STA=" ++ MAC_FMT "\n", MAC_ARG(hdr->addr2)); ++ } ++ key->dot11RSNAStatsCCMPDecryptErrors++; ++ return -5; ++ } ++ ++ memcpy(key->rx_pn, pn, CCMP_PN_LEN); ++ } ++ /* Remove hdr and MIC */ ++ memmove(skb->data + CCMP_HDR_LEN, skb->data, hdr_len); ++ skb_pull(skb, CCMP_HDR_LEN); ++ skb_trim(skb, skb->len - CCMP_MIC_LEN); ++ ++ return keyidx; ++} ++ ++ ++static int ieee80211_ccmp_set_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct ieee80211_ccmp_data *data = priv; ++ int keyidx; ++ struct crypto_tfm *tfm = data->tfm; ++ ++ keyidx = data->key_idx; ++ memset(data, 0, sizeof(*data)); ++ data->key_idx = keyidx; ++ data->tfm = tfm; ++ if (len == CCMP_TK_LEN) { ++ memcpy(data->key, key, CCMP_TK_LEN); ++ data->key_set = 1; ++ if (seq) { ++ data->rx_pn[0] = seq[5]; ++ data->rx_pn[1] = seq[4]; ++ data->rx_pn[2] = seq[3]; ++ data->rx_pn[3] = seq[2]; ++ data->rx_pn[4] = seq[1]; ++ data->rx_pn[5] = seq[0]; ++ } ++ crypto_cipher_setkey((void*)data->tfm, data->key, CCMP_TK_LEN); ++ } else if (len == 0) ++ data->key_set = 0; ++ else ++ return -1; ++ ++ return 0; ++} ++ ++ ++static int ieee80211_ccmp_get_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct ieee80211_ccmp_data *data = priv; ++ ++ if (len < CCMP_TK_LEN) ++ return -1; ++ ++ if (!data->key_set) ++ return 0; ++ memcpy(key, data->key, CCMP_TK_LEN); ++ ++ if (seq) { ++ seq[0] = data->tx_pn[5]; ++ seq[1] = data->tx_pn[4]; ++ seq[2] = data->tx_pn[3]; ++ seq[3] = data->tx_pn[2]; ++ seq[4] = data->tx_pn[1]; ++ seq[5] = data->tx_pn[0]; ++ } ++ ++ return CCMP_TK_LEN; ++} ++ ++ ++static char * ieee80211_ccmp_print_stats(char *p, void *priv) ++{ ++ struct ieee80211_ccmp_data *ccmp = priv; ++ p += sprintf(p, "key[%d] alg=CCMP key_set=%d " ++ "tx_pn=%02x%02x%02x%02x%02x%02x " ++ "rx_pn=%02x%02x%02x%02x%02x%02x " ++ "format_errors=%d replays=%d decrypt_errors=%d\n", ++ ccmp->key_idx, ccmp->key_set, ++ MAC_ARG(ccmp->tx_pn), MAC_ARG(ccmp->rx_pn), ++ ccmp->dot11RSNAStatsCCMPFormatErrors, ++ ccmp->dot11RSNAStatsCCMPReplays, ++ ccmp->dot11RSNAStatsCCMPDecryptErrors); ++ ++ return p; ++} ++ ++void ieee80211_ccmp_null(void) ++{ ++// printk("============>%s()\n", __FUNCTION__); ++ return; ++} ++ ++static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = { ++ .name = "CCMP", ++ .init = ieee80211_ccmp_init, ++ .deinit = ieee80211_ccmp_deinit, ++ .encrypt_mpdu = ieee80211_ccmp_encrypt, ++ .decrypt_mpdu = ieee80211_ccmp_decrypt, ++ .encrypt_msdu = NULL, ++ .decrypt_msdu = NULL, ++ .set_key = ieee80211_ccmp_set_key, ++ .get_key = ieee80211_ccmp_get_key, ++ .print_stats = ieee80211_ccmp_print_stats, ++ .extra_prefix_len = CCMP_HDR_LEN, ++ .extra_postfix_len = CCMP_MIC_LEN, ++ .owner = THIS_MODULE, ++}; ++ ++ ++int __init ieee80211_crypto_ccmp_init(void) ++{ ++ return ieee80211_register_crypto_ops(&ieee80211_crypt_ccmp); ++} ++ ++ ++void __exit ieee80211_crypto_ccmp_exit(void) ++{ ++ ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp); ++} ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_ccmp_null); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_ccmp_null); ++#endif ++ ++//module_init(ieee80211_crypto_ccmp_init); ++//module_exit(ieee80211_crypto_ccmp_exit); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c +@@ -0,0 +1,1034 @@ ++/* ++ * Host AP crypt: host-based TKIP encryption implementation for Host AP driver ++ * ++ * Copyright (c) 2003-2004, Jouni Malinen ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)) ++//#include "crypto_compat.h" ++#endif ++ ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#include "rtl_crypto.h" ++#else ++#include ++#endif ++//#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++ #include ++#else ++ #include ++#endif ++ ++#include ++ ++MODULE_AUTHOR("Jouni Malinen"); ++MODULE_DESCRIPTION("Host AP crypt: TKIP"); ++MODULE_LICENSE("GPL"); ++ ++#ifndef OPENSUSE_SLED ++#define OPENSUSE_SLED 0 ++#endif ++ ++struct ieee80211_tkip_data { ++#define TKIP_KEY_LEN 32 ++ u8 key[TKIP_KEY_LEN]; ++ int key_set; ++ ++ u32 tx_iv32; ++ u16 tx_iv16; ++ u16 tx_ttak[5]; ++ int tx_phase1_done; ++ ++ u32 rx_iv32; ++ u16 rx_iv16; ++ u16 rx_ttak[5]; ++ int rx_phase1_done; ++ u32 rx_iv32_new; ++ u16 rx_iv16_new; ++ ++ u32 dot11RSNAStatsTKIPReplays; ++ u32 dot11RSNAStatsTKIPICVErrors; ++ u32 dot11RSNAStatsTKIPLocalMICFailures; ++ ++ int key_idx; ++#if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) ++ struct crypto_blkcipher *rx_tfm_arc4; ++ struct crypto_hash *rx_tfm_michael; ++ struct crypto_blkcipher *tx_tfm_arc4; ++ struct crypto_hash *tx_tfm_michael; ++#else ++ struct crypto_tfm *tx_tfm_arc4; ++ struct crypto_tfm *tx_tfm_michael; ++ struct crypto_tfm *rx_tfm_arc4; ++ struct crypto_tfm *rx_tfm_michael; ++#endif ++ /* scratch buffers for virt_to_page() (crypto API) */ ++ u8 rx_hdr[16], tx_hdr[16]; ++}; ++ ++static void * ieee80211_tkip_init(int key_idx) ++{ ++ struct ieee80211_tkip_data *priv; ++ ++ priv = kmalloc(sizeof(*priv), GFP_ATOMIC); ++ if (priv == NULL) ++ goto fail; ++ memset(priv, 0, sizeof(*priv)); ++ priv->key_idx = key_idx; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ priv->tx_tfm_arc4 = crypto_alloc_tfm("arc4", 0); ++ if (priv->tx_tfm_arc4 == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API arc4\n"); ++ goto fail; ++ } ++ ++ priv->tx_tfm_michael = crypto_alloc_tfm("michael_mic", 0); ++ if (priv->tx_tfm_michael == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API michael_mic\n"); ++ goto fail; ++ } ++ ++ priv->rx_tfm_arc4 = crypto_alloc_tfm("arc4", 0); ++ if (priv->rx_tfm_arc4 == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API arc4\n"); ++ goto fail; ++ } ++ ++ priv->rx_tfm_michael = crypto_alloc_tfm("michael_mic", 0); ++ if (priv->rx_tfm_michael == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API michael_mic\n"); ++ goto fail; ++ } ++#else ++ priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->tx_tfm_arc4)) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API arc4\n"); ++ priv->tx_tfm_arc4 = NULL; ++ goto fail; ++ } ++ ++ priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0, ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->tx_tfm_michael)) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API michael_mic\n"); ++ priv->tx_tfm_michael = NULL; ++ goto fail; ++ } ++ ++ priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->rx_tfm_arc4)) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API arc4\n"); ++ priv->rx_tfm_arc4 = NULL; ++ goto fail; ++ } ++ ++ priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0, ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->rx_tfm_michael)) { ++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " ++ "crypto API michael_mic\n"); ++ priv->rx_tfm_michael = NULL; ++ goto fail; ++ } ++#endif ++ return priv; ++ ++fail: ++ if (priv) { ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (priv->tx_tfm_michael) ++ crypto_free_tfm(priv->tx_tfm_michael); ++ if (priv->tx_tfm_arc4) ++ crypto_free_tfm(priv->tx_tfm_arc4); ++ if (priv->rx_tfm_michael) ++ crypto_free_tfm(priv->rx_tfm_michael); ++ if (priv->rx_tfm_arc4) ++ crypto_free_tfm(priv->rx_tfm_arc4); ++ ++#else ++ if (priv->tx_tfm_michael) ++ crypto_free_hash(priv->tx_tfm_michael); ++ if (priv->tx_tfm_arc4) ++ crypto_free_blkcipher(priv->tx_tfm_arc4); ++ if (priv->rx_tfm_michael) ++ crypto_free_hash(priv->rx_tfm_michael); ++ if (priv->rx_tfm_arc4) ++ crypto_free_blkcipher(priv->rx_tfm_arc4); ++#endif ++ kfree(priv); ++ } ++ ++ return NULL; ++} ++ ++ ++static void ieee80211_tkip_deinit(void *priv) ++{ ++ struct ieee80211_tkip_data *_priv = priv; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (_priv->tx_tfm_michael) ++ crypto_free_tfm(_priv->tx_tfm_michael); ++ if (_priv->tx_tfm_arc4) ++ crypto_free_tfm(_priv->tx_tfm_arc4); ++ if (_priv->rx_tfm_michael) ++ crypto_free_tfm(_priv->rx_tfm_michael); ++ if (_priv->rx_tfm_arc4) ++ crypto_free_tfm(_priv->rx_tfm_arc4); ++#else ++ if (_priv) { ++ if (_priv->tx_tfm_michael) ++ crypto_free_hash(_priv->tx_tfm_michael); ++ if (_priv->tx_tfm_arc4) ++ crypto_free_blkcipher(_priv->tx_tfm_arc4); ++ if (_priv->rx_tfm_michael) ++ crypto_free_hash(_priv->rx_tfm_michael); ++ if (_priv->rx_tfm_arc4) ++ crypto_free_blkcipher(_priv->rx_tfm_arc4); ++ } ++#endif ++ kfree(priv); ++} ++ ++ ++static inline u16 RotR1(u16 val) ++{ ++ return (val >> 1) | (val << 15); ++} ++ ++ ++static inline u8 Lo8(u16 val) ++{ ++ return val & 0xff; ++} ++ ++ ++static inline u8 Hi8(u16 val) ++{ ++ return val >> 8; ++} ++ ++ ++static inline u16 Lo16(u32 val) ++{ ++ return val & 0xffff; ++} ++ ++ ++static inline u16 Hi16(u32 val) ++{ ++ return val >> 16; ++} ++ ++ ++static inline u16 Mk16(u8 hi, u8 lo) ++{ ++ return lo | (((u16) hi) << 8); ++} ++ ++ ++static inline u16 Mk16_le(u16 *v) ++{ ++ return le16_to_cpu(*v); ++} ++ ++ ++static const u16 Sbox[256] = ++{ ++ 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, ++ 0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A, ++ 0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B, ++ 0x41EC, 0xB367, 0x5FFD, 0x45EA, 0x23BF, 0x53F7, 0xE496, 0x9B5B, ++ 0x75C2, 0xE11C, 0x3DAE, 0x4C6A, 0x6C5A, 0x7E41, 0xF502, 0x834F, ++ 0x685C, 0x51F4, 0xD134, 0xF908, 0xE293, 0xAB73, 0x6253, 0x2A3F, ++ 0x080C, 0x9552, 0x4665, 0x9D5E, 0x3028, 0x37A1, 0x0A0F, 0x2FB5, ++ 0x0E09, 0x2436, 0x1B9B, 0xDF3D, 0xCD26, 0x4E69, 0x7FCD, 0xEA9F, ++ 0x121B, 0x1D9E, 0x5874, 0x342E, 0x362D, 0xDCB2, 0xB4EE, 0x5BFB, ++ 0xA4F6, 0x764D, 0xB761, 0x7DCE, 0x527B, 0xDD3E, 0x5E71, 0x1397, ++ 0xA6F5, 0xB968, 0x0000, 0xC12C, 0x4060, 0xE31F, 0x79C8, 0xB6ED, ++ 0xD4BE, 0x8D46, 0x67D9, 0x724B, 0x94DE, 0x98D4, 0xB0E8, 0x854A, ++ 0xBB6B, 0xC52A, 0x4FE5, 0xED16, 0x86C5, 0x9AD7, 0x6655, 0x1194, ++ 0x8ACF, 0xE910, 0x0406, 0xFE81, 0xA0F0, 0x7844, 0x25BA, 0x4BE3, ++ 0xA2F3, 0x5DFE, 0x80C0, 0x058A, 0x3FAD, 0x21BC, 0x7048, 0xF104, ++ 0x63DF, 0x77C1, 0xAF75, 0x4263, 0x2030, 0xE51A, 0xFD0E, 0xBF6D, ++ 0x814C, 0x1814, 0x2635, 0xC32F, 0xBEE1, 0x35A2, 0x88CC, 0x2E39, ++ 0x9357, 0x55F2, 0xFC82, 0x7A47, 0xC8AC, 0xBAE7, 0x322B, 0xE695, ++ 0xC0A0, 0x1998, 0x9ED1, 0xA37F, 0x4466, 0x547E, 0x3BAB, 0x0B83, ++ 0x8CCA, 0xC729, 0x6BD3, 0x283C, 0xA779, 0xBCE2, 0x161D, 0xAD76, ++ 0xDB3B, 0x6456, 0x744E, 0x141E, 0x92DB, 0x0C0A, 0x486C, 0xB8E4, ++ 0x9F5D, 0xBD6E, 0x43EF, 0xC4A6, 0x39A8, 0x31A4, 0xD337, 0xF28B, ++ 0xD532, 0x8B43, 0x6E59, 0xDAB7, 0x018C, 0xB164, 0x9CD2, 0x49E0, ++ 0xD8B4, 0xACFA, 0xF307, 0xCF25, 0xCAAF, 0xF48E, 0x47E9, 0x1018, ++ 0x6FD5, 0xF088, 0x4A6F, 0x5C72, 0x3824, 0x57F1, 0x73C7, 0x9751, ++ 0xCB23, 0xA17C, 0xE89C, 0x3E21, 0x96DD, 0x61DC, 0x0D86, 0x0F85, ++ 0xE090, 0x7C42, 0x71C4, 0xCCAA, 0x90D8, 0x0605, 0xF701, 0x1C12, ++ 0xC2A3, 0x6A5F, 0xAEF9, 0x69D0, 0x1791, 0x9958, 0x3A27, 0x27B9, ++ 0xD938, 0xEB13, 0x2BB3, 0x2233, 0xD2BB, 0xA970, 0x0789, 0x33A7, ++ 0x2DB6, 0x3C22, 0x1592, 0xC920, 0x8749, 0xAAFF, 0x5078, 0xA57A, ++ 0x038F, 0x59F8, 0x0980, 0x1A17, 0x65DA, 0xD731, 0x84C6, 0xD0B8, ++ 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, ++}; ++ ++ ++static inline u16 _S_(u16 v) ++{ ++ u16 t = Sbox[Hi8(v)]; ++ return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8)); ++} ++ ++ ++#define PHASE1_LOOP_COUNT 8 ++ ++ ++static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) ++{ ++ int i, j; ++ ++ /* Initialize the 80-bit TTAK from TSC (IV32) and TA[0..5] */ ++ TTAK[0] = Lo16(IV32); ++ TTAK[1] = Hi16(IV32); ++ TTAK[2] = Mk16(TA[1], TA[0]); ++ TTAK[3] = Mk16(TA[3], TA[2]); ++ TTAK[4] = Mk16(TA[5], TA[4]); ++ ++ for (i = 0; i < PHASE1_LOOP_COUNT; i++) { ++ j = 2 * (i & 1); ++ TTAK[0] += _S_(TTAK[4] ^ Mk16(TK[1 + j], TK[0 + j])); ++ TTAK[1] += _S_(TTAK[0] ^ Mk16(TK[5 + j], TK[4 + j])); ++ TTAK[2] += _S_(TTAK[1] ^ Mk16(TK[9 + j], TK[8 + j])); ++ TTAK[3] += _S_(TTAK[2] ^ Mk16(TK[13 + j], TK[12 + j])); ++ TTAK[4] += _S_(TTAK[3] ^ Mk16(TK[1 + j], TK[0 + j])) + i; ++ } ++} ++ ++ ++static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, ++ u16 IV16) ++{ ++ /* Make temporary area overlap WEP seed so that the final copy can be ++ * avoided on little endian hosts. */ ++ u16 *PPK = (u16 *) &WEPSeed[4]; ++ ++ /* Step 1 - make copy of TTAK and bring in TSC */ ++ PPK[0] = TTAK[0]; ++ PPK[1] = TTAK[1]; ++ PPK[2] = TTAK[2]; ++ PPK[3] = TTAK[3]; ++ PPK[4] = TTAK[4]; ++ PPK[5] = TTAK[4] + IV16; ++ ++ /* Step 2 - 96-bit bijective mixing using S-box */ ++ PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) &TK[0])); ++ PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) &TK[2])); ++ PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) &TK[4])); ++ PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) &TK[6])); ++ PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) &TK[8])); ++ PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) &TK[10])); ++ ++ PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) &TK[12])); ++ PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) &TK[14])); ++ PPK[2] += RotR1(PPK[1]); ++ PPK[3] += RotR1(PPK[2]); ++ PPK[4] += RotR1(PPK[3]); ++ PPK[5] += RotR1(PPK[4]); ++ ++ /* Step 3 - bring in last of TK bits, assign 24-bit WEP IV value ++ * WEPSeed[0..2] is transmitted as WEP IV */ ++ WEPSeed[0] = Hi8(IV16); ++ WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F; ++ WEPSeed[2] = Lo8(IV16); ++ WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((u16 *) &TK[0])) >> 1); ++ ++#ifdef __BIG_ENDIAN ++ { ++ int i; ++ for (i = 0; i < 6; i++) ++ PPK[i] = (PPK[i] << 8) | (PPK[i] >> 8); ++ } ++#endif ++} ++ ++ ++static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ int len; ++ u8 *pos; ++ struct ieee80211_hdr_4addr *hdr; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ ++ #if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) ++ struct blkcipher_desc desc = {.tfm = tkey->tx_tfm_arc4}; ++ int ret = 0; ++ #endif ++ u8 rc4key[16], *icv; ++ u32 crc; ++ struct scatterlist sg; ++ ++ if (skb_headroom(skb) < 8 || skb_tailroom(skb) < 4 || ++ skb->len < hdr_len) ++ return -1; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ ++#if 0 ++printk("@@ tkey\n"); ++printk("%x|", ((u32*)tkey->key)[0]); ++printk("%x|", ((u32*)tkey->key)[1]); ++printk("%x|", ((u32*)tkey->key)[2]); ++printk("%x|", ((u32*)tkey->key)[3]); ++printk("%x|", ((u32*)tkey->key)[4]); ++printk("%x|", ((u32*)tkey->key)[5]); ++printk("%x|", ((u32*)tkey->key)[6]); ++printk("%x\n", ((u32*)tkey->key)[7]); ++#endif ++ ++ if (!tcb_desc->bHwSec) ++ { ++ if (!tkey->tx_phase1_done) { ++ tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2, ++ tkey->tx_iv32); ++ tkey->tx_phase1_done = 1; ++ } ++ tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16); ++ } ++ else ++ tkey->tx_phase1_done = 1; ++ ++ ++ len = skb->len - hdr_len; ++ pos = skb_push(skb, 8); ++ memmove(pos, pos + 8, hdr_len); ++ pos += hdr_len; ++ ++ if (tcb_desc->bHwSec) ++ { ++ *pos++ = Hi8(tkey->tx_iv16); ++ *pos++ = (Hi8(tkey->tx_iv16) | 0x20) & 0x7F; ++ *pos++ = Lo8(tkey->tx_iv16); ++ } ++ else ++ { ++ *pos++ = rc4key[0]; ++ *pos++ = rc4key[1]; ++ *pos++ = rc4key[2]; ++ } ++ ++ *pos++ = (tkey->key_idx << 6) | (1 << 5) /* Ext IV included */; ++ *pos++ = tkey->tx_iv32 & 0xff; ++ *pos++ = (tkey->tx_iv32 >> 8) & 0xff; ++ *pos++ = (tkey->tx_iv32 >> 16) & 0xff; ++ *pos++ = (tkey->tx_iv32 >> 24) & 0xff; ++ ++ if (!tcb_desc->bHwSec) ++ { ++ icv = skb_put(skb, 4); ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ crc = ~crc32_le(~0, pos, len); ++#else ++ crc = ~ether_crc_le(len, pos); ++#endif ++ icv[0] = crc; ++ icv[1] = crc >> 8; ++ icv[2] = crc >> 16; ++ icv[3] = crc >> 24; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ crypto_cipher_setkey(tkey->tx_tfm_arc4, rc4key, 16); ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = len + 4; ++ crypto_cipher_encrypt(tkey->tx_tfm_arc4, &sg, &sg, len + 4); ++#else ++ crypto_blkcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16); ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = len + 4; ++#else ++ sg_init_one(&sg, pos, len+4); ++#endif ++ ret= crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); ++#endif ++ ++ } ++ ++ tkey->tx_iv16++; ++ if (tkey->tx_iv16 == 0) { ++ tkey->tx_phase1_done = 0; ++ tkey->tx_iv32++; ++ } ++ ++ if (!tcb_desc->bHwSec) ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ return 0; ++ #else ++ return ret; ++ #endif ++ else ++ return 0; ++ ++ ++} ++ ++static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ u8 keyidx, *pos; ++ u32 iv32; ++ u16 iv16; ++ struct ieee80211_hdr_4addr *hdr; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ #if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) ++ struct blkcipher_desc desc = {.tfm = tkey->rx_tfm_arc4}; ++ #endif ++ u8 rc4key[16]; ++ u8 icv[4]; ++ u32 crc; ++ struct scatterlist sg; ++ int plen; ++ if (skb->len < hdr_len + 8 + 4) ++ return -1; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ pos = skb->data + hdr_len; ++ keyidx = pos[3]; ++ if (!(keyidx & (1 << 5))) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "TKIP: received packet without ExtIV" ++ " flag from " MAC_FMT "\n", MAC_ARG(hdr->addr2)); ++ } ++ return -2; ++ } ++ keyidx >>= 6; ++ if (tkey->key_idx != keyidx) { ++ printk(KERN_DEBUG "TKIP: RX tkey->key_idx=%d frame " ++ "keyidx=%d priv=%p\n", tkey->key_idx, keyidx, priv); ++ return -6; ++ } ++ if (!tkey->key_set) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "TKIP: received packet from " MAC_FMT ++ " with keyid=%d that does not have a configured" ++ " key\n", MAC_ARG(hdr->addr2), keyidx); ++ } ++ return -3; ++ } ++ iv16 = (pos[0] << 8) | pos[2]; ++ iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24); ++ pos += 8; ++ ++ if (!tcb_desc->bHwSec) ++ { ++ if (iv32 < tkey->rx_iv32 || ++ (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "TKIP: replay detected: STA=" MAC_FMT ++ " previous TSC %08x%04x received TSC " ++ "%08x%04x\n", MAC_ARG(hdr->addr2), ++ tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); ++ } ++ tkey->dot11RSNAStatsTKIPReplays++; ++ return -4; ++ } ++ ++ if (iv32 != tkey->rx_iv32 || !tkey->rx_phase1_done) { ++ tkip_mixing_phase1(tkey->rx_ttak, tkey->key, hdr->addr2, iv32); ++ tkey->rx_phase1_done = 1; ++ } ++ tkip_mixing_phase2(rc4key, tkey->key, tkey->rx_ttak, iv16); ++ ++ plen = skb->len - hdr_len - 12; ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ crypto_cipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = plen + 4; ++ crypto_cipher_decrypt(tkey->rx_tfm_arc4, &sg, &sg, plen + 4); ++#else ++ crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = plen + 4; ++#else ++ sg_init_one(&sg, pos, plen+4); ++#endif ++ if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG ": TKIP: failed to decrypt " ++ "received packet from " MAC_FMT "\n", ++ MAC_ARG(hdr->addr2)); ++ } ++ return -7; ++ } ++#endif ++ ++ #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ crc = ~crc32_le(~0, pos, plen); ++ #else ++ crc = ~ether_crc_le(plen, pos); ++ #endif ++ icv[0] = crc; ++ icv[1] = crc >> 8; ++ icv[2] = crc >> 16; ++ icv[3] = crc >> 24; ++ ++ if (memcmp(icv, pos + plen, 4) != 0) { ++ if (iv32 != tkey->rx_iv32) { ++ /* Previously cached Phase1 result was already lost, so ++ * it needs to be recalculated for the next packet. */ ++ tkey->rx_phase1_done = 0; ++ } ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "TKIP: ICV error detected: STA=" ++ MAC_FMT "\n", MAC_ARG(hdr->addr2)); ++ } ++ tkey->dot11RSNAStatsTKIPICVErrors++; ++ return -5; ++ } ++ ++ } ++ ++ /* Update real counters only after Michael MIC verification has ++ * completed */ ++ tkey->rx_iv32_new = iv32; ++ tkey->rx_iv16_new = iv16; ++ ++ /* Remove IV and ICV */ ++ memmove(skb->data + 8, skb->data, hdr_len); ++ skb_pull(skb, 8); ++ skb_trim(skb, skb->len - 4); ++ ++//john's test ++#ifdef JOHN_DUMP ++if( ((u16*)skb->data)[0] & 0x4000){ ++ printk("@@ rx decrypted skb->data"); ++ int i; ++ for(i=0;ilen;i++){ ++ if( (i%24)==0 ) printk("\n"); ++ printk("%2x ", ((u8*)skb->data)[i]); ++ } ++ printk("\n"); ++} ++#endif /*JOHN_DUMP*/ ++ return keyidx; ++} ++ ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++static int michael_mic(struct crypto_tfm * tfm_michael, u8 *key, u8 *hdr, ++ u8 *data, size_t data_len, u8 *mic) ++{ ++ struct scatterlist sg[2]; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ struct hash_desc desc; ++ int ret = 0; ++#endif ++ ++ if (tfm_michael == NULL){ ++ printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); ++ return -1; ++ } ++ sg[0].page = virt_to_page(hdr); ++ sg[0].offset = offset_in_page(hdr); ++ sg[0].length = 16; ++ ++ sg[1].page = virt_to_page(data); ++ sg[1].offset = offset_in_page(data); ++ sg[1].length = data_len; ++ ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++ crypto_digest_init(tfm_michael); ++ crypto_digest_setkey(tfm_michael, key, 8); ++ crypto_digest_update(tfm_michael, sg, 2); ++ crypto_digest_final(tfm_michael, mic); ++ return 0; ++#else ++if (crypto_hash_setkey(tkey->tfm_michael, key, 8)) ++ return -1; ++ ++// return 0; ++ desc.tfm = tkey->tfm_michael; ++ desc.flags = 0; ++ ret = crypto_hash_digest(&desc, sg, data_len + 16, mic); ++ return ret; ++#endif ++} ++#else ++static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr, ++ u8 * data, size_t data_len, u8 * mic) ++{ ++ struct hash_desc desc; ++ struct scatterlist sg[2]; ++ ++ if (tfm_michael == NULL) { ++ printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); ++ return -1; ++ } ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ++ sg[0].page = virt_to_page(hdr); ++ sg[0].offset = offset_in_page(hdr); ++ sg[0].length = 16; ++ ++ sg[1].page = virt_to_page(data); ++ sg[1].offset = offset_in_page(data); ++ sg[1].length = data_len; ++#else ++ sg_init_table(sg, 2); ++ sg_set_buf(&sg[0], hdr, 16); ++ sg_set_buf(&sg[1], data, data_len); ++#endif ++ ++ if (crypto_hash_setkey(tfm_michael, key, 8)) ++ return -1; ++ ++ desc.tfm = tfm_michael; ++ desc.flags = 0; ++ return crypto_hash_digest(&desc, sg, data_len + 16, mic); ++} ++#endif ++ ++ ++ ++static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) ++{ ++ struct ieee80211_hdr_4addr *hdr11; ++ ++ hdr11 = (struct ieee80211_hdr_4addr *) skb->data; ++ switch (le16_to_cpu(hdr11->frame_ctl) & ++ (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { ++ case IEEE80211_FCTL_TODS: ++ memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */ ++ memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */ ++ break; ++ case IEEE80211_FCTL_FROMDS: ++ memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */ ++ memcpy(hdr + ETH_ALEN, hdr11->addr3, ETH_ALEN); /* SA */ ++ break; ++ case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: ++ memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */ ++ memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */ ++ break; ++ case 0: ++ memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */ ++ memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */ ++ break; ++ } ++ ++ hdr[12] = 0; /* priority */ ++ ++ hdr[13] = hdr[14] = hdr[15] = 0; /* reserved */ ++} ++ ++ ++static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ u8 *pos; ++ struct ieee80211_hdr_4addr *hdr; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ ++ if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { ++ printk(KERN_DEBUG "Invalid packet for Michael MIC add " ++ "(tailroom=%d hdr_len=%d skb->len=%d)\n", ++ skb_tailroom(skb), hdr_len, skb->len); ++ return -1; ++ } ++ ++ michael_mic_hdr(skb, tkey->tx_hdr); ++ ++ // { david, 2006.9.1 ++ // fix the wpa process with wmm enabled. ++ if(IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) { ++ tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; ++ } ++ // } ++ pos = skb_put(skb, 8); ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, ++ skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) ++#else ++ if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, ++ skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) ++#endif ++ return -1; ++ ++ return 0; ++} ++ ++ ++#if WIRELESS_EXT >= 18 ++static void ieee80211_michael_mic_failure(struct net_device *dev, ++ struct ieee80211_hdr_4addr *hdr, ++ int keyidx) ++{ ++ union iwreq_data wrqu; ++ struct iw_michaelmicfailure ev; ++ ++ /* TODO: needed parameters: count, keyid, key type, TSC */ ++ memset(&ev, 0, sizeof(ev)); ++ ev.flags = keyidx & IW_MICFAILURE_KEY_ID; ++ if (hdr->addr1[0] & 0x01) ++ ev.flags |= IW_MICFAILURE_GROUP; ++ else ++ ev.flags |= IW_MICFAILURE_PAIRWISE; ++ ev.src_addr.sa_family = ARPHRD_ETHER; ++ memcpy(ev.src_addr.sa_data, hdr->addr2, ETH_ALEN); ++ memset(&wrqu, 0, sizeof(wrqu)); ++ wrqu.data.length = sizeof(ev); ++ wireless_send_event(dev, IWEVMICHAELMICFAILURE, &wrqu, (char *) &ev); ++} ++#elif WIRELESS_EXT >= 15 ++static void ieee80211_michael_mic_failure(struct net_device *dev, ++ struct ieee80211_hdr_4addr *hdr, ++ int keyidx) ++{ ++ union iwreq_data wrqu; ++ char buf[128]; ++ ++ /* TODO: needed parameters: count, keyid, key type, TSC */ ++ sprintf(buf, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr=" ++ MAC_FMT ")", keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni", ++ MAC_ARG(hdr->addr2)); ++ memset(&wrqu, 0, sizeof(wrqu)); ++ wrqu.data.length = strlen(buf); ++ wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); ++} ++#else /* WIRELESS_EXT >= 15 */ ++static inline void ieee80211_michael_mic_failure(struct net_device *dev, ++ struct ieee80211_hdr_4addr *hdr, ++ int keyidx) ++{ ++} ++#endif /* WIRELESS_EXT >= 15 */ ++ ++static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, ++ int hdr_len, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ u8 mic[8]; ++ struct ieee80211_hdr_4addr *hdr; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ ++ if (!tkey->key_set) ++ return -1; ++ ++ michael_mic_hdr(skb, tkey->rx_hdr); ++ // { david, 2006.9.1 ++ // fix the wpa process with wmm enabled. ++ if(IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) { ++ tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; ++ } ++ // } ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, ++ skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) ++#else ++ if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, ++ skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) ++#endif ++ return -1; ++ if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { ++ struct ieee80211_hdr_4addr *hdr; ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ printk(KERN_DEBUG "%s: Michael MIC verification failed for " ++ "MSDU from " MAC_FMT " keyidx=%d\n", ++ skb->dev ? skb->dev->name : "N/A", MAC_ARG(hdr->addr2), ++ keyidx); ++ if (skb->dev) ++ ieee80211_michael_mic_failure(skb->dev, hdr, keyidx); ++ tkey->dot11RSNAStatsTKIPLocalMICFailures++; ++ return -1; ++ } ++ ++ /* Update TSC counters for RX now that the packet verification has ++ * completed. */ ++ tkey->rx_iv32 = tkey->rx_iv32_new; ++ tkey->rx_iv16 = tkey->rx_iv16_new; ++ ++ skb_trim(skb, skb->len - 8); ++ ++ return 0; ++} ++ ++ ++static int ieee80211_tkip_set_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ int keyidx; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ struct crypto_tfm *tfm = tkey->tx_tfm_michael; ++ struct crypto_tfm *tfm2 = tkey->tx_tfm_arc4; ++ struct crypto_tfm *tfm3 = tkey->rx_tfm_michael; ++ struct crypto_tfm *tfm4 = tkey->rx_tfm_arc4; ++#else ++ struct crypto_hash *tfm = tkey->tx_tfm_michael; ++ struct crypto_blkcipher *tfm2 = tkey->tx_tfm_arc4; ++ struct crypto_hash *tfm3 = tkey->rx_tfm_michael; ++ struct crypto_blkcipher *tfm4 = tkey->rx_tfm_arc4; ++#endif ++ ++ keyidx = tkey->key_idx; ++ memset(tkey, 0, sizeof(*tkey)); ++ tkey->key_idx = keyidx; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ tkey->tx_tfm_michael = tfm; ++ tkey->tx_tfm_arc4 = tfm2; ++ tkey->rx_tfm_michael = tfm3; ++ tkey->rx_tfm_arc4 = tfm4; ++#else ++ tkey->tx_tfm_michael = tfm; ++ tkey->tx_tfm_arc4 = tfm2; ++ tkey->rx_tfm_michael = tfm3; ++ tkey->rx_tfm_arc4 = tfm4; ++#endif ++ ++ if (len == TKIP_KEY_LEN) { ++ memcpy(tkey->key, key, TKIP_KEY_LEN); ++ tkey->key_set = 1; ++ tkey->tx_iv16 = 1; /* TSC is initialized to 1 */ ++ if (seq) { ++ tkey->rx_iv32 = (seq[5] << 24) | (seq[4] << 16) | ++ (seq[3] << 8) | seq[2]; ++ tkey->rx_iv16 = (seq[1] << 8) | seq[0]; ++ } ++ } else if (len == 0) ++ tkey->key_set = 0; ++ else ++ return -1; ++ ++ return 0; ++} ++ ++ ++static int ieee80211_tkip_get_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct ieee80211_tkip_data *tkey = priv; ++ ++ if (len < TKIP_KEY_LEN) ++ return -1; ++ ++ if (!tkey->key_set) ++ return 0; ++ memcpy(key, tkey->key, TKIP_KEY_LEN); ++ ++ if (seq) { ++ /* Return the sequence number of the last transmitted frame. */ ++ u16 iv16 = tkey->tx_iv16; ++ u32 iv32 = tkey->tx_iv32; ++ if (iv16 == 0) ++ iv32--; ++ iv16--; ++ seq[0] = tkey->tx_iv16; ++ seq[1] = tkey->tx_iv16 >> 8; ++ seq[2] = tkey->tx_iv32; ++ seq[3] = tkey->tx_iv32 >> 8; ++ seq[4] = tkey->tx_iv32 >> 16; ++ seq[5] = tkey->tx_iv32 >> 24; ++ } ++ ++ return TKIP_KEY_LEN; ++} ++ ++ ++static char * ieee80211_tkip_print_stats(char *p, void *priv) ++{ ++ struct ieee80211_tkip_data *tkip = priv; ++ p += sprintf(p, "key[%d] alg=TKIP key_set=%d " ++ "tx_pn=%02x%02x%02x%02x%02x%02x " ++ "rx_pn=%02x%02x%02x%02x%02x%02x " ++ "replays=%d icv_errors=%d local_mic_failures=%d\n", ++ tkip->key_idx, tkip->key_set, ++ (tkip->tx_iv32 >> 24) & 0xff, ++ (tkip->tx_iv32 >> 16) & 0xff, ++ (tkip->tx_iv32 >> 8) & 0xff, ++ tkip->tx_iv32 & 0xff, ++ (tkip->tx_iv16 >> 8) & 0xff, ++ tkip->tx_iv16 & 0xff, ++ (tkip->rx_iv32 >> 24) & 0xff, ++ (tkip->rx_iv32 >> 16) & 0xff, ++ (tkip->rx_iv32 >> 8) & 0xff, ++ tkip->rx_iv32 & 0xff, ++ (tkip->rx_iv16 >> 8) & 0xff, ++ tkip->rx_iv16 & 0xff, ++ tkip->dot11RSNAStatsTKIPReplays, ++ tkip->dot11RSNAStatsTKIPICVErrors, ++ tkip->dot11RSNAStatsTKIPLocalMICFailures); ++ return p; ++} ++ ++ ++static struct ieee80211_crypto_ops ieee80211_crypt_tkip = { ++ .name = "TKIP", ++ .init = ieee80211_tkip_init, ++ .deinit = ieee80211_tkip_deinit, ++ .encrypt_mpdu = ieee80211_tkip_encrypt, ++ .decrypt_mpdu = ieee80211_tkip_decrypt, ++ .encrypt_msdu = ieee80211_michael_mic_add, ++ .decrypt_msdu = ieee80211_michael_mic_verify, ++ .set_key = ieee80211_tkip_set_key, ++ .get_key = ieee80211_tkip_get_key, ++ .print_stats = ieee80211_tkip_print_stats, ++ .extra_prefix_len = 4 + 4, /* IV + ExtIV */ ++ .extra_postfix_len = 8 + 4, /* MIC + ICV */ ++ .owner = THIS_MODULE, ++}; ++ ++ ++int __init ieee80211_crypto_tkip_init(void) ++{ ++ return ieee80211_register_crypto_ops(&ieee80211_crypt_tkip); ++} ++ ++ ++void __exit ieee80211_crypto_tkip_exit(void) ++{ ++ ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip); ++} ++ ++void ieee80211_tkip_null(void) ++{ ++// printk("============>%s()\n", __FUNCTION__); ++ return; ++} ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_tkip_null); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_tkip_null); ++#endif ++ ++//module_init(ieee80211_crypto_tkip_init); ++//module_exit(ieee80211_crypto_tkip_exit); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c +@@ -0,0 +1,397 @@ ++/* ++ * Host AP crypt: host-based WEP encryption implementation for Host AP driver ++ * ++ * Copyright (c) 2002-2004, Jouni Malinen ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)) ++//#include "crypto_compat.h" ++#endif ++ ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#include "rtl_crypto.h" ++#else ++#include ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++ #include ++#else ++ #include ++#endif ++//#include ++#include ++// ++/* ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++#include "rtl_crypto.h" ++#else ++#include ++#endif ++ ++#include ++#include ++*/ ++MODULE_AUTHOR("Jouni Malinen"); ++MODULE_DESCRIPTION("Host AP crypt: WEP"); ++MODULE_LICENSE("GPL"); ++#ifndef OPENSUSE_SLED ++#define OPENSUSE_SLED 0 ++#endif ++ ++struct prism2_wep_data { ++ u32 iv; ++#define WEP_KEY_LEN 13 ++ u8 key[WEP_KEY_LEN + 1]; ++ u8 key_len; ++ u8 key_idx; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ struct crypto_tfm *tfm; ++ #else ++ struct crypto_blkcipher *tx_tfm; ++ struct crypto_blkcipher *rx_tfm; ++ #endif ++}; ++ ++ ++static void * prism2_wep_init(int keyidx) ++{ ++ struct prism2_wep_data *priv; ++ ++ priv = kmalloc(sizeof(*priv), GFP_ATOMIC); ++ if (priv == NULL) ++ goto fail; ++ memset(priv, 0, sizeof(*priv)); ++ priv->key_idx = keyidx; ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ priv->tfm = crypto_alloc_tfm("arc4", 0); ++ if (priv->tfm == NULL) { ++ printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " ++ "crypto API arc4\n"); ++ goto fail; ++ } ++ #else ++ priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->tx_tfm)) { ++ printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " ++ "crypto API arc4\n"); ++ priv->tx_tfm = NULL; ++ goto fail; ++ } ++ priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(priv->rx_tfm)) { ++ printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " ++ "crypto API arc4\n"); ++ priv->rx_tfm = NULL; ++ goto fail; ++ } ++ #endif ++ ++ /* start WEP IV from a random value */ ++ get_random_bytes(&priv->iv, 4); ++ ++ return priv; ++ ++fail: ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (priv) { ++ if (priv->tfm) ++ crypto_free_tfm(priv->tfm); ++ kfree(priv); ++ } ++ #else ++ if (priv) { ++ if (priv->tx_tfm) ++ crypto_free_blkcipher(priv->tx_tfm); ++ if (priv->rx_tfm) ++ crypto_free_blkcipher(priv->rx_tfm); ++ kfree(priv); ++ } ++ #endif ++ return NULL; ++} ++ ++ ++static void prism2_wep_deinit(void *priv) ++{ ++ struct prism2_wep_data *_priv = priv; ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ if (_priv && _priv->tfm) ++ crypto_free_tfm(_priv->tfm); ++ #else ++ if (_priv) { ++ if (_priv->tx_tfm) ++ crypto_free_blkcipher(_priv->tx_tfm); ++ if (_priv->rx_tfm) ++ crypto_free_blkcipher(_priv->rx_tfm); ++ } ++ #endif ++ kfree(priv); ++} ++ ++/* Perform WEP encryption on given skb that has at least 4 bytes of headroom ++ * for IV and 4 bytes of tailroom for ICV. Both IV and ICV will be transmitted, ++ * so the payload length increases with 8 bytes. ++ * ++ * WEP frame payload: IV + TX key idx, RC4(data), ICV = RC4(CRC32(data)) ++ */ ++static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct prism2_wep_data *wep = priv; ++ u32 klen, len; ++ u8 key[WEP_KEY_LEN + 3]; ++ u8 *pos; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ #if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) ++ struct blkcipher_desc desc = {.tfm = wep->tx_tfm}; ++ #endif ++ u32 crc; ++ u8 *icv; ++ struct scatterlist sg; ++ if (skb_headroom(skb) < 4 || skb_tailroom(skb) < 4 || ++ skb->len < hdr_len) ++ return -1; ++ ++ len = skb->len - hdr_len; ++ pos = skb_push(skb, 4); ++ memmove(pos, pos + 4, hdr_len); ++ pos += hdr_len; ++ ++ klen = 3 + wep->key_len; ++ ++ wep->iv++; ++ ++ /* Fluhrer, Mantin, and Shamir have reported weaknesses in the key ++ * scheduling algorithm of RC4. At least IVs (KeyByte + 3, 0xff, N) ++ * can be used to speedup attacks, so avoid using them. */ ++ if ((wep->iv & 0xff00) == 0xff00) { ++ u8 B = (wep->iv >> 16) & 0xff; ++ if (B >= 3 && B < klen) ++ wep->iv += 0x0100; ++ } ++ ++ /* Prepend 24-bit IV to RC4 key and TX frame */ ++ *pos++ = key[0] = (wep->iv >> 16) & 0xff; ++ *pos++ = key[1] = (wep->iv >> 8) & 0xff; ++ *pos++ = key[2] = wep->iv & 0xff; ++ *pos++ = wep->key_idx << 6; ++ ++ /* Copy rest of the WEP key (the secret part) */ ++ memcpy(key + 3, wep->key, wep->key_len); ++ ++ if (!tcb_desc->bHwSec) ++ { ++ ++ /* Append little-endian CRC32 and encrypt it to produce ICV */ ++ #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ crc = ~crc32_le(~0, pos, len); ++ #else ++ crc = ~ether_crc_le(len, pos); ++ #endif ++ icv = skb_put(skb, 4); ++ icv[0] = crc; ++ icv[1] = crc >> 8; ++ icv[2] = crc >> 16; ++ icv[3] = crc >> 24; ++ ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ crypto_cipher_setkey(wep->tfm, key, klen); ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = len + 4; ++ crypto_cipher_encrypt(wep->tfm, &sg, &sg, len + 4); ++ return 0; ++ #else ++ crypto_blkcipher_setkey(wep->tx_tfm, key, klen); ++ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = len + 4; ++ #else ++ sg_init_one(&sg, pos, len+4); ++ #endif ++ return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); ++ #endif ++ } ++ ++ return 0; ++} ++ ++ ++/* Perform WEP decryption on given buffer. Buffer includes whole WEP part of ++ * the frame: IV (4 bytes), encrypted payload (including SNAP header), ++ * ICV (4 bytes). len includes both IV and ICV. ++ * ++ * Returns 0 if frame was decrypted successfully and ICV was correct and -1 on ++ * failure. If frame is OK, IV and ICV will be removed. ++ */ ++static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ++{ ++ struct prism2_wep_data *wep = priv; ++ u32 klen, plen; ++ u8 key[WEP_KEY_LEN + 3]; ++ u8 keyidx, *pos; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ #if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)) || (OPENSUSE_SLED)) ++ struct blkcipher_desc desc = {.tfm = wep->rx_tfm}; ++ #endif ++ u32 crc; ++ u8 icv[4]; ++ struct scatterlist sg; ++ if (skb->len < hdr_len + 8) ++ return -1; ++ ++ pos = skb->data + hdr_len; ++ key[0] = *pos++; ++ key[1] = *pos++; ++ key[2] = *pos++; ++ keyidx = *pos++ >> 6; ++ if (keyidx != wep->key_idx) ++ return -1; ++ ++ klen = 3 + wep->key_len; ++ ++ /* Copy rest of the WEP key (the secret part) */ ++ memcpy(key + 3, wep->key, wep->key_len); ++ ++ /* Apply RC4 to data and compute CRC32 over decrypted data */ ++ plen = skb->len - hdr_len - 8; ++ ++ if (!tcb_desc->bHwSec) ++ { ++#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!OPENSUSE_SLED)) ++ crypto_cipher_setkey(wep->tfm, key, klen); ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = plen + 4; ++ crypto_cipher_decrypt(wep->tfm, &sg, &sg, plen + 4); ++ #else ++ crypto_blkcipher_setkey(wep->rx_tfm, key, klen); ++ #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ sg.page = virt_to_page(pos); ++ sg.offset = offset_in_page(pos); ++ sg.length = plen + 4; ++ #else ++ sg_init_one(&sg, pos, plen+4); ++ #endif ++ if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) ++ return -7; ++ #endif ++ #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ crc = ~crc32_le(~0, pos, plen); ++ #else ++ crc = ~ether_crc_le(plen, pos); ++ #endif ++ icv[0] = crc; ++ icv[1] = crc >> 8; ++ icv[2] = crc >> 16; ++ icv[3] = crc >> 24; ++ if (memcmp(icv, pos + plen, 4) != 0) { ++ /* ICV mismatch - drop frame */ ++ return -2; ++ } ++ } ++ /* Remove IV and ICV */ ++ memmove(skb->data + 4, skb->data, hdr_len); ++ skb_pull(skb, 4); ++ skb_trim(skb, skb->len - 4); ++ ++ return 0; ++} ++ ++ ++static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct prism2_wep_data *wep = priv; ++ ++ if (len < 0 || len > WEP_KEY_LEN) ++ return -1; ++ ++ memcpy(wep->key, key, len); ++ wep->key_len = len; ++ ++ return 0; ++} ++ ++ ++static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) ++{ ++ struct prism2_wep_data *wep = priv; ++ ++ if (len < wep->key_len) ++ return -1; ++ ++ memcpy(key, wep->key, wep->key_len); ++ ++ return wep->key_len; ++} ++ ++ ++static char * prism2_wep_print_stats(char *p, void *priv) ++{ ++ struct prism2_wep_data *wep = priv; ++ p += sprintf(p, "key[%d] alg=WEP len=%d\n", ++ wep->key_idx, wep->key_len); ++ return p; ++} ++ ++ ++static struct ieee80211_crypto_ops ieee80211_crypt_wep = { ++ .name = "WEP", ++ .init = prism2_wep_init, ++ .deinit = prism2_wep_deinit, ++ .encrypt_mpdu = prism2_wep_encrypt, ++ .decrypt_mpdu = prism2_wep_decrypt, ++ .encrypt_msdu = NULL, ++ .decrypt_msdu = NULL, ++ .set_key = prism2_wep_set_key, ++ .get_key = prism2_wep_get_key, ++ .print_stats = prism2_wep_print_stats, ++ .extra_prefix_len = 4, /* IV */ ++ .extra_postfix_len = 4, /* ICV */ ++ .owner = THIS_MODULE, ++}; ++ ++ ++int __init ieee80211_crypto_wep_init(void) ++{ ++ return ieee80211_register_crypto_ops(&ieee80211_crypt_wep); ++} ++ ++ ++void __exit ieee80211_crypto_wep_exit(void) ++{ ++ ieee80211_unregister_crypto_ops(&ieee80211_crypt_wep); ++} ++ ++void ieee80211_wep_null(void) ++{ ++// printk("============>%s()\n", __FUNCTION__); ++ return; ++} ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_wep_null); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_wep_null); ++#endif ++ ++//module_init(ieee80211_crypto_wep_init); ++//module_exit(ieee80211_crypto_wep_exit); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c +@@ -0,0 +1,432 @@ ++/******************************************************************************* ++ ++ Copyright(c) 2004 Intel Corporation. All rights reserved. ++ ++ Portions of this file are based on the WEP enablement code provided by the ++ Host AP project hostap-drivers v0.1.3 ++ Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ ++ Copyright (c) 2002-2003, Jouni Malinen ++ ++ 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., 59 ++ Temple Place - Suite 330, Boston, MA 02111-1307, 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 ++ ++*******************************************************************************/ ++ ++#include ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++ ++MODULE_DESCRIPTION("802.11 data/management/control stack"); ++MODULE_AUTHOR("Copyright (C) 2004 Intel Corporation "); ++MODULE_LICENSE("GPL"); ++ ++#define DRV_NAME "ieee80211" ++ ++static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) ++{ ++ if (ieee->networks) ++ return 0; ++ ++ ieee->networks = kmalloc( ++ MAX_NETWORK_COUNT * sizeof(struct ieee80211_network), ++ GFP_KERNEL); ++ if (!ieee->networks) { ++ printk(KERN_WARNING "%s: Out of memory allocating beacons\n", ++ ieee->dev->name); ++ return -ENOMEM; ++ } ++ ++ memset(ieee->networks, 0, ++ MAX_NETWORK_COUNT * sizeof(struct ieee80211_network)); ++ ++ return 0; ++} ++ ++static inline void ieee80211_networks_free(struct ieee80211_device *ieee) ++{ ++ if (!ieee->networks) ++ return; ++ kfree(ieee->networks); ++ ieee->networks = NULL; ++} ++ ++static inline void ieee80211_networks_initialize(struct ieee80211_device *ieee) ++{ ++ int i; ++ ++ INIT_LIST_HEAD(&ieee->network_free_list); ++ INIT_LIST_HEAD(&ieee->network_list); ++ for (i = 0; i < MAX_NETWORK_COUNT; i++) ++ list_add_tail(&ieee->networks[i].list, &ieee->network_free_list); ++} ++ ++ ++struct net_device *alloc_ieee80211(int sizeof_priv) ++{ ++ struct ieee80211_device *ieee; ++ struct net_device *dev; ++ int i,err; ++ ++ IEEE80211_DEBUG_INFO("Initializing...\n"); ++ ++ dev = alloc_etherdev(sizeof(struct ieee80211_device) + sizeof_priv); ++ if (!dev) { ++ IEEE80211_ERROR("Unable to network device.\n"); ++ goto failed; ++ } ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) ++ ieee = netdev_priv(dev); ++#else ++ ieee = (struct ieee80211_device *)dev->priv; ++#endif ++#if 0 ++ dev->hard_start_xmit = ieee80211_xmit; ++#endif ++ ++ memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); ++ ieee->dev = dev; ++ ++ err = ieee80211_networks_allocate(ieee); ++ if (err) { ++ IEEE80211_ERROR("Unable to allocate beacon storage: %d\n", ++ err); ++ goto failed; ++ } ++ ieee80211_networks_initialize(ieee); ++ ++ ++ /* Default fragmentation threshold is maximum payload size */ ++ ieee->fts = DEFAULT_FTS; ++ ieee->scan_age = DEFAULT_MAX_SCAN_AGE; ++ ieee->open_wep = 1; ++ ++ /* Default to enabling full open WEP with host based encrypt/decrypt */ ++ ieee->host_encrypt = 1; ++ ieee->host_decrypt = 1; ++ ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ ++ ++ INIT_LIST_HEAD(&ieee->crypt_deinit_list); ++ init_timer(&ieee->crypt_deinit_timer); ++ ieee->crypt_deinit_timer.data = (unsigned long)ieee; ++ ieee->crypt_deinit_timer.function = ieee80211_crypt_deinit_handler; ++ ++ spin_lock_init(&ieee->lock); ++ spin_lock_init(&ieee->wpax_suitlist_lock); ++ spin_lock_init(&ieee->bw_spinlock); ++ spin_lock_init(&ieee->reorder_spinlock); ++ //added by WB ++ atomic_set(&(ieee->atm_chnlop), 0); ++ atomic_set(&(ieee->atm_swbw), 0); ++ ++ ieee->wpax_type_set = 0; ++ ieee->wpa_enabled = 0; ++ ieee->tkip_countermeasures = 0; ++ ieee->drop_unencrypted = 0; ++ ieee->privacy_invoked = 0; ++ ieee->ieee802_1x = 1; ++ ieee->raw_tx = 0; ++ //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead. ++ ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary. ++ ++ ieee80211_softmac_init(ieee); ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) ++ ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); ++#else ++ ieee->pHTInfo = (RT_HIGH_THROUGHPUT*)kmalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); ++ memset(ieee->pHTInfo,0,sizeof(RT_HIGH_THROUGHPUT)); ++#endif ++ if (ieee->pHTInfo == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); ++ return NULL; ++ } ++ HTUpdateDefaultSetting(ieee); ++ HTInitializeHTInfo(ieee); //may move to other place. ++ TSInitialize(ieee); ++#if 0 ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++ INIT_WORK(&ieee->ht_onAssRsp, (void(*)(void*)) HTOnAssocRsp_wq); ++#else ++ INIT_WORK(&ieee->ht_onAssRsp, (void(*)(void*)) HTOnAssocRsp_wq, ieee); ++#endif ++#endif ++ for (i = 0; i < IEEE_IBSS_MAC_HASH_SIZE; i++) ++ INIT_LIST_HEAD(&ieee->ibss_mac_hash[i]); ++ ++ for (i = 0; i < 17; i++) { ++ ieee->last_rxseq_num[i] = -1; ++ ieee->last_rxfrag_num[i] = -1; ++ ieee->last_packet_time[i] = 0; ++ } ++ ++//These function were added to load crypte module autoly ++ ieee80211_tkip_null(); ++ ieee80211_wep_null(); ++ ieee80211_ccmp_null(); ++ ++ return dev; ++ ++ failed: ++ if (dev) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) ++ free_netdev(dev); ++#else ++ kfree(dev); ++#endif ++ return NULL; ++} ++ ++ ++void free_ieee80211(struct net_device *dev) ++{ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) ++ struct ieee80211_device *ieee = netdev_priv(dev); ++#else ++ struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv; ++#endif ++ int i; ++ //struct list_head *p, *q; ++// del_timer_sync(&ieee->SwBwTimer); ++#if 1 ++ if (ieee->pHTInfo != NULL) ++ { ++ kfree(ieee->pHTInfo); ++ ieee->pHTInfo = NULL; ++ } ++#endif ++ RemoveAllTS(ieee); ++ ieee80211_softmac_free(ieee); ++ del_timer_sync(&ieee->crypt_deinit_timer); ++ ieee80211_crypt_deinit_entries(ieee, 1); ++ ++ for (i = 0; i < WEP_KEYS; i++) { ++ struct ieee80211_crypt_data *crypt = ieee->crypt[i]; ++ if (crypt) { ++ if (crypt->ops) { ++ crypt->ops->deinit(crypt->priv); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ++ module_put(crypt->ops->owner); ++#else ++ __MOD_DEC_USE_COUNT(crypt->ops->owner); ++#endif ++ } ++ kfree(crypt); ++ ieee->crypt[i] = NULL; ++ } ++ } ++ ++ ieee80211_networks_free(ieee); ++#if 0 ++ for (i = 0; i < IEEE_IBSS_MAC_HASH_SIZE; i++) { ++ list_for_each_safe(p, q, &ieee->ibss_mac_hash[i]) { ++ kfree(list_entry(p, struct ieee_ibss_seq, list)); ++ list_del(p); ++ } ++ } ++ ++#endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) ++ free_netdev(dev); ++#else ++ kfree(dev); ++#endif ++} ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++ ++u32 ieee80211_debug_level = 0; ++static int debug = \ ++ // IEEE80211_DL_INFO | ++ // IEEE80211_DL_WX | ++ // IEEE80211_DL_SCAN | ++ // IEEE80211_DL_STATE | ++ // IEEE80211_DL_MGMT | ++ // IEEE80211_DL_FRAG | ++ // IEEE80211_DL_EAP | ++ // IEEE80211_DL_DROP | ++ // IEEE80211_DL_TX | ++ // IEEE80211_DL_RX | ++ //IEEE80211_DL_QOS | ++ // IEEE80211_DL_HT | ++ // IEEE80211_DL_TS | ++// IEEE80211_DL_BA | ++ // IEEE80211_DL_REORDER| ++// IEEE80211_DL_TRACE | ++ //IEEE80211_DL_DATA | ++ IEEE80211_DL_ERR //awayls open this flags to show error out ++ ; ++struct proc_dir_entry *ieee80211_proc = NULL; ++ ++static int show_debug_level(char *page, char **start, off_t offset, ++ int count, int *eof, void *data) ++{ ++ return snprintf(page, count, "0x%08X\n", ieee80211_debug_level); ++} ++ ++static int store_debug_level(struct file *file, const char *buffer, ++ unsigned long count, void *data) ++{ ++ char buf[] = "0x00000000"; ++ unsigned long len = min(sizeof(buf) - 1, (u32)count); ++ char *p = (char *)buf; ++ unsigned long val; ++ ++ if (copy_from_user(buf, buffer, len)) ++ return count; ++ buf[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 == buf) ++ printk(KERN_INFO DRV_NAME ++ ": %s is not in hex or decimal form.\n", buf); ++ else ++ ieee80211_debug_level = val; ++ ++ return strnlen(buf, count); ++} ++ ++extern int ieee80211_crypto_init(void); ++extern void ieee80211_crypto_deinit(void); ++extern int ieee80211_crypto_tkip_init(void); ++extern void ieee80211_crypto_tkip_exit(void); ++extern int ieee80211_crypto_ccmp_init(void); ++extern void ieee80211_crypto_ccmp_exit(void); ++extern int ieee80211_crypto_wep_init(void); ++extern void ieee80211_crypto_wep_exit(void); ++ ++int __init ieee80211_init(void) ++{ ++ struct proc_dir_entry *e; ++ int retval; ++ ++ retval = ieee80211_crypto_init(); ++ if (retval) ++ return retval; ++ retval = ieee80211_crypto_tkip_init(); ++ if (retval) { ++ ieee80211_crypto_deinit(); ++ return retval; ++ } ++ retval = ieee80211_crypto_ccmp_init(); ++ if (retval) { ++ ieee80211_crypto_tkip_exit(); ++ ieee80211_crypto_deinit(); ++ return retval; ++ } ++ retval = ieee80211_crypto_wep_init(); ++ if (retval) { ++ ieee80211_crypto_ccmp_exit(); ++ ieee80211_crypto_tkip_exit(); ++ ieee80211_crypto_deinit(); ++ return retval; ++ } ++ ++ ieee80211_debug_level = debug; ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, proc_net); ++#else ++ ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, init_net.proc_net); ++#endif ++ if (ieee80211_proc == NULL) { ++ IEEE80211_ERROR("Unable to create " DRV_NAME ++ " proc directory\n"); ++ return -EIO; ++ } ++ e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR, ++ ieee80211_proc); ++ if (!e) { ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ remove_proc_entry(DRV_NAME, proc_net); ++#else ++ remove_proc_entry(DRV_NAME, init_net.proc_net); ++#endif ++ ieee80211_proc = NULL; ++ return -EIO; ++ } ++ e->read_proc = show_debug_level; ++ e->write_proc = store_debug_level; ++ e->data = NULL; ++ ++ return 0; ++} ++ ++void __exit ieee80211_exit(void) ++{ ++ if (ieee80211_proc) { ++ remove_proc_entry("debug_level", ieee80211_proc); ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ remove_proc_entry(DRV_NAME, proc_net); ++#else ++ remove_proc_entry(DRV_NAME, init_net.proc_net); ++#endif ++ ieee80211_proc = NULL; ++ } ++ ieee80211_crypto_wep_exit(); ++ ieee80211_crypto_ccmp_exit(); ++ ieee80211_crypto_tkip_exit(); ++ ieee80211_crypto_deinit(); ++} ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++#include ++module_param(debug, int, 0444); ++MODULE_PARM_DESC(debug, "debug output mask"); ++ ++ ++//module_exit(ieee80211_exit); ++//module_init(ieee80211_init); ++#endif ++#endif ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(alloc_ieee80211); ++//EXPORT_SYMBOL(free_ieee80211); ++#else ++EXPORT_SYMBOL_NOVERS(alloc_ieee80211); ++EXPORT_SYMBOL_NOVERS(free_ieee80211); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c +@@ -0,0 +1,2802 @@ ++/* ++ * Original code based Host AP (software wireless LAN access point) driver ++ * for Intersil Prism2/2.5/3 - hostap.o module, common routines ++ * ++ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * Copyright (c) 2004, Intel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ ****************************************************************************** ++ ++ Few modifications for Realtek's Wi-Fi drivers by ++ Andrea Merello ++ ++ A special thanks goes to Realtek for their support ! ++ ++******************************************************************************/ ++ ++ ++#include ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, ++ struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats) ++{ ++ struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *)skb->data; ++ u16 fc = le16_to_cpu(hdr->frame_ctl); ++ ++ skb->dev = ieee->dev; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++ skb_reset_mac_header(skb); ++#else ++ skb->mac.raw = skb->data; ++#endif ++ ++ skb_pull(skb, ieee80211_get_hdrlen(fc)); ++ skb->pkt_type = PACKET_OTHERHOST; ++ skb->protocol = __constant_htons(ETH_P_80211_RAW); ++ memset(skb->cb, 0, sizeof(skb->cb)); ++ netif_rx(skb); ++} ++ ++ ++/* Called only as a tasklet (software IRQ) */ ++static struct ieee80211_frag_entry * ++ieee80211_frag_cache_find(struct ieee80211_device *ieee, unsigned int seq, ++ unsigned int frag, u8 tid,u8 *src, u8 *dst) ++{ ++ struct ieee80211_frag_entry *entry; ++ int i; ++ ++ for (i = 0; i < IEEE80211_FRAG_CACHE_LEN; i++) { ++ entry = &ieee->frag_cache[tid][i]; ++ if (entry->skb != NULL && ++ time_after(jiffies, entry->first_frag_time + 2 * HZ)) { ++ IEEE80211_DEBUG_FRAG( ++ "expiring fragment cache entry " ++ "seq=%u last_frag=%u\n", ++ entry->seq, entry->last_frag); ++ dev_kfree_skb_any(entry->skb); ++ entry->skb = NULL; ++ } ++ ++ if (entry->skb != NULL && entry->seq == seq && ++ (entry->last_frag + 1 == frag || frag == -1) && ++ memcmp(entry->src_addr, src, ETH_ALEN) == 0 && ++ memcmp(entry->dst_addr, dst, ETH_ALEN) == 0) ++ return entry; ++ } ++ ++ return NULL; ++} ++ ++/* Called only as a tasklet (software IRQ) */ ++static struct sk_buff * ++ieee80211_frag_cache_get(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *hdr) ++{ ++ struct sk_buff *skb = NULL; ++ u16 fc = le16_to_cpu(hdr->frame_ctl); ++ u16 sc = le16_to_cpu(hdr->seq_ctl); ++ unsigned int frag = WLAN_GET_SEQ_FRAG(sc); ++ unsigned int seq = WLAN_GET_SEQ_SEQ(sc); ++ struct ieee80211_frag_entry *entry; ++ struct ieee80211_hdr_3addrqos *hdr_3addrqos; ++ struct ieee80211_hdr_4addrqos *hdr_4addrqos; ++ u8 tid; ++ ++ if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { ++ hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr; ++ tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else if (IEEE80211_QOS_HAS_SEQ(fc)) { ++ hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr; ++ tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else { ++ tid = 0; ++ } ++ ++ if (frag == 0) { ++ /* Reserve enough space to fit maximum frame length */ ++ skb = dev_alloc_skb(ieee->dev->mtu + ++ sizeof(struct ieee80211_hdr_4addr) + ++ 8 /* LLC */ + ++ 2 /* alignment */ + ++ 8 /* WEP */ + ++ ETH_ALEN /* WDS */ + ++ (IEEE80211_QOS_HAS_SEQ(fc)?2:0) /* QOS Control */); ++ if (skb == NULL) ++ return NULL; ++ ++ entry = &ieee->frag_cache[tid][ieee->frag_next_idx[tid]]; ++ ieee->frag_next_idx[tid]++; ++ if (ieee->frag_next_idx[tid] >= IEEE80211_FRAG_CACHE_LEN) ++ ieee->frag_next_idx[tid] = 0; ++ ++ if (entry->skb != NULL) ++ dev_kfree_skb_any(entry->skb); ++ ++ entry->first_frag_time = jiffies; ++ entry->seq = seq; ++ entry->last_frag = frag; ++ entry->skb = skb; ++ memcpy(entry->src_addr, hdr->addr2, ETH_ALEN); ++ memcpy(entry->dst_addr, hdr->addr1, ETH_ALEN); ++ } else { ++ /* received a fragment of a frame for which the head fragment ++ * should have already been received */ ++ entry = ieee80211_frag_cache_find(ieee, seq, frag, tid,hdr->addr2, ++ hdr->addr1); ++ if (entry != NULL) { ++ entry->last_frag = frag; ++ skb = entry->skb; ++ } ++ } ++ ++ return skb; ++} ++ ++ ++/* Called only as a tasklet (software IRQ) */ ++static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *hdr) ++{ ++ u16 fc = le16_to_cpu(hdr->frame_ctl); ++ u16 sc = le16_to_cpu(hdr->seq_ctl); ++ unsigned int seq = WLAN_GET_SEQ_SEQ(sc); ++ struct ieee80211_frag_entry *entry; ++ struct ieee80211_hdr_3addrqos *hdr_3addrqos; ++ struct ieee80211_hdr_4addrqos *hdr_4addrqos; ++ u8 tid; ++ ++ if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { ++ hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr; ++ tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else if (IEEE80211_QOS_HAS_SEQ(fc)) { ++ hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr; ++ tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else { ++ tid = 0; ++ } ++ ++ entry = ieee80211_frag_cache_find(ieee, seq, -1, tid,hdr->addr2, ++ hdr->addr1); ++ ++ if (entry == NULL) { ++ IEEE80211_DEBUG_FRAG( ++ "could not invalidate fragment cache " ++ "entry (seq=%u)\n", seq); ++ return -1; ++ } ++ ++ entry->skb = NULL; ++ return 0; ++} ++ ++ ++ ++/* ieee80211_rx_frame_mgtmt ++ * ++ * Responsible for handling management control frames ++ * ++ * Called by ieee80211_rx */ ++static inline int ++ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats, u16 type, ++ u16 stype) ++{ ++ /* On the struct stats definition there is written that ++ * this is not mandatory.... but seems that the probe ++ * response parser uses it ++ */ ++ struct ieee80211_hdr_3addr * hdr = (struct ieee80211_hdr_3addr *)skb->data; ++ ++ rx_stats->len = skb->len; ++ ieee80211_rx_mgt(ieee,(struct ieee80211_hdr_4addr *)skb->data,rx_stats); ++ //if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, ieee->current_network.bssid, ETH_ALEN))) ++ if ((memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN)))//use ADDR1 to perform address matching for Management frames ++ { ++ dev_kfree_skb_any(skb); ++ return 0; ++ } ++ ++ ieee80211_rx_frame_softmac(ieee, skb, rx_stats, type, stype); ++ ++ dev_kfree_skb_any(skb); ++ ++ return 0; ++ ++ #ifdef NOT_YET ++ if (ieee->iw_mode == IW_MODE_MASTER) { ++ printk(KERN_DEBUG "%s: Master mode not yet suppported.\n", ++ ieee->dev->name); ++ return 0; ++/* ++ hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *) ++ skb->data);*/ ++ } ++ ++ if (ieee->hostapd && type == IEEE80211_TYPE_MGMT) { ++ if (stype == WLAN_FC_STYPE_BEACON && ++ ieee->iw_mode == IW_MODE_MASTER) { ++ struct sk_buff *skb2; ++ /* Process beacon frames also in kernel driver to ++ * update STA(AP) table statistics */ ++ skb2 = skb_clone(skb, GFP_ATOMIC); ++ if (skb2) ++ hostap_rx(skb2->dev, skb2, rx_stats); ++ } ++ ++ /* send management frames to the user space daemon for ++ * processing */ ++ ieee->apdevstats.rx_packets++; ++ ieee->apdevstats.rx_bytes += skb->len; ++ prism2_rx_80211(ieee->apdev, skb, rx_stats, PRISM2_RX_MGMT); ++ return 0; ++ } ++ ++ if (ieee->iw_mode == IW_MODE_MASTER) { ++ if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) { ++ printk(KERN_DEBUG "%s: unknown management frame " ++ "(type=0x%02x, stype=0x%02x) dropped\n", ++ skb->dev->name, type, stype); ++ return -1; ++ } ++ ++ hostap_rx(skb->dev, skb, rx_stats); ++ return 0; ++ } ++ ++ printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: management frame " ++ "received in non-Host AP mode\n", skb->dev->name); ++ return -1; ++ #endif ++} ++ ++ ++ ++/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ ++/* Ethernet-II snap header (RFC1042 for most EtherTypes) */ ++static unsigned char rfc1042_header[] = ++{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; ++/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ ++static unsigned char bridge_tunnel_header[] = ++{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; ++/* No encapsulation header if EtherType < 0x600 (=length) */ ++ ++/* Called by ieee80211_rx_frame_decrypt */ ++static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, ++ struct sk_buff *skb, size_t hdrlen) ++{ ++ struct net_device *dev = ieee->dev; ++ u16 fc, ethertype; ++ struct ieee80211_hdr_4addr *hdr; ++ u8 *pos; ++ ++ if (skb->len < 24) ++ return 0; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ fc = le16_to_cpu(hdr->frame_ctl); ++ ++ /* check that the frame is unicast frame to us */ ++ if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == ++ IEEE80211_FCTL_TODS && ++ memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0 && ++ memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { ++ /* ToDS frame with own addr BSSID and DA */ ++ } else if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == ++ IEEE80211_FCTL_FROMDS && ++ memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) { ++ /* FromDS frame with own addr as DA */ ++ } else ++ return 0; ++ ++ if (skb->len < 24 + 8) ++ return 0; ++ ++ /* check for port access entity Ethernet type */ ++// pos = skb->data + 24; ++ pos = skb->data + hdrlen; ++ ethertype = (pos[6] << 8) | pos[7]; ++ if (ethertype == ETH_P_PAE) ++ return 1; ++ ++ return 0; ++} ++ ++/* Called only as a tasklet (software IRQ), by ieee80211_rx */ ++static inline int ++ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb, ++ struct ieee80211_crypt_data *crypt) ++{ ++ struct ieee80211_hdr_4addr *hdr; ++ int res, hdrlen; ++ ++ if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) ++ return 0; ++#if 1 ++ if (ieee->hwsec_active) ++ { ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); ++ tcb_desc->bHwSec = 1; ++ } ++#endif ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); ++ ++#ifdef CONFIG_IEEE80211_CRYPT_TKIP ++ if (ieee->tkip_countermeasures && ++ strcmp(crypt->ops->name, "TKIP") == 0) { ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " ++ "received packet from " MAC_FMT "\n", ++ ieee->dev->name, MAC_ARG(hdr->addr2)); ++ } ++ return -1; ++ } ++#endif ++ ++ atomic_inc(&crypt->refcnt); ++ res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); ++ atomic_dec(&crypt->refcnt); ++ if (res < 0) { ++ IEEE80211_DEBUG_DROP( ++ "decryption failed (SA=" MAC_FMT ++ ") res=%d\n", MAC_ARG(hdr->addr2), res); ++ if (res == -2) ++ IEEE80211_DEBUG_DROP("Decryption failed ICV " ++ "mismatch (key %d)\n", ++ skb->data[hdrlen + 3] >> 6); ++ ieee->ieee_stats.rx_discards_undecryptable++; ++ return -1; ++ } ++ ++ return res; ++} ++ ++ ++/* Called only as a tasklet (software IRQ), by ieee80211_rx */ ++static inline int ++ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *skb, ++ int keyidx, struct ieee80211_crypt_data *crypt) ++{ ++ struct ieee80211_hdr_4addr *hdr; ++ int res, hdrlen; ++ ++ if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) ++ return 0; ++ if (ieee->hwsec_active) ++ { ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); ++ tcb_desc->bHwSec = 1; ++ } ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); ++ ++ atomic_inc(&crypt->refcnt); ++ res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); ++ atomic_dec(&crypt->refcnt); ++ if (res < 0) { ++ printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" ++ " (SA=" MAC_FMT " keyidx=%d)\n", ++ ieee->dev->name, MAC_ARG(hdr->addr2), keyidx); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ ++/* this function is stolen from ipw2200 driver*/ ++#define IEEE_PACKET_RETRY_TIME (5*HZ) ++static int is_duplicate_packet(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *header) ++{ ++ u16 fc = le16_to_cpu(header->frame_ctl); ++ u16 sc = le16_to_cpu(header->seq_ctl); ++ u16 seq = WLAN_GET_SEQ_SEQ(sc); ++ u16 frag = WLAN_GET_SEQ_FRAG(sc); ++ u16 *last_seq, *last_frag; ++ unsigned long *last_time; ++ struct ieee80211_hdr_3addrqos *hdr_3addrqos; ++ struct ieee80211_hdr_4addrqos *hdr_4addrqos; ++ u8 tid; ++ ++ ++ //TO2DS and QoS ++ if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { ++ hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header; ++ tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else if(IEEE80211_QOS_HAS_SEQ(fc)) { //QoS ++ hdr_3addrqos = (struct ieee80211_hdr_3addrqos*)header; ++ tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID; ++ tid = UP2AC(tid); ++ tid ++; ++ } else { // no QoS ++ tid = 0; ++ } ++ ++ switch (ieee->iw_mode) { ++ case IW_MODE_ADHOC: ++ { ++ struct list_head *p; ++ struct ieee_ibss_seq *entry = NULL; ++ u8 *mac = header->addr2; ++ int index = mac[5] % IEEE_IBSS_MAC_HASH_SIZE; ++ //for (pos = (head)->next; pos != (head); pos = pos->next) ++ //__list_for_each(p, &ieee->ibss_mac_hash[index]) { ++ list_for_each(p, &ieee->ibss_mac_hash[index]) { ++ entry = list_entry(p, struct ieee_ibss_seq, list); ++ if (!memcmp(entry->mac, mac, ETH_ALEN)) ++ break; ++ } ++ // if (memcmp(entry->mac, mac, ETH_ALEN)){ ++ if (p == &ieee->ibss_mac_hash[index]) { ++ entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC); ++ if (!entry) { ++ printk(KERN_WARNING "Cannot malloc new mac entry\n"); ++ return 0; ++ } ++ memcpy(entry->mac, mac, ETH_ALEN); ++ entry->seq_num[tid] = seq; ++ entry->frag_num[tid] = frag; ++ entry->packet_time[tid] = jiffies; ++ list_add(&entry->list, &ieee->ibss_mac_hash[index]); ++ return 0; ++ } ++ last_seq = &entry->seq_num[tid]; ++ last_frag = &entry->frag_num[tid]; ++ last_time = &entry->packet_time[tid]; ++ break; ++ } ++ ++ case IW_MODE_INFRA: ++ last_seq = &ieee->last_rxseq_num[tid]; ++ last_frag = &ieee->last_rxfrag_num[tid]; ++ last_time = &ieee->last_packet_time[tid]; ++ ++ break; ++ default: ++ return 0; ++ } ++ ++// if(tid != 0) { ++// printk(KERN_WARNING ":)))))))))))%x %x %x, fc(%x)\n", tid, *last_seq, seq, header->frame_ctl); ++// } ++ if ((*last_seq == seq) && ++ time_after(*last_time + IEEE_PACKET_RETRY_TIME, jiffies)) { ++ if (*last_frag == frag){ ++ //printk(KERN_WARNING "[1] go drop!\n"); ++ goto drop; ++ ++ } ++ if (*last_frag + 1 != frag) ++ /* out-of-order fragment */ ++ //printk(KERN_WARNING "[2] go drop!\n"); ++ goto drop; ++ } else ++ *last_seq = seq; ++ ++ *last_frag = frag; ++ *last_time = jiffies; ++ return 0; ++ ++drop: ++// BUG_ON(!(fc & IEEE80211_FCTL_RETRY)); ++// printk("DUP\n"); ++ ++ return 1; ++} ++bool ++AddReorderEntry( ++ PRX_TS_RECORD pTS, ++ PRX_REORDER_ENTRY pReorderEntry ++ ) ++{ ++ struct list_head *pList = &pTS->RxPendingPktList; ++#if 1 ++ while(pList->next != &pTS->RxPendingPktList) ++ { ++ if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) ++ { ++ pList = pList->next; ++ } ++ else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) ++ { ++ return false; ++ } ++ else ++ { ++ break; ++ } ++ } ++#endif ++ pReorderEntry->List.next = pList->next; ++ pReorderEntry->List.next->prev = &pReorderEntry->List; ++ pReorderEntry->List.prev = pList; ++ pList->next = &pReorderEntry->List; ++ ++ return true; ++} ++ ++void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_rxb** prxbIndicateArray,u8 index) ++{ ++ u8 i = 0 , j=0; ++ u16 ethertype; ++// if(index > 1) ++// IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): hahahahhhh, We indicate packet from reorder list, index is %u\n",__FUNCTION__,index); ++ for(j = 0; jnr_subframes; i++) { ++ struct sk_buff *sub_skb = prxb->subframes[i]; ++ ++ /* convert hdr + possible LLC headers into Ethernet header */ ++ ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7]; ++ if (sub_skb->len >= 8 && ++ ((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 && ++ ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || ++ memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) { ++ /* remove RFC1042 or Bridge-Tunnel encapsulation and ++ * replace EtherType */ ++ skb_pull(sub_skb, SNAP_SIZE); ++ memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN); ++ memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN); ++ } else { ++ u16 len; ++ /* Leave Ethernet header part of hdr and full payload */ ++ len = htons(sub_skb->len); ++ memcpy(skb_push(sub_skb, 2), &len, 2); ++ memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN); ++ memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN); ++ } ++ //stats->rx_packets++; ++ //stats->rx_bytes += sub_skb->len; ++ ++ /* Indicat the packets to upper layer */ ++ if (sub_skb) { ++ //printk("0skb_len(%d)\n", skb->len); ++ sub_skb->protocol = eth_type_trans(sub_skb, ieee->dev); ++ memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); ++ sub_skb->dev = ieee->dev; ++ sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ ++ //skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */ ++ ieee->last_rx_ps_time = jiffies; ++ //printk("1skb_len(%d)\n", skb->len); ++ netif_rx(sub_skb); ++ } ++ } ++ kfree(prxb); ++ prxb = NULL; ++ } ++} ++ ++ ++void RxReorderIndicatePacket( struct ieee80211_device *ieee, ++ struct ieee80211_rxb* prxb, ++ PRX_TS_RECORD pTS, ++ u16 SeqNum) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ PRX_REORDER_ENTRY pReorderEntry = NULL; ++ struct ieee80211_rxb* prxbIndicateArray[REORDER_WIN_SIZE]; ++ u8 WinSize = pHTInfo->RxReorderWinSize; ++ u16 WinEnd = (pTS->RxIndicateSeq + WinSize -1)%4096; ++ u8 index = 0; ++ bool bMatchWinStart = false, bPktInBuf = false; ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__FUNCTION__,SeqNum,pTS->RxIndicateSeq,WinSize); ++#if 0 ++ if(!list_empty(&ieee->RxReorder_Unused_List)) ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): ieee->RxReorder_Unused_List is nut NULL\n"); ++#endif ++ /* Rx Reorder initialize condition.*/ ++ if(pTS->RxIndicateSeq == 0xffff) { ++ pTS->RxIndicateSeq = SeqNum; ++ } ++ ++ /* Drop out the packet which SeqNum is smaller than WinStart */ ++ if(SN_LESS(SeqNum, pTS->RxIndicateSeq)) { ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"Packet Drop! IndicateSeq: %d, NewSeq: %d\n", ++ pTS->RxIndicateSeq, SeqNum); ++ pHTInfo->RxReorderDropCounter++; ++ { ++ int i; ++ for(i =0; i < prxb->nr_subframes; i++) { ++ dev_kfree_skb(prxb->subframes[i]); ++ } ++ kfree(prxb); ++ prxb = NULL; ++ } ++ return; ++ } ++ ++ /* ++ * Sliding window manipulation. Conditions includes: ++ * 1. Incoming SeqNum is equal to WinStart =>Window shift 1 ++ * 2. Incoming SeqNum is larger than the WinEnd => Window shift N ++ */ ++ if(SN_EQUAL(SeqNum, pTS->RxIndicateSeq)) { ++ pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096; ++ bMatchWinStart = true; ++ } else if(SN_LESS(WinEnd, SeqNum)) { ++ if(SeqNum >= (WinSize - 1)) { ++ pTS->RxIndicateSeq = SeqNum + 1 -WinSize; ++ } else { ++ pTS->RxIndicateSeq = 4095 - (WinSize - (SeqNum +1)) + 1; ++ } ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER, "Window Shift! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); ++ } ++ ++ /* ++ * Indication process. ++ * After Packet dropping and Sliding Window shifting as above, we can now just indicate the packets ++ * with the SeqNum smaller than latest WinStart and buffer other packets. ++ */ ++ /* For Rx Reorder condition: ++ * 1. All packets with SeqNum smaller than WinStart => Indicate ++ * 2. All packets with SeqNum larger than or equal to WinStart => Buffer it. ++ */ ++ if(bMatchWinStart) { ++ /* Current packet is going to be indicated.*/ ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER, "Packets indication!! IndicateSeq: %d, NewSeq: %d\n",\ ++ pTS->RxIndicateSeq, SeqNum); ++ prxbIndicateArray[0] = prxb; ++// printk("========================>%s(): SeqNum is %d\n",__FUNCTION__,SeqNum); ++ index = 1; ++ } else { ++ /* Current packet is going to be inserted into pending list.*/ ++ //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to orderd list\n",__FUNCTION__); ++ if(!list_empty(&ieee->RxReorder_Unused_List)) { ++ pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List); ++ list_del_init(&pReorderEntry->List); ++ ++ /* Make a reorder entry and insert into a the packet list.*/ ++ pReorderEntry->SeqNum = SeqNum; ++ pReorderEntry->prxb = prxb; ++ // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum); ++ ++#if 1 ++ if(!AddReorderEntry(pTS, pReorderEntry)) { ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", ++ __FUNCTION__, pTS->RxIndicateSeq, SeqNum); ++ list_add_tail(&pReorderEntry->List,&ieee->RxReorder_Unused_List); ++ { ++ int i; ++ for(i =0; i < prxb->nr_subframes; i++) { ++ dev_kfree_skb(prxb->subframes[i]); ++ } ++ kfree(prxb); ++ prxb = NULL; ++ } ++ } else { ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER, ++ "Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); ++ } ++#endif ++ } ++ else { ++ /* ++ * Packets are dropped if there is not enough reorder entries. ++ * This part shall be modified!! We can just indicate all the ++ * packets in buffer and get reorder entries. ++ */ ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): There is no reorder entry!! Packet is dropped!!\n"); ++ { ++ int i; ++ for(i =0; i < prxb->nr_subframes; i++) { ++ dev_kfree_skb(prxb->subframes[i]); ++ } ++ kfree(prxb); ++ prxb = NULL; ++ } ++ } ++ } ++ ++ /* Check if there is any packet need indicate.*/ ++ while(!list_empty(&pTS->RxPendingPktList)) { ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__FUNCTION__); ++#if 1 ++ pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); ++ if( SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) || ++ SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) ++ { ++ /* This protect buffer from overflow. */ ++ if(index >= REORDER_WIN_SIZE) { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Buffer overflow!! \n"); ++ bPktInBuf = true; ++ break; ++ } ++ ++ list_del_init(&pReorderEntry->List); ++ ++ if(SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) ++ pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096; ++ ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"Packets indication!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); ++ prxbIndicateArray[index] = pReorderEntry->prxb; ++ // printk("========================>%s(): pReorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum); ++ index++; ++ ++ list_add_tail(&pReorderEntry->List,&ieee->RxReorder_Unused_List); ++ } else { ++ bPktInBuf = true; ++ break; ++ } ++#endif ++ } ++ ++ /* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/ ++ if(index>0) { ++ // Cancel previous pending timer. ++ if (timer_pending(&pTS->RxPktPendingTimer)) ++ del_timer_sync(&pTS->RxPktPendingTimer); ++ pTS->RxTimeoutIndicateSeq = 0xffff; ++ ++ // Indicate packets ++ if(index>REORDER_WIN_SIZE){ ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorer buffer full!! \n"); ++ return; ++ } ++ ieee80211_indicate_packets(ieee, prxbIndicateArray, index); ++ bPktInBuf = false; ++ } ++ ++#if 1 ++ if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) { ++ // Set new pending timer. ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__); ++ pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq; ++#if 0 ++ if(timer_pending(&pTS->RxPktPendingTimer)) ++ del_timer_sync(&pTS->RxPktPendingTimer); ++ pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime); ++ add_timer(&pTS->RxPktPendingTimer); ++#else ++ mod_timer(&pTS->RxPktPendingTimer, jiffies + MSECS(pHTInfo->RxReorderPendingTime)); ++#endif ++ } ++#endif ++} ++ ++u8 parse_subframe(struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats, ++ struct ieee80211_rxb *rxb,u8* src,u8* dst) ++{ ++ struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr* )skb->data; ++ u16 fc = le16_to_cpu(hdr->frame_ctl); ++ ++ u16 LLCOffset= sizeof(struct ieee80211_hdr_3addr); ++ u16 ChkLength; ++ bool bIsAggregateFrame = false; ++ u16 nSubframe_Length; ++ u8 nPadding_Length = 0; ++ u16 SeqNum=0; ++ ++ struct sk_buff *sub_skb; ++ u8 *data_ptr; ++ /* just for debug purpose */ ++ SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl)); ++ ++ if((IEEE80211_QOS_HAS_SEQ(fc))&&\ ++ (((frameqos *)(skb->data + IEEE80211_3ADDR_LEN))->field.reserved)) { ++ bIsAggregateFrame = true; ++ } ++ ++ if(IEEE80211_QOS_HAS_SEQ(fc)) { ++ LLCOffset += 2; ++ } ++ ++ if(rx_stats->bContainHTC) { ++ LLCOffset += sHTCLng; ++ } ++ //printk("ChkLength = %d\n", LLCOffset); ++ // Null packet, don't indicate it to upper layer ++ ChkLength = LLCOffset;/* + (Frame_WEP(frame)!=0 ?Adapter->MgntInfo.SecurityInfo.EncryptionHeadOverhead:0);*/ ++ ++ if( skb->len <= ChkLength ) { ++ return 0; ++ } ++ ++ skb_pull(skb, LLCOffset); ++ ++ if(!bIsAggregateFrame) { ++ rxb->nr_subframes = 1; ++#ifdef JOHN_NOCPY ++ rxb->subframes[0] = skb; ++#else ++ rxb->subframes[0] = skb_copy(skb, GFP_ATOMIC); ++#endif ++ ++ memcpy(rxb->src,src,ETH_ALEN); ++ memcpy(rxb->dst,dst,ETH_ALEN); ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_RX,skb->data,skb->len); ++ return 1; ++ } else { ++ rxb->nr_subframes = 0; ++ memcpy(rxb->src,src,ETH_ALEN); ++ memcpy(rxb->dst,dst,ETH_ALEN); ++ while(skb->len > ETHERNET_HEADER_SIZE) { ++ /* Offset 12 denote 2 mac address */ ++ nSubframe_Length = *((u16*)(skb->data + 12)); ++ //==m==>change the length order ++ nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); ++ ++ if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) { ++#if 0//cosa ++ RT_ASSERT( ++ (nRemain_Length>=(ETHERNET_HEADER_SIZE + nSubframe_Length)), ++ ("ParseSubframe(): A-MSDU subframe parse error!! Subframe Length: %d\n", nSubframe_Length) ); ++#endif ++ printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\ ++ __FUNCTION__,rxb->nr_subframes); ++ printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__FUNCTION__, nSubframe_Length); ++ printk("nRemain_Length is %d and nSubframe_Length is : %d\n",skb->len,nSubframe_Length); ++ printk("The Packet SeqNum is %d\n",SeqNum); ++ return 0; ++ } ++ ++ /* move the data point to data content */ ++ skb_pull(skb, ETHERNET_HEADER_SIZE); ++ ++#ifdef JOHN_NOCPY ++ sub_skb = skb_clone(skb, GFP_ATOMIC); ++ sub_skb->len = nSubframe_Length; ++ sub_skb->tail = sub_skb->data + nSubframe_Length; ++#else ++ /* Allocate new skb for releasing to upper layer */ ++ sub_skb = dev_alloc_skb(nSubframe_Length + 12); ++ skb_reserve(sub_skb, 12); ++ data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length); ++ memcpy(data_ptr,skb->data,nSubframe_Length); ++#endif ++ rxb->subframes[rxb->nr_subframes++] = sub_skb; ++ if(rxb->nr_subframes >= MAX_SUBFRAME_COUNT) { ++ IEEE80211_DEBUG_RX("ParseSubframe(): Too many Subframes! Packets dropped!\n"); ++ break; ++ } ++ skb_pull(skb,nSubframe_Length); ++ ++ if(skb->len != 0) { ++ nPadding_Length = 4 - ((nSubframe_Length + ETHERNET_HEADER_SIZE) % 4); ++ if(nPadding_Length == 4) { ++ nPadding_Length = 0; ++ } ++ ++ if(skb->len < nPadding_Length) { ++ return 0; ++ } ++ ++ skb_pull(skb,nPadding_Length); ++ } ++ } ++#ifdef JOHN_NOCPY ++ dev_kfree_skb(skb); ++#endif ++ //{just for debug added by david ++ //printk("AMSDU::rxb->nr_subframes = %d\n",rxb->nr_subframes); ++ //} ++ return rxb->nr_subframes; ++ } ++} ++ ++/* All received frames are sent to this function. @skb contains the frame in ++ * IEEE 802.11 format, i.e., in the format it was sent over air. ++ * This function is called only as a tasklet (software IRQ). */ ++int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats) ++{ ++ struct net_device *dev = ieee->dev; ++ struct ieee80211_hdr_4addr *hdr; ++ //struct ieee80211_hdr_3addrqos *hdr; ++ ++ size_t hdrlen; ++ u16 fc, type, stype, sc; ++ struct net_device_stats *stats; ++ unsigned int frag; ++ u8 *payload; ++ u16 ethertype; ++ //added by amy for reorder ++ u8 TID = 0; ++ u16 SeqNum = 0; ++ PRX_TS_RECORD pTS = NULL; ++ //bool bIsAggregateFrame = false; ++ //added by amy for reorder ++#ifdef NOT_YET ++ struct net_device *wds = NULL; ++ struct sk_buff *skb2 = NULL; ++ struct net_device *wds = NULL; ++ int frame_authorized = 0; ++ int from_assoc_ap = 0; ++ void *sta = NULL; ++#endif ++// u16 qos_ctl = 0; ++ u8 dst[ETH_ALEN]; ++ u8 src[ETH_ALEN]; ++ u8 bssid[ETH_ALEN]; ++ struct ieee80211_crypt_data *crypt = NULL; ++ int keyidx = 0; ++ ++ int i; ++ struct ieee80211_rxb* rxb = NULL; ++ // cheat the the hdr type ++ hdr = (struct ieee80211_hdr_4addr *)skb->data; ++ stats = &ieee->stats; ++ ++ if (skb->len < 10) { ++ printk(KERN_INFO "%s: SKB length < 10\n", ++ dev->name); ++ goto rx_dropped; ++ } ++ ++ fc = le16_to_cpu(hdr->frame_ctl); ++ type = WLAN_FC_GET_TYPE(fc); ++ stype = WLAN_FC_GET_STYPE(fc); ++ sc = le16_to_cpu(hdr->seq_ctl); ++ ++ frag = WLAN_GET_SEQ_FRAG(sc); ++ hdrlen = ieee80211_get_hdrlen(fc); ++ ++ if(HTCCheck(ieee, skb->data)) ++ { ++ if(net_ratelimit()) ++ printk("find HTCControl\n"); ++ hdrlen += 4; ++ rx_stats->bContainHTC = 1; ++ } ++ ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ++#ifdef NOT_YET ++#if WIRELESS_EXT > 15 ++ /* Put this code here so that we avoid duplicating it in all ++ * Rx paths. - Jean II */ ++#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ ++ /* If spy monitoring on */ ++ if (iface->spy_data.spy_number > 0) { ++ struct iw_quality wstats; ++ wstats.level = rx_stats->rssi; ++ wstats.noise = rx_stats->noise; ++ wstats.updated = 6; /* No qual value */ ++ /* Update spy records */ ++ wireless_spy_update(dev, hdr->addr2, &wstats); ++ } ++#endif /* IW_WIRELESS_SPY */ ++#endif /* WIRELESS_EXT > 15 */ ++ hostap_update_rx_stats(local->ap, hdr, rx_stats); ++#endif ++ ++#if WIRELESS_EXT > 15 ++ if (ieee->iw_mode == IW_MODE_MONITOR) { ++ ieee80211_monitor_rx(ieee, skb, rx_stats); ++ stats->rx_packets++; ++ stats->rx_bytes += skb->len; ++ return 1; ++ } ++#endif ++ if (ieee->host_decrypt) { ++ int idx = 0; ++ if (skb->len >= hdrlen + 3) ++ idx = skb->data[hdrlen + 3] >> 6; ++ crypt = ieee->crypt[idx]; ++#ifdef NOT_YET ++ sta = NULL; ++ ++ /* Use station specific key to override default keys if the ++ * receiver address is a unicast address ("individual RA"). If ++ * bcrx_sta_key parameter is set, station specific key is used ++ * even with broad/multicast targets (this is against IEEE ++ * 802.11, but makes it easier to use different keys with ++ * stations that do not support WEP key mapping). */ ++ ++ if (!(hdr->addr1[0] & 0x01) || local->bcrx_sta_key) ++ (void) hostap_handle_sta_crypto(local, hdr, &crypt, ++ &sta); ++#endif ++ ++ /* allow NULL decrypt to indicate an station specific override ++ * for default encryption */ ++ if (crypt && (crypt->ops == NULL || ++ crypt->ops->decrypt_mpdu == NULL)) ++ crypt = NULL; ++ ++ if (!crypt && (fc & IEEE80211_FCTL_WEP)) { ++ /* This seems to be triggered by some (multicast?) ++ * frames from other than current BSS, so just drop the ++ * frames silently instead of filling system log with ++ * these reports. */ ++ IEEE80211_DEBUG_DROP("Decryption failed (not set)" ++ " (SA=" MAC_FMT ")\n", ++ MAC_ARG(hdr->addr2)); ++ ieee->ieee_stats.rx_discards_undecryptable++; ++ goto rx_dropped; ++ } ++ } ++ ++ if (skb->len < IEEE80211_DATA_HDR3_LEN) ++ goto rx_dropped; ++ ++ // if QoS enabled, should check the sequence for each of the AC ++ if( (ieee->pHTInfo->bCurRxReorderEnable == false) || !ieee->current_network.qos_data.active|| !IsDataFrame(skb->data) || IsLegacyDataFrame(skb->data)){ ++ if (is_duplicate_packet(ieee, hdr)) ++ goto rx_dropped; ++ ++ } ++ else ++ { ++ PRX_TS_RECORD pRxTS = NULL; ++ #if 0 ++ struct ieee80211_hdr_3addr *hdr; ++ u16 fc; ++ hdr = (struct ieee80211_hdr_3addr *)skb->data; ++ fc = le16_to_cpu(hdr->frame_ctl); ++ u8 tmp = (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS); ++ ++ u8 tid = (*((u8*)skb->data + (((fc& IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))?30:24)))&0xf; ++ printk("====================>fc:%x, tid:%d, tmp:%d\n", fc, tid, tmp); ++ //u8 tid = (u8)((frameqos*)(buf + ((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24))->field.tid; ++ #endif ++ //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__FUNCTION__, tid); ++#if 1 ++ if(GetTs( ++ ieee, ++ (PTS_COMMON_INFO*) &pRxTS, ++ hdr->addr2, ++ (u8)Frame_QoSTID((u8*)(skb->data)), ++ RX_DIR, ++ true)) ++ { ++ ++ // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pRxTS->RxLastFragNum is %d,frag is %d,pRxTS->RxLastSeqNum is %d,seq is %d\n",__FUNCTION__,pRxTS->RxLastFragNum,frag,pRxTS->RxLastSeqNum,WLAN_GET_SEQ_SEQ(sc)); ++ if( (fc & (1<<11)) && ++ (frag == pRxTS->RxLastFragNum) && ++ (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum) ) ++ { ++ goto rx_dropped; ++ } ++ else ++ { ++ pRxTS->RxLastFragNum = frag; ++ pRxTS->RxLastSeqNum = WLAN_GET_SEQ_SEQ(sc); ++ } ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s(): No TS!! Skip the check!!\n",__FUNCTION__); ++ goto rx_dropped; ++ } ++ } ++#endif ++ if (type == IEEE80211_FTYPE_MGMT) { ++ ++ #if 0 ++ if ( stype == IEEE80211_STYPE_AUTH && ++ fc & IEEE80211_FCTL_WEP && ieee->host_decrypt && ++ (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) ++ { ++ printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " ++ "from " MAC_FMT "\n", dev->name, ++ MAC_ARG(hdr->addr2)); ++ /* TODO: could inform hostapd about this so that it ++ * could send auth failure report */ ++ goto rx_dropped; ++ } ++ #endif ++ ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ++ if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) ++ goto rx_dropped; ++ else ++ goto rx_exit; ++ } ++ ++ /* Data frame - extract src/dst addresses */ ++ switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { ++ case IEEE80211_FCTL_FROMDS: ++ memcpy(dst, hdr->addr1, ETH_ALEN); ++ memcpy(src, hdr->addr3, ETH_ALEN); ++ memcpy(bssid, hdr->addr2, ETH_ALEN); ++ break; ++ case IEEE80211_FCTL_TODS: ++ memcpy(dst, hdr->addr3, ETH_ALEN); ++ memcpy(src, hdr->addr2, ETH_ALEN); ++ memcpy(bssid, hdr->addr1, ETH_ALEN); ++ break; ++ case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: ++ if (skb->len < IEEE80211_DATA_HDR4_LEN) ++ goto rx_dropped; ++ memcpy(dst, hdr->addr3, ETH_ALEN); ++ memcpy(src, hdr->addr4, ETH_ALEN); ++ memcpy(bssid, ieee->current_network.bssid, ETH_ALEN); ++ break; ++ case 0: ++ memcpy(dst, hdr->addr1, ETH_ALEN); ++ memcpy(src, hdr->addr2, ETH_ALEN); ++ memcpy(bssid, hdr->addr3, ETH_ALEN); ++ break; ++ } ++ ++#ifdef NOT_YET ++ if (hostap_rx_frame_wds(ieee, hdr, fc, &wds)) ++ goto rx_dropped; ++ if (wds) { ++ skb->dev = dev = wds; ++ stats = hostap_get_stats(dev); ++ } ++ ++ if (ieee->iw_mode == IW_MODE_MASTER && !wds && ++ (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == IEEE80211_FCTL_FROMDS && ++ ieee->stadev && ++ memcmp(hdr->addr2, ieee->assoc_ap_addr, ETH_ALEN) == 0) { ++ /* Frame from BSSID of the AP for which we are a client */ ++ skb->dev = dev = ieee->stadev; ++ stats = hostap_get_stats(dev); ++ from_assoc_ap = 1; ++ } ++#endif ++ ++ dev->last_rx = jiffies; ++ ++#ifdef NOT_YET ++ if ((ieee->iw_mode == IW_MODE_MASTER || ++ ieee->iw_mode == IW_MODE_REPEAT) && ++ !from_assoc_ap) { ++ switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats, ++ wds != NULL)) { ++ case AP_RX_CONTINUE_NOT_AUTHORIZED: ++ frame_authorized = 0; ++ break; ++ case AP_RX_CONTINUE: ++ frame_authorized = 1; ++ break; ++ case AP_RX_DROP: ++ goto rx_dropped; ++ case AP_RX_EXIT: ++ goto rx_exit; ++ } ++ } ++#endif ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ++ /* Nullfunc frames may have PS-bit set, so they must be passed to ++ * hostap_handle_sta_rx() before being dropped here. */ ++ if (stype != IEEE80211_STYPE_DATA && ++ stype != IEEE80211_STYPE_DATA_CFACK && ++ stype != IEEE80211_STYPE_DATA_CFPOLL && ++ stype != IEEE80211_STYPE_DATA_CFACKPOLL&& ++ stype != IEEE80211_STYPE_QOS_DATA//add by David,2006.8.4 ++ ) { ++ if (stype != IEEE80211_STYPE_NULLFUNC) ++ IEEE80211_DEBUG_DROP( ++ "RX: dropped data frame " ++ "with no data (type=0x%02x, " ++ "subtype=0x%02x, len=%d)\n", ++ type, stype, skb->len); ++ goto rx_dropped; ++ } ++ if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN)) ++ goto rx_dropped; ++ ++ /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ ++ ++ if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && ++ (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) ++ { ++ printk("decrypt frame error\n"); ++ goto rx_dropped; ++ } ++ ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ ++ /* skb: hdr + (possibly fragmented) plaintext payload */ ++ // PR: FIXME: hostap has additional conditions in the "if" below: ++ // ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && ++ if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) { ++ int flen; ++ struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr); ++ IEEE80211_DEBUG_FRAG("Rx Fragment received (%u)\n", frag); ++ ++ if (!frag_skb) { ++ IEEE80211_DEBUG(IEEE80211_DL_RX | IEEE80211_DL_FRAG, ++ "Rx cannot get skb from fragment " ++ "cache (morefrag=%d seq=%u frag=%u)\n", ++ (fc & IEEE80211_FCTL_MOREFRAGS) != 0, ++ WLAN_GET_SEQ_SEQ(sc), frag); ++ goto rx_dropped; ++ } ++ flen = skb->len; ++ if (frag != 0) ++ flen -= hdrlen; ++ ++ if (frag_skb->tail + flen > frag_skb->end) { ++ printk(KERN_WARNING "%s: host decrypted and " ++ "reassembled frame did not fit skb\n", ++ dev->name); ++ ieee80211_frag_cache_invalidate(ieee, hdr); ++ goto rx_dropped; ++ } ++ ++ if (frag == 0) { ++ /* copy first fragment (including full headers) into ++ * beginning of the fragment cache skb */ ++ memcpy(skb_put(frag_skb, flen), skb->data, flen); ++ } else { ++ /* append frame payload to the end of the fragment ++ * cache skb */ ++ memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, ++ flen); ++ } ++ dev_kfree_skb_any(skb); ++ skb = NULL; ++ ++ if (fc & IEEE80211_FCTL_MOREFRAGS) { ++ /* more fragments expected - leave the skb in fragment ++ * cache for now; it will be delivered to upper layers ++ * after all fragments have been received */ ++ goto rx_exit; ++ } ++ ++ /* this was the last fragment and the frame will be ++ * delivered, so remove skb from fragment cache */ ++ skb = frag_skb; ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ ieee80211_frag_cache_invalidate(ieee, hdr); ++ } ++ ++ /* skb: hdr + (possible reassembled) full MSDU payload; possibly still ++ * encrypted/authenticated */ ++ if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && ++ ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) ++ { ++ printk("==>decrypt msdu error\n"); ++ goto rx_dropped; ++ } ++ ++ //added by amy for AP roaming ++ ieee->LinkDetectInfo.NumRecvDataInPeriod++; ++ ieee->LinkDetectInfo.NumRxOkInPeriod++; ++ ++ hdr = (struct ieee80211_hdr_4addr *) skb->data; ++ if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) { ++ if (/*ieee->ieee802_1x &&*/ ++ ieee80211_is_eapol_frame(ieee, skb, hdrlen)) { ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++ /* pass unencrypted EAPOL frames even if encryption is ++ * configured */ ++ struct eapol *eap = (struct eapol *)(skb->data + ++ 24); ++ IEEE80211_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n", ++ eap_get_type(eap->type)); ++#endif ++ } else { ++ IEEE80211_DEBUG_DROP( ++ "encryption configured, but RX " ++ "frame not encrypted (SA=" MAC_FMT ")\n", ++ MAC_ARG(hdr->addr2)); ++ goto rx_dropped; ++ } ++ } ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++ if (crypt && !(fc & IEEE80211_FCTL_WEP) && ++ ieee80211_is_eapol_frame(ieee, skb, hdrlen)) { ++ struct eapol *eap = (struct eapol *)(skb->data + ++ 24); ++ IEEE80211_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n", ++ eap_get_type(eap->type)); ++ } ++#endif ++ ++ if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep && ++ !ieee80211_is_eapol_frame(ieee, skb, hdrlen)) { ++ IEEE80211_DEBUG_DROP( ++ "dropped unencrypted RX data " ++ "frame from " MAC_FMT ++ " (drop_unencrypted=1)\n", ++ MAC_ARG(hdr->addr2)); ++ goto rx_dropped; ++ } ++/* ++ if(ieee80211_is_eapol_frame(ieee, skb, hdrlen)) { ++ printk(KERN_WARNING "RX: IEEE802.1X EPAOL frame!\n"); ++ } ++*/ ++//added by amy for reorder ++#if 1 ++ if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) ++ && !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1)) ++ { ++ TID = Frame_QoSTID(skb->data); ++ SeqNum = WLAN_GET_SEQ_SEQ(sc); ++ GetTs(ieee,(PTS_COMMON_INFO*) &pTS,hdr->addr2,TID,RX_DIR,true); ++ if(TID !=0 && TID !=3) ++ { ++ ieee->bis_any_nonbepkts = true; ++ } ++ } ++#endif ++//added by amy for reorder ++ /* skb: hdr + (possible reassembled) full plaintext payload */ ++ payload = skb->data + hdrlen; ++ //ethertype = (payload[6] << 8) | payload[7]; ++ rxb = (struct ieee80211_rxb*)kmalloc(sizeof(struct ieee80211_rxb),GFP_ATOMIC); ++ if(rxb == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR,"%s(): kmalloc rxb error\n",__FUNCTION__); ++ goto rx_dropped; ++ } ++ /* to parse amsdu packets */ ++ /* qos data packets & reserved bit is 1 */ ++ if(parse_subframe(skb,rx_stats,rxb,src,dst) == 0) { ++ /* only to free rxb, and not submit the packets to upper layer */ ++ for(i =0; i < rxb->nr_subframes; i++) { ++ dev_kfree_skb(rxb->subframes[i]); ++ } ++ kfree(rxb); ++ rxb = NULL; ++ goto rx_dropped; ++ } ++ ++ ieee->last_rx_ps_time = jiffies; ++//added by amy for reorder ++ if(ieee->pHTInfo->bCurRxReorderEnable == false ||pTS == NULL){ ++//added by amy for reorder ++ for(i = 0; inr_subframes; i++) { ++ struct sk_buff *sub_skb = rxb->subframes[i]; ++ ++ if (sub_skb) { ++ /* convert hdr + possible LLC headers into Ethernet header */ ++ ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7]; ++ if (sub_skb->len >= 8 && ++ ((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 && ++ ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || ++ memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) { ++ /* remove RFC1042 or Bridge-Tunnel encapsulation and ++ * replace EtherType */ ++ skb_pull(sub_skb, SNAP_SIZE); ++ memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN); ++ memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN); ++ } else { ++ u16 len; ++ /* Leave Ethernet header part of hdr and full payload */ ++ len = htons(sub_skb->len); ++ memcpy(skb_push(sub_skb, 2), &len, 2); ++ memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN); ++ memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN); ++ } ++ ++ stats->rx_packets++; ++ stats->rx_bytes += sub_skb->len; ++ if(is_multicast_ether_addr(dst)) { ++ stats->multicast++; ++ } ++ ++ /* Indicat the packets to upper layer */ ++ //printk("0skb_len(%d)\n", skb->len); ++ sub_skb->protocol = eth_type_trans(sub_skb, dev); ++ memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); ++ sub_skb->dev = dev; ++ sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ ++ //skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */ ++ //printk("1skb_len(%d)\n", skb->len); ++ netif_rx(sub_skb); ++ } ++ } ++ kfree(rxb); ++ rxb = NULL; ++ ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): REORDER ENABLE AND PTS not NULL, and we will enter RxReorderIndicatePacket()\n",__FUNCTION__); ++ RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum); ++ } ++#ifndef JOHN_NOCPY ++ dev_kfree_skb(skb); ++#endif ++ ++ rx_exit: ++#ifdef NOT_YET ++ if (sta) ++ hostap_handle_sta_release(sta); ++#endif ++ return 1; ++ ++ rx_dropped: ++ if (rxb != NULL) ++ { ++ kfree(rxb); ++ rxb = NULL; ++ } ++ stats->rx_dropped++; ++ ++ /* Returning 0 indicates to caller that we have not handled the SKB-- ++ * so it is still allocated and can be used again by underlying ++ * hardware as a DMA target */ ++ return 0; ++} ++ ++#define MGMT_FRAME_FIXED_PART_LENGTH 0x24 ++ ++static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 }; ++ ++/* ++* Make ther structure we read from the beacon packet has ++* the right values ++*/ ++static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element ++ *info_element, int sub_type) ++{ ++ ++ if (info_element->qui_subtype != sub_type) ++ return -1; ++ if (memcmp(info_element->qui, qos_oui, QOS_OUI_LEN)) ++ return -1; ++ if (info_element->qui_type != QOS_OUI_TYPE) ++ return -1; ++ if (info_element->version != QOS_VERSION_1) ++ return -1; ++ ++ return 0; ++} ++ ++ ++/* ++ * Parse a QoS parameter element ++ */ ++static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info ++ *element_param, struct ieee80211_info_element ++ *info_element) ++{ ++ int ret = 0; ++ u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; ++ ++ if ((info_element == NULL) || (element_param == NULL)) ++ return -1; ++ ++ if (info_element->id == QOS_ELEMENT_ID && info_element->len == size) { ++ memcpy(element_param->info_element.qui, info_element->data, ++ info_element->len); ++ element_param->info_element.elementID = info_element->id; ++ element_param->info_element.length = info_element->len; ++ } else ++ ret = -1; ++ if (ret == 0) ++ ret = ieee80211_verify_qos_info(&element_param->info_element, ++ QOS_OUI_PARAM_SUB_TYPE); ++ return ret; ++} ++ ++/* ++ * Parse a QoS information element ++ */ ++static int ieee80211_read_qos_info_element(struct ++ ieee80211_qos_information_element ++ *element_info, struct ieee80211_info_element ++ *info_element) ++{ ++ int ret = 0; ++ u16 size = sizeof(struct ieee80211_qos_information_element) - 2; ++ ++ if (element_info == NULL) ++ return -1; ++ if (info_element == NULL) ++ return -1; ++ ++ if ((info_element->id == QOS_ELEMENT_ID) && (info_element->len == size)) { ++ memcpy(element_info->qui, info_element->data, ++ info_element->len); ++ element_info->elementID = info_element->id; ++ element_info->length = info_element->len; ++ } else ++ ret = -1; ++ ++ if (ret == 0) ++ ret = ieee80211_verify_qos_info(element_info, ++ QOS_OUI_INFO_SUB_TYPE); ++ return ret; ++} ++ ++ ++/* ++ * Write QoS parameters from the ac parameters. ++ */ ++static int ieee80211_qos_convert_ac_to_parameters(struct ++ ieee80211_qos_parameter_info ++ *param_elm, struct ++ ieee80211_qos_parameters ++ *qos_param) ++{ ++ int rc = 0; ++ int i; ++ struct ieee80211_qos_ac_parameter *ac_params; ++ u8 aci; ++ //u8 cw_min; ++ //u8 cw_max; ++ ++ for (i = 0; i < QOS_QUEUE_NUM; i++) { ++ ac_params = &(param_elm->ac_params_record[i]); ++ ++ aci = (ac_params->aci_aifsn & 0x60) >> 5; ++ ++ if(aci >= QOS_QUEUE_NUM) ++ continue; ++ qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f; ++ ++ /* WMM spec P.11: The minimum value for AIFSN shall be 2 */ ++ qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2:qos_param->aifs[aci]; ++ ++ qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F; ++ ++ qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4; ++ ++ qos_param->flag[aci] = ++ (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00; ++ qos_param->tx_op_limit[aci] = le16_to_cpu(ac_params->tx_op_limit); ++ } ++ return rc; ++} ++ ++/* ++ * we have a generic data element which it may contain QoS information or ++ * parameters element. check the information element length to decide ++ * which type to read ++ */ ++static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element ++ *info_element, ++ struct ieee80211_network *network) ++{ ++ int rc = 0; ++ struct ieee80211_qos_parameters *qos_param = NULL; ++ struct ieee80211_qos_information_element qos_info_element; ++ ++ rc = ieee80211_read_qos_info_element(&qos_info_element, info_element); ++ ++ if (rc == 0) { ++ network->qos_data.param_count = qos_info_element.ac_info & 0x0F; ++ network->flags |= NETWORK_HAS_QOS_INFORMATION; ++ } else { ++ struct ieee80211_qos_parameter_info param_element; ++ ++ rc = ieee80211_read_qos_param_element(¶m_element, ++ info_element); ++ if (rc == 0) { ++ qos_param = &(network->qos_data.parameters); ++ ieee80211_qos_convert_ac_to_parameters(¶m_element, ++ qos_param); ++ network->flags |= NETWORK_HAS_QOS_PARAMETERS; ++ network->qos_data.param_count = ++ param_element.info_element.ac_info & 0x0F; ++ } ++ } ++ ++ if (rc == 0) { ++ IEEE80211_DEBUG_QOS("QoS is supported\n"); ++ network->qos_data.supported = 1; ++ } ++ return rc; ++} ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++#define MFIE_STRING(x) case MFIE_TYPE_ ##x: return #x ++ ++static const char *get_info_element_string(u16 id) ++{ ++ switch (id) { ++ MFIE_STRING(SSID); ++ MFIE_STRING(RATES); ++ MFIE_STRING(FH_SET); ++ MFIE_STRING(DS_SET); ++ MFIE_STRING(CF_SET); ++ MFIE_STRING(TIM); ++ MFIE_STRING(IBSS_SET); ++ MFIE_STRING(COUNTRY); ++ MFIE_STRING(HOP_PARAMS); ++ MFIE_STRING(HOP_TABLE); ++ MFIE_STRING(REQUEST); ++ MFIE_STRING(CHALLENGE); ++ MFIE_STRING(POWER_CONSTRAINT); ++ MFIE_STRING(POWER_CAPABILITY); ++ MFIE_STRING(TPC_REQUEST); ++ MFIE_STRING(TPC_REPORT); ++ MFIE_STRING(SUPP_CHANNELS); ++ MFIE_STRING(CSA); ++ MFIE_STRING(MEASURE_REQUEST); ++ MFIE_STRING(MEASURE_REPORT); ++ MFIE_STRING(QUIET); ++ MFIE_STRING(IBSS_DFS); ++ // MFIE_STRING(ERP_INFO); ++ MFIE_STRING(RSN); ++ MFIE_STRING(RATES_EX); ++ MFIE_STRING(GENERIC); ++ MFIE_STRING(QOS_PARAMETER); ++ default: ++ return "UNKNOWN"; ++ } ++} ++#endif ++ ++#ifdef ENABLE_DOT11D ++static inline void ieee80211_extract_country_ie( ++ struct ieee80211_device *ieee, ++ struct ieee80211_info_element *info_element, ++ struct ieee80211_network *network, ++ u8 * addr2 ++) ++{ ++ if(IS_DOT11D_ENABLE(ieee)) ++ { ++ if(info_element->len!= 0) ++ { ++ memcpy(network->CountryIeBuf, info_element->data, info_element->len); ++ network->CountryIeLen = info_element->len; ++ ++ if(!IS_COUNTRY_IE_VALID(ieee)) ++ { ++ Dot11d_UpdateCountryIe(ieee, addr2, info_element->len, info_element->data); ++ } ++ } ++ ++ // ++ // 070305, rcnjko: I update country IE watch dog here because ++ // some AP (e.g. Cisco 1242) don't include country IE in their ++ // probe response frame. ++ // ++ if(IS_EQUAL_CIE_SRC(ieee, addr2) ) ++ { ++ UPDATE_CIE_WATCHDOG(ieee); ++ } ++ } ++ ++} ++#endif ++ ++int ieee80211_parse_info_param(struct ieee80211_device *ieee, ++ struct ieee80211_info_element *info_element, ++ u16 length, ++ struct ieee80211_network *network, ++ struct ieee80211_rx_stats *stats) ++{ ++ u8 i; ++ short offset; ++ u16 tmp_htcap_len=0; ++ u16 tmp_htinfo_len=0; ++ u16 ht_realtek_agg_len=0; ++ u8 ht_realtek_agg_buf[MAX_IE_LEN]; ++// u16 broadcom_len = 0; ++#ifdef CONFIG_IEEE80211_DEBUG ++ char rates_str[64]; ++ char *p; ++#endif ++ ++ while (length >= sizeof(*info_element)) { ++ if (sizeof(*info_element) + info_element->len > length) { ++ IEEE80211_DEBUG_MGMT("Info elem: parse failed: " ++ "info_element->len + 2 > left : " ++ "info_element->len+2=%zd left=%d, id=%d.\n", ++ info_element->len + ++ sizeof(*info_element), ++ length, info_element->id); ++ /* We stop processing but don't return an error here ++ * because some misbehaviour APs break this rule. ie. ++ * Orinoco AP1000. */ ++ break; ++ } ++ ++ switch (info_element->id) { ++ case MFIE_TYPE_SSID: ++ if (ieee80211_is_empty_essid(info_element->data, ++ info_element->len)) { ++ network->flags |= NETWORK_EMPTY_ESSID; ++ break; ++ } ++ ++ network->ssid_len = min(info_element->len, ++ (u8) IW_ESSID_MAX_SIZE); ++ memcpy(network->ssid, info_element->data, network->ssid_len); ++ if (network->ssid_len < IW_ESSID_MAX_SIZE) ++ memset(network->ssid + network->ssid_len, 0, ++ IW_ESSID_MAX_SIZE - network->ssid_len); ++ ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", ++ network->ssid, network->ssid_len); ++ break; ++ ++ case MFIE_TYPE_RATES: ++#ifdef CONFIG_IEEE80211_DEBUG ++ p = rates_str; ++#endif ++ network->rates_len = min(info_element->len, ++ MAX_RATES_LENGTH); ++ for (i = 0; i < network->rates_len; i++) { ++ network->rates[i] = info_element->data[i]; ++#ifdef CONFIG_IEEE80211_DEBUG ++ p += snprintf(p, sizeof(rates_str) - ++ (p - rates_str), "%02X ", ++ network->rates[i]); ++#endif ++ if (ieee80211_is_ofdm_rate ++ (info_element->data[i])) { ++ network->flags |= NETWORK_HAS_OFDM; ++ if (info_element->data[i] & ++ IEEE80211_BASIC_RATE_MASK) ++ network->flags &= ++ ~NETWORK_HAS_CCK; ++ } ++ } ++ ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_RATES: '%s' (%d)\n", ++ rates_str, network->rates_len); ++ break; ++ ++ case MFIE_TYPE_RATES_EX: ++#ifdef CONFIG_IEEE80211_DEBUG ++ p = rates_str; ++#endif ++ network->rates_ex_len = min(info_element->len, ++ MAX_RATES_EX_LENGTH); ++ for (i = 0; i < network->rates_ex_len; i++) { ++ network->rates_ex[i] = info_element->data[i]; ++#ifdef CONFIG_IEEE80211_DEBUG ++ p += snprintf(p, sizeof(rates_str) - ++ (p - rates_str), "%02X ", ++ network->rates[i]); ++#endif ++ if (ieee80211_is_ofdm_rate ++ (info_element->data[i])) { ++ network->flags |= NETWORK_HAS_OFDM; ++ if (info_element->data[i] & ++ IEEE80211_BASIC_RATE_MASK) ++ network->flags &= ++ ~NETWORK_HAS_CCK; ++ } ++ } ++ ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_RATES_EX: '%s' (%d)\n", ++ rates_str, network->rates_ex_len); ++ break; ++ ++ case MFIE_TYPE_DS_SET: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_DS_SET: %d\n", ++ info_element->data[0]); ++ network->channel = info_element->data[0]; ++ break; ++ ++ case MFIE_TYPE_FH_SET: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_FH_SET: ignored\n"); ++ break; ++ ++ case MFIE_TYPE_CF_SET: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_CF_SET: ignored\n"); ++ break; ++ ++ case MFIE_TYPE_TIM: ++ if(info_element->len < 4) ++ break; ++ ++ network->tim.tim_count = info_element->data[0]; ++ network->tim.tim_period = info_element->data[1]; ++ ++ network->dtim_period = info_element->data[1]; ++ if(ieee->state != IEEE80211_LINKED) ++ break; ++#if 0 ++ network->last_dtim_sta_time[0] = stats->mac_time[0]; ++#else ++ //we use jiffies for legacy Power save ++ network->last_dtim_sta_time[0] = jiffies; ++#endif ++ network->last_dtim_sta_time[1] = stats->mac_time[1]; ++ ++ network->dtim_data = IEEE80211_DTIM_VALID; ++ ++ if(info_element->data[0] != 0) ++ break; ++ ++ if(info_element->data[2] & 1) ++ network->dtim_data |= IEEE80211_DTIM_MBCAST; ++ ++ offset = (info_element->data[2] >> 1)*2; ++ ++ //printk("offset1:%x aid:%x\n",offset, ieee->assoc_id); ++ ++ if(ieee->assoc_id < 8*offset || ++ ieee->assoc_id > 8*(offset + info_element->len -3)) ++ ++ break; ++ ++ offset = (ieee->assoc_id / 8) - offset;// + ((aid % 8)? 0 : 1) ; ++ ++ if(info_element->data[3+offset] & (1<<(ieee->assoc_id%8))) ++ network->dtim_data |= IEEE80211_DTIM_UCAST; ++ ++ //IEEE80211_DEBUG_MGMT("MFIE_TYPE_TIM: partially ignored\n"); ++ break; ++ ++ case MFIE_TYPE_ERP: ++ network->erp_value = info_element->data[0]; ++ network->flags |= NETWORK_HAS_ERP_VALUE; ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n", ++ network->erp_value); ++ break; ++ case MFIE_TYPE_IBSS_SET: ++ network->atim_window = info_element->data[0]; ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_IBSS_SET: %d\n", ++ network->atim_window); ++ break; ++ ++ case MFIE_TYPE_CHALLENGE: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_CHALLENGE: ignored\n"); ++ break; ++ ++ case MFIE_TYPE_GENERIC: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_GENERIC: %d bytes\n", ++ info_element->len); ++ if (!ieee80211_parse_qos_info_param_IE(info_element, ++ network)) ++ break; ++ ++ if (info_element->len >= 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x50 && ++ info_element->data[2] == 0xf2 && ++ info_element->data[3] == 0x01) { ++ network->wpa_ie_len = min(info_element->len + 2, ++ MAX_WPA_IE_LEN); ++ memcpy(network->wpa_ie, info_element, ++ network->wpa_ie_len); ++ break; ++ } ++ ++#ifdef THOMAS_TURBO ++ if (info_element->len == 7 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0xe0 && ++ info_element->data[2] == 0x4c && ++ info_element->data[3] == 0x01 && ++ info_element->data[4] == 0x02) { ++ network->Turbo_Enable = 1; ++ } ++#endif ++ ++ //for HTcap and HTinfo parameters ++ if(tmp_htcap_len == 0){ ++ if(info_element->len >= 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x90 && ++ info_element->data[2] == 0x4c && ++ info_element->data[3] == 0x033){ ++ ++ tmp_htcap_len = min(info_element->len,(u8)MAX_IE_LEN); ++ if(tmp_htcap_len != 0){ ++ network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; ++ network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf)?\ ++ sizeof(network->bssht.bdHTCapBuf):tmp_htcap_len; ++ memcpy(network->bssht.bdHTCapBuf,info_element->data,network->bssht.bdHTCapLen); ++ } ++ } ++ if(tmp_htcap_len != 0) ++ network->bssht.bdSupportHT = true; ++ else ++ network->bssht.bdSupportHT = false; ++ } ++ ++ ++ if(tmp_htinfo_len == 0){ ++ if(info_element->len >= 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x90 && ++ info_element->data[2] == 0x4c && ++ info_element->data[3] == 0x034){ ++ ++ tmp_htinfo_len = min(info_element->len,(u8)MAX_IE_LEN); ++ if(tmp_htinfo_len != 0){ ++ network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; ++ if(tmp_htinfo_len){ ++ network->bssht.bdHTInfoLen = tmp_htinfo_len > sizeof(network->bssht.bdHTInfoBuf)?\ ++ sizeof(network->bssht.bdHTInfoBuf):tmp_htinfo_len; ++ memcpy(network->bssht.bdHTInfoBuf,info_element->data,network->bssht.bdHTInfoLen); ++ } ++ ++ } ++ ++ } ++ } ++ ++ if(ieee->aggregation){ ++ if(network->bssht.bdSupportHT){ ++ if(info_element->len >= 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0xe0 && ++ info_element->data[2] == 0x4c && ++ info_element->data[3] == 0x02){ ++ ++ ht_realtek_agg_len = min(info_element->len,(u8)MAX_IE_LEN); ++ memcpy(ht_realtek_agg_buf,info_element->data,info_element->len); ++ ++ } ++ if(ht_realtek_agg_len >= 5){ ++ network->bssht.bdRT2RTAggregation = true; ++ ++ if((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & 0x02)) ++ network->bssht.bdRT2RTLongSlotTime = true; ++ } ++ } ++ ++ } ++ ++ //if(tmp_htcap_len !=0 || tmp_htinfo_len != 0) ++ { ++ if((info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x05 && ++ info_element->data[2] == 0xb5) || ++ (info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x0a && ++ info_element->data[2] == 0xf7) || ++ (info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x10 && ++ info_element->data[2] == 0x18)){ ++ ++ network->broadcom_cap_exist = true; ++ ++ } ++ } ++#if 0 ++ if (tmp_htcap_len !=0) ++ { ++ u16 cap_ext = ((PHT_CAPABILITY_ELE)&info_element->data[0])->ExtHTCapInfo; ++ if ((cap_ext & 0x0c00) == 0x0c00) ++ { ++ network->ralink_cap_exist = true; ++ } ++ } ++#endif ++ if(info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x0c && ++ info_element->data[2] == 0x43) ++ { ++ network->ralink_cap_exist = true; ++ } ++ else ++ network->ralink_cap_exist = false; ++ //added by amy for atheros AP ++ if((info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x03 && ++ info_element->data[2] == 0x7f) || ++ (info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x13 && ++ info_element->data[2] == 0x74)) ++ { ++ printk("========>%s(): athros AP is exist\n",__FUNCTION__); ++ network->atheros_cap_exist = true; ++ } ++ else ++ network->atheros_cap_exist = false; ++ ++ if(info_element->len >= 3 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x40 && ++ info_element->data[2] == 0x96) ++ { ++ network->cisco_cap_exist = true; ++ } ++ else ++ network->cisco_cap_exist = false; ++ //added by amy for LEAP of cisco ++ if(info_element->len > 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x40 && ++ info_element->data[2] == 0x96 && ++ info_element->data[3] == 0x01) ++ { ++ if(info_element->len == 6) ++ { ++ memcpy(network->CcxRmState, &info_element[4], 2); ++ if(network->CcxRmState[0] != 0) ++ { ++ network->bCcxRmEnable = true; ++ } ++ else ++ network->bCcxRmEnable = false; ++ // ++ // CCXv4 Table 59-1 MBSSID Masks. ++ // ++ network->MBssidMask = network->CcxRmState[1] & 0x07; ++ if(network->MBssidMask != 0) ++ { ++ network->bMBssidValid = true; ++ network->MBssidMask = 0xff << (network->MBssidMask); ++ cpMacAddr(network->MBssid, network->bssid); ++ network->MBssid[5] &= network->MBssidMask; ++ } ++ else ++ { ++ network->bMBssidValid = false; ++ } ++ } ++ else ++ { ++ network->bCcxRmEnable = false; ++ } ++ } ++ if(info_element->len > 4 && ++ info_element->data[0] == 0x00 && ++ info_element->data[1] == 0x40 && ++ info_element->data[2] == 0x96 && ++ info_element->data[3] == 0x03) ++ { ++ if(info_element->len == 5) ++ { ++ network->bWithCcxVerNum = true; ++ network->BssCcxVerNumber = info_element->data[4]; ++ } ++ else ++ { ++ network->bWithCcxVerNum = false; ++ network->BssCcxVerNumber = 0; ++ } ++ } ++ break; ++ ++ case MFIE_TYPE_RSN: ++ IEEE80211_DEBUG_MGMT("MFIE_TYPE_RSN: %d bytes\n", ++ info_element->len); ++ network->rsn_ie_len = min(info_element->len + 2, ++ MAX_WPA_IE_LEN); ++ memcpy(network->rsn_ie, info_element, ++ network->rsn_ie_len); ++ break; ++ ++ //HT related element. ++ case MFIE_TYPE_HT_CAP: ++ IEEE80211_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n", ++ info_element->len); ++ tmp_htcap_len = min(info_element->len,(u8)MAX_IE_LEN); ++ if(tmp_htcap_len != 0){ ++ network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; ++ network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf)?\ ++ sizeof(network->bssht.bdHTCapBuf):tmp_htcap_len; ++ memcpy(network->bssht.bdHTCapBuf,info_element->data,network->bssht.bdHTCapLen); ++ ++ //If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() ++ // windows driver will update WMM parameters each beacon received once connected ++ // Linux driver is a bit different. ++ network->bssht.bdSupportHT = true; ++ } ++ else ++ network->bssht.bdSupportHT = false; ++ break; ++ ++ ++ case MFIE_TYPE_HT_INFO: ++ IEEE80211_DEBUG_SCAN("MFIE_TYPE_HT_INFO: %d bytes\n", ++ info_element->len); ++ tmp_htinfo_len = min(info_element->len,(u8)MAX_IE_LEN); ++ if(tmp_htinfo_len){ ++ network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; ++ network->bssht.bdHTInfoLen = tmp_htinfo_len > sizeof(network->bssht.bdHTInfoBuf)?\ ++ sizeof(network->bssht.bdHTInfoBuf):tmp_htinfo_len; ++ memcpy(network->bssht.bdHTInfoBuf,info_element->data,network->bssht.bdHTInfoLen); ++ } ++ break; ++ ++ case MFIE_TYPE_AIRONET: ++ IEEE80211_DEBUG_SCAN("MFIE_TYPE_AIRONET: %d bytes\n", ++ info_element->len); ++ if(info_element->len >IE_CISCO_FLAG_POSITION) ++ { ++ network->bWithAironetIE = true; ++ ++ // CCX 1 spec v1.13, A01.1 CKIP Negotiation (page23): ++ // "A Cisco access point advertises support for CKIP in beacon and probe response packets, ++ // by adding an Aironet element and setting one or both of the CKIP negotiation bits." ++ if( (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_MIC) || ++ (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_PK) ) ++ { ++ network->bCkipSupported = true; ++ } ++ else ++ { ++ network->bCkipSupported = false; ++ } ++ } ++ else ++ { ++ network->bWithAironetIE = false; ++ network->bCkipSupported = false; ++ } ++ break; ++ case MFIE_TYPE_QOS_PARAMETER: ++ printk(KERN_ERR ++ "QoS Error need to parse QOS_PARAMETER IE\n"); ++ break; ++ ++#ifdef ENABLE_DOT11D ++ case MFIE_TYPE_COUNTRY: ++ IEEE80211_DEBUG_SCAN("MFIE_TYPE_COUNTRY: %d bytes\n", ++ info_element->len); ++ //printk("=====>Receive <%s> Country IE\n",network->ssid); ++ ieee80211_extract_country_ie(ieee, info_element, network, network->bssid);//addr2 is same as addr3 when from an AP ++ break; ++#endif ++/* TODO */ ++#if 0 ++ /* 802.11h */ ++ case MFIE_TYPE_POWER_CONSTRAINT: ++ network->power_constraint = info_element->data[0]; ++ network->flags |= NETWORK_HAS_POWER_CONSTRAINT; ++ break; ++ ++ case MFIE_TYPE_CSA: ++ network->power_constraint = info_element->data[0]; ++ network->flags |= NETWORK_HAS_CSA; ++ break; ++ ++ case MFIE_TYPE_QUIET: ++ network->quiet.count = info_element->data[0]; ++ network->quiet.period = info_element->data[1]; ++ network->quiet.duration = info_element->data[2]; ++ network->quiet.offset = info_element->data[3]; ++ network->flags |= NETWORK_HAS_QUIET; ++ break; ++ ++ case MFIE_TYPE_IBSS_DFS: ++ if (network->ibss_dfs) ++ break; ++ network->ibss_dfs = kmemdup(info_element->data, ++ info_element->len, ++ GFP_ATOMIC); ++ if (!network->ibss_dfs) ++ return 1; ++ network->flags |= NETWORK_HAS_IBSS_DFS; ++ break; ++ ++ case MFIE_TYPE_TPC_REPORT: ++ network->tpc_report.transmit_power = ++ info_element->data[0]; ++ network->tpc_report.link_margin = info_element->data[1]; ++ network->flags |= NETWORK_HAS_TPC_REPORT; ++ break; ++#endif ++ default: ++ IEEE80211_DEBUG_MGMT ++ ("Unsupported info element: %s (%d)\n", ++ get_info_element_string(info_element->id), ++ info_element->id); ++ break; ++ } ++ ++ length -= sizeof(*info_element) + info_element->len; ++ info_element = ++ (struct ieee80211_info_element *)&info_element-> ++ data[info_element->len]; ++ } ++ ++ if(!network->atheros_cap_exist && !network->broadcom_cap_exist && ++ !network->cisco_cap_exist && !network->ralink_cap_exist && !network->bssht.bdRT2RTAggregation) ++ { ++ network->unknown_cap_exist = true; ++ } ++ else ++ { ++ network->unknown_cap_exist = false; ++ } ++ return 0; ++} ++ ++static inline u8 ieee80211_SignalStrengthTranslate( ++ u8 CurrSS ++ ) ++{ ++ u8 RetSS; ++ ++ // Step 1. Scale mapping. ++ if(CurrSS >= 71 && CurrSS <= 100) ++ { ++ RetSS = 90 + ((CurrSS - 70) / 3); ++ } ++ else if(CurrSS >= 41 && CurrSS <= 70) ++ { ++ RetSS = 78 + ((CurrSS - 40) / 3); ++ } ++ else if(CurrSS >= 31 && CurrSS <= 40) ++ { ++ RetSS = 66 + (CurrSS - 30); ++ } ++ else if(CurrSS >= 21 && CurrSS <= 30) ++ { ++ RetSS = 54 + (CurrSS - 20); ++ } ++ else if(CurrSS >= 5 && CurrSS <= 20) ++ { ++ RetSS = 42 + (((CurrSS - 5) * 2) / 3); ++ } ++ else if(CurrSS == 4) ++ { ++ RetSS = 36; ++ } ++ else if(CurrSS == 3) ++ { ++ RetSS = 27; ++ } ++ else if(CurrSS == 2) ++ { ++ RetSS = 18; ++ } ++ else if(CurrSS == 1) ++ { ++ RetSS = 9; ++ } ++ else ++ { ++ RetSS = CurrSS; ++ } ++ //RT_TRACE(COMP_DBG, DBG_LOUD, ("##### After Mapping: LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS)); ++ ++ // Step 2. Smoothing. ++ ++ //RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$$$ After Smoothing: LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS)); ++ ++ return RetSS; ++} ++ ++long ieee80211_translate_todbm(u8 signal_strength_index )// 0-100 index. ++{ ++ long signal_power; // in dBm. ++ ++ // Translate to dBm (x=0.5y-95). ++ signal_power = (long)((signal_strength_index + 1) >> 1); ++ signal_power -= 95; ++ ++ return signal_power; ++} ++ ++static inline int ieee80211_network_init( ++ struct ieee80211_device *ieee, ++ struct ieee80211_probe_response *beacon, ++ struct ieee80211_network *network, ++ struct ieee80211_rx_stats *stats) ++{ ++#ifdef CONFIG_IEEE80211_DEBUG ++ //char rates_str[64]; ++ //char *p; ++#endif ++ ++ network->qos_data.active = 0; ++ network->qos_data.supported = 0; ++ network->qos_data.param_count = 0; ++ network->qos_data.old_param_count = 0; ++ ++ /* Pull out fixed field data */ ++ memcpy(network->bssid, beacon->header.addr3, ETH_ALEN); ++ network->capability = le16_to_cpu(beacon->capability); ++ network->last_scanned = jiffies; ++ network->time_stamp[0] = le32_to_cpu(beacon->time_stamp[0]); ++ network->time_stamp[1] = le32_to_cpu(beacon->time_stamp[1]); ++ network->beacon_interval = le32_to_cpu(beacon->beacon_interval); ++ /* Where to pull this? beacon->listen_interval;*/ ++ network->listen_interval = 0x0A; ++ network->rates_len = network->rates_ex_len = 0; ++ network->last_associate = 0; ++ network->ssid_len = 0; ++ network->flags = 0; ++ network->atim_window = 0; ++ network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? ++ 0x3 : 0x0; ++ network->berp_info_valid = false; ++ network->broadcom_cap_exist = false; ++ network->ralink_cap_exist = false; ++ network->atheros_cap_exist = false; ++ network->cisco_cap_exist = false; ++ network->unknown_cap_exist = false; ++#ifdef THOMAS_TURBO ++ network->Turbo_Enable = 0; ++#endif ++#ifdef ENABLE_DOT11D ++ network->CountryIeLen = 0; ++ memset(network->CountryIeBuf, 0, MAX_IE_LEN); ++#endif ++//Initialize HT parameters ++ //ieee80211_ht_initialize(&network->bssht); ++ HTInitializeBssDesc(&network->bssht); ++ if (stats->freq == IEEE80211_52GHZ_BAND) { ++ /* for A band (No DS info) */ ++ network->channel = stats->received_channel; ++ } else ++ network->flags |= NETWORK_HAS_CCK; ++ ++ network->wpa_ie_len = 0; ++ network->rsn_ie_len = 0; ++ ++ if (ieee80211_parse_info_param ++ (ieee,beacon->info_element, stats->len - sizeof(*beacon), network, stats)) ++ return 1; ++ ++ network->mode = 0; ++ if (stats->freq == IEEE80211_52GHZ_BAND) ++ network->mode = IEEE_A; ++ else { ++ if (network->flags & NETWORK_HAS_OFDM) ++ network->mode |= IEEE_G; ++ if (network->flags & NETWORK_HAS_CCK) ++ network->mode |= IEEE_B; ++ } ++ ++ if (network->mode == 0) { ++ IEEE80211_DEBUG_SCAN("Filtered out '%s (" MAC_FMT ")' " ++ "network.\n", ++ escape_essid(network->ssid, ++ network->ssid_len), ++ MAC_ARG(network->bssid)); ++ return 1; ++ } ++ ++ if(network->bssht.bdSupportHT){ ++ if(network->mode == IEEE_A) ++ network->mode = IEEE_N_5G; ++ else if(network->mode & (IEEE_G | IEEE_B)) ++ network->mode = IEEE_N_24G; ++ } ++ if (ieee80211_is_empty_essid(network->ssid, network->ssid_len)) ++ network->flags |= NETWORK_EMPTY_ESSID; ++ ++#if 1 ++ stats->signal = 30 + (stats->SignalStrength * 70) / 100; ++ //stats->signal = ieee80211_SignalStrengthTranslate(stats->signal); ++ stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25; ++#endif ++ ++ memcpy(&network->stats, stats, sizeof(network->stats)); ++ ++ return 0; ++} ++ ++static inline int is_same_network(struct ieee80211_network *src, ++ struct ieee80211_network *dst, struct ieee80211_device* ieee) ++{ ++ /* A network is only a duplicate if the channel, BSSID, ESSID ++ * and the capability field (in particular IBSS and BSS) all match. ++ * We treat all with the same BSSID and channel ++ * as one network */ ++ return //((src->ssid_len == dst->ssid_len) && ++ (((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && ++ (src->channel == dst->channel) && ++ !memcmp(src->bssid, dst->bssid, ETH_ALEN) && ++ //!memcmp(src->ssid, dst->ssid, src->ssid_len) && ++ (!memcmp(src->ssid, dst->ssid, src->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && ++ ((src->capability & WLAN_CAPABILITY_IBSS) == ++ (dst->capability & WLAN_CAPABILITY_IBSS)) && ++ ((src->capability & WLAN_CAPABILITY_BSS) == ++ (dst->capability & WLAN_CAPABILITY_BSS))); ++} ++ ++static inline void update_network(struct ieee80211_network *dst, ++ struct ieee80211_network *src) ++{ ++ int qos_active; ++ u8 old_param; ++ ++ memcpy(&dst->stats, &src->stats, sizeof(struct ieee80211_rx_stats)); ++ dst->capability = src->capability; ++ memcpy(dst->rates, src->rates, src->rates_len); ++ dst->rates_len = src->rates_len; ++ memcpy(dst->rates_ex, src->rates_ex, src->rates_ex_len); ++ dst->rates_ex_len = src->rates_ex_len; ++ if(src->ssid_len > 0) ++ { ++ memset(dst->ssid, 0, dst->ssid_len); ++ dst->ssid_len = src->ssid_len; ++ memcpy(dst->ssid, src->ssid, src->ssid_len); ++ } ++ dst->mode = src->mode; ++ dst->flags = src->flags; ++ dst->time_stamp[0] = src->time_stamp[0]; ++ dst->time_stamp[1] = src->time_stamp[1]; ++ if (src->flags & NETWORK_HAS_ERP_VALUE) ++ { ++ dst->erp_value = src->erp_value; ++ dst->berp_info_valid = src->berp_info_valid = true; ++ } ++ dst->beacon_interval = src->beacon_interval; ++ dst->listen_interval = src->listen_interval; ++ dst->atim_window = src->atim_window; ++ dst->dtim_period = src->dtim_period; ++ dst->dtim_data = src->dtim_data; ++ dst->last_dtim_sta_time[0] = src->last_dtim_sta_time[0]; ++ dst->last_dtim_sta_time[1] = src->last_dtim_sta_time[1]; ++ memcpy(&dst->tim, &src->tim, sizeof(struct ieee80211_tim_parameters)); ++ ++ dst->bssht.bdSupportHT = src->bssht.bdSupportHT; ++ dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; ++ dst->bssht.bdHTCapLen= src->bssht.bdHTCapLen; ++ memcpy(dst->bssht.bdHTCapBuf,src->bssht.bdHTCapBuf,src->bssht.bdHTCapLen); ++ dst->bssht.bdHTInfoLen= src->bssht.bdHTInfoLen; ++ memcpy(dst->bssht.bdHTInfoBuf,src->bssht.bdHTInfoBuf,src->bssht.bdHTInfoLen); ++ dst->bssht.bdHTSpecVer = src->bssht.bdHTSpecVer; ++ dst->bssht.bdRT2RTLongSlotTime = src->bssht.bdRT2RTLongSlotTime; ++ dst->broadcom_cap_exist = src->broadcom_cap_exist; ++ dst->ralink_cap_exist = src->ralink_cap_exist; ++ dst->atheros_cap_exist = src->atheros_cap_exist; ++ dst->cisco_cap_exist = src->cisco_cap_exist; ++ dst->unknown_cap_exist = src->unknown_cap_exist; ++ memcpy(dst->wpa_ie, src->wpa_ie, src->wpa_ie_len); ++ dst->wpa_ie_len = src->wpa_ie_len; ++ memcpy(dst->rsn_ie, src->rsn_ie, src->rsn_ie_len); ++ dst->rsn_ie_len = src->rsn_ie_len; ++ ++ dst->last_scanned = jiffies; ++ /* qos related parameters */ ++ //qos_active = src->qos_data.active; ++ qos_active = dst->qos_data.active; ++ //old_param = dst->qos_data.old_param_count; ++ old_param = dst->qos_data.param_count; ++ if(dst->flags & NETWORK_HAS_QOS_MASK){ ++ //not update QOS paramter in beacon, as most AP will set all these parameter to 0.//WB ++ // printk("====>%s(), aifs:%x, %x\n", __FUNCTION__, dst->qos_data.parameters.aifs[0], src->qos_data.parameters.aifs[0]); ++ // memcpy(&dst->qos_data, &src->qos_data, ++ // sizeof(struct ieee80211_qos_data)); ++ } ++ else { ++ dst->qos_data.supported = src->qos_data.supported; ++ dst->qos_data.param_count = src->qos_data.param_count; ++ } ++ ++ if(dst->qos_data.supported == 1) { ++ dst->QoS_Enable = 1; ++ if(dst->ssid_len) ++ IEEE80211_DEBUG_QOS ++ ("QoS the network %s is QoS supported\n", ++ dst->ssid); ++ else ++ IEEE80211_DEBUG_QOS ++ ("QoS the network is QoS supported\n"); ++ } ++ dst->qos_data.active = qos_active; ++ dst->qos_data.old_param_count = old_param; ++ ++ /* dst->last_associate is not overwritten */ ++#if 1 ++ dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame. ++ if(src->wmm_param[0].ac_aci_acm_aifsn|| \ ++ src->wmm_param[1].ac_aci_acm_aifsn|| \ ++ src->wmm_param[2].ac_aci_acm_aifsn|| \ ++ src->wmm_param[1].ac_aci_acm_aifsn) { ++ memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN); ++ } ++ //dst->QoS_Enable = src->QoS_Enable; ++#else ++ dst->QoS_Enable = 1;//for Rtl8187 simulation ++#endif ++#ifdef THOMAS_TURBO ++ dst->Turbo_Enable = src->Turbo_Enable; ++#endif ++ ++#ifdef ENABLE_DOT11D ++ dst->CountryIeLen = src->CountryIeLen; ++ memcpy(dst->CountryIeBuf, src->CountryIeBuf, src->CountryIeLen); ++#endif ++ ++ //added by amy for LEAP ++ dst->bWithAironetIE = src->bWithAironetIE; ++ dst->bCkipSupported = src->bCkipSupported; ++ memcpy(dst->CcxRmState,src->CcxRmState,2); ++ dst->bCcxRmEnable = src->bCcxRmEnable; ++ dst->MBssidMask = src->MBssidMask; ++ dst->bMBssidValid = src->bMBssidValid; ++ memcpy(dst->MBssid,src->MBssid,6); ++ dst->bWithCcxVerNum = src->bWithCcxVerNum; ++ dst->BssCcxVerNumber = src->BssCcxVerNumber; ++ ++} ++ ++static inline int is_beacon(__le16 fc) ++{ ++ return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); ++} ++ ++static inline void ieee80211_process_probe_response( ++ struct ieee80211_device *ieee, ++ struct ieee80211_probe_response *beacon, ++ struct ieee80211_rx_stats *stats) ++{ ++ struct ieee80211_network network; ++ struct ieee80211_network *target; ++ struct ieee80211_network *oldest = NULL; ++#ifdef CONFIG_IEEE80211_DEBUG ++ struct ieee80211_info_element *info_element = &beacon->info_element[0]; ++#endif ++ unsigned long flags; ++ short renew; ++ //u8 wmm_info; ++ ++ memset(&network, 0, sizeof(struct ieee80211_network)); ++ IEEE80211_DEBUG_SCAN( ++ "'%s' (" MAC_FMT "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", ++ escape_essid(info_element->data, info_element->len), ++ MAC_ARG(beacon->header.addr3), ++ (beacon->capability & (1<<0xf)) ? '1' : '0', ++ (beacon->capability & (1<<0xe)) ? '1' : '0', ++ (beacon->capability & (1<<0xd)) ? '1' : '0', ++ (beacon->capability & (1<<0xc)) ? '1' : '0', ++ (beacon->capability & (1<<0xb)) ? '1' : '0', ++ (beacon->capability & (1<<0xa)) ? '1' : '0', ++ (beacon->capability & (1<<0x9)) ? '1' : '0', ++ (beacon->capability & (1<<0x8)) ? '1' : '0', ++ (beacon->capability & (1<<0x7)) ? '1' : '0', ++ (beacon->capability & (1<<0x6)) ? '1' : '0', ++ (beacon->capability & (1<<0x5)) ? '1' : '0', ++ (beacon->capability & (1<<0x4)) ? '1' : '0', ++ (beacon->capability & (1<<0x3)) ? '1' : '0', ++ (beacon->capability & (1<<0x2)) ? '1' : '0', ++ (beacon->capability & (1<<0x1)) ? '1' : '0', ++ (beacon->capability & (1<<0x0)) ? '1' : '0'); ++ ++ if (ieee80211_network_init(ieee, beacon, &network, stats)) { ++ IEEE80211_DEBUG_SCAN("Dropped '%s' (" MAC_FMT ") via %s.\n", ++ escape_essid(info_element->data, ++ info_element->len), ++ MAC_ARG(beacon->header.addr3), ++ WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == ++ IEEE80211_STYPE_PROBE_RESP ? ++ "PROBE RESPONSE" : "BEACON"); ++ return; ++ } ++ ++#ifdef ENABLE_DOT11D ++ // For Asus EeePc request, ++ // (1) if wireless adapter receive get any 802.11d country code in AP beacon, ++ // wireless adapter should follow the country code. ++ // (2) If there is no any country code in beacon, ++ // then wireless adapter should do active scan from ch1~11 and ++ // passive scan from ch12~14 ++ ++ if( !IsLegalChannel(ieee, network.channel) ) ++ return; ++ if(ieee->bGlobalDomain) ++ { ++ if (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == IEEE80211_STYPE_PROBE_RESP) ++ { ++ // Case 1: Country code ++ if(IS_COUNTRY_IE_VALID(ieee) ) ++ { ++ if( !IsLegalChannel(ieee, network.channel) ) ++ { ++ printk("GetScanInfo(): For Country code, filter probe response at channel(%d).\n", network.channel); ++ return; ++ } ++ } ++ // Case 2: No any country code. ++ else ++ { ++ // Filter over channel ch12~14 ++ if(network.channel > 11) ++ { ++ printk("GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", network.channel); ++ return; ++ } ++ } ++ } ++ else ++ { ++ // Case 1: Country code ++ if(IS_COUNTRY_IE_VALID(ieee) ) ++ { ++ if( !IsLegalChannel(ieee, network.channel) ) ++ { ++ printk("GetScanInfo(): For Country code, filter beacon at channel(%d).\n",network.channel); ++ return; ++ } ++ } ++ // Case 2: No any country code. ++ else ++ { ++ // Filter over channel ch12~14 ++ if(network.channel > 14) ++ { ++ printk("GetScanInfo(): For Global Domain, filter beacon at channel(%d).\n",network.channel); ++ return; ++ } ++ } ++ } ++ } ++#endif ++ ++ /* The network parsed correctly -- so now we scan our known networks ++ * to see if we can find it in our list. ++ * ++ * NOTE: This search is definitely not optimized. Once its doing ++ * the "right thing" we'll optimize it for efficiency if ++ * necessary */ ++ ++ /* Search for this entry in the list and update it if it is ++ * already there. */ ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if(is_same_network(&ieee->current_network, &network, ieee)) { ++ update_network(&ieee->current_network, &network); ++ if((ieee->current_network.mode == IEEE_N_24G || ieee->current_network.mode == IEEE_G) ++ && ieee->current_network.berp_info_valid){ ++ if(ieee->current_network.erp_value& ERP_UseProtection) ++ ieee->current_network.buseprotection = true; ++ else ++ ieee->current_network.buseprotection = false; ++ } ++ if(is_beacon(beacon->header.frame_ctl)) ++ { ++ if(ieee->state == IEEE80211_LINKED) ++ ieee->LinkDetectInfo.NumRecvBcnInPeriod++; ++ } ++ else //hidden AP ++ network.flags = (~NETWORK_EMPTY_ESSID & network.flags)|(NETWORK_EMPTY_ESSID & ieee->current_network.flags); ++ } ++ ++ list_for_each_entry(target, &ieee->network_list, list) { ++ if (is_same_network(target, &network, ieee)) ++ break; ++ if ((oldest == NULL) || ++ (target->last_scanned < oldest->last_scanned)) ++ oldest = target; ++ } ++ ++ /* If we didn't find a match, then get a new network slot to initialize ++ * with this beacon's information */ ++ if (&target->list == &ieee->network_list) { ++ if (list_empty(&ieee->network_free_list)) { ++ /* If there are no more slots, expire the oldest */ ++ list_del(&oldest->list); ++ target = oldest; ++ IEEE80211_DEBUG_SCAN("Expired '%s' (" MAC_FMT ") from " ++ "network list.\n", ++ escape_essid(target->ssid, ++ target->ssid_len), ++ MAC_ARG(target->bssid)); ++ } else { ++ /* Otherwise just pull from the free list */ ++ target = list_entry(ieee->network_free_list.next, ++ struct ieee80211_network, list); ++ list_del(ieee->network_free_list.next); ++ } ++ ++ ++#ifdef CONFIG_IEEE80211_DEBUG ++ IEEE80211_DEBUG_SCAN("Adding '%s' (" MAC_FMT ") via %s.\n", ++ escape_essid(network.ssid, ++ network.ssid_len), ++ MAC_ARG(network.bssid), ++ WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == ++ IEEE80211_STYPE_PROBE_RESP ? ++ "PROBE RESPONSE" : "BEACON"); ++#endif ++ memcpy(target, &network, sizeof(*target)); ++ list_add_tail(&target->list, &ieee->network_list); ++ if(ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) ++ ieee80211_softmac_new_net(ieee,&network); ++ } else { ++ IEEE80211_DEBUG_SCAN("Updating '%s' (" MAC_FMT ") via %s.\n", ++ escape_essid(target->ssid, ++ target->ssid_len), ++ MAC_ARG(target->bssid), ++ WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == ++ IEEE80211_STYPE_PROBE_RESP ? ++ "PROBE RESPONSE" : "BEACON"); ++ ++ /* we have an entry and we are going to update it. But this entry may ++ * be already expired. In this case we do the same as we found a new ++ * net and call the new_net handler ++ */ ++ renew = !time_after(target->last_scanned + ieee->scan_age, jiffies); ++ //YJ,add,080819,for hidden ap ++ if(is_beacon(beacon->header.frame_ctl) == 0) ++ network.flags = (~NETWORK_EMPTY_ESSID & network.flags)|(NETWORK_EMPTY_ESSID & target->flags); ++ //if(strncmp(network.ssid, "linksys-c",9) == 0) ++ // printk("====>2 network.ssid=%s FLAG=%d target.ssid=%s FLAG=%d\n", network.ssid, network.flags, target->ssid, target->flags); ++ if(((network.flags & NETWORK_EMPTY_ESSID) == NETWORK_EMPTY_ESSID) \ ++ && (((network.ssid_len > 0) && (strncmp(target->ssid, network.ssid, network.ssid_len)))\ ++ ||((ieee->current_network.ssid_len == network.ssid_len)&&(strncmp(ieee->current_network.ssid, network.ssid, network.ssid_len) == 0)&&(ieee->state == IEEE80211_NOLINK)))) ++ renew = 1; ++ //YJ,add,080819,for hidden ap,end ++ ++ update_network(target, &network); ++ if(renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) ++ ieee80211_softmac_new_net(ieee,&network); ++ } ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ if (is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, &network, ieee)&&\ ++ (ieee->state == IEEE80211_LINKED)) { ++ if(ieee->handle_beacon != NULL) { ++ ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network); ++ } ++ } ++} ++ ++void ieee80211_rx_mgt(struct ieee80211_device *ieee, ++ struct ieee80211_hdr_4addr *header, ++ struct ieee80211_rx_stats *stats) ++{ ++ if(ieee->sta_sleep || (ieee->ps != IEEE80211_PS_DISABLED && ++ ieee->iw_mode == IW_MODE_INFRA && ++ ieee->state == IEEE80211_LINKED)) ++ { ++ tasklet_schedule(&ieee->ps_task); ++ } ++ ++ if(WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_PROBE_RESP && ++ WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_BEACON) ++ ieee->last_rx_ps_time = jiffies; ++ ++ switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { ++ ++ case IEEE80211_STYPE_BEACON: ++ IEEE80211_DEBUG_MGMT("received BEACON (%d)\n", ++ WLAN_FC_GET_STYPE(header->frame_ctl)); ++ IEEE80211_DEBUG_SCAN("Beacon\n"); ++ ieee80211_process_probe_response( ++ ieee, (struct ieee80211_probe_response *)header, stats); ++ break; ++ ++ case IEEE80211_STYPE_PROBE_RESP: ++ IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n", ++ WLAN_FC_GET_STYPE(header->frame_ctl)); ++ IEEE80211_DEBUG_SCAN("Probe response\n"); ++ ieee80211_process_probe_response( ++ ieee, (struct ieee80211_probe_response *)header, stats); ++ break; ++ ++ } ++} ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_rx_mgt); ++//EXPORT_SYMBOL(ieee80211_rx); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_rx_mgt); ++EXPORT_SYMBOL_NOVERS(ieee80211_rx); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +@@ -0,0 +1,3548 @@ ++/* IEEE 802.11 SoftMAC layer ++ * Copyright (c) 2005 Andrea Merello ++ * ++ * Mostly extracted from the rtl8180-sa2400 driver for the ++ * in-kernel generic ieee802.11 stack. ++ * ++ * Few lines might be stolen from other part of the ieee80211 ++ * stack. Copyright who own it's copyright ++ * ++ * WPA code stolen from the ipw2200 driver. ++ * Copyright who own it's copyright. ++ * ++ * released under the GPL ++ */ ++ ++ ++#include "ieee80211.h" ++ ++#include ++#include ++#include ++#include ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++ ++u8 rsn_authen_cipher_suite[16][4] = { ++ {0x00,0x0F,0xAC,0x00}, //Use group key, //Reserved ++ {0x00,0x0F,0xAC,0x01}, //WEP-40 //RSNA default ++ {0x00,0x0F,0xAC,0x02}, //TKIP //NONE //{used just as default} ++ {0x00,0x0F,0xAC,0x03}, //WRAP-historical ++ {0x00,0x0F,0xAC,0x04}, //CCMP ++ {0x00,0x0F,0xAC,0x05}, //WEP-104 ++}; ++ ++short ieee80211_is_54g(struct ieee80211_network net) ++{ ++ return ((net.rates_ex_len > 0) || (net.rates_len > 4)); ++} ++ ++short ieee80211_is_shortslot(struct ieee80211_network net) ++{ ++ return (net.capability & WLAN_CAPABILITY_SHORT_SLOT); ++} ++ ++/* returns the total length needed for pleacing the RATE MFIE ++ * tag and the EXTENDED RATE MFIE tag if needed. ++ * It encludes two bytes per tag for the tag itself and its len ++ */ ++unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee) ++{ ++ unsigned int rate_len = 0; ++ ++ if (ieee->modulation & IEEE80211_CCK_MODULATION) ++ rate_len = IEEE80211_CCK_RATE_LEN + 2; ++ ++ if (ieee->modulation & IEEE80211_OFDM_MODULATION) ++ ++ rate_len += IEEE80211_OFDM_RATE_LEN + 2; ++ ++ return rate_len; ++} ++ ++/* pleace the MFIE rate, tag to the memory (double) poined. ++ * Then it updates the pointer so that ++ * it points after the new MFIE tag added. ++ */ ++void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p) ++{ ++ u8 *tag = *tag_p; ++ ++ if (ieee->modulation & IEEE80211_CCK_MODULATION){ ++ *tag++ = MFIE_TYPE_RATES; ++ *tag++ = 4; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB; ++ } ++ ++ /* We may add an option for custom rates that specific HW might support */ ++ *tag_p = tag; ++} ++ ++void ieee80211_MFIE_Grate(struct ieee80211_device *ieee, u8 **tag_p) ++{ ++ u8 *tag = *tag_p; ++ ++ if (ieee->modulation & IEEE80211_OFDM_MODULATION){ ++ ++ *tag++ = MFIE_TYPE_RATES_EX; ++ *tag++ = 8; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_9MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_12MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_18MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_24MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_36MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_48MB; ++ *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB; ++ ++ } ++ ++ /* We may add an option for custom rates that specific HW might support */ ++ *tag_p = tag; ++} ++ ++ ++void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p) { ++ u8 *tag = *tag_p; ++ ++ *tag++ = MFIE_TYPE_GENERIC; //0 ++ *tag++ = 7; ++ *tag++ = 0x00; ++ *tag++ = 0x50; ++ *tag++ = 0xf2; ++ *tag++ = 0x02;//5 ++ *tag++ = 0x00; ++ *tag++ = 0x01; ++#ifdef SUPPORT_USPD ++ if(ieee->current_network.wmm_info & 0x80) { ++ *tag++ = 0x0f|MAX_SP_Len; ++ } else { ++ *tag++ = MAX_SP_Len; ++ } ++#else ++ *tag++ = MAX_SP_Len; ++#endif ++ *tag_p = tag; ++} ++ ++#ifdef THOMAS_TURBO ++void ieee80211_TURBO_Info(struct ieee80211_device *ieee, u8 **tag_p) { ++ u8 *tag = *tag_p; ++ ++ *tag++ = MFIE_TYPE_GENERIC; //0 ++ *tag++ = 7; ++ *tag++ = 0x00; ++ *tag++ = 0xe0; ++ *tag++ = 0x4c; ++ *tag++ = 0x01;//5 ++ *tag++ = 0x02; ++ *tag++ = 0x11; ++ *tag++ = 0x00; ++ ++ *tag_p = tag; ++ printk(KERN_ALERT "This is enable turbo mode IE process\n"); ++} ++#endif ++ ++void enqueue_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb) ++{ ++ int nh; ++ nh = (ieee->mgmt_queue_head +1) % MGMT_QUEUE_NUM; ++ ++/* ++ * if the queue is full but we have newer frames then ++ * just overwrites the oldest. ++ * ++ * if (nh == ieee->mgmt_queue_tail) ++ * return -1; ++ */ ++ ieee->mgmt_queue_head = nh; ++ ieee->mgmt_queue_ring[nh] = skb; ++ ++ //return 0; ++} ++ ++struct sk_buff *dequeue_mgmt(struct ieee80211_device *ieee) ++{ ++ struct sk_buff *ret; ++ ++ if(ieee->mgmt_queue_tail == ieee->mgmt_queue_head) ++ return NULL; ++ ++ ret = ieee->mgmt_queue_ring[ieee->mgmt_queue_tail]; ++ ++ ieee->mgmt_queue_tail = ++ (ieee->mgmt_queue_tail+1) % MGMT_QUEUE_NUM; ++ ++ return ret; ++} ++ ++void init_mgmt_queue(struct ieee80211_device *ieee) ++{ ++ ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; ++} ++ ++u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device *ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ u8 rate; ++ ++ // 2008/01/25 MH For broadcom, MGNT frame set as OFDM 6M. ++ if(pHTInfo->IOTAction & HT_IOT_ACT_MGNT_USE_CCK_6M) ++ rate = 0x0c; ++ else ++ rate = ieee->basic_rate & 0x7f; ++ ++ if(rate == 0){ ++ // 2005.01.26, by rcnjko. ++ if(ieee->mode == IEEE_A|| ++ ieee->mode== IEEE_N_5G|| ++ (ieee->mode== IEEE_N_24G&&!pHTInfo->bCurSuppCCK)) ++ rate = 0x0c; ++ else ++ rate = 0x02; ++ } ++ ++ /* ++ // Data rate of ProbeReq is already decided. Annie, 2005-03-31 ++ if( pMgntInfo->bScanInProgress || (pMgntInfo->bDualModeScanStep!=0) ) ++ { ++ if(pMgntInfo->dot11CurrentWirelessMode==WIRELESS_MODE_A) ++ rate = 0x0c; ++ else ++ rate = 0x02; ++ } ++ */ ++ return rate; ++} ++ ++ ++void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl); ++ ++inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++ short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE; ++ struct ieee80211_hdr_3addr *header= ++ (struct ieee80211_hdr_3addr *) skb->data; ++ ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + 8); ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ /* called with 2nd param 0, no mgmt lock required */ ++ ieee80211_sta_wakeup(ieee,0); ++ ++ tcb_desc->queue_index = MGNT_QUEUE; ++ tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); ++ tcb_desc->RATRIndex = 7; ++ tcb_desc->bTxDisableRateFallBack = 1; ++ tcb_desc->bTxUseDriverAssingedRate = 1; ++ ++ if(single){ ++ if(ieee->queue_stop){ ++ enqueue_mgmt(ieee,skb); ++ }else{ ++ header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ /* avoid watchdog triggers */ ++ // ieee->dev->trans_start = jiffies; ++ ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ }else{ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ spin_lock_irqsave(&ieee->mgmt_tx_lock, flags); ++ ++ header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ /* check wether the managed packet queued greater than 5 */ ++ if(!ieee->check_nic_enough_desc(ieee->dev,tcb_desc->queue_index)||\ ++ (skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0)||\ ++ (ieee->queue_stop) ) { ++ /* insert the skb packet to the management queue */ ++ /* as for the completion function, it does not need ++ * to check it any more. ++ * */ ++ printk("%s():insert to waitqueue!\n",__FUNCTION__); ++ skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], skb); ++ } else { ++ //printk("TX packet!\n"); ++ ieee->softmac_hard_start_xmit(skb,ieee->dev); ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++ spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags); ++ } ++} ++ ++inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee) ++{ ++ ++ short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE; ++ struct ieee80211_hdr_3addr *header = ++ (struct ieee80211_hdr_3addr *) skb->data; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + 8); ++ ++ tcb_desc->queue_index = MGNT_QUEUE; ++ tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); ++ tcb_desc->RATRIndex = 7; ++ tcb_desc->bTxDisableRateFallBack = 1; ++ tcb_desc->bTxUseDriverAssingedRate = 1; ++ //printk("=============>%s()\n", __FUNCTION__); ++ if(single){ ++ ++ header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ /* avoid watchdog triggers */ ++ // ieee->dev->trans_start = jiffies; ++ ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); ++ ++ }else{ ++ ++ header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ ieee->softmac_hard_start_xmit(skb,ieee->dev); ++ ++ } ++ //dev_kfree_skb_any(skb);//edit by thomas ++} ++ ++inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee) ++{ ++ unsigned int len,rate_len; ++ u8 *tag; ++ struct sk_buff *skb; ++ struct ieee80211_probe_request *req; ++ ++ len = ieee->current_network.ssid_len; ++ ++ rate_len = ieee80211_MFIE_rate_len(ieee); ++ ++ skb = dev_alloc_skb(sizeof(struct ieee80211_probe_request) + ++ 2 + len + rate_len + ieee->tx_headroom); ++ if (!skb) ++ return NULL; ++ ++ skb_reserve(skb, ieee->tx_headroom); ++ ++ req = (struct ieee80211_probe_request *) skb_put(skb,sizeof(struct ieee80211_probe_request)); ++ req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ); ++ req->header.duration_id = 0; //FIXME: is this OK ? ++ ++ memset(req->header.addr1, 0xff, ETH_ALEN); ++ memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memset(req->header.addr3, 0xff, ETH_ALEN); ++ ++ tag = (u8 *) skb_put(skb,len+2+rate_len); ++ ++ *tag++ = MFIE_TYPE_SSID; ++ *tag++ = len; ++ memcpy(tag, ieee->current_network.ssid, len); ++ tag += len; ++ ++ ieee80211_MFIE_Brate(ieee,&tag); ++ ieee80211_MFIE_Grate(ieee,&tag); ++ return skb; ++} ++ ++struct sk_buff *ieee80211_get_beacon_(struct ieee80211_device *ieee); ++void ieee80211_send_beacon(struct ieee80211_device *ieee) ++{ ++ struct sk_buff *skb; ++ if(!ieee->ieee_up) ++ return; ++ //unsigned long flags; ++ skb = ieee80211_get_beacon_(ieee); ++ ++ if (skb){ ++ softmac_mgmt_xmit(skb, ieee); ++ ieee->softmac_stats.tx_beacons++; ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++// ieee->beacon_timer.expires = jiffies + ++// (MSECS( ieee->current_network.beacon_interval -5)); ++ ++ //spin_lock_irqsave(&ieee->beacon_lock,flags); ++ if(ieee->beacon_txing && ieee->ieee_up){ ++// if(!timer_pending(&ieee->beacon_timer)) ++// add_timer(&ieee->beacon_timer); ++ mod_timer(&ieee->beacon_timer,jiffies+(MSECS(ieee->current_network.beacon_interval-5))); ++ } ++ //spin_unlock_irqrestore(&ieee->beacon_lock,flags); ++} ++ ++ ++void ieee80211_send_beacon_cb(unsigned long _ieee) ++{ ++ struct ieee80211_device *ieee = ++ (struct ieee80211_device *) _ieee; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ieee->beacon_lock, flags); ++ ieee80211_send_beacon(ieee); ++ spin_unlock_irqrestore(&ieee->beacon_lock, flags); ++} ++ ++ ++void ieee80211_send_probe(struct ieee80211_device *ieee) ++{ ++ struct sk_buff *skb; ++ ++ skb = ieee80211_probe_req(ieee); ++ if (skb){ ++ softmac_mgmt_xmit(skb, ieee); ++ ieee->softmac_stats.tx_probe_rq++; ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++} ++ ++void ieee80211_send_probe_requests(struct ieee80211_device *ieee) ++{ ++ if (ieee->active_scan && (ieee->softmac_features & IEEE_SOFTMAC_PROBERQ)){ ++ ieee80211_send_probe(ieee); ++ ieee80211_send_probe(ieee); ++ } ++} ++ ++/* this performs syncro scan blocking the caller until all channels ++ * in the allowed channel map has been checked. ++ */ ++void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) ++{ ++ short ch = 0; ++#ifdef ENABLE_DOT11D ++ u8 channel_map[MAX_CHANNEL_NUMBER+1]; ++ memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); ++#endif ++ down(&ieee->scan_sem); ++ ++ while(1) ++ { ++ ++ do{ ++ ch++; ++ if (ch > MAX_CHANNEL_NUMBER) ++ goto out; /* scan completed */ ++#ifdef ENABLE_DOT11D ++ }while(!channel_map[ch]); ++#else ++ }while(!ieee->channel_map[ch]); ++#endif ++ ++ /* this fuction can be called in two situations ++ * 1- We have switched to ad-hoc mode and we are ++ * performing a complete syncro scan before conclude ++ * there are no interesting cell and to create a ++ * new one. In this case the link state is ++ * IEEE80211_NOLINK until we found an interesting cell. ++ * If so the ieee8021_new_net, called by the RX path ++ * will set the state to IEEE80211_LINKED, so we stop ++ * scanning ++ * 2- We are linked and the root uses run iwlist scan. ++ * So we switch to IEEE80211_LINKED_SCANNING to remember ++ * that we are still logically linked (not interested in ++ * new network events, despite for updating the net list, ++ * but we are temporarly 'unlinked' as the driver shall ++ * not filter RX frames and the channel is changing. ++ * So the only situation in witch are interested is to check ++ * if the state become LINKED because of the #1 situation ++ */ ++ ++ if (ieee->state == IEEE80211_LINKED) ++ goto out; ++ ieee->set_chan(ieee->dev, ch); ++#ifdef ENABLE_DOT11D ++ if(channel_map[ch] == 1) ++#endif ++ ieee80211_send_probe_requests(ieee); ++ ++ /* this prevent excessive time wait when we ++ * need to wait for a syncro scan to end.. ++ */ ++ if(ieee->state < IEEE80211_LINKED) ++ ; ++ else ++ if (ieee->sync_scan_hurryup) ++ goto out; ++ ++ ++ msleep_interruptible_rsl(IEEE80211_SOFTMAC_SCAN_TIME); ++ ++ } ++out: ++ if(ieee->state < IEEE80211_LINKED){ ++ ieee->actscanning = false; ++ up(&ieee->scan_sem); ++ } ++ else{ ++ ieee->sync_scan_hurryup = 0; ++#ifdef ENABLE_DOT11D ++ if(IS_DOT11D_ENABLE(ieee)) ++ DOT11D_ScanComplete(ieee); ++#endif ++ up(&ieee->scan_sem); ++} ++} ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++/* called both by wq with ieee->lock held */ ++void ieee80211_softmac_scan(struct ieee80211_device *ieee) ++{ ++#if 0 ++ short watchdog = 0; ++ do{ ++ ieee->current_network.channel = ++ (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; ++ if (watchdog++ > MAX_CHANNEL_NUMBER) ++ return; /* no good chans */ ++ ++ }while(!ieee->channel_map[ieee->current_network.channel]); ++#endif ++ ++ schedule_task(&ieee->softmac_scan_wq); ++} ++#endif ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void ieee80211_softmac_scan_wq(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work, struct delayed_work, work); ++ struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); ++#else ++void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ static short watchdog = 0; ++ u8 last_channel = ieee->current_network.channel; ++#ifdef ENABLE_DOT11D ++ u8 channel_map[MAX_CHANNEL_NUMBER+1]; ++ memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); ++#endif ++ if(!ieee->ieee_up) ++ return; ++ down(&ieee->scan_sem); ++ do{ ++ ieee->current_network.channel = ++ (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; ++ if (watchdog++ > MAX_CHANNEL_NUMBER) ++ { ++ //if current channel is not in channel map, set to default channel. ++ #ifdef ENABLE_DOT11D ++ if (!channel_map[ieee->current_network.channel]); ++ #else ++ if (!ieee->channel_map[ieee->current_network.channel]); ++ #endif ++ ieee->current_network.channel = 6; ++ goto out; /* no good chans */ ++ } ++#ifdef ENABLE_DOT11D ++ }while(!channel_map[ieee->current_network.channel]); ++#else ++ }while(!ieee->channel_map[ieee->current_network.channel]); ++#endif ++ if (ieee->scanning == 0 ) ++ goto out; ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++#ifdef ENABLE_DOT11D ++ if(channel_map[ieee->current_network.channel] == 1) ++#endif ++ ieee80211_send_probe_requests(ieee); ++ ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME); ++#else ++ //ieee->scan_timer.expires = jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME); ++ if (ieee->scanning == 1) ++ mod_timer(&ieee->scan_timer,(jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME))); ++#endif ++ ++ up(&ieee->scan_sem); ++ return; ++out: ++#ifdef ENABLE_DOT11D ++ if(IS_DOT11D_ENABLE(ieee)) ++ DOT11D_ScanComplete(ieee); ++#endif ++ ieee->current_network.channel = last_channel; ++ ieee->actscanning = false; ++ watchdog = 0; ++ ieee->scanning = 0; ++ up(&ieee->scan_sem); ++} ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++void ieee80211_softmac_scan_cb(unsigned long _dev) ++{ ++ unsigned long flags; ++ struct ieee80211_device *ieee = (struct ieee80211_device *)_dev; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ieee80211_softmac_scan(ieee); ++ spin_unlock_irqrestore(&ieee->lock, flags); ++} ++#endif ++ ++ ++void ieee80211_beacons_start(struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++ spin_lock_irqsave(&ieee->beacon_lock,flags); ++ ++ ieee->beacon_txing = 1; ++ ieee80211_send_beacon(ieee); ++ ++ spin_unlock_irqrestore(&ieee->beacon_lock,flags); ++} ++ ++void ieee80211_beacons_stop(struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ieee->beacon_lock,flags); ++ ++ ieee->beacon_txing = 0; ++ del_timer_sync(&ieee->beacon_timer); ++ ++ spin_unlock_irqrestore(&ieee->beacon_lock,flags); ++ ++} ++ ++ ++void ieee80211_stop_send_beacons(struct ieee80211_device *ieee) ++{ ++ if(ieee->stop_send_beacons) ++ ieee->stop_send_beacons(ieee->dev); ++ if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS) ++ ieee80211_beacons_stop(ieee); ++} ++ ++ ++void ieee80211_start_send_beacons(struct ieee80211_device *ieee) ++{ ++ if(ieee->start_send_beacons) ++ ieee->start_send_beacons(ieee->dev,ieee->basic_rate); ++ if(ieee->softmac_features & IEEE_SOFTMAC_BEACONS) ++ ieee80211_beacons_start(ieee); ++} ++ ++ ++void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) ++{ ++// unsigned long flags; ++ ++ //ieee->sync_scan_hurryup = 1; ++ ++ down(&ieee->scan_sem); ++// spin_lock_irqsave(&ieee->lock, flags); ++ ++ if (ieee->scanning == 1){ ++ ieee->scanning = 0; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&ieee->softmac_scan_wq); ++#else ++ del_timer_sync(&ieee->scan_timer); ++#endif ++ } ++ ++// spin_unlock_irqrestore(&ieee->lock, flags); ++ up(&ieee->scan_sem); ++} ++ ++void ieee80211_stop_scan(struct ieee80211_device *ieee) ++{ ++ if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) ++ ieee80211_softmac_stop_scan(ieee); ++ else ++ ieee->stop_scan(ieee->dev); ++} ++ ++/* called with ieee->lock held */ ++void ieee80211_start_scan(struct ieee80211_device *ieee) ++{ ++#ifdef ENABLE_DOT11D ++ if(IS_DOT11D_ENABLE(ieee) ) ++ { ++ if(IS_COUNTRY_IE_VALID(ieee)) ++ { ++ RESET_CIE_WATCHDOG(ieee); ++ } ++ } ++#endif ++ if (ieee->softmac_features & IEEE_SOFTMAC_SCAN){ ++ if (ieee->scanning == 0){ ++ ieee->scanning = 1; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0); ++#else ++ ++ queue_work(ieee->wq, &ieee->softmac_scan_wq); ++#endif ++#else ++ ieee80211_softmac_scan(ieee); ++#endif ++ } ++ }else ++ ieee->start_scan(ieee->dev); ++ ++} ++ ++/* called with wx_sem held */ ++void ieee80211_start_scan_syncro(struct ieee80211_device *ieee) ++{ ++#ifdef ENABLE_DOT11D ++ if(IS_DOT11D_ENABLE(ieee) ) ++ { ++ if(IS_COUNTRY_IE_VALID(ieee)) ++ { ++ RESET_CIE_WATCHDOG(ieee); ++ } ++ } ++#endif ++ ieee->sync_scan_hurryup = 0; ++ if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) ++ ieee80211_softmac_scan_syncro(ieee); ++ else ++ ieee->scan_syncro(ieee->dev); ++ ++} ++ ++inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *beacon, ++ struct ieee80211_device *ieee, int challengelen) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_authentication *auth; ++ int len = sizeof(struct ieee80211_authentication) + challengelen + ieee->tx_headroom; ++ ++ ++ skb = dev_alloc_skb(len); ++ if (!skb) return NULL; ++ ++ skb_reserve(skb, ieee->tx_headroom); ++ auth = (struct ieee80211_authentication *) ++ skb_put(skb, sizeof(struct ieee80211_authentication)); ++ ++ auth->header.frame_ctl = IEEE80211_STYPE_AUTH; ++ if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP; ++ ++ auth->header.duration_id = 0x013a; //FIXME ++ ++ memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN); ++ memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(auth->header.addr3, beacon->bssid, ETH_ALEN); ++ ++ //auth->algorithm = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY; ++ if(ieee->auth_mode == 0) ++ auth->algorithm = WLAN_AUTH_OPEN; ++ else if(ieee->auth_mode == 1) ++ auth->algorithm = WLAN_AUTH_SHARED_KEY; ++ else if(ieee->auth_mode == 2) ++ auth->algorithm = WLAN_AUTH_OPEN;//0x80; ++ printk("=================>%s():auth->algorithm is %d\n",__FUNCTION__,auth->algorithm); ++ auth->transaction = cpu_to_le16(ieee->associate_seq); ++ ieee->associate_seq++; ++ ++ auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS); ++ ++ return skb; ++ ++} ++ ++ ++static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *dest) ++{ ++ u8 *tag; ++ int beacon_size; ++ struct ieee80211_probe_response *beacon_buf; ++ struct sk_buff *skb = NULL; ++ int encrypt; ++ int atim_len,erp_len; ++ struct ieee80211_crypt_data* crypt; ++ ++ char *ssid = ieee->current_network.ssid; ++ int ssid_len = ieee->current_network.ssid_len; ++ int rate_len = ieee->current_network.rates_len+2; ++ int rate_ex_len = ieee->current_network.rates_ex_len; ++ int wpa_ie_len = ieee->wpa_ie_len; ++ u8 erpinfo_content = 0; ++ ++ u8* tmp_ht_cap_buf; ++ u8 tmp_ht_cap_len=0; ++ u8* tmp_ht_info_buf; ++ u8 tmp_ht_info_len=0; ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ u8* tmp_generic_ie_buf=NULL; ++ u8 tmp_generic_ie_len=0; ++ ++ if(rate_ex_len > 0) rate_ex_len+=2; ++ ++ if(ieee->current_network.capability & WLAN_CAPABILITY_IBSS) ++ atim_len = 4; ++ else ++ atim_len = 0; ++ ++#if 1 ++ if(ieee80211_is_54g(ieee->current_network)) ++ erp_len = 3; ++ else ++ erp_len = 0; ++#else ++ if((ieee->current_network.mode == IEEE_G) ++ ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { ++ erp_len = 3; ++ erpinfo_content = 0; ++ if(ieee->current_network.buseprotection) ++ erpinfo_content |= ERP_UseProtection; ++ } ++ else ++ erp_len = 0; ++#endif ++ ++ ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++ ++ ++ encrypt = ieee->host_encrypt && crypt && crypt->ops && ++ ((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len)); ++ //HT ralated element ++#if 1 ++ tmp_ht_cap_buf =(u8*) &(ieee->pHTInfo->SelfHTCap); ++ tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); ++ tmp_ht_info_buf =(u8*) &(ieee->pHTInfo->SelfHTInfo); ++ tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo); ++ HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, &tmp_ht_cap_len,encrypt); ++ HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt); ++ ++ ++ if(pHTInfo->bRegRT2RTAggregation) ++ { ++ tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer; ++ tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer); ++ HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len); ++ } ++// printk("===============>tmp_ht_cap_len is %d,tmp_ht_info_len is %d, tmp_generic_ie_len is %d\n",tmp_ht_cap_len,tmp_ht_info_len,tmp_generic_ie_len); ++#endif ++ beacon_size = sizeof(struct ieee80211_probe_response)+2+ ++ ssid_len ++ +3 //channel ++ +rate_len ++ +rate_ex_len ++ +atim_len ++ +erp_len ++ +wpa_ie_len ++ // +tmp_ht_cap_len ++ // +tmp_ht_info_len ++ // +tmp_generic_ie_len ++// +wmm_len+2 ++ +ieee->tx_headroom; ++ skb = dev_alloc_skb(beacon_size); ++ if (!skb) ++ return NULL; ++ skb_reserve(skb, ieee->tx_headroom); ++ beacon_buf = (struct ieee80211_probe_response*) skb_put(skb, (beacon_size - ieee->tx_headroom)); ++ memcpy (beacon_buf->header.addr1, dest,ETH_ALEN); ++ memcpy (beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy (beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN); ++ ++ beacon_buf->header.duration_id = 0; //FIXME ++ beacon_buf->beacon_interval = ++ cpu_to_le16(ieee->current_network.beacon_interval); ++ beacon_buf->capability = ++ cpu_to_le16(ieee->current_network.capability & WLAN_CAPABILITY_IBSS); ++ beacon_buf->capability |= ++ cpu_to_le16(ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE); //add short preamble here ++ ++ if(ieee->short_slot && (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT)) ++ cpu_to_le16((beacon_buf->capability |= WLAN_CAPABILITY_SHORT_SLOT)); ++ ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++#if 0 ++ encrypt = ieee->host_encrypt && crypt && crypt->ops && ++ (0 == strcmp(crypt->ops->name, "WEP")); ++#endif ++ if (encrypt) ++ beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); ++ ++ ++ beacon_buf->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_RESP); ++ beacon_buf->info_element[0].id = MFIE_TYPE_SSID; ++ beacon_buf->info_element[0].len = ssid_len; ++ ++ tag = (u8*) beacon_buf->info_element[0].data; ++ ++ memcpy(tag, ssid, ssid_len); ++ ++ tag += ssid_len; ++ ++ *(tag++) = MFIE_TYPE_RATES; ++ *(tag++) = rate_len-2; ++ memcpy(tag,ieee->current_network.rates,rate_len-2); ++ tag+=rate_len-2; ++ ++ *(tag++) = MFIE_TYPE_DS_SET; ++ *(tag++) = 1; ++ *(tag++) = ieee->current_network.channel; ++ ++ if(atim_len){ ++ u16 val16; ++ *(tag++) = MFIE_TYPE_IBSS_SET; ++ *(tag++) = 2; ++ //*((u16*)(tag)) = cpu_to_le16(ieee->current_network.atim_window); ++ val16 = cpu_to_le16(ieee->current_network.atim_window); ++ memcpy((u8 *)tag, (u8 *)&val16, 2); ++ tag+=2; ++ } ++ ++ if(erp_len){ ++ *(tag++) = MFIE_TYPE_ERP; ++ *(tag++) = 1; ++ *(tag++) = erpinfo_content; ++ } ++#if 0 ++ //Include High Throuput capability ++ ++ *(tag++) = MFIE_TYPE_HT_CAP; ++ *(tag++) = tmp_ht_cap_len - 2; ++ memcpy(tag, tmp_ht_cap_buf, tmp_ht_cap_len - 2); ++ tag += tmp_ht_cap_len - 2; ++#endif ++ if(rate_ex_len){ ++ *(tag++) = MFIE_TYPE_RATES_EX; ++ *(tag++) = rate_ex_len-2; ++ memcpy(tag,ieee->current_network.rates_ex,rate_ex_len-2); ++ tag+=rate_ex_len-2; ++ } ++ ++#if 0 ++ //Include High Throuput info ++ ++ *(tag++) = MFIE_TYPE_HT_INFO; ++ *(tag++) = tmp_ht_info_len - 2; ++ memcpy(tag, tmp_ht_info_buf, tmp_ht_info_len -2); ++ tag += tmp_ht_info_len - 2; ++#endif ++ if (wpa_ie_len) ++ { ++ if (ieee->iw_mode == IW_MODE_ADHOC) ++ {//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue. WB 2008.07.07 ++ memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4); ++ } ++ memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len); ++ tag += wpa_ie_len; ++ } ++ ++#if 0 ++ // ++ // Construct Realtek Proprietary Aggregation mode (Set AMPDU Factor to 2, 32k) ++ // ++ if(pHTInfo->bRegRT2RTAggregation) ++ { ++ (*tag++) = 0xdd; ++ (*tag++) = tmp_generic_ie_len - 2; ++ memcpy(tag,tmp_generic_ie_buf,tmp_generic_ie_len -2); ++ tag += tmp_generic_ie_len -2; ++ ++ } ++#endif ++#if 0 ++ if(ieee->qos_support) ++ { ++ (*tag++) = 0xdd; ++ (*tag++) = wmm_len; ++ memcpy(tag,QosOui,wmm_len); ++ tag += wmm_len; ++ } ++#endif ++ //skb->dev = ieee->dev; ++ return skb; ++} ++ ++ ++struct sk_buff* ieee80211_assoc_resp(struct ieee80211_device *ieee, u8 *dest) ++{ ++ struct sk_buff *skb; ++ u8* tag; ++ ++ struct ieee80211_crypt_data* crypt; ++ struct ieee80211_assoc_response_frame *assoc; ++ short encrypt; ++ ++ unsigned int rate_len = ieee80211_MFIE_rate_len(ieee); ++ int len = sizeof(struct ieee80211_assoc_response_frame) + rate_len + ieee->tx_headroom; ++ ++ skb = dev_alloc_skb(len); ++ ++ if (!skb) ++ return NULL; ++ ++ skb_reserve(skb, ieee->tx_headroom); ++ ++ assoc = (struct ieee80211_assoc_response_frame *) ++ skb_put(skb,sizeof(struct ieee80211_assoc_response_frame)); ++ ++ assoc->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP); ++ memcpy(assoc->header.addr1, dest,ETH_ALEN); ++ memcpy(assoc->header.addr3, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(assoc->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? ++ WLAN_CAPABILITY_BSS : WLAN_CAPABILITY_IBSS); ++ ++ ++ if(ieee->short_slot) ++ assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT); ++ ++ if (ieee->host_encrypt) ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++ else crypt = NULL; ++ ++ encrypt = ( crypt && crypt->ops); ++ ++ if (encrypt) ++ assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); ++ ++ assoc->status = 0; ++ assoc->aid = cpu_to_le16(ieee->assoc_id); ++ if (ieee->assoc_id == 0x2007) ieee->assoc_id=0; ++ else ieee->assoc_id++; ++ ++ tag = (u8*) skb_put(skb, rate_len); ++ ++ ieee80211_MFIE_Brate(ieee, &tag); ++ ieee80211_MFIE_Grate(ieee, &tag); ++ ++ return skb; ++} ++ ++struct sk_buff* ieee80211_auth_resp(struct ieee80211_device *ieee,int status, u8 *dest) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_authentication *auth; ++ int len = ieee->tx_headroom + sizeof(struct ieee80211_authentication)+1; ++ ++ skb = dev_alloc_skb(len); ++ ++ if (!skb) ++ return NULL; ++ ++ skb->len = sizeof(struct ieee80211_authentication); ++ ++ auth = (struct ieee80211_authentication *)skb->data; ++ ++ auth->status = cpu_to_le16(status); ++ auth->transaction = cpu_to_le16(2); ++ auth->algorithm = cpu_to_le16(WLAN_AUTH_OPEN); ++ ++ memcpy(auth->header.addr3, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(auth->header.addr1, dest, ETH_ALEN); ++ auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH); ++ return skb; ++ ++ ++} ++ ++struct sk_buff* ieee80211_null_func(struct ieee80211_device *ieee,short pwr) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_hdr_3addr* hdr; ++ ++ skb = dev_alloc_skb(sizeof(struct ieee80211_hdr_3addr)); ++ ++ if (!skb) ++ return NULL; ++ ++ hdr = (struct ieee80211_hdr_3addr*)skb_put(skb,sizeof(struct ieee80211_hdr_3addr)); ++ ++ memcpy(hdr->addr1, ieee->current_network.bssid, ETH_ALEN); ++ memcpy(hdr->addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(hdr->addr3, ieee->current_network.bssid, ETH_ALEN); ++ ++ hdr->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_DATA | ++ IEEE80211_STYPE_NULLFUNC | IEEE80211_FCTL_TODS | ++ (pwr ? IEEE80211_FCTL_PM:0)); ++ ++ return skb; ++ ++ ++} ++ ++ ++void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8* dest) ++{ ++ struct sk_buff *buf = ieee80211_assoc_resp(ieee, dest); ++ ++ if (buf) ++ softmac_mgmt_xmit(buf, ieee); ++} ++ ++ ++void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8* dest) ++{ ++ struct sk_buff *buf = ieee80211_auth_resp(ieee, s, dest); ++ ++ if (buf) ++ softmac_mgmt_xmit(buf, ieee); ++} ++ ++ ++void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest) ++{ ++ ++ ++ struct sk_buff *buf = ieee80211_probe_resp(ieee, dest); ++ if (buf) ++ softmac_mgmt_xmit(buf, ieee); ++} ++ ++ ++inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beacon,struct ieee80211_device *ieee) ++{ ++ struct sk_buff *skb; ++ //unsigned long flags; ++ ++ struct ieee80211_assoc_request_frame *hdr; ++ u8 *tag;//,*rsn_ie; ++ //short info_addr = 0; ++ //int i; ++ //u16 suite_count = 0; ++ //u8 suit_select = 0; ++ //unsigned int wpa_len = beacon->wpa_ie_len; ++ //for HT ++ u8* ht_cap_buf = NULL; ++ u8 ht_cap_len=0; ++ u8* realtek_ie_buf=NULL; ++ u8 realtek_ie_len=0; ++ int wpa_ie_len= ieee->wpa_ie_len; ++ unsigned int ckip_ie_len=0; ++ unsigned int ccxrm_ie_len=0; ++ unsigned int cxvernum_ie_len=0; ++ struct ieee80211_crypt_data* crypt; ++ int encrypt; ++ ++ unsigned int rate_len = ieee80211_MFIE_rate_len(ieee); ++ unsigned int wmm_info_len = beacon->qos_data.supported?9:0; ++#ifdef THOMAS_TURBO ++ unsigned int turbo_info_len = beacon->Turbo_Enable?9:0; ++#endif ++ ++ int len = 0; ++ ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++ encrypt = ieee->host_encrypt && crypt && crypt->ops && ((0 == strcmp(crypt->ops->name,"WEP") || wpa_ie_len)); ++ ++ //Include High Throuput capability && Realtek proprietary ++ if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT) ++ { ++ ht_cap_buf = (u8*)&(ieee->pHTInfo->SelfHTCap); ++ ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); ++ HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, encrypt); ++ if(ieee->pHTInfo->bCurrentRT2RTAggregation) ++ { ++ realtek_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer; ++ realtek_ie_len = sizeof( ieee->pHTInfo->szRT2RTAggBuffer); ++ HTConstructRT2RTAggElement(ieee, realtek_ie_buf, &realtek_ie_len); ++ ++ } ++ } ++ if(ieee->qos_support){ ++ wmm_info_len = beacon->qos_data.supported?9:0; ++ } ++ ++ ++ if(beacon->bCkipSupported) ++ { ++ ckip_ie_len = 30+2; ++ } ++ if(beacon->bCcxRmEnable) ++ { ++ ccxrm_ie_len = 6+2; ++ } ++ if( beacon->BssCcxVerNumber >= 2 ) ++ { ++ cxvernum_ie_len = 5+2; ++ } ++#ifdef THOMAS_TURBO ++ len = sizeof(struct ieee80211_assoc_request_frame)+ 2 ++ + beacon->ssid_len//essid tagged val ++ + rate_len//rates tagged val ++ + wpa_ie_len ++ + wmm_info_len ++ + turbo_info_len ++ + ht_cap_len ++ + realtek_ie_len ++ + ckip_ie_len ++ + ccxrm_ie_len ++ + cxvernum_ie_len ++ + ieee->tx_headroom; ++#else ++ len = sizeof(struct ieee80211_assoc_request_frame)+ 2 ++ + beacon->ssid_len//essid tagged val ++ + rate_len//rates tagged val ++ + wpa_ie_len ++ + wmm_info_len ++ + ht_cap_len ++ + realtek_ie_len ++ + ckip_ie_len ++ + ccxrm_ie_len ++ + cxvernum_ie_len ++ + ieee->tx_headroom; ++#endif ++ ++ skb = dev_alloc_skb(len); ++ ++ if (!skb) ++ return NULL; ++ ++ skb_reserve(skb, ieee->tx_headroom); ++ ++ hdr = (struct ieee80211_assoc_request_frame *) ++ skb_put(skb, sizeof(struct ieee80211_assoc_request_frame)+2); ++ ++ ++ hdr->header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ; ++ hdr->header.duration_id= 37; //FIXME ++ memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN); ++ memcpy(hdr->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN); ++ ++ memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);//for HW security, John ++ ++ hdr->capability = cpu_to_le16(WLAN_CAPABILITY_BSS); ++ if (beacon->capability & WLAN_CAPABILITY_PRIVACY ) ++ hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); ++ ++ if (beacon->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) ++ hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); //add short_preamble here ++ ++ if(ieee->short_slot) ++ hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT); ++ if (wmm_info_len) //QOS ++ hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS); ++ ++ hdr->listen_interval = 0xa; //FIXME ++ ++ hdr->info_element[0].id = MFIE_TYPE_SSID; ++ ++ hdr->info_element[0].len = beacon->ssid_len; ++ tag = skb_put(skb, beacon->ssid_len); ++ memcpy(tag, beacon->ssid, beacon->ssid_len); ++ ++ tag = skb_put(skb, rate_len); ++ ++ ieee80211_MFIE_Brate(ieee, &tag); ++ ieee80211_MFIE_Grate(ieee, &tag); ++ // For CCX 1 S13, CKIP. Added by Annie, 2006-08-14. ++ if( beacon->bCkipSupported ) ++ { ++ static u8 AironetIeOui[] = {0x00, 0x01, 0x66}; // "4500-client" ++ u8 CcxAironetBuf[30]; ++ OCTET_STRING osCcxAironetIE; ++ ++ memset(CcxAironetBuf, 0,30); ++ osCcxAironetIE.Octet = CcxAironetBuf; ++ osCcxAironetIE.Length = sizeof(CcxAironetBuf); ++ // ++ // Ref. CCX test plan v3.61, 3.2.3.1 step 13. ++ // We want to make the device type as "4500-client". 060926, by CCW. ++ // ++ memcpy(osCcxAironetIE.Octet, AironetIeOui, sizeof(AironetIeOui)); ++ ++ // CCX1 spec V1.13, A01.1 CKIP Negotiation (page23): ++ // "The CKIP negotiation is started with the associate request from the client to the access point, ++ // containing an Aironet element with both the MIC and KP bits set." ++ osCcxAironetIE.Octet[IE_CISCO_FLAG_POSITION] |= (SUPPORT_CKIP_PK|SUPPORT_CKIP_MIC) ; ++ tag = skb_put(skb, ckip_ie_len); ++ *tag++ = MFIE_TYPE_AIRONET; ++ *tag++ = osCcxAironetIE.Length; ++ memcpy(tag,osCcxAironetIE.Octet,osCcxAironetIE.Length); ++ tag += osCcxAironetIE.Length; ++ } ++ ++ if(beacon->bCcxRmEnable) ++ { ++ static u8 CcxRmCapBuf[] = {0x00, 0x40, 0x96, 0x01, 0x01, 0x00}; ++ OCTET_STRING osCcxRmCap; ++ ++ osCcxRmCap.Octet = CcxRmCapBuf; ++ osCcxRmCap.Length = sizeof(CcxRmCapBuf); ++ tag = skb_put(skb,ccxrm_ie_len); ++ *tag++ = MFIE_TYPE_GENERIC; ++ *tag++ = osCcxRmCap.Length; ++ memcpy(tag,osCcxRmCap.Octet,osCcxRmCap.Length); ++ tag += osCcxRmCap.Length; ++ } ++ ++ if( beacon->BssCcxVerNumber >= 2 ) ++ { ++ u8 CcxVerNumBuf[] = {0x00, 0x40, 0x96, 0x03, 0x00}; ++ OCTET_STRING osCcxVerNum; ++ CcxVerNumBuf[4] = beacon->BssCcxVerNumber; ++ osCcxVerNum.Octet = CcxVerNumBuf; ++ osCcxVerNum.Length = sizeof(CcxVerNumBuf); ++ tag = skb_put(skb,cxvernum_ie_len); ++ *tag++ = MFIE_TYPE_GENERIC; ++ *tag++ = osCcxVerNum.Length; ++ memcpy(tag,osCcxVerNum.Octet,osCcxVerNum.Length); ++ tag += osCcxVerNum.Length; ++ } ++ //HT cap element ++ if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ ++ if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) ++ { ++ tag = skb_put(skb, ht_cap_len); ++ *tag++ = MFIE_TYPE_HT_CAP; ++ *tag++ = ht_cap_len - 2; ++ memcpy(tag, ht_cap_buf,ht_cap_len -2); ++ tag += ht_cap_len -2; ++ } ++ } ++ ++ ++ //choose what wpa_supplicant gives to associate. ++ tag = skb_put(skb, wpa_ie_len); ++ if (wpa_ie_len){ ++ memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len); ++ } ++ ++ tag = skb_put(skb,wmm_info_len); ++ if(wmm_info_len) { ++ ieee80211_WMM_Info(ieee, &tag); ++ } ++#ifdef THOMAS_TURBO ++ tag = skb_put(skb,turbo_info_len); ++ if(turbo_info_len) { ++ ieee80211_TURBO_Info(ieee, &tag); ++ } ++#endif ++ ++ if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ ++ if(ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) ++ { ++ tag = skb_put(skb, ht_cap_len); ++ *tag++ = MFIE_TYPE_GENERIC; ++ *tag++ = ht_cap_len - 2; ++ memcpy(tag, ht_cap_buf,ht_cap_len - 2); ++ tag += ht_cap_len -2; ++ } ++ ++ if(ieee->pHTInfo->bCurrentRT2RTAggregation){ ++ tag = skb_put(skb, realtek_ie_len); ++ *tag++ = MFIE_TYPE_GENERIC; ++ *tag++ = realtek_ie_len - 2; ++ memcpy(tag, realtek_ie_buf,realtek_ie_len -2 ); ++ } ++ } ++// printk("<=====%s(), %p, %p\n", __FUNCTION__, ieee->dev, ieee->dev->dev_addr); ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ++ return skb; ++} ++ ++void ieee80211_associate_abort(struct ieee80211_device *ieee) ++{ ++ ++ unsigned long flags; ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ ieee->associate_seq++; ++ ++ /* don't scan, and avoid to have the RX path possibily ++ * try again to associate. Even do not react to AUTH or ++ * ASSOC response. Just wait for the retry wq to be scheduled. ++ * Here we will check if there are good nets to associate ++ * with, so we retry or just get back to NO_LINK and scanning ++ */ ++ if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING){ ++ IEEE80211_DEBUG_MGMT("Authentication failed\n"); ++ ieee->softmac_stats.no_auth_rs++; ++ }else{ ++ IEEE80211_DEBUG_MGMT("Association failed\n"); ++ ieee->softmac_stats.no_ass_rs++; ++ } ++ ++ ieee->state = IEEE80211_ASSOCIATING_RETRY; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \ ++ IEEE80211_SOFTMAC_ASSOC_RETRY_TIME); ++#else ++ schedule_task(&ieee->associate_retry_wq); ++#endif ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++} ++ ++void ieee80211_associate_abort_cb(unsigned long dev) ++{ ++ ieee80211_associate_abort((struct ieee80211_device *) dev); ++} ++ ++ ++void ieee80211_associate_step1(struct ieee80211_device *ieee) ++{ ++ struct ieee80211_network *beacon = &ieee->current_network; ++ struct sk_buff *skb; ++ ++ IEEE80211_DEBUG_MGMT("Stopping scan\n"); ++ ++ ieee->softmac_stats.tx_auth_rq++; ++ skb=ieee80211_authentication_req(beacon, ieee, 0); ++ ++ if (!skb) ++ ieee80211_associate_abort(ieee); ++ else{ ++ ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING ; ++ IEEE80211_DEBUG_MGMT("Sending authentication request\n"); ++ //printk(KERN_WARNING "Sending authentication request\n"); ++ softmac_mgmt_xmit(skb, ieee); ++ //BUGON when you try to add_timer twice, using mod_timer may be better, john0709 ++ if(!timer_pending(&ieee->associate_timer)){ ++ ieee->associate_timer.expires = jiffies + (HZ / 2); ++ add_timer(&ieee->associate_timer); ++ } ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++} ++ ++void ieee80211_auth_challenge(struct ieee80211_device *ieee, u8 *challenge, int chlen) ++{ ++ u8 *c; ++ struct sk_buff *skb; ++ struct ieee80211_network *beacon = &ieee->current_network; ++// int hlen = sizeof(struct ieee80211_authentication); ++ ++ ieee->associate_seq++; ++ ieee->softmac_stats.tx_auth_rq++; ++ ++ skb = ieee80211_authentication_req(beacon, ieee, chlen+2); ++ if (!skb) ++ ieee80211_associate_abort(ieee); ++ else{ ++ c = skb_put(skb, chlen+2); ++ *(c++) = MFIE_TYPE_CHALLENGE; ++ *(c++) = chlen; ++ memcpy(c, challenge, chlen); ++ ++ IEEE80211_DEBUG_MGMT("Sending authentication challenge response\n"); ++ ++ ieee80211_encrypt_fragment(ieee, skb, sizeof(struct ieee80211_hdr_3addr )); ++ ++ softmac_mgmt_xmit(skb, ieee); ++ mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); ++#if 0 ++ ieee->associate_timer.expires = jiffies + (HZ / 2); ++ add_timer(&ieee->associate_timer); ++#endif ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++ kfree(challenge); ++} ++ ++void ieee80211_associate_step2(struct ieee80211_device *ieee) ++{ ++ struct sk_buff* skb; ++ struct ieee80211_network *beacon = &ieee->current_network; ++ ++ del_timer_sync(&ieee->associate_timer); ++ ++ IEEE80211_DEBUG_MGMT("Sending association request\n"); ++ ++ ieee->softmac_stats.tx_ass_rq++; ++ skb=ieee80211_association_req(beacon, ieee); ++ if (!skb) ++ ieee80211_associate_abort(ieee); ++ else{ ++ softmac_mgmt_xmit(skb, ieee); ++ mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); ++#if 0 ++ ieee->associate_timer.expires = jiffies + (HZ / 2); ++ add_timer(&ieee->associate_timer); ++#endif ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++} ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void ieee80211_associate_complete_wq(struct work_struct *work) ++{ ++ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); ++#else ++void ieee80211_associate_complete_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ printk(KERN_INFO "Associated successfully\n"); ++ ieee->is_roaming = false; ++ if(ieee80211_is_54g(ieee->current_network) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION)){ ++ ++ ieee->rate = 108; ++ printk(KERN_INFO"Using G rates:%d\n", ieee->rate); ++ }else{ ++ ieee->rate = 22; ++ printk(KERN_INFO"Using B rates:%d\n", ieee->rate); ++ } ++ if (ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT) ++ { ++ printk("Successfully associated, ht enabled\n"); ++ HTOnAssocRsp(ieee); ++ } ++ else ++ { ++ printk("Successfully associated, ht not enabled(%d, %d)\n", ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bEnableHT); ++ memset(ieee->dot11HTOperationalRateSet, 0, 16); ++ //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ } ++ ieee->LinkDetectInfo.SlotNum = 2 * (1 + ieee->current_network.beacon_interval/500); ++ // To prevent the immediately calling watch_dog after association. ++ if(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0 ) ++ { ++ ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; ++ ieee->LinkDetectInfo.NumRecvDataInPeriod= 1; ++ } ++ ieee->link_change(ieee->dev); ++ if(ieee->is_silent_reset == 0){ ++ printk("============>normal associate\n"); ++ notify_wx_assoc_event(ieee); ++ } ++ else if(ieee->is_silent_reset == 1) ++ { ++ printk("==================>silent reset associate\n"); ++ ieee->is_silent_reset = 0; ++ } ++ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ netif_carrier_on(ieee->dev); ++} ++ ++void ieee80211_associate_complete(struct ieee80211_device *ieee) ++{ ++// int i; ++// struct net_device* dev = ieee->dev; ++ del_timer_sync(&ieee->associate_timer); ++ ++#if 0 ++ for(i = 0; i < 6; i++) { ++ ieee->seq_ctrl[i] = 0; ++ } ++#endif ++ ieee->state = IEEE80211_LINKED; ++#if 0 ++ if (ieee->pHTInfo->bCurrentHTSupport) ++ { ++ printk("Successfully associated, ht enabled\n"); ++ queue_work(ieee->wq, &ieee->ht_onAssRsp); ++ } ++ else ++ { ++ printk("Successfully associated, ht not enabled\n"); ++ memset(ieee->dot11HTOperationalRateSet, 0, 16); ++ HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ } ++#endif ++ //ieee->UpdateHalRATRTableHandler(dev, ieee->dot11HTOperationalRateSet); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_complete_wq); ++#else ++ schedule_task(&ieee->associate_complete_wq); ++#endif ++} ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void ieee80211_associate_procedure_wq(struct work_struct *work) ++{ ++ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); ++#else ++void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ ieee->sync_scan_hurryup = 1; ++ down(&ieee->wx_sem); ++ ++ if (ieee->data_hard_stop) ++ ieee->data_hard_stop(ieee->dev); ++ ++ ieee80211_stop_scan(ieee); ++ printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel); ++ //ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ ++ ieee->associate_seq = 1; ++ ieee80211_associate_step1(ieee); ++ ++ up(&ieee->wx_sem); ++} ++ ++inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee80211_network *net) ++{ ++ u8 tmp_ssid[IW_ESSID_MAX_SIZE+1]; ++ int tmp_ssid_len = 0; ++ ++ short apset,ssidset,ssidbroad,apmatch,ssidmatch; ++ ++ /* we are interested in new new only if we are not associated ++ * and we are not associating / authenticating ++ */ ++ if (ieee->state != IEEE80211_NOLINK) ++ return; ++ ++ if ((ieee->iw_mode == IW_MODE_INFRA) && !(net->capability & WLAN_CAPABILITY_BSS)) ++ return; ++ ++ if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS)) ++ return; ++ ++ ++ if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC){ ++ /* if the user specified the AP MAC, we need also the essid ++ * This could be obtained by beacons or, if the network does not ++ * broadcast it, it can be put manually. ++ */ ++ apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, zero,ETH_ALEN)!=0 ); ++ ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != '\0'; ++ ssidbroad = !(net->ssid_len == 0 || net->ssid[0]== '\0'); ++ apmatch = (memcmp(ieee->current_network.bssid, net->bssid, ETH_ALEN)==0); ++ ssidmatch = (ieee->current_network.ssid_len == net->ssid_len)&&\ ++ (!strncmp(ieee->current_network.ssid, net->ssid, net->ssid_len)); ++ ++ ++ if ( /* if the user set the AP check if match. ++ * if the network does not broadcast essid we check the user supplyed ANY essid ++ * if the network does broadcast and the user does not set essid it is OK ++ * if the network does broadcast and the user did set essid chech if essid match ++ */ ++ ( apset && apmatch && ++ ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset)) ) || ++ /* if the ap is not set, check that the user set the bssid ++ * and the network does bradcast and that those two bssid matches ++ */ ++ (!apset && ssidset && ssidbroad && ssidmatch) ++ ){ ++ /* if the essid is hidden replace it with the ++ * essid provided by the user. ++ */ ++ if (!ssidbroad){ ++ strncpy(tmp_ssid, ieee->current_network.ssid, IW_ESSID_MAX_SIZE); ++ tmp_ssid_len = ieee->current_network.ssid_len; ++ } ++ memcpy(&ieee->current_network, net, sizeof(struct ieee80211_network)); ++ ++ if (!ssidbroad){ ++ strncpy(ieee->current_network.ssid, tmp_ssid, IW_ESSID_MAX_SIZE); ++ ieee->current_network.ssid_len = tmp_ssid_len; ++ } ++ printk(KERN_INFO"Linking with %s,channel:%d, qos:%d, myHT:%d, networkHT:%d\n",ieee->current_network.ssid,ieee->current_network.channel, ieee->current_network.qos_data.supported, ieee->pHTInfo->bEnableHT, ieee->current_network.bssht.bdSupportHT); ++ ++ //ieee->pHTInfo->IOTAction = 0; ++ HTResetIOTSetting(ieee->pHTInfo); ++ if (ieee->iw_mode == IW_MODE_INFRA){ ++ /* Join the network for the first time */ ++ ieee->AsocRetryCount = 0; ++ //for HT by amy 080514 ++ if((ieee->current_network.qos_data.supported == 1) && ++ // (ieee->pHTInfo->bEnableHT && ieee->current_network.bssht.bdSupportHT)) ++ ieee->current_network.bssht.bdSupportHT) ++/*WB, 2008.09.09:bCurrentHTSupport and bEnableHT two flags are going to put together to check whether we are in HT now, so needn't to check bEnableHT flags here. That's is to say we will set to HT support whenever joined AP has the ability to support HT. And whether we are in HT or not, please check bCurrentHTSupport&&bEnableHT now please.*/ ++ { ++ // ieee->pHTInfo->bCurrentHTSupport = true; ++ HTResetSelfAndSavePeerSetting(ieee, &(ieee->current_network)); ++ } ++ else ++ { ++ ieee->pHTInfo->bCurrentHTSupport = false; ++ } ++ ++ ieee->state = IEEE80211_ASSOCIATING; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_procedure_wq); ++#else ++ schedule_task(&ieee->associate_procedure_wq); ++#endif ++ }else{ ++ if(ieee80211_is_54g(ieee->current_network) && ++ (ieee->modulation & IEEE80211_OFDM_MODULATION)){ ++ ieee->rate = 108; ++ ieee->SetWirelessMode(ieee->dev, IEEE_G); ++ printk(KERN_INFO"Using G rates\n"); ++ }else{ ++ ieee->rate = 22; ++ ieee->SetWirelessMode(ieee->dev, IEEE_B); ++ printk(KERN_INFO"Using B rates\n"); ++ } ++ memset(ieee->dot11HTOperationalRateSet, 0, 16); ++ //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ ieee->state = IEEE80211_LINKED; ++ } ++ ++ } ++ } ++ ++} ++ ++void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++ struct ieee80211_network *target; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ list_for_each_entry(target, &ieee->network_list, list) { ++ ++ /* if the state become different that NOLINK means ++ * we had found what we are searching for ++ */ ++ ++ if (ieee->state != IEEE80211_NOLINK) ++ break; ++ ++ if (ieee->scan_age == 0 || time_after(target->last_scanned + ieee->scan_age, jiffies)) ++ ieee80211_softmac_new_net(ieee, target); ++ } ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++} ++ ++ ++static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen) ++{ ++ struct ieee80211_authentication *a; ++ u8 *t; ++ if (skb->len < (sizeof(struct ieee80211_authentication)-sizeof(struct ieee80211_info_element))){ ++ IEEE80211_DEBUG_MGMT("invalid len in auth resp: %d\n",skb->len); ++ return 0xcafe; ++ } ++ *challenge = NULL; ++ a = (struct ieee80211_authentication*) skb->data; ++ if(skb->len > (sizeof(struct ieee80211_authentication) +3)){ ++ t = skb->data + sizeof(struct ieee80211_authentication); ++ ++ if(*(t++) == MFIE_TYPE_CHALLENGE){ ++ *chlen = *(t++); ++ *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC); ++ memcpy(*challenge, t, *chlen); ++ } ++ } ++ ++ return cpu_to_le16(a->status); ++ ++} ++ ++ ++int auth_rq_parse(struct sk_buff *skb,u8* dest) ++{ ++ struct ieee80211_authentication *a; ++ ++ if (skb->len < (sizeof(struct ieee80211_authentication)-sizeof(struct ieee80211_info_element))){ ++ IEEE80211_DEBUG_MGMT("invalid len in auth request: %d\n",skb->len); ++ return -1; ++ } ++ a = (struct ieee80211_authentication*) skb->data; ++ ++ memcpy(dest,a->header.addr2, ETH_ALEN); ++ ++ if (le16_to_cpu(a->algorithm) != WLAN_AUTH_OPEN) ++ return WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG; ++ ++ return WLAN_STATUS_SUCCESS; ++} ++ ++static short probe_rq_parse(struct ieee80211_device *ieee, struct sk_buff *skb, u8 *src) ++{ ++ u8 *tag; ++ u8 *skbend; ++ u8 *ssid=NULL; ++ u8 ssidlen = 0; ++ ++ struct ieee80211_hdr_3addr *header = ++ (struct ieee80211_hdr_3addr *) skb->data; ++ ++ if (skb->len < sizeof (struct ieee80211_hdr_3addr )) ++ return -1; /* corrupted */ ++ ++ memcpy(src,header->addr2, ETH_ALEN); ++ ++ skbend = (u8*)skb->data + skb->len; ++ ++ tag = skb->data + sizeof (struct ieee80211_hdr_3addr ); ++ ++ while (tag+1 < skbend){ ++ if (*tag == 0){ ++ ssid = tag+2; ++ ssidlen = *(tag+1); ++ break; ++ } ++ tag++; /* point to the len field */ ++ tag = tag + *(tag); /* point to the last data byte of the tag */ ++ tag++; /* point to the next tag */ ++ } ++ ++ //IEEE80211DMESG("Card MAC address is "MACSTR, MAC2STR(src)); ++ if (ssidlen == 0) return 1; ++ ++ if (!ssid) return 1; /* ssid not found in tagged param */ ++ return (!strncmp(ssid, ieee->current_network.ssid, ssidlen)); ++ ++} ++ ++int assoc_rq_parse(struct sk_buff *skb,u8* dest) ++{ ++ struct ieee80211_assoc_request_frame *a; ++ ++ if (skb->len < (sizeof(struct ieee80211_assoc_request_frame) - ++ sizeof(struct ieee80211_info_element))) { ++ ++ IEEE80211_DEBUG_MGMT("invalid len in auth request:%d \n", skb->len); ++ return -1; ++ } ++ ++ a = (struct ieee80211_assoc_request_frame*) skb->data; ++ ++ memcpy(dest,a->header.addr2,ETH_ALEN); ++ ++ return 0; ++} ++ ++static inline u16 assoc_parse(struct ieee80211_device *ieee, struct sk_buff *skb, int *aid) ++{ ++ struct ieee80211_assoc_response_frame *response_head; ++ u16 status_code; ++ ++ if (skb->len < sizeof(struct ieee80211_assoc_response_frame)){ ++ IEEE80211_DEBUG_MGMT("invalid len in auth resp: %d\n", skb->len); ++ return 0xcafe; ++ } ++ ++ response_head = (struct ieee80211_assoc_response_frame*) skb->data; ++ *aid = le16_to_cpu(response_head->aid) & 0x3fff; ++ ++ status_code = le16_to_cpu(response_head->status); ++ if((status_code==WLAN_STATUS_ASSOC_DENIED_RATES || \ ++ status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&& ++ ((ieee->mode == IEEE_G) && ++ (ieee->current_network.mode == IEEE_N_24G) && ++ (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { ++ ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE; ++ }else { ++ ieee->AsocRetryCount = 0; ++ } ++ ++ return le16_to_cpu(response_head->status); ++} ++ ++static inline void ++ieee80211_rx_probe_rq(struct ieee80211_device *ieee, struct sk_buff *skb) ++{ ++ u8 dest[ETH_ALEN]; ++ ++ //IEEE80211DMESG("Rx probe"); ++ ieee->softmac_stats.rx_probe_rq++; ++ //DMESG("Dest is "MACSTR, MAC2STR(dest)); ++ if (probe_rq_parse(ieee, skb, dest)){ ++ //IEEE80211DMESG("Was for me!"); ++ ieee->softmac_stats.tx_probe_rs++; ++ ieee80211_resp_to_probe(ieee, dest); ++ } ++} ++ ++static inline void ++ieee80211_rx_auth_rq(struct ieee80211_device *ieee, struct sk_buff *skb) ++{ ++ u8 dest[ETH_ALEN]; ++ int status; ++ //IEEE80211DMESG("Rx probe"); ++ ieee->softmac_stats.rx_auth_rq++; ++ ++ if ((status = auth_rq_parse(skb, dest))!= -1){ ++ ieee80211_resp_to_auth(ieee, status, dest); ++ } ++ //DMESG("Dest is "MACSTR, MAC2STR(dest)); ++ ++} ++ ++static inline void ++ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb) ++{ ++ ++ u8 dest[ETH_ALEN]; ++ //unsigned long flags; ++ ++ ieee->softmac_stats.rx_ass_rq++; ++ if (assoc_rq_parse(skb,dest) != -1){ ++ ieee80211_resp_to_assoc_rq(ieee, dest); ++ } ++ ++ printk(KERN_INFO"New client associated: "MAC_FMT"\n", MAC_ARG(dest)); ++ //FIXME ++ #if 0 ++ spin_lock_irqsave(&ieee->lock,flags); ++ add_associate(ieee,dest); ++ spin_unlock_irqrestore(&ieee->lock,flags); ++ #endif ++} ++ ++ ++ ++void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr) ++{ ++ ++ struct sk_buff *buf = ieee80211_null_func(ieee, pwr); ++ ++ if (buf) ++ softmac_ps_mgmt_xmit(buf, ieee); ++ ++} ++ ++ ++short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, u32 *time_l) ++{ ++ int timeout = ieee->ps_timeout; ++ u8 dtim; ++ /*if(ieee->ps == IEEE80211_PS_DISABLED || ++ ieee->iw_mode != IW_MODE_INFRA || ++ ieee->state != IEEE80211_LINKED) ++ ++ return 0; ++ */ ++ dtim = ieee->current_network.dtim_data; ++ //printk("DTIM\n"); ++ if(!(dtim & IEEE80211_DTIM_VALID)) ++ return 0; ++ timeout = ieee->current_network.beacon_interval; //should we use ps_timeout value or beacon_interval ++ //printk("VALID\n"); ++ ieee->current_network.dtim_data = IEEE80211_DTIM_INVALID; ++ ++ if(dtim & ((IEEE80211_DTIM_UCAST | IEEE80211_DTIM_MBCAST)& ieee->ps)) ++ return 2; ++ ++ if(!time_after(jiffies, ieee->dev->trans_start + MSECS(timeout))) ++ return 0; ++ ++ if(!time_after(jiffies, ieee->last_rx_ps_time + MSECS(timeout))) ++ return 0; ++ ++ if((ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE ) && ++ (ieee->mgmt_queue_tail != ieee->mgmt_queue_head)) ++ return 0; ++ ++ if(time_l){ ++ *time_l = ieee->current_network.last_dtim_sta_time[0] ++ + (ieee->current_network.beacon_interval); ++ // * ieee->current_network.dtim_period) * 1000; ++ } ++ ++ if(time_h){ ++ *time_h = ieee->current_network.last_dtim_sta_time[1]; ++ if(time_l && *time_l < ieee->current_network.last_dtim_sta_time[0]) ++ *time_h += 1; ++ } ++ ++ return 1; ++ ++ ++} ++ ++inline void ieee80211_sta_ps(struct ieee80211_device *ieee) ++{ ++ ++ u32 th,tl; ++ short sleep; ++ ++ unsigned long flags,flags2; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if((ieee->ps == IEEE80211_PS_DISABLED || ++ ieee->iw_mode != IW_MODE_INFRA || ++ ieee->state != IEEE80211_LINKED)){ ++ ++ // #warning CHECK_LOCK_HERE ++ spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); ++ ++ ieee80211_sta_wakeup(ieee, 1); ++ ++ spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); ++ } ++ ++ sleep = ieee80211_sta_ps_sleep(ieee,&th, &tl); ++ /* 2 wake, 1 sleep, 0 do nothing */ ++ if(sleep == 0) ++ goto out; ++ ++ if(sleep == 1){ ++ ++ if(ieee->sta_sleep == 1) ++ ieee->enter_sleep_state(ieee->dev,th,tl); ++ ++ else if(ieee->sta_sleep == 0){ ++ // printk("send null 1\n"); ++ spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); ++ ++ if(ieee->ps_is_queue_empty(ieee->dev)){ ++ ++ ++ ieee->sta_sleep = 2; ++ ++ ieee->ack_tx_to_ieee = 1; ++ ++ ieee80211_sta_ps_send_null_frame(ieee,1); ++ ++ ieee->ps_th = th; ++ ieee->ps_tl = tl; ++ } ++ spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); ++ ++ } ++ ++ ++ }else if(sleep == 2){ ++//#warning CHECK_LOCK_HERE ++ spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); ++ ++ ieee80211_sta_wakeup(ieee,1); ++ ++ spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); ++ } ++ ++out: ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++} ++ ++void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl) ++{ ++ if(ieee->sta_sleep == 0){ ++ if(nl){ ++ printk("Warning: driver is probably failing to report TX ps error\n"); ++ ieee->ack_tx_to_ieee = 1; ++ ieee80211_sta_ps_send_null_frame(ieee, 0); ++ } ++ return; ++ ++ } ++ ++ if(ieee->sta_sleep == 1) ++ ieee->sta_wake_up(ieee->dev); ++ ++ ieee->sta_sleep = 0; ++ ++ if(nl){ ++ ieee->ack_tx_to_ieee = 1; ++ ieee80211_sta_ps_send_null_frame(ieee, 0); ++ } ++} ++ ++void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success) ++{ ++ unsigned long flags,flags2; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if(ieee->sta_sleep == 2){ ++ /* Null frame with PS bit set */ ++ if(success){ ++ ieee->sta_sleep = 1; ++ ieee->enter_sleep_state(ieee->dev,ieee->ps_th,ieee->ps_tl); ++ } ++ /* if the card report not success we can't be sure the AP ++ * has not RXed so we can't assume the AP believe us awake ++ */ ++ } ++ /* 21112005 - tx again null without PS bit if lost */ ++ else { ++ ++ if((ieee->sta_sleep == 0) && !success){ ++ spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); ++ ieee80211_sta_ps_send_null_frame(ieee, 0); ++ spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); ++ } ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++} ++void ieee80211_process_action(struct ieee80211_device* ieee, struct sk_buff* skb) ++{ ++ struct ieee80211_hdr* header = (struct ieee80211_hdr*)skb->data; ++ u8* act = ieee80211_get_payload(header); ++ u8 tmp = 0; ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); ++ if (act == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n"); ++ return; ++ } ++ tmp = *act; ++ act ++; ++ switch (tmp) ++ { ++ case ACT_CAT_BA: ++ if (*act == ACT_ADDBAREQ) ++ ieee80211_rx_ADDBAReq(ieee, skb); ++ else if (*act == ACT_ADDBARSP) ++ ieee80211_rx_ADDBARsp(ieee, skb); ++ else if (*act == ACT_DELBA) ++ ieee80211_rx_DELBA(ieee, skb); ++ break; ++ default: ++// if (net_ratelimit()) ++// IEEE80211_DEBUG(IEEE80211_DL_BA, "unknown action frame(%d)\n", tmp); ++ break; ++ } ++ return; ++ ++} ++inline int ++ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ++ struct ieee80211_rx_stats *rx_stats, u16 type, ++ u16 stype) ++{ ++ struct ieee80211_hdr_3addr *header = (struct ieee80211_hdr_3addr *) skb->data; ++ u16 errcode; ++ u8* challenge; ++ int chlen=0; ++ int aid; ++ struct ieee80211_assoc_response_frame *assoc_resp; ++// struct ieee80211_info_element *info_element; ++ bool bSupportNmode = true, bHalfSupportNmode = false; //default support N mode, disable halfNmode ++ ++ if(!ieee->proto_started) ++ return 0; ++#if 0 ++ printk("%d, %d, %d, %d\n", ieee->sta_sleep, ieee->ps, ieee->iw_mode, ieee->state); ++ if(ieee->sta_sleep || (ieee->ps != IEEE80211_PS_DISABLED && ++ ieee->iw_mode == IW_MODE_INFRA && ++ ieee->state == IEEE80211_LINKED)) ++ ++ tasklet_schedule(&ieee->ps_task); ++ ++ if(WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_PROBE_RESP && ++ WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_BEACON) ++ ieee->last_rx_ps_time = jiffies; ++#endif ++ ++ switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { ++ ++ case IEEE80211_STYPE_ASSOC_RESP: ++ case IEEE80211_STYPE_REASSOC_RESP: ++ ++ IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n", ++ WLAN_FC_GET_STYPE(header->frame_ctl)); ++ if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && ++ ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED && ++ ieee->iw_mode == IW_MODE_INFRA){ ++ struct ieee80211_network network_resp; ++ struct ieee80211_network *network = &network_resp; ++ ++ if (0 == (errcode=assoc_parse(ieee,skb, &aid))){ ++ ieee->state=IEEE80211_LINKED; ++ ieee->assoc_id = aid; ++ ieee->softmac_stats.rx_ass_ok++; ++ /* station support qos */ ++ /* Let the register setting defaultly with Legacy station */ ++ if(ieee->qos_support) { ++ assoc_resp = (struct ieee80211_assoc_response_frame*)skb->data; ++ memset(network, 0, sizeof(*network)); ++ if (ieee80211_parse_info_param(ieee,assoc_resp->info_element,\ ++ rx_stats->len - sizeof(*assoc_resp),\ ++ network,rx_stats)){ ++ return 1; ++ } ++ else ++ { //filling the PeerHTCap. //maybe not neccesary as we can get its info from current_network. ++ memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen); ++ memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen); ++ } ++ if (ieee->handle_assoc_response != NULL) ++ ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame*)header, network); ++ } ++ ieee80211_associate_complete(ieee); ++ } else { ++ /* aid could not been allocated */ ++ ieee->softmac_stats.rx_ass_err++; ++ printk( ++ "Association response status code 0x%x\n", ++ errcode); ++ IEEE80211_DEBUG_MGMT( ++ "Association response status code 0x%x\n", ++ errcode); ++ if(ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) { ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_procedure_wq); ++#else ++ schedule_task(&ieee->associate_procedure_wq); ++#endif ++ } else { ++ ieee80211_associate_abort(ieee); ++ } ++ } ++ } ++ break; ++ ++ case IEEE80211_STYPE_ASSOC_REQ: ++ case IEEE80211_STYPE_REASSOC_REQ: ++ ++ if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && ++ ieee->iw_mode == IW_MODE_MASTER) ++ ++ ieee80211_rx_assoc_rq(ieee, skb); ++ break; ++ ++ case IEEE80211_STYPE_AUTH: ++ ++ if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){ ++ if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING && ++ ieee->iw_mode == IW_MODE_INFRA){ ++ ++ IEEE80211_DEBUG_MGMT("Received authentication response"); ++ ++ if (0 == (errcode=auth_parse(skb, &challenge, &chlen))){ ++ if(ieee->open_wep || !challenge){ ++ ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED; ++ ieee->softmac_stats.rx_auth_rs_ok++; ++ if(!(ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE)) ++ { ++ if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) ++ { ++ // WEP or TKIP encryption ++ if(IsHTHalfNmodeAPs(ieee)) ++ { ++ bSupportNmode = true; ++ bHalfSupportNmode = true; ++ } ++ else ++ { ++ bSupportNmode = false; ++ bHalfSupportNmode = false; ++ } ++ printk("==========>to link with AP using SEC(%d, %d)", bSupportNmode, bHalfSupportNmode); ++ } ++ } ++ /* Dummy wirless mode setting to avoid encryption issue */ ++ if(bSupportNmode) { ++ //N mode setting ++ ieee->SetWirelessMode(ieee->dev, \ ++ ieee->current_network.mode); ++ }else{ ++ //b/g mode setting ++ /*TODO*/ ++ ieee->SetWirelessMode(ieee->dev, IEEE_G); ++ } ++ ++ if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true) ++ { ++ printk("===============>entern half N mode\n"); ++ ieee->bHalfWirelessN24GMode = true; ++ } ++ else ++ ieee->bHalfWirelessN24GMode = false; ++ ++ ieee80211_associate_step2(ieee); ++ }else{ ++ ieee80211_auth_challenge(ieee, challenge, chlen); ++ } ++ }else{ ++ ieee->softmac_stats.rx_auth_rs_err++; ++ IEEE80211_DEBUG_MGMT("Authentication respose status code 0x%x",errcode); ++ ++ printk("Authentication respose status code 0x%x",errcode); ++ ieee80211_associate_abort(ieee); ++ } ++ ++ }else if (ieee->iw_mode == IW_MODE_MASTER){ ++ ieee80211_rx_auth_rq(ieee, skb); ++ } ++ } ++ break; ++ ++ case IEEE80211_STYPE_PROBE_REQ: ++ ++ if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && ++ ((ieee->iw_mode == IW_MODE_ADHOC || ++ ieee->iw_mode == IW_MODE_MASTER) && ++ ieee->state == IEEE80211_LINKED)){ ++ ieee80211_rx_probe_rq(ieee, skb); ++ } ++ break; ++ ++ case IEEE80211_STYPE_DISASSOC: ++ case IEEE80211_STYPE_DEAUTH: ++ /* FIXME for now repeat all the association procedure ++ * both for disassociation and deauthentication ++ */ ++ if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && ++ ieee->state == IEEE80211_LINKED && ++ ieee->iw_mode == IW_MODE_INFRA){ ++ ++ ieee->state = IEEE80211_ASSOCIATING; ++ ieee->softmac_stats.reassoc++; ++ ieee->is_roaming = true; ++ ieee80211_disassociate(ieee); ++ // notify_wx_assoc_event(ieee); ++ //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ RemovePeerTS(ieee, header->addr2); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_procedure_wq); ++#else ++ schedule_task(&ieee->associate_procedure_wq); ++#endif ++ } ++ break; ++ case IEEE80211_STYPE_MANAGE_ACT: ++ ieee80211_process_action(ieee,skb); ++ break; ++ default: ++ return -1; ++ break; ++ } ++ ++ //dev_kfree_skb_any(skb); ++ return 0; ++} ++ ++/* following are for a simplier TX queue management. ++ * Instead of using netif_[stop/wake]_queue the driver ++ * will uses these two function (plus a reset one), that ++ * will internally uses the kernel netif_* and takes ++ * care of the ieee802.11 fragmentation. ++ * So the driver receives a fragment per time and might ++ * call the stop function when it want without take care ++ * to have enought room to TX an entire packet. ++ * This might be useful if each fragment need it's own ++ * descriptor, thus just keep a total free memory > than ++ * the max fragmentation treshold is not enought.. If the ++ * ieee802.11 stack passed a TXB struct then you needed ++ * to keep N free descriptors where ++ * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD ++ * In this way you need just one and the 802.11 stack ++ * will take care of buffering fragments and pass them to ++ * to the driver later, when it wakes the queue. ++ */ ++void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *ieee) ++{ ++ ++ unsigned int queue_index = txb->queue_index; ++ unsigned long flags; ++ int i; ++ cb_desc *tcb_desc = NULL; ++ ++ spin_lock_irqsave(&ieee->lock,flags); ++ ++ /* called with 2nd parm 0, no tx mgmt lock required */ ++ ieee80211_sta_wakeup(ieee,0); ++ ++ /* update the tx status */ ++// ieee->stats.tx_bytes += txb->payload_size; ++// ieee->stats.tx_packets++; ++ tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); ++ if(tcb_desc->bMulticast) { ++ ieee->stats.multicast++; ++ } ++#if 1 ++ /* if xmit available, just xmit it immediately, else just insert it to the wait queue */ ++ for(i = 0; i < txb->nr_frags; i++) { ++#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ++ if ((skb_queue_len(&ieee->skb_drv_aggQ[queue_index]) != 0) || ++#else ++ if ((skb_queue_len(&ieee->skb_waitQ[queue_index]) != 0) || ++#endif ++ (!ieee->check_nic_enough_desc(ieee->dev,queue_index))||\ ++ (ieee->queue_stop)) { ++ /* insert the skb packet to the wait queue */ ++ /* as for the completion function, it does not need ++ * to check it any more. ++ * */ ++ //printk("error:no descriptor left@queue_index %d\n", queue_index); ++ //ieee80211_stop_queue(ieee); ++#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ++ skb_queue_tail(&ieee->skb_drv_aggQ[queue_index], txb->fragments[i]); ++#else ++ skb_queue_tail(&ieee->skb_waitQ[queue_index], txb->fragments[i]); ++#endif ++ }else{ ++ ieee->softmac_data_hard_start_xmit( ++ txb->fragments[i], ++ ieee->dev,ieee->rate); ++ //ieee->stats.tx_packets++; ++ //ieee->stats.tx_bytes += txb->fragments[i]->len; ++ //ieee->dev->trans_start = jiffies; ++ } ++ } ++#endif ++ ieee80211_txb_free(txb); ++ ++//exit: ++ spin_unlock_irqrestore(&ieee->lock,flags); ++ ++} ++ ++/* called with ieee->lock acquired */ ++void ieee80211_resume_tx(struct ieee80211_device *ieee) ++{ ++ int i; ++ for(i = ieee->tx_pending.frag; i < ieee->tx_pending.txb->nr_frags; i++) { ++ ++ if (ieee->queue_stop){ ++ ieee->tx_pending.frag = i; ++ return; ++ }else{ ++ ++ ieee->softmac_data_hard_start_xmit( ++ ieee->tx_pending.txb->fragments[i], ++ ieee->dev,ieee->rate); ++ //(i+1)tx_pending.txb->nr_frags); ++ ieee->stats.tx_packets++; ++ // ieee->dev->trans_start = jiffies; ++ } ++ } ++ ++ ++ ieee80211_txb_free(ieee->tx_pending.txb); ++ ieee->tx_pending.txb = NULL; ++} ++ ++ ++void ieee80211_reset_queue(struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ieee->lock,flags); ++ init_mgmt_queue(ieee); ++ if (ieee->tx_pending.txb){ ++ ieee80211_txb_free(ieee->tx_pending.txb); ++ ieee->tx_pending.txb = NULL; ++ } ++ ieee->queue_stop = 0; ++ spin_unlock_irqrestore(&ieee->lock,flags); ++ ++} ++ ++void ieee80211_wake_queue(struct ieee80211_device *ieee) ++{ ++ ++ unsigned long flags; ++ struct sk_buff *skb; ++ struct ieee80211_hdr_3addr *header; ++ ++ spin_lock_irqsave(&ieee->lock,flags); ++ if (! ieee->queue_stop) goto exit; ++ ++ ieee->queue_stop = 0; ++ ++ if(ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE){ ++ while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))){ ++ ++ header = (struct ieee80211_hdr_3addr *) skb->data; ++ ++ header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++ } ++ if (!ieee->queue_stop && ieee->tx_pending.txb) ++ ieee80211_resume_tx(ieee); ++ ++ if (!ieee->queue_stop && netif_queue_stopped(ieee->dev)){ ++ ieee->softmac_stats.swtxawake++; ++ netif_wake_queue(ieee->dev); ++ } ++ ++exit : ++ spin_unlock_irqrestore(&ieee->lock,flags); ++} ++ ++ ++void ieee80211_stop_queue(struct ieee80211_device *ieee) ++{ ++ //unsigned long flags; ++ //spin_lock_irqsave(&ieee->lock,flags); ++ ++ if (! netif_queue_stopped(ieee->dev)){ ++ netif_stop_queue(ieee->dev); ++ ieee->softmac_stats.swtxstop++; ++ } ++ ieee->queue_stop = 1; ++ //spin_unlock_irqrestore(&ieee->lock,flags); ++ ++} ++ ++ ++inline void ieee80211_randomize_cell(struct ieee80211_device *ieee) ++{ ++ ++ get_random_bytes(ieee->current_network.bssid, ETH_ALEN); ++ ++ /* an IBSS cell address must have the two less significant ++ * bits of the first byte = 2 ++ */ ++ ieee->current_network.bssid[0] &= ~0x01; ++ ieee->current_network.bssid[0] |= 0x02; ++} ++ ++/* called in user context only */ ++void ieee80211_start_master_bss(struct ieee80211_device *ieee) ++{ ++ ieee->assoc_id = 1; ++ ++ if (ieee->current_network.ssid_len == 0){ ++ strncpy(ieee->current_network.ssid, ++ IEEE80211_DEFAULT_TX_ESSID, ++ IW_ESSID_MAX_SIZE); ++ ++ ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID); ++ ieee->ssid_set = 1; ++ } ++ ++ memcpy(ieee->current_network.bssid, ieee->dev->dev_addr, ETH_ALEN); ++ ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ieee->state = IEEE80211_LINKED; ++ ieee->link_change(ieee->dev); ++ notify_wx_assoc_event(ieee); ++ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ ++ netif_carrier_on(ieee->dev); ++} ++ ++void ieee80211_start_monitor_mode(struct ieee80211_device *ieee) ++{ ++ if(ieee->raw_tx){ ++ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ ++ netif_carrier_on(ieee->dev); ++ } ++} ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void ieee80211_start_ibss_wq(struct work_struct *work) ++{ ++ ++ struct delayed_work *dwork = container_of(work, struct delayed_work, work); ++ struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq); ++#else ++void ieee80211_start_ibss_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ /* iwconfig mode ad-hoc will schedule this and return ++ * on the other hand this will block further iwconfig SET ++ * operations because of the wx_sem hold. ++ * Anyway some most set operations set a flag to speed-up ++ * (abort) this wq (when syncro scanning) before sleeping ++ * on the semaphore ++ */ ++ if(!ieee->proto_started){ ++ printk("==========oh driver down return\n"); ++ return; ++ } ++ down(&ieee->wx_sem); ++ ++ if (ieee->current_network.ssid_len == 0){ ++ strcpy(ieee->current_network.ssid,IEEE80211_DEFAULT_TX_ESSID); ++ ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID); ++ ieee->ssid_set = 1; ++ } ++ ++ /* check if we have this cell in our network list */ ++ ieee80211_softmac_check_all_nets(ieee); ++ ++ ++#ifdef ENABLE_DOT11D //if creating an ad-hoc, set its channel to 10 temporarily--this is the requirement for ASUS, not 11D, so disable 11d. ++// if((IS_DOT11D_ENABLE(ieee)) && (ieee->state == IEEE80211_NOLINK)) ++ if (ieee->state == IEEE80211_NOLINK) ++ ieee->current_network.channel = 6; ++#endif ++ /* if not then the state is not linked. Maybe the user swithced to ++ * ad-hoc mode just after being in monitor mode, or just after ++ * being very few time in managed mode (so the card have had no ++ * time to scan all the chans..) or we have just run up the iface ++ * after setting ad-hoc mode. So we have to give another try.. ++ * Here, in ibss mode, should be safe to do this without extra care ++ * (in bss mode we had to make sure no-one tryed to associate when ++ * we had just checked the ieee->state and we was going to start the ++ * scan) beacause in ibss mode the ieee80211_new_net function, when ++ * finds a good net, just set the ieee->state to IEEE80211_LINKED, ++ * so, at worst, we waste a bit of time to initiate an unneeded syncro ++ * scan, that will stop at the first round because it sees the state ++ * associated. ++ */ ++ if (ieee->state == IEEE80211_NOLINK) ++ ieee80211_start_scan_syncro(ieee); ++ ++ /* the network definitively is not here.. create a new cell */ ++ if (ieee->state == IEEE80211_NOLINK){ ++ printk("creating new IBSS cell\n"); ++ if(!ieee->wap_set) ++ ieee80211_randomize_cell(ieee); ++ ++ if(ieee->modulation & IEEE80211_CCK_MODULATION){ ++ ++ ieee->current_network.rates_len = 4; ++ ++ ieee->current_network.rates[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; ++ ieee->current_network.rates[1] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB; ++ ieee->current_network.rates[2] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB; ++ ieee->current_network.rates[3] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB; ++ ++ }else ++ ieee->current_network.rates_len = 0; ++ ++ if(ieee->modulation & IEEE80211_OFDM_MODULATION){ ++ ieee->current_network.rates_ex_len = 8; ++ ++ ieee->current_network.rates_ex[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB; ++ ieee->current_network.rates_ex[1] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_9MB; ++ ieee->current_network.rates_ex[2] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_12MB; ++ ieee->current_network.rates_ex[3] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_18MB; ++ ieee->current_network.rates_ex[4] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_24MB; ++ ieee->current_network.rates_ex[5] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_36MB; ++ ieee->current_network.rates_ex[6] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_48MB; ++ ieee->current_network.rates_ex[7] = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB; ++ ++ ieee->rate = 108; ++ }else{ ++ ieee->current_network.rates_ex_len = 0; ++ ieee->rate = 22; ++ } ++ ++ // By default, WMM function will be disabled in IBSS mode ++ ieee->current_network.QoS_Enable = 0; ++ ieee->SetWirelessMode(ieee->dev, IEEE_G); ++ ieee->current_network.atim_window = 0; ++ ieee->current_network.capability = WLAN_CAPABILITY_IBSS; ++ if(ieee->short_slot) ++ ieee->current_network.capability |= WLAN_CAPABILITY_SHORT_SLOT; ++ ++ } ++ ++ ieee->state = IEEE80211_LINKED; ++ ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ieee->link_change(ieee->dev); ++ ++ notify_wx_assoc_event(ieee); ++ ++ ieee80211_start_send_beacons(ieee); ++ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ netif_carrier_on(ieee->dev); ++ ++ up(&ieee->wx_sem); ++} ++ ++inline void ieee80211_start_ibss(struct ieee80211_device *ieee) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_delayed_work(ieee->wq, &ieee->start_ibss_wq, 150); ++#else ++ schedule_task(&ieee->start_ibss_wq); ++#endif ++} ++ ++/* this is called only in user context, with wx_sem held */ ++void ieee80211_start_bss(struct ieee80211_device *ieee) ++{ ++ unsigned long flags; ++#ifdef ENABLE_DOT11D ++ // ++ // Ref: 802.11d 11.1.3.3 ++ // STA shall not start a BSS unless properly formed Beacon frame including a Country IE. ++ // ++ if(IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) ++ { ++ if(! ieee->bGlobalDomain) ++ { ++ return; ++ } ++ } ++#endif ++ /* check if we have already found the net we ++ * are interested in (if any). ++ * if not (we are disassociated and we are not ++ * in associating / authenticating phase) start the background scanning. ++ */ ++ ieee80211_softmac_check_all_nets(ieee); ++ ++ /* ensure no-one start an associating process (thus setting ++ * the ieee->state to ieee80211_ASSOCIATING) while we ++ * have just cheked it and we are going to enable scan. ++ * The ieee80211_new_net function is always called with ++ * lock held (from both ieee80211_softmac_check_all_nets and ++ * the rx path), so we cannot be in the middle of such function ++ */ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if (ieee->state == IEEE80211_NOLINK){ ++ ieee->actscanning = true; ++ ieee80211_start_scan(ieee); ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++} ++ ++/* called only in userspace context */ ++void ieee80211_disassociate(struct ieee80211_device *ieee) ++{ ++ ++ ++ netif_carrier_off(ieee->dev); ++ if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) ++ ieee80211_reset_queue(ieee); ++ ++ if (ieee->data_hard_stop) ++ ieee->data_hard_stop(ieee->dev); ++#ifdef ENABLE_DOT11D ++ if(IS_DOT11D_ENABLE(ieee)) ++ Dot11d_Reset(ieee); ++#endif ++ ieee->state = IEEE80211_NOLINK; ++ ieee->is_set_key = false; ++ ieee->link_change(ieee->dev); ++ //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ notify_wx_assoc_event(ieee); ++ ++} ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void ieee80211_associate_retry_wq(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work, struct delayed_work, work); ++ struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, associate_retry_wq); ++#else ++void ieee80211_associate_retry_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ unsigned long flags; ++ ++ down(&ieee->wx_sem); ++ if(!ieee->proto_started) ++ goto exit; ++ ++ if(ieee->state != IEEE80211_ASSOCIATING_RETRY) ++ goto exit; ++ ++ /* until we do not set the state to IEEE80211_NOLINK ++ * there are no possibility to have someone else trying ++ * to start an association procdure (we get here with ++ * ieee->state = IEEE80211_ASSOCIATING). ++ * When we set the state to IEEE80211_NOLINK it is possible ++ * that the RX path run an attempt to associate, but ++ * both ieee80211_softmac_check_all_nets and the ++ * RX path works with ieee->lock held so there are no ++ * problems. If we are still disassociated then start a scan. ++ * the lock here is necessary to ensure no one try to start ++ * an association procedure when we have just checked the ++ * state and we are going to start the scan. ++ */ ++ ieee->beinretry = true; ++ ieee->state = IEEE80211_NOLINK; ++ ++ ieee80211_softmac_check_all_nets(ieee); ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if(ieee->state == IEEE80211_NOLINK) ++ { ++ ieee->is_roaming= false; ++ ieee->actscanning = true; ++ ieee80211_start_scan(ieee); ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++ ieee->beinretry = false; ++exit: ++ up(&ieee->wx_sem); ++} ++ ++struct sk_buff *ieee80211_get_beacon_(struct ieee80211_device *ieee) ++{ ++ u8 broadcast_addr[] = {0xff,0xff,0xff,0xff,0xff,0xff}; ++ ++ struct sk_buff *skb; ++ struct ieee80211_probe_response *b; ++ ++ skb = ieee80211_probe_resp(ieee, broadcast_addr); ++ ++ if (!skb) ++ return NULL; ++ ++ b = (struct ieee80211_probe_response *) skb->data; ++ b->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_BEACON); ++ ++ return skb; ++ ++} ++ ++struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_probe_response *b; ++ ++ skb = ieee80211_get_beacon_(ieee); ++ if(!skb) ++ return NULL; ++ ++ b = (struct ieee80211_probe_response *) skb->data; ++ b->header.seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ++ ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ ++ return skb; ++} ++ ++void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee) ++{ ++ ieee->sync_scan_hurryup = 1; ++ down(&ieee->wx_sem); ++ ieee80211_stop_protocol(ieee); ++ up(&ieee->wx_sem); ++} ++ ++ ++void ieee80211_stop_protocol(struct ieee80211_device *ieee) ++{ ++ if (!ieee->proto_started) ++ return; ++ ++ ieee->proto_started = 0; ++ ++ ieee80211_stop_send_beacons(ieee); ++ del_timer_sync(&ieee->associate_timer); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&ieee->associate_retry_wq); ++ cancel_delayed_work(&ieee->start_ibss_wq); ++#endif ++ ieee80211_stop_scan(ieee); ++ ++ ieee80211_disassociate(ieee); ++ RemoveAllTS(ieee); //added as we disconnect from the previous BSS, Remove all TS ++} ++ ++void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee) ++{ ++ ieee->sync_scan_hurryup = 0; ++ down(&ieee->wx_sem); ++ ieee80211_start_protocol(ieee); ++ up(&ieee->wx_sem); ++} ++ ++void ieee80211_start_protocol(struct ieee80211_device *ieee) ++{ ++ short ch = 0; ++ int i = 0; ++ if (ieee->proto_started) ++ return; ++ ++ ieee->proto_started = 1; ++ ++ if (ieee->current_network.channel == 0){ ++ do{ ++ ch++; ++ if (ch > MAX_CHANNEL_NUMBER) ++ return; /* no channel found */ ++#ifdef ENABLE_DOT11D ++ }while(!GET_DOT11D_INFO(ieee)->channel_map[ch]); ++#else ++ }while(!ieee->channel_map[ch]); ++#endif ++ ieee->current_network.channel = ch; ++ } ++ ++ if (ieee->current_network.beacon_interval == 0) ++ ieee->current_network.beacon_interval = 100; ++// printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel); ++// ieee->set_chan(ieee->dev,ieee->current_network.channel); ++ ++ for(i = 0; i < 17; i++) { ++ ieee->last_rxseq_num[i] = -1; ++ ieee->last_rxfrag_num[i] = -1; ++ ieee->last_packet_time[i] = 0; ++ } ++ ++ ieee->init_wmmparam_flag = 0;//reinitialize AC_xx_PARAM registers. ++ ++ ++ /* if the user set the MAC of the ad-hoc cell and then ++ * switch to managed mode, shall we make sure that association ++ * attempts does not fail just because the user provide the essid ++ * and the nic is still checking for the AP MAC ?? ++ */ ++ if (ieee->iw_mode == IW_MODE_INFRA) ++ ieee80211_start_bss(ieee); ++ ++ else if (ieee->iw_mode == IW_MODE_ADHOC) ++ ieee80211_start_ibss(ieee); ++ ++ else if (ieee->iw_mode == IW_MODE_MASTER) ++ ieee80211_start_master_bss(ieee); ++ ++ else if(ieee->iw_mode == IW_MODE_MONITOR) ++ ieee80211_start_monitor_mode(ieee); ++} ++ ++ ++#define DRV_NAME "Ieee80211" ++void ieee80211_softmac_init(struct ieee80211_device *ieee) ++{ ++ int i; ++ memset(&ieee->current_network, 0, sizeof(struct ieee80211_network)); ++ ++ ieee->state = IEEE80211_NOLINK; ++ ieee->sync_scan_hurryup = 0; ++ for(i = 0; i < 5; i++) { ++ ieee->seq_ctrl[i] = 0; ++ } ++#ifdef ENABLE_DOT11D ++ ieee->pDot11dInfo = kmalloc(sizeof(RT_DOT11D_INFO), GFP_ATOMIC); ++ if (!ieee->pDot11dInfo) ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n"); ++ memset(ieee->pDot11dInfo, 0, sizeof(RT_DOT11D_INFO)); ++#endif ++ //added for AP roaming ++ ieee->LinkDetectInfo.SlotNum = 2; ++ ieee->LinkDetectInfo.NumRecvBcnInPeriod=0; ++ ieee->LinkDetectInfo.NumRecvDataInPeriod=0; ++ ++ ieee->assoc_id = 0; ++ ieee->queue_stop = 0; ++ ieee->scanning = 0; ++ ieee->softmac_features = 0; //so IEEE2100-like driver are happy ++ ieee->wap_set = 0; ++ ieee->ssid_set = 0; ++ ieee->proto_started = 0; ++ ieee->basic_rate = IEEE80211_DEFAULT_BASIC_RATE; ++ ieee->rate = 22; ++ ieee->ps = IEEE80211_PS_DISABLED; ++ ieee->sta_sleep = 0; ++ ieee->Regdot11HTOperationalRateSet[0]= 0xff;//support MCS 0~7 ++ ieee->Regdot11HTOperationalRateSet[1]= 0xff;//support MCS 8~15 ++ ieee->Regdot11HTOperationalRateSet[4]= 0x01; ++ //added by amy ++ ieee->actscanning = false; ++ ieee->beinretry = false; ++ ieee->is_set_key = false; ++ init_mgmt_queue(ieee); ++ ++ ieee->sta_edca_param[0] = 0x0000A403; ++ ieee->sta_edca_param[1] = 0x0000A427; ++ ieee->sta_edca_param[2] = 0x005E4342; ++ ieee->sta_edca_param[3] = 0x002F3262; ++ ieee->aggregation = true; ++ ieee->enable_rx_imm_BA = 1; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ init_timer(&ieee->scan_timer); ++ ieee->scan_timer.data = (unsigned long)ieee; ++ ieee->scan_timer.function = ieee80211_softmac_scan_cb; ++#endif ++ ieee->tx_pending.txb = NULL; ++ ++ init_timer(&ieee->associate_timer); ++ ieee->associate_timer.data = (unsigned long)ieee; ++ ieee->associate_timer.function = ieee80211_associate_abort_cb; ++ ++ init_timer(&ieee->beacon_timer); ++ ieee->beacon_timer.data = (unsigned long) ieee; ++ ieee->beacon_timer.function = ieee80211_send_beacon_cb; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#ifdef PF_SYNCTHREAD ++ ieee->wq = create_workqueue(DRV_NAME,0); ++#else ++ ieee->wq = create_workqueue(DRV_NAME); ++#endif ++#endif ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq); ++ INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq); ++ INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq); ++ INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq); ++ INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq); ++ INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq); ++ ++#else ++ INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); ++ INIT_WORK(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee); ++ INIT_WORK(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee); ++ INIT_WORK(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee); ++ INIT_WORK(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee); ++ INIT_WORK(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee); ++#endif ++ ++#else ++ tq_init(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); ++ tq_init(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee); ++ tq_init(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee); ++ tq_init(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee); ++ tq_init(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee); ++ tq_init(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee); ++#endif ++ sema_init(&ieee->wx_sem, 1); ++ sema_init(&ieee->scan_sem, 1); ++ ++ spin_lock_init(&ieee->mgmt_tx_lock); ++ spin_lock_init(&ieee->beacon_lock); ++ ++ tasklet_init(&ieee->ps_task, ++ (void(*)(unsigned long)) ieee80211_sta_ps, ++ (unsigned long)ieee); ++ ++} ++ ++void ieee80211_softmac_free(struct ieee80211_device *ieee) ++{ ++ down(&ieee->wx_sem); ++#ifdef ENABLE_DOT11D ++ if(NULL != ieee->pDot11dInfo) ++ { ++ kfree(ieee->pDot11dInfo); ++ ieee->pDot11dInfo = NULL; ++ } ++#endif ++ del_timer_sync(&ieee->associate_timer); ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&ieee->associate_retry_wq); ++ destroy_workqueue(ieee->wq); ++#endif ++ ++ up(&ieee->wx_sem); ++} ++ ++/******************************************************** ++ * Start of WPA code. * ++ * this is stolen from the ipw2200 driver * ++ ********************************************************/ ++ ++ ++static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value) ++{ ++ /* This is called when wpa_supplicant loads and closes the driver ++ * interface. */ ++ printk("%s WPA\n",value ? "enabling" : "disabling"); ++ ieee->wpa_enabled = value; ++ return 0; ++} ++ ++ ++void ieee80211_wpa_assoc_frame(struct ieee80211_device *ieee, char *wpa_ie, int wpa_ie_len) ++{ ++ /* make sure WPA is enabled */ ++ ieee80211_wpa_enable(ieee, 1); ++ ++ ieee80211_disassociate(ieee); ++} ++ ++ ++static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command, int reason) ++{ ++ ++ int ret = 0; ++ ++ switch (command) { ++ case IEEE_MLME_STA_DEAUTH: ++ // silently ignore ++ break; ++ ++ case IEEE_MLME_STA_DISASSOC: ++ ieee80211_disassociate(ieee); ++ break; ++ ++ default: ++ printk("Unknown MLME request: %d\n", command); ++ ret = -EOPNOTSUPP; ++ } ++ ++ return ret; ++} ++ ++ ++static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee, ++ struct ieee_param *param, int plen) ++{ ++ 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; ++ } ++ ++ ieee80211_wpa_assoc_frame(ieee, ieee->wpa_ie, ieee->wpa_ie_len); ++ return 0; ++} ++ ++#define AUTH_ALG_OPEN_SYSTEM 0x1 ++#define AUTH_ALG_SHARED_KEY 0x2 ++ ++static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value) ++{ ++ ++ struct ieee80211_security sec = { ++ .flags = SEC_AUTH_MODE, ++ }; ++ int ret = 0; ++ ++ if (value & AUTH_ALG_SHARED_KEY) { ++ sec.auth_mode = WLAN_AUTH_SHARED_KEY; ++ ieee->open_wep = 0; ++ ieee->auth_mode = 1; ++ } else if (value & AUTH_ALG_OPEN_SYSTEM){ ++ sec.auth_mode = WLAN_AUTH_OPEN; ++ ieee->open_wep = 1; ++ ieee->auth_mode = 0; ++ } ++ else if (value & IW_AUTH_ALG_LEAP){ ++ sec.auth_mode = WLAN_AUTH_LEAP; ++ ieee->open_wep = 1; ++ ieee->auth_mode = 2; ++ } ++ ++ ++ if (ieee->set_security) ++ ieee->set_security(ieee->dev, &sec); ++ //else ++ // ret = -EOPNOTSUPP; ++ ++ return ret; ++} ++ ++static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 value) ++{ ++ int ret=0; ++ unsigned long flags; ++ ++ switch (name) { ++ case IEEE_PARAM_WPA_ENABLED: ++ ret = ieee80211_wpa_enable(ieee, value); ++ break; ++ ++ case IEEE_PARAM_TKIP_COUNTERMEASURES: ++ ieee->tkip_countermeasures=value; ++ break; ++ ++ case IEEE_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_ENABLED, ++ .enabled = value, ++ }; ++ ieee->drop_unencrypted = value; ++ /* We only change SEC_LEVEL for open mode. Others ++ * are set by ipw_wpa_set_encryption. ++ */ ++ if (!value) { ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_0; ++ } ++ else { ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_1; ++ } ++ if (ieee->set_security) ++ ieee->set_security(ieee->dev, &sec); ++ break; ++ } ++ ++ case IEEE_PARAM_PRIVACY_INVOKED: ++ ieee->privacy_invoked=value; ++ break; ++ ++ case IEEE_PARAM_AUTH_ALGS: ++ ret = ieee80211_wpa_set_auth_algs(ieee, value); ++ break; ++ ++ case IEEE_PARAM_IEEE_802_1X: ++ ieee->ieee802_1x=value; ++ break; ++ case IEEE_PARAM_WPAX_SELECT: ++ // added for WPA2 mixed mode ++ spin_lock_irqsave(&ieee->wpax_suitlist_lock,flags); ++ ieee->wpax_type_set = 1; ++ ieee->wpax_type_notify = value; ++ spin_unlock_irqrestore(&ieee->wpax_suitlist_lock,flags); ++ break; ++ ++ default: ++ printk("Unknown WPA param: %d\n",name); ++ ret = -EOPNOTSUPP; ++ } ++ ++ return ret; ++} ++ ++/* implementation borrowed from hostap driver */ ++ ++static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ++ struct ieee_param *param, int param_len) ++{ ++ int ret = 0; ++ ++ 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[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; ++ ++ if (param_len != ++ (int) ((char *) param->u.crypt.key - (char *) param) + ++ param->u.crypt.key_len) { ++ printk("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; ++ } ++ ++ if (strcmp(param->u.crypt.alg, "none") == 0) { ++ if (crypt) { ++ sec.enabled = 0; ++ // FIXME FIXME ++ //sec.encrypt = 0; ++ sec.level = SEC_LEVEL_0; ++ sec.flags |= SEC_ENABLED | SEC_LEVEL; ++ ieee80211_crypt_delayed_deinit(ieee, crypt); ++ } ++ goto done; ++ } ++ sec.enabled = 1; ++// FIXME FIXME ++// sec.encrypt = 1; ++ sec.flags |= SEC_ENABLED; ++ ++ /* IPW HW cannot build TKIP MIC, host decryption still needed. */ ++ if (!(ieee->host_encrypt || ieee->host_decrypt) && ++ strcmp(param->u.crypt.alg, "TKIP")) ++ goto skip_host_crypt; ++ ++ 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); ++ //set WEP40 first, it will be modified according to WEP104 or WEP40 at other place ++ } 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) { ++ printk("unknown crypto alg '%s'\n", param->u.crypt.alg); ++ param->u.crypt.err = IEEE_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 LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ++ if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) ++#else ++ if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) ++#endif ++ new_crypt->priv = ++ new_crypt->ops->init(param->u.crypt.idx); ++ ++ if (new_crypt->priv == NULL) { ++ kfree(new_crypt); ++ param->u.crypt.err = IEEE_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) { ++ printk("key setting failed\n"); ++ param->u.crypt.err = IEEE_CRYPT_ERR_KEY_SET_FAILED; ++ ret = -EINVAL; ++ goto done; ++ } ++ ++ skip_host_crypt: ++ 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; ++ } else ++ sec.flags &= ~SEC_ACTIVE_KEY; ++ ++ if (param->u.crypt.alg != NULL) { ++ 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); ++ ++ if (strcmp(param->u.crypt.alg, "WEP") == 0) { ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_1; ++ } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_2; ++ } else if (strcmp(param->u.crypt.alg, "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(ieee->dev)) { ++ printk("reset_port failed\n"); ++ param->u.crypt.err = IEEE_CRYPT_ERR_CARD_CONF_FAILED; ++ return -EINVAL; ++ } ++ ++ return ret; ++} ++ ++inline struct sk_buff *ieee80211_disassociate_skb( ++ struct ieee80211_network *beacon, ++ struct ieee80211_device *ieee, ++ u8 asRsn) ++{ ++ struct sk_buff *skb; ++ struct ieee80211_disassoc *disass; ++ ++ skb = dev_alloc_skb(sizeof(struct ieee80211_disassoc)); ++ if (!skb) ++ return NULL; ++ ++ disass = (struct ieee80211_disassoc *) skb_put(skb,sizeof(struct ieee80211_disassoc)); ++ disass->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_DISASSOC); ++ disass->header.duration_id = 0; ++ ++ memcpy(disass->header.addr1, beacon->bssid, ETH_ALEN); ++ memcpy(disass->header.addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(disass->header.addr3, beacon->bssid, ETH_ALEN); ++ ++ disass->reason = asRsn; ++ return skb; ++} ++ ++ ++void ++SendDisassociation( ++ struct ieee80211_device *ieee, ++ u8* asSta, ++ u8 asRsn ++) ++{ ++ struct ieee80211_network *beacon = &ieee->current_network; ++ struct sk_buff *skb; ++ skb = ieee80211_disassociate_skb(beacon,ieee,asRsn); ++ if (skb){ ++ softmac_mgmt_xmit(skb, ieee); ++ //dev_kfree_skb_any(skb);//edit by thomas ++ } ++} ++ ++int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee, struct iw_point *p) ++{ ++ struct ieee_param *param; ++ int ret=0; ++ ++ down(&ieee->wx_sem); ++ //IEEE_DEBUG_INFO("wpa_supplicant: len=%d\n", p->length); ++ ++ if (p->length < sizeof(struct ieee_param) || !p->pointer){ ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); ++ if (param == NULL){ ++ ret = -ENOMEM; ++ goto out; ++ } ++ if (copy_from_user(param, p->pointer, p->length)) { ++ kfree(param); ++ ret = -EFAULT; ++ goto out; ++ } ++ ++ switch (param->cmd) { ++ ++ case IEEE_CMD_SET_WPA_PARAM: ++ ret = ieee80211_wpa_set_param(ieee, param->u.wpa_param.name, ++ param->u.wpa_param.value); ++ break; ++ ++ case IEEE_CMD_SET_WPA_IE: ++ ret = ieee80211_wpa_set_wpa_ie(ieee, param, p->length); ++ break; ++ ++ case IEEE_CMD_SET_ENCRYPTION: ++ ret = ieee80211_wpa_set_encryption(ieee, param, p->length); ++ break; ++ ++ case IEEE_CMD_MLME: ++ ret = ieee80211_wpa_mlme(ieee, param->u.mlme.command, ++ param->u.mlme.reason_code); ++ break; ++ ++ default: ++ printk("Unknown WPA supplicant request: %d\n",param->cmd); ++ ret = -EOPNOTSUPP; ++ break; ++ } ++ ++ if (ret == 0 && copy_to_user(p->pointer, param, p->length)) ++ ret = -EFAULT; ++ ++ kfree(param); ++out: ++ up(&ieee->wx_sem); ++ ++ return ret; ++} ++ ++void notify_wx_assoc_event(struct ieee80211_device *ieee) ++{ ++ union iwreq_data wrqu; ++ wrqu.ap_addr.sa_family = ARPHRD_ETHER; ++ if (ieee->state == IEEE80211_LINKED) ++ memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, ETH_ALEN); ++ else ++ memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); ++ wireless_send_event(ieee->dev, SIOCGIWAP, &wrqu, NULL); ++} ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_get_beacon); ++//EXPORT_SYMBOL(ieee80211_wake_queue); ++//EXPORT_SYMBOL(ieee80211_stop_queue); ++//EXPORT_SYMBOL(ieee80211_reset_queue); ++//EXPORT_SYMBOL(ieee80211_softmac_stop_protocol); ++//EXPORT_SYMBOL(ieee80211_softmac_start_protocol); ++//EXPORT_SYMBOL(ieee80211_is_shortslot); ++//EXPORT_SYMBOL(ieee80211_is_54g); ++//EXPORT_SYMBOL(ieee80211_wpa_supplicant_ioctl); ++//EXPORT_SYMBOL(ieee80211_ps_tx_ack); ++//EXPORT_SYMBOL(ieee80211_softmac_xmit); ++//EXPORT_SYMBOL(ieee80211_stop_send_beacons); ++//EXPORT_SYMBOL(notify_wx_assoc_event); ++//EXPORT_SYMBOL(SendDisassociation); ++//EXPORT_SYMBOL(ieee80211_disassociate); ++//EXPORT_SYMBOL(ieee80211_start_send_beacons); ++//EXPORT_SYMBOL(ieee80211_stop_scan); ++//EXPORT_SYMBOL(ieee80211_send_probe_requests); ++//EXPORT_SYMBOL(ieee80211_softmac_scan_syncro); ++//EXPORT_SYMBOL(ieee80211_start_scan_syncro); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_get_beacon); ++EXPORT_SYMBOL_NOVERS(ieee80211_wake_queue); ++EXPORT_SYMBOL_NOVERS(ieee80211_stop_queue); ++EXPORT_SYMBOL_NOVERS(ieee80211_reset_queue); ++EXPORT_SYMBOL_NOVERS(ieee80211_softmac_stop_protocol); ++EXPORT_SYMBOL_NOVERS(ieee80211_softmac_start_protocol); ++EXPORT_SYMBOL_NOVERS(ieee80211_is_shortslot); ++EXPORT_SYMBOL_NOVERS(ieee80211_is_54g); ++EXPORT_SYMBOL_NOVERS(ieee80211_wpa_supplicant_ioctl); ++EXPORT_SYMBOL_NOVERS(ieee80211_ps_tx_ack); ++EXPORT_SYMBOL_NOVERS(ieee80211_softmac_xmit); ++EXPORT_SYMBOL_NOVERS(ieee80211_stop_send_beacons); ++EXPORT_SYMBOL_NOVERS(notify_wx_assoc_event); ++EXPORT_SYMBOL_NOVERS(SendDisassociation); ++EXPORT_SYMBOL_NOVERS(ieee80211_disassociate); ++EXPORT_SYMBOL_NOVERS(ieee80211_start_send_beacons); ++EXPORT_SYMBOL_NOVERS(ieee80211_stop_scan); ++EXPORT_SYMBOL_NOVERS(ieee80211_send_probe_requests); ++EXPORT_SYMBOL_NOVERS(ieee80211_softmac_scan_syncro); ++EXPORT_SYMBOL_NOVERS(ieee80211_start_scan_syncro); ++#endif ++//EXPORT_SYMBOL(ieee80211_sta_ps_send_null_frame); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c +@@ -0,0 +1,692 @@ ++/* IEEE 802.11 SoftMAC layer ++ * Copyright (c) 2005 Andrea Merello ++ * ++ * Mostly extracted from the rtl8180-sa2400 driver for the ++ * in-kernel generic ieee802.11 stack. ++ * ++ * Some pieces of code might be stolen from ipw2100 driver ++ * copyright of who own it's copyright ;-) ++ * ++ * PS wx handler mostly stolen from hostap, copyright who ++ * own it's copyright ;-) ++ * ++ * released under the GPL ++ */ ++ ++ ++#include "ieee80211.h" ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++/* FIXME: add A freqs */ ++ ++const long ieee80211_wlan_frequencies[] = { ++ 2412, 2417, 2422, 2427, ++ 2432, 2437, 2442, 2447, ++ 2452, 2457, 2462, 2467, ++ 2472, 2484 ++}; ++ ++ ++int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ int ret; ++ struct iw_freq *fwrq = & wrqu->freq; ++ ++ down(&ieee->wx_sem); ++ ++ if(ieee->iw_mode == IW_MODE_INFRA){ ++ ret = -EOPNOTSUPP; ++ goto out; ++ } ++ ++ /* if setting by freq convert to channel */ ++ if (fwrq->e == 1) { ++ if ((fwrq->m >= (int) 2.412e8 && ++ fwrq->m <= (int) 2.487e8)) { ++ int f = fwrq->m / 100000; ++ int c = 0; ++ ++ while ((c < 14) && (f != ieee80211_wlan_frequencies[c])) ++ c++; ++ ++ /* hack to fall through */ ++ fwrq->e = 0; ++ fwrq->m = c + 1; ++ } ++ } ++ ++ if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){ ++ ret = -EOPNOTSUPP; ++ goto out; ++ ++ }else { /* Set the channel */ ++ ++#ifdef ENABLE_DOT11D ++ if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) { ++ ret = -EINVAL; ++ goto out; ++ } ++#endif ++ ieee->current_network.channel = fwrq->m; ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ++ if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) ++ if(ieee->state == IEEE80211_LINKED){ ++ ++ ieee80211_stop_send_beacons(ieee); ++ ieee80211_start_send_beacons(ieee); ++ } ++ } ++ ++ ret = 0; ++out: ++ up(&ieee->wx_sem); ++ return ret; ++} ++ ++ ++int ieee80211_wx_get_freq(struct ieee80211_device *ieee, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct iw_freq *fwrq = & wrqu->freq; ++ ++ if (ieee->current_network.channel == 0) ++ return -1; ++ //NM 0.7.0 will not accept channel any more. ++ fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 100000; ++ fwrq->e = 1; ++// fwrq->m = ieee->current_network.channel; ++// fwrq->e = 0; ++ ++ return 0; ++} ++ ++int ieee80211_wx_get_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ unsigned long flags; ++ wrqu->ap_addr.sa_family = ARPHRD_ETHER; ++ ++ if (ieee->iw_mode == IW_MODE_MONITOR) ++ return -1; ++ ++ /* We want avoid to give to the user inconsistent infos*/ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if (ieee->state != IEEE80211_LINKED && ++ ieee->state != IEEE80211_LINKED_SCANNING && ++ ieee->wap_set == 0) ++ ++ memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); ++ else ++ memcpy(wrqu->ap_addr.sa_data, ++ ieee->current_network.bssid, ETH_ALEN); ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++ return 0; ++} ++ ++ ++int ieee80211_wx_set_wap(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *awrq, ++ char *extra) ++{ ++ ++ int ret = 0; ++ u8 zero[] = {0,0,0,0,0,0}; ++ unsigned long flags; ++ ++ short ifup = ieee->proto_started;//dev->flags & IFF_UP; ++ struct sockaddr *temp = (struct sockaddr *)awrq; ++ ++ ieee->sync_scan_hurryup = 1; ++ ++ down(&ieee->wx_sem); ++ /* use ifconfig hw ether */ ++ if (ieee->iw_mode == IW_MODE_MASTER){ ++ ret = -1; ++ goto out; ++ } ++ ++ if (temp->sa_family != ARPHRD_ETHER){ ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (ifup) ++ ieee80211_stop_protocol(ieee); ++ ++ /* just to avoid to give inconsistent infos in the ++ * get wx method. not really needed otherwise ++ */ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); ++ ieee->wap_set = memcmp(temp->sa_data, zero,ETH_ALEN)!=0; ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++ if (ifup) ++ ieee80211_start_protocol(ieee); ++out: ++ up(&ieee->wx_sem); ++ return ret; ++} ++ ++ int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,union iwreq_data *wrqu,char *b) ++{ ++ int len,ret = 0; ++ unsigned long flags; ++ ++ if (ieee->iw_mode == IW_MODE_MONITOR) ++ return -1; ++ ++ /* We want avoid to give to the user inconsistent infos*/ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if (ieee->current_network.ssid[0] == '\0' || ++ ieee->current_network.ssid_len == 0){ ++ ret = -1; ++ goto out; ++ } ++ ++ if (ieee->state != IEEE80211_LINKED && ++ ieee->state != IEEE80211_LINKED_SCANNING && ++ ieee->ssid_set == 0){ ++ ret = -1; ++ goto out; ++ } ++ len = ieee->current_network.ssid_len; ++ wrqu->essid.length = len; ++ strncpy(b,ieee->current_network.ssid,len); ++ wrqu->essid.flags = 1; ++ ++out: ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++ return ret; ++ ++} ++ ++int ieee80211_wx_set_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ ++ u32 target_rate = wrqu->bitrate.value; ++ ++ ieee->rate = target_rate/100000; ++ //FIXME: we might want to limit rate also in management protocols. ++ return 0; ++} ++ ++ ++ ++int ieee80211_wx_get_rate(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ u32 tmp_rate; ++#if 0 ++ printk("===>mode:%d, halfNmode:%d\n", ieee->mode, ieee->bHalfWirelessN24GMode); ++ if (ieee->mode & (IEEE_A | IEEE_B | IEEE_G)) ++ tmp_rate = ieee->rate; ++ else if (ieee->mode & IEEE_N_5G) ++ tmp_rate = 580; ++ else if (ieee->mode & IEEE_N_24G) ++ { ++ if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) ++ tmp_rate = HTHalfMcsToDataRate(ieee, 15); ++ else ++ tmp_rate = HTMcsToDataRate(ieee, 15); ++ } ++#else ++ tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate); ++ ++#endif ++ wrqu->bitrate.value = tmp_rate * 500000; ++ ++ return 0; ++} ++ ++ ++int ieee80211_wx_set_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ if (wrqu->rts.disabled || !wrqu->rts.fixed) ++ ieee->rts = DEFAULT_RTS_THRESHOLD; ++ else ++ { ++ if (wrqu->rts.value < MIN_RTS_THRESHOLD || ++ wrqu->rts.value > MAX_RTS_THRESHOLD) ++ return -EINVAL; ++ ieee->rts = wrqu->rts.value; ++ } ++ return 0; ++} ++ ++int ieee80211_wx_get_rts(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ wrqu->rts.value = ieee->rts; ++ wrqu->rts.fixed = 0; /* no auto select */ ++ wrqu->rts.disabled = (wrqu->rts.value == DEFAULT_RTS_THRESHOLD); ++ return 0; ++} ++int ieee80211_wx_set_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ ++ ieee->sync_scan_hurryup = 1; ++ ++ down(&ieee->wx_sem); ++ ++ if (wrqu->mode == ieee->iw_mode) ++ goto out; ++ ++ if (wrqu->mode == IW_MODE_MONITOR){ ++ ++ ieee->dev->type = ARPHRD_IEEE80211; ++ }else{ ++ ieee->dev->type = ARPHRD_ETHER; ++ } ++ ++ if (!ieee->proto_started){ ++ ieee->iw_mode = wrqu->mode; ++ }else{ ++ ieee80211_stop_protocol(ieee); ++ ieee->iw_mode = wrqu->mode; ++ ieee80211_start_protocol(ieee); ++ } ++ ++out: ++ up(&ieee->wx_sem); ++ return 0; ++} ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++void ieee80211_wx_sync_scan_wq(struct work_struct *work) ++{ ++ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); ++#else ++void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee) ++{ ++#endif ++ short chan; ++ HT_EXTCHNL_OFFSET chan_offset=0; ++ HT_CHANNEL_WIDTH bandwidth=0; ++ int b40M = 0; ++ static int count = 0; ++ chan = ieee->current_network.channel; ++ netif_carrier_off(ieee->dev); ++ ++ if (ieee->data_hard_stop) ++ ieee->data_hard_stop(ieee->dev); ++ ++ ieee80211_stop_send_beacons(ieee); ++ ++ ieee->state = IEEE80211_LINKED_SCANNING; ++ ieee->link_change(ieee->dev); ++ ieee->InitialGainHandler(ieee->dev,IG_Backup); ++ if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT && ieee->pHTInfo->bCurBW40MHz) { ++ b40M = 1; ++ chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset; ++ bandwidth = (HT_CHANNEL_WIDTH)ieee->pHTInfo->bCurBW40MHz; ++ printk("Scan in 40M, force to 20M first:%d, %d\n", chan_offset, bandwidth); ++ ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ } ++ ieee80211_start_scan_syncro(ieee); ++ if (b40M) { ++ printk("Scan in 20M, back to 40M\n"); ++ if (chan_offset == HT_EXTCHNL_OFFSET_UPPER) ++ ieee->set_chan(ieee->dev, chan + 2); ++ else if (chan_offset == HT_EXTCHNL_OFFSET_LOWER) ++ ieee->set_chan(ieee->dev, chan - 2); ++ else ++ ieee->set_chan(ieee->dev, chan); ++ ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); ++ } else { ++ ieee->set_chan(ieee->dev, chan); ++ } ++ ++ ieee->InitialGainHandler(ieee->dev,IG_Restore); ++ ieee->state = IEEE80211_LINKED; ++ ieee->link_change(ieee->dev); ++ // To prevent the immediately calling watch_dog after scan. ++ if(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0 ) ++ { ++ ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; ++ ieee->LinkDetectInfo.NumRecvDataInPeriod= 1; ++ } ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ ++ if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) ++ ieee80211_start_send_beacons(ieee); ++ ++ netif_carrier_on(ieee->dev); ++ count = 0; ++ up(&ieee->wx_sem); ++ ++} ++ ++int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ int ret = 0; ++ ++ down(&ieee->wx_sem); ++ ++ if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)){ ++ ret = -1; ++ goto out; ++ } ++ ++ if ( ieee->state == IEEE80211_LINKED){ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->wx_sync_scan_wq); ++#else ++ schedule_task(&ieee->wx_sync_scan_wq); ++#endif ++ /* intentionally forget to up sem */ ++ return 0; ++ } ++ ++out: ++ up(&ieee->wx_sem); ++ return ret; ++} ++ ++int ieee80211_wx_set_essid(struct ieee80211_device *ieee, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *extra) ++{ ++ ++ int ret=0,len; ++ short proto_started; ++ unsigned long flags; ++ ++ ieee->sync_scan_hurryup = 1; ++ down(&ieee->wx_sem); ++ ++ proto_started = ieee->proto_started; ++ ++ if (wrqu->essid.length > IW_ESSID_MAX_SIZE){ ++ ret= -E2BIG; ++ goto out; ++ } ++ ++ if (ieee->iw_mode == IW_MODE_MONITOR){ ++ ret= -1; ++ goto out; ++ } ++ ++ if(proto_started) ++ ieee80211_stop_protocol(ieee); ++ ++ ++ /* this is just to be sure that the GET wx callback ++ * has consisten infos. not needed otherwise ++ */ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ if (wrqu->essid.flags && wrqu->essid.length) { ++ //first flush current network.ssid ++ len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++ strncpy(ieee->current_network.ssid, extra, len); ++ ieee->current_network.ssid_len = len; ++#if 0 ++ { ++ int i; ++ for (i=0; icurrent_network.ssid, extra, len+1); ++ ieee->current_network.ssid_len = len+1; ++#if 0 ++ { ++ int i; ++ for (i=0; issid_set = 1; ++ } ++ else{ ++ ieee->ssid_set = 0; ++ ieee->current_network.ssid[0] = '\0'; ++ ieee->current_network.ssid_len = 0; ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ ++ if (proto_started) ++ ieee80211_start_protocol(ieee); ++out: ++ up(&ieee->wx_sem); ++ return ret; ++} ++ ++ int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ ++ wrqu->mode = ieee->iw_mode; ++ return 0; ++} ++ ++ int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ ++ int *parms = (int *)extra; ++ int enable = (parms[0] > 0); ++ short prev = ieee->raw_tx; ++ ++ down(&ieee->wx_sem); ++ ++ if(enable) ++ ieee->raw_tx = 1; ++ else ++ ieee->raw_tx = 0; ++ ++ printk(KERN_INFO"raw TX is %s\n", ++ ieee->raw_tx ? "enabled" : "disabled"); ++ ++ if(ieee->iw_mode == IW_MODE_MONITOR) ++ { ++ if(prev == 0 && ieee->raw_tx){ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ ++ netif_carrier_on(ieee->dev); ++ } ++ ++ if(prev && ieee->raw_tx == 1) ++ netif_carrier_off(ieee->dev); ++ } ++ ++ up(&ieee->wx_sem); ++ ++ return 0; ++} ++ ++int ieee80211_wx_get_name(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ strcpy(wrqu->name, "802.11"); ++ if(ieee->modulation & IEEE80211_CCK_MODULATION){ ++ strcat(wrqu->name, "b"); ++ if(ieee->modulation & IEEE80211_OFDM_MODULATION) ++ strcat(wrqu->name, "/g"); ++ }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) ++ strcat(wrqu->name, "g"); ++ if (ieee->mode & (IEEE_N_24G | IEEE_N_5G)) ++ strcat(wrqu->name, "/n"); ++ ++ if((ieee->state == IEEE80211_LINKED) || ++ (ieee->state == IEEE80211_LINKED_SCANNING)) ++ strcat(wrqu->name," linked"); ++ else if(ieee->state != IEEE80211_NOLINK) ++ strcat(wrqu->name," link.."); ++ ++ ++ return 0; ++} ++ ++ ++/* this is mostly stolen from hostap */ ++int ieee80211_wx_set_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret = 0; ++#if 1 ++ if( ++ (!ieee->sta_wake_up) || ++ // (!ieee->ps_request_tx_ack) || ++ (!ieee->enter_sleep_state) || ++ (!ieee->ps_is_queue_empty)){ ++ ++ // printk("ERROR. PS mode is tryied to be use but driver missed a callback\n\n"); ++ ++ return -1; ++ } ++#endif ++ down(&ieee->wx_sem); ++ ++ if (wrqu->power.disabled){ ++ ieee->ps = IEEE80211_PS_DISABLED; ++ goto exit; ++ } ++ if (wrqu->power.flags & IW_POWER_TIMEOUT) { ++ //ieee->ps_period = wrqu->power.value / 1000; ++ ieee->ps_timeout = wrqu->power.value / 1000; ++ } ++ ++ if (wrqu->power.flags & IW_POWER_PERIOD) { ++ ++ //ieee->ps_timeout = wrqu->power.value / 1000; ++ ieee->ps_period = wrqu->power.value / 1000; ++ //wrq->value / 1024; ++ ++ } ++ switch (wrqu->power.flags & IW_POWER_MODE) { ++ case IW_POWER_UNICAST_R: ++ ieee->ps = IEEE80211_PS_UNICAST; ++ break; ++ case IW_POWER_MULTICAST_R: ++ ieee->ps = IEEE80211_PS_MBCAST; ++ break; ++ case IW_POWER_ALL_R: ++ ieee->ps = IEEE80211_PS_UNICAST | IEEE80211_PS_MBCAST; ++ break; ++ ++ case IW_POWER_ON: ++ // ieee->ps = IEEE80211_PS_DISABLED; ++ break; ++ ++ default: ++ ret = -EINVAL; ++ goto exit; ++ ++ } ++exit: ++ up(&ieee->wx_sem); ++ return ret; ++ ++} ++ ++/* this is stolen from hostap */ ++int ieee80211_wx_get_power(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret =0; ++ ++ down(&ieee->wx_sem); ++ ++ if(ieee->ps == IEEE80211_PS_DISABLED){ ++ wrqu->power.disabled = 1; ++ goto exit; ++ } ++ ++ wrqu->power.disabled = 0; ++ ++ if ((wrqu->power.flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { ++ wrqu->power.flags = IW_POWER_TIMEOUT; ++ wrqu->power.value = ieee->ps_timeout * 1000; ++ } else { ++// ret = -EOPNOTSUPP; ++// goto exit; ++ wrqu->power.flags = IW_POWER_PERIOD; ++ wrqu->power.value = ieee->ps_period * 1000; ++//ieee->current_network.dtim_period * ieee->current_network.beacon_interval * 1024; ++ } ++ ++ if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) ++ wrqu->power.flags |= IW_POWER_ALL_R; ++ else if (ieee->ps & IEEE80211_PS_MBCAST) ++ wrqu->power.flags |= IW_POWER_MULTICAST_R; ++ else ++ wrqu->power.flags |= IW_POWER_UNICAST_R; ++ ++exit: ++ up(&ieee->wx_sem); ++ return ret; ++ ++} ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_wx_get_essid); ++//EXPORT_SYMBOL(ieee80211_wx_set_essid); ++//EXPORT_SYMBOL(ieee80211_wx_set_rate); ++//EXPORT_SYMBOL(ieee80211_wx_get_rate); ++//EXPORT_SYMBOL(ieee80211_wx_set_wap); ++//EXPORT_SYMBOL(ieee80211_wx_get_wap); ++//EXPORT_SYMBOL(ieee80211_wx_set_mode); ++//EXPORT_SYMBOL(ieee80211_wx_get_mode); ++//EXPORT_SYMBOL(ieee80211_wx_set_scan); ++//EXPORT_SYMBOL(ieee80211_wx_get_freq); ++//EXPORT_SYMBOL(ieee80211_wx_set_freq); ++//EXPORT_SYMBOL(ieee80211_wx_set_rawtx); ++//EXPORT_SYMBOL(ieee80211_wx_get_name); ++//EXPORT_SYMBOL(ieee80211_wx_set_power); ++//EXPORT_SYMBOL(ieee80211_wx_get_power); ++//EXPORT_SYMBOL(ieee80211_wlan_frequencies); ++//EXPORT_SYMBOL(ieee80211_wx_set_rts); ++//EXPORT_SYMBOL(ieee80211_wx_get_rts); ++#else ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_essid); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_essid); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rate); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rate); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_wap); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_wap); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mode); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_mode); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_scan); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_freq); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_freq); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rawtx); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_name); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_power); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_power); ++EXPORT_SYMBOL_NOVERS(ieee80211_wlan_frequencies); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rts); ++EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rts); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c +@@ -0,0 +1,933 @@ ++/****************************************************************************** ++ ++ Copyright(c) 2003 - 2004 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., 59 ++ Temple Place - Suite 330, Boston, MA 02111-1307, 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 ++ ++****************************************************************************** ++ ++ Few modifications for Realtek's Wi-Fi drivers by ++ Andrea Merello ++ ++ A special thanks goes to Realtek for their support ! ++ ++******************************************************************************/ ++ ++#include ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++ ++ ++/* ++ ++ ++802.11 Data Frame ++ ++ ++802.11 frame_contorl for data frames - 2 bytes ++ ,-----------------------------------------------------------------------------------------. ++bits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | ++ |----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------| ++val | 0 | 0 | 0 | 1 | x | 0 | 0 | 0 | 1 | 0 | x | x | x | x | x | ++ |----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------| ++desc | ^-ver-^ | ^type-^ | ^-----subtype-----^ | to |from |more |retry| pwr |more |wep | ++ | | | x=0 data,x=1 data+ack | DS | DS |frag | | mgm |data | | ++ '-----------------------------------------------------------------------------------------' ++ /\ ++ | ++802.11 Data Frame | ++ ,--------- 'ctrl' expands to >-----------' ++ | ++ ,--'---,-------------------------------------------------------------. ++Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | ++ |------|------|---------|---------|---------|------|---------|------| ++Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | Frame | fcs | ++ | | tion | (BSSID) | | | ence | data | | ++ `--------------------------------------------------| |------' ++Total: 28 non-data bytes `----.----' ++ | ++ .- 'Frame data' expands to <---------------------------' ++ | ++ V ++ ,---------------------------------------------------. ++Bytes | 1 | 1 | 1 | 3 | 2 | 0-2304 | ++ |------|------|---------|----------|------|---------| ++Desc. | SNAP | SNAP | Control |Eth Tunnel| Type | IP | ++ | DSAP | SSAP | | | | Packet | ++ | 0xAA | 0xAA |0x03 (UI)|0x00-00-F8| | | ++ `-----------------------------------------| | ++Total: 8 non-data bytes `----.----' ++ | ++ .- 'IP Packet' expands, if WEP enabled, to <--' ++ | ++ V ++ ,-----------------------. ++Bytes | 4 | 0-2296 | 4 | ++ |-----|-----------|-----| ++Desc. | IV | Encrypted | ICV | ++ | | IP Packet | | ++ `-----------------------' ++Total: 8 non-data bytes ++ ++ ++802.3 Ethernet Data Frame ++ ++ ,-----------------------------------------. ++Bytes | 6 | 6 | 2 | Variable | 4 | ++ |-------|-------|------|-----------|------| ++Desc. | Dest. | Source| Type | IP Packet | fcs | ++ | MAC | MAC | | | | ++ `-----------------------------------------' ++Total: 18 non-data bytes ++ ++In the event that fragmentation is required, the incoming payload is split into ++N parts of size ieee->fts. The first fragment contains the SNAP header and the ++remaining packets are just data. ++ ++If encryption is enabled, each fragment payload size is reduced by enough space ++to add the prefix and postfix (IV and ICV totalling 8 bytes in the case of WEP) ++So if you have 1500 bytes of payload with ieee->fts set to 500 without ++encryption it will take 3 frames. With WEP it will take 4 frames as the ++payload of each frame is reduced to 492 bytes. ++ ++* SKB visualization ++* ++* ,- skb->data ++* | ++* | ETHERNET HEADER ,-<-- PAYLOAD ++* | | 14 bytes from skb->data ++* | 2 bytes for Type --> ,T. | (sizeof ethhdr) ++* | | | | ++* |,-Dest.--. ,--Src.---. | | | ++* | 6 bytes| | 6 bytes | | | | ++* v | | | | | | ++* 0 | v 1 | v | v 2 ++* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 ++* ^ | ^ | ^ | ++* | | | | | | ++* | | | | `T' <---- 2 bytes for Type ++* | | | | ++* | | '---SNAP--' <-------- 6 bytes for SNAP ++* | | ++* `-IV--' <-------------------- 4 bytes for IV (WEP) ++* ++* SNAP HEADER ++* ++*/ ++ ++static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; ++static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; ++ ++static inline int ieee80211_put_snap(u8 *data, u16 h_proto) ++{ ++ struct ieee80211_snap_hdr *snap; ++ u8 *oui; ++ ++ snap = (struct ieee80211_snap_hdr *)data; ++ snap->dsap = 0xaa; ++ snap->ssap = 0xaa; ++ snap->ctrl = 0x03; ++ ++ if (h_proto == 0x8137 || h_proto == 0x80f3) ++ oui = P802_1H_OUI; ++ else ++ oui = RFC1042_OUI; ++ snap->oui[0] = oui[0]; ++ snap->oui[1] = oui[1]; ++ snap->oui[2] = oui[2]; ++ ++ *(u16 *)(data + SNAP_SIZE) = htons(h_proto); ++ ++ return SNAP_SIZE + sizeof(u16); ++} ++ ++int ieee80211_encrypt_fragment( ++ struct ieee80211_device *ieee, ++ struct sk_buff *frag, ++ int hdr_len) ++{ ++ struct ieee80211_crypt_data* crypt = ieee->crypt[ieee->tx_keyidx]; ++ int res; ++ ++ if (!(crypt && crypt->ops)) ++ { ++ printk("=========>%s(), crypt is null\n", __FUNCTION__); ++ return -1; ++ } ++#ifdef CONFIG_IEEE80211_CRYPT_TKIP ++ struct ieee80211_hdr *header; ++ ++ if (ieee->tkip_countermeasures && ++ crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) { ++ header = (struct ieee80211_hdr *) frag->data; ++ if (net_ratelimit()) { ++ printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " ++ "TX packet to " MAC_FMT "\n", ++ ieee->dev->name, MAC_ARG(header->addr1)); ++ } ++ return -1; ++ } ++#endif ++ /* To encrypt, frame format is: ++ * IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */ ++ ++ // PR: FIXME: Copied from hostap. Check fragmentation/MSDU/MPDU encryption. ++ /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so ++ * call both MSDU and MPDU encryption functions from here. */ ++ atomic_inc(&crypt->refcnt); ++ res = 0; ++ if (crypt->ops->encrypt_msdu) ++ res = crypt->ops->encrypt_msdu(frag, hdr_len, crypt->priv); ++ if (res == 0 && crypt->ops->encrypt_mpdu) ++ res = crypt->ops->encrypt_mpdu(frag, hdr_len, crypt->priv); ++ ++ atomic_dec(&crypt->refcnt); ++ if (res < 0) { ++ printk(KERN_INFO "%s: Encryption failed: len=%d.\n", ++ ieee->dev->name, frag->len); ++ ieee->ieee_stats.tx_discards++; ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ ++void ieee80211_txb_free(struct ieee80211_txb *txb) { ++ //int i; ++ if (unlikely(!txb)) ++ return; ++#if 0 ++ for (i = 0; i < txb->nr_frags; i++) ++ if (txb->fragments[i]) ++ dev_kfree_skb_any(txb->fragments[i]); ++#endif ++ kfree(txb); ++} ++ ++struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, ++ int gfp_mask) ++{ ++ struct ieee80211_txb *txb; ++ int i; ++ txb = kmalloc( ++ sizeof(struct ieee80211_txb) + (sizeof(u8*) * nr_frags), ++ gfp_mask); ++ if (!txb) ++ return NULL; ++ ++ memset(txb, 0, sizeof(struct ieee80211_txb)); ++ txb->nr_frags = nr_frags; ++ txb->frag_size = txb_size; ++ ++ for (i = 0; i < nr_frags; i++) { ++ txb->fragments[i] = dev_alloc_skb(txb_size); ++ if (unlikely(!txb->fragments[i])) { ++ i--; ++ break; ++ } ++ memset(txb->fragments[i]->cb, 0, sizeof(txb->fragments[i]->cb)); ++ } ++ if (unlikely(i != nr_frags)) { ++ while (i >= 0) ++ dev_kfree_skb_any(txb->fragments[i--]); ++ kfree(txb); ++ return NULL; ++ } ++ return txb; ++} ++ ++// Classify the to-be send data packet ++// Need to acquire the sent queue index. ++static int ++ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) ++{ ++ struct ethhdr *eth; ++ struct iphdr *ip; ++ eth = (struct ethhdr *)skb->data; ++ if (eth->h_proto != htons(ETH_P_IP)) ++ return 0; ++ ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) ++ ip = ip_hdr(skb); ++#else ++ ip = (struct iphdr*)(skb->data + sizeof(struct ether_header)); ++#endif ++ switch (ip->tos & 0xfc) { ++ case 0x20: ++ return 2; ++ case 0x40: ++ return 1; ++ case 0x60: ++ return 3; ++ case 0x80: ++ return 4; ++ case 0xa0: ++ return 5; ++ case 0xc0: ++ return 6; ++ case 0xe0: ++ return 7; ++ default: ++ return 0; ++ } ++} ++ ++#define SN_LESS(a, b) (((a-b)&0x800)!=0) ++void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* skb, cb_desc* tcb_desc) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ PTX_TS_RECORD pTxTs = NULL; ++ struct ieee80211_hdr_1addr* hdr = (struct ieee80211_hdr_1addr*)skb->data; ++ ++ if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) ++ return; ++ if (!IsQoSDataFrame(skb->data)) ++ return; ++ ++ if (is_multicast_ether_addr(hdr->addr1) || is_broadcast_ether_addr(hdr->addr1)) ++ return; ++ //check packet and mode later ++#ifdef TO_DO_LIST ++ if(pTcb->PacketLength >= 4096) ++ return; ++ // For RTL819X, if pairwisekey = wep/tkip, we don't aggrregation. ++ if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) ++ return; ++#endif ++#if 1 ++ if(!ieee->GetNmodeSupportBySecCfg(ieee->dev)) ++ { ++ return; ++ } ++#endif ++ if(pHTInfo->bCurrentAMPDUEnable) ++ { ++ if (!GetTs(ieee, (PTS_COMMON_INFO*)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) ++ { ++ printk("===>can't get TS\n"); ++ return; ++ } ++ if (pTxTs->TxAdmittedBARecord.bValid == false) ++ { ++ //as some AP will refuse our action frame until key handshake has been finished. WB ++ if (ieee->wpa_ie_len && (ieee->pairwise_key_type == KEY_TYPE_NA)) ++ ; ++ else ++ TsStartAddBaProcess(ieee, pTxTs); ++ goto FORCED_AGG_SETTING; ++ } ++ else if (pTxTs->bUsingBa == false) ++ { ++ if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, (pTxTs->TxCurSeq+1)%4096)) ++ pTxTs->bUsingBa = true; ++ else ++ goto FORCED_AGG_SETTING; ++ } ++ ++ if (ieee->iw_mode == IW_MODE_INFRA) ++ { ++ tcb_desc->bAMPDUEnable = true; ++ tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor; ++ tcb_desc->ampdu_density = pHTInfo->CurrentMPDUDensity; ++ } ++ } ++FORCED_AGG_SETTING: ++ switch(pHTInfo->ForcedAMPDUMode ) ++ { ++ case HT_AGG_AUTO: ++ break; ++ ++ case HT_AGG_FORCE_ENABLE: ++ tcb_desc->bAMPDUEnable = true; ++ tcb_desc->ampdu_density = pHTInfo->ForcedMPDUDensity; ++ tcb_desc->ampdu_factor = pHTInfo->ForcedAMPDUFactor; ++ break; ++ ++ case HT_AGG_FORCE_DISABLE: ++ tcb_desc->bAMPDUEnable = false; ++ tcb_desc->ampdu_density = 0; ++ tcb_desc->ampdu_factor = 0; ++ break; ++ ++ } ++ return; ++} ++ ++extern void ieee80211_qurey_ShortPreambleMode(struct ieee80211_device* ieee, cb_desc* tcb_desc) ++{ ++ tcb_desc->bUseShortPreamble = false; ++ if (tcb_desc->data_rate == 2) ++ {//// 1M can only use Long Preamble. 11B spec ++ return; ++ } ++ else if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) ++ { ++ tcb_desc->bUseShortPreamble = true; ++ } ++ return; ++} ++extern void ++ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, cb_desc *tcb_desc) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ tcb_desc->bUseShortGI = false; ++ ++ if(!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) ++ return; ++ ++ if(pHTInfo->bForcedShortGI) ++ { ++ tcb_desc->bUseShortGI = true; ++ return; ++ } ++ ++ if((pHTInfo->bCurBW40MHz==true) && pHTInfo->bCurShortGI40MHz) ++ tcb_desc->bUseShortGI = true; ++ else if((pHTInfo->bCurBW40MHz==false) && pHTInfo->bCurShortGI20MHz) ++ tcb_desc->bUseShortGI = true; ++} ++ ++void ieee80211_query_BandwidthMode(struct ieee80211_device* ieee, cb_desc *tcb_desc) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ tcb_desc->bPacketBW = false; ++ ++ if(!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) ++ return; ++ ++ if(tcb_desc->bMulticast || tcb_desc->bBroadcast) ++ return; ++ ++ if((tcb_desc->data_rate & 0x80)==0) // If using legacy rate, it shall use 20MHz channel. ++ return; ++ //BandWidthAutoSwitch is for auto switch to 20 or 40 in long distance ++ if(pHTInfo->bCurBW40MHz && pHTInfo->bCurTxBW40MHz && !ieee->bandwidth_auto_switch.bforced_tx20Mhz) ++ tcb_desc->bPacketBW = true; ++ return; ++} ++ ++void ieee80211_query_protectionmode(struct ieee80211_device* ieee, cb_desc* tcb_desc, struct sk_buff* skb) ++{ ++ // Common Settings ++ tcb_desc->bRTSSTBC = false; ++ tcb_desc->bRTSUseShortGI = false; // Since protection frames are always sent by legacy rate, ShortGI will never be used. ++ tcb_desc->bCTSEnable = false; // Most of protection using RTS/CTS ++ tcb_desc->RTSSC = 0; // 20MHz: Don't care; 40MHz: Duplicate. ++ tcb_desc->bRTSBW = false; // RTS frame bandwidth is always 20MHz ++ ++ if(tcb_desc->bBroadcast || tcb_desc->bMulticast)//only unicast frame will use rts/cts ++ return; ++ ++ if (is_broadcast_ether_addr(skb->data+16)) //check addr3 as infrastructure add3 is DA. ++ return; ++ ++ if (ieee->mode < IEEE_N_24G) //b, g mode ++ { ++ // (1) RTS_Threshold is compared to the MPDU, not MSDU. ++ // (2) If there are more than one frag in this MSDU, only the first frag uses protection frame. ++ // Other fragments are protected by previous fragment. ++ // So we only need to check the length of first fragment. ++ if (skb->len > ieee->rts) ++ { ++ tcb_desc->bRTSEnable = true; ++ tcb_desc->rts_rate = MGN_24M; ++ } ++ else if (ieee->current_network.buseprotection) ++ { ++ // Use CTS-to-SELF in protection mode. ++ tcb_desc->bRTSEnable = true; ++ tcb_desc->bCTSEnable = true; ++ tcb_desc->rts_rate = MGN_24M; ++ } ++ //otherwise return; ++ return; ++ } ++ else ++ {// 11n High throughput case. ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ while (true) ++ { ++ //check ERP protection ++ if (ieee->current_network.buseprotection) ++ {// CTS-to-SELF ++ tcb_desc->bRTSEnable = true; ++ tcb_desc->bCTSEnable = true; ++ tcb_desc->rts_rate = MGN_24M; ++ break; ++ } ++ //check HT op mode ++ if(pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) ++ { ++ u8 HTOpMode = pHTInfo->CurrentOpMode; ++ if((pHTInfo->bCurBW40MHz && (HTOpMode == 2 || HTOpMode == 3)) || ++ (!pHTInfo->bCurBW40MHz && HTOpMode == 3) ) ++ { ++ tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. ++ tcb_desc->bRTSEnable = true; ++ break; ++ } ++ } ++ //check rts ++ if (skb->len > ieee->rts) ++ { ++ tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. ++ tcb_desc->bRTSEnable = true; ++ break; ++ } ++ //to do list: check MIMO power save condition. ++ //check AMPDU aggregation for TXOP ++ if(tcb_desc->bAMPDUEnable) ++ { ++ tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. ++ // According to 8190 design, firmware sends CF-End only if RTS/CTS is enabled. However, it degrads ++ // throughput around 10M, so we disable of this mechanism. 2007.08.03 by Emily ++ tcb_desc->bRTSEnable = false; ++ break; ++ } ++ //check IOT action ++ if(pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) ++ { ++ tcb_desc->bCTSEnable = true; ++ tcb_desc->rts_rate = MGN_24M; ++ tcb_desc->bRTSEnable = true; ++ break; ++ } ++ // Totally no protection case!! ++ goto NO_PROTECTION; ++ } ++ } ++ // For test , CTS replace with RTS ++ if( 0 ) ++ { ++ tcb_desc->bCTSEnable = true; ++ tcb_desc->rts_rate = MGN_24M; ++ tcb_desc->bRTSEnable = true; ++ } ++ if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) ++ tcb_desc->bUseShortPreamble = true; ++ if (ieee->mode == IW_MODE_MASTER) ++ goto NO_PROTECTION; ++ return; ++NO_PROTECTION: ++ tcb_desc->bRTSEnable = false; ++ tcb_desc->bCTSEnable = false; ++ tcb_desc->rts_rate = 0; ++ tcb_desc->RTSSC = 0; ++ tcb_desc->bRTSBW = false; ++} ++ ++ ++void ieee80211_txrate_selectmode(struct ieee80211_device* ieee, cb_desc* tcb_desc) ++{ ++#ifdef TO_DO_LIST ++ if(!IsDataFrame(pFrame)) ++ { ++ pTcb->bTxDisableRateFallBack = TRUE; ++ pTcb->bTxUseDriverAssingedRate = TRUE; ++ pTcb->RATRIndex = 7; ++ return; ++ } ++ ++ if(pMgntInfo->ForcedDataRate!= 0) ++ { ++ pTcb->bTxDisableRateFallBack = TRUE; ++ pTcb->bTxUseDriverAssingedRate = TRUE; ++ return; ++ } ++#endif ++ if(ieee->bTxDisableRateFallBack) ++ tcb_desc->bTxDisableRateFallBack = true; ++ ++ if(ieee->bTxUseDriverAssingedRate) ++ tcb_desc->bTxUseDriverAssingedRate = true; ++ if(!tcb_desc->bTxDisableRateFallBack || !tcb_desc->bTxUseDriverAssingedRate) ++ { ++ if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) ++ tcb_desc->RATRIndex = 0; ++ } ++} ++ ++void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u8* dst) ++{ ++ if (is_multicast_ether_addr(dst) || is_broadcast_ether_addr(dst)) ++ return; ++ if (IsQoSDataFrame(skb->data)) //we deal qos data only ++ { ++ PTX_TS_RECORD pTS = NULL; ++ if (!GetTs(ieee, (PTS_COMMON_INFO*)(&pTS), dst, skb->priority, TX_DIR, true)) ++ { ++ return; ++ } ++ pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096; ++ } ++} ++ ++int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) ++{ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) ++ struct ieee80211_device *ieee = netdev_priv(dev); ++#else ++ struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv; ++#endif ++ struct ieee80211_txb *txb = NULL; ++ struct ieee80211_hdr_3addrqos *frag_hdr; ++ int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size; ++ unsigned long flags; ++ struct net_device_stats *stats = &ieee->stats; ++ int ether_type = 0, encrypt; ++ int bytes, fc, qos_ctl = 0, hdr_len; ++ struct sk_buff *skb_frag; ++ struct ieee80211_hdr_3addrqos header = { /* Ensure zero initialized */ ++ .duration_id = 0, ++ .seq_ctl = 0, ++ .qos_ctl = 0 ++ }; ++ u8 dest[ETH_ALEN], src[ETH_ALEN]; ++ int qos_actived = ieee->current_network.qos_data.active; ++ ++ struct ieee80211_crypt_data* crypt; ++ ++ cb_desc *tcb_desc; ++ ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ /* If there is no driver handler to take the TXB, dont' bother ++ * creating it... */ ++ if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))|| ++ ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) { ++ printk(KERN_WARNING "%s: No xmit handler.\n", ++ ieee->dev->name); ++ goto success; ++ } ++ ++ ++ if(likely(ieee->raw_tx == 0)){ ++ if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { ++ printk(KERN_WARNING "%s: skb too small (%d).\n", ++ ieee->dev->name, skb->len); ++ goto success; ++ } ++ ++ memset(skb->cb, 0, sizeof(skb->cb)); ++ ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); ++ ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++ ++ encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && ++ ieee->host_encrypt && crypt && crypt->ops; ++ ++ if (!encrypt && ieee->ieee802_1x && ++ ieee->drop_unencrypted && ether_type != ETH_P_PAE) { ++ stats->tx_dropped++; ++ goto success; ++ } ++ #ifdef CONFIG_IEEE80211_DEBUG ++ if (crypt && !encrypt && ether_type == ETH_P_PAE) { ++ struct eapol *eap = (struct eapol *)(skb->data + ++ sizeof(struct ethhdr) - SNAP_SIZE - sizeof(u16)); ++ IEEE80211_DEBUG_EAP("TX: IEEE 802.11 EAPOL frame: %s\n", ++ eap_get_type(eap->type)); ++ } ++ #endif ++ ++ /* Save source and destination addresses */ ++ memcpy(&dest, skb->data, ETH_ALEN); ++ memcpy(&src, skb->data+ETH_ALEN, ETH_ALEN); ++ ++ /* Advance the SKB to the start of the payload */ ++ skb_pull(skb, sizeof(struct ethhdr)); ++ ++ /* Determine total amount of storage required for TXB packets */ ++ bytes = skb->len + SNAP_SIZE + sizeof(u16); ++ ++ if (encrypt) ++ fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_WEP; ++ else ++ ++ fc = IEEE80211_FTYPE_DATA; ++ ++ //if(ieee->current_network.QoS_Enable) ++ if(qos_actived) ++ fc |= IEEE80211_STYPE_QOS_DATA; ++ else ++ fc |= IEEE80211_STYPE_DATA; ++ ++ if (ieee->iw_mode == IW_MODE_INFRA) { ++ fc |= IEEE80211_FCTL_TODS; ++ /* To DS: Addr1 = BSSID, Addr2 = SA, ++ Addr3 = DA */ ++ memcpy(&header.addr1, ieee->current_network.bssid, ETH_ALEN); ++ memcpy(&header.addr2, &src, ETH_ALEN); ++ memcpy(&header.addr3, &dest, ETH_ALEN); ++ } else if (ieee->iw_mode == IW_MODE_ADHOC) { ++ /* not From/To DS: Addr1 = DA, Addr2 = SA, ++ Addr3 = BSSID */ ++ memcpy(&header.addr1, dest, ETH_ALEN); ++ memcpy(&header.addr2, src, ETH_ALEN); ++ memcpy(&header.addr3, ieee->current_network.bssid, ETH_ALEN); ++ } ++ ++ header.frame_ctl = cpu_to_le16(fc); ++ ++ /* Determine fragmentation size based on destination (multicast ++ * and broadcast are not fragmented) */ ++ if (is_multicast_ether_addr(header.addr1) || ++ is_broadcast_ether_addr(header.addr1)) { ++ frag_size = MAX_FRAG_THRESHOLD; ++ qos_ctl |= QOS_CTL_NOTCONTAIN_ACK; ++ } ++ else { ++ frag_size = ieee->fts;//default:392 ++ qos_ctl = 0; ++ } ++ ++ //if (ieee->current_network.QoS_Enable) ++ if(qos_actived) ++ { ++ hdr_len = IEEE80211_3ADDR_LEN + 2; ++ ++ skb->priority = ieee80211_classify(skb, &ieee->current_network); ++ qos_ctl |= skb->priority; //set in the ieee80211_classify ++ header.qos_ctl = cpu_to_le16(qos_ctl & IEEE80211_QOS_TID); ++ } else { ++ hdr_len = IEEE80211_3ADDR_LEN; ++ } ++ /* Determine amount of payload per fragment. Regardless of if ++ * this stack is providing the full 802.11 header, one will ++ * eventually be affixed to this fragment -- so we must account for ++ * it when determining the amount of payload space. */ ++ bytes_per_frag = frag_size - hdr_len; ++ if (ieee->config & ++ (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) ++ bytes_per_frag -= IEEE80211_FCS_LEN; ++ ++ /* Each fragment may need to have room for encryptiong pre/postfix */ ++ if (encrypt) ++ bytes_per_frag -= crypt->ops->extra_prefix_len + ++ crypt->ops->extra_postfix_len; ++ ++ /* Number of fragments is the total bytes_per_frag / ++ * payload_per_fragment */ ++ nr_frags = bytes / bytes_per_frag; ++ bytes_last_frag = bytes % bytes_per_frag; ++ if (bytes_last_frag) ++ nr_frags++; ++ else ++ bytes_last_frag = bytes_per_frag; ++ ++ /* When we allocate the TXB we allocate enough space for the reserve ++ * and full fragment bytes (bytes_per_frag doesn't include prefix, ++ * postfix, header, FCS, etc.) */ ++ txb = ieee80211_alloc_txb(nr_frags, frag_size + ieee->tx_headroom, GFP_ATOMIC); ++ if (unlikely(!txb)) { ++ printk(KERN_WARNING "%s: Could not allocate TXB\n", ++ ieee->dev->name); ++ goto failed; ++ } ++ txb->encrypted = encrypt; ++ txb->payload_size = bytes; ++ ++ //if (ieee->current_network.QoS_Enable) ++ if(qos_actived) ++ { ++ txb->queue_index = UP2AC(skb->priority); ++ } else { ++ txb->queue_index = WME_AC_BK;; ++ } ++ ++ ++ ++ for (i = 0; i < nr_frags; i++) { ++ skb_frag = txb->fragments[i]; ++ tcb_desc = (cb_desc *)(skb_frag->cb + MAX_DEV_ADDR_SIZE); ++ if(qos_actived){ ++ skb_frag->priority = skb->priority;//UP2AC(skb->priority); ++ tcb_desc->queue_index = UP2AC(skb->priority); ++ } else { ++ skb_frag->priority = WME_AC_BK; ++ tcb_desc->queue_index = WME_AC_BK; ++ } ++ skb_reserve(skb_frag, ieee->tx_headroom); ++ ++ if (encrypt){ ++ if (ieee->hwsec_active) ++ tcb_desc->bHwSec = 1; ++ else ++ tcb_desc->bHwSec = 0; ++ skb_reserve(skb_frag, crypt->ops->extra_prefix_len); ++ } ++ else ++ { ++ tcb_desc->bHwSec = 0; ++ } ++ frag_hdr = (struct ieee80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len); ++ memcpy(frag_hdr, &header, hdr_len); ++ ++ /* If this is not the last fragment, then add the MOREFRAGS ++ * bit to the frame control */ ++ if (i != nr_frags - 1) { ++ frag_hdr->frame_ctl = cpu_to_le16( ++ fc | IEEE80211_FCTL_MOREFRAGS); ++ bytes = bytes_per_frag; ++ ++ } else { ++ /* The last fragment takes the remaining length */ ++ bytes = bytes_last_frag; ++ } ++ //if(ieee->current_network.QoS_Enable) ++ if(qos_actived) ++ { ++ // add 1 only indicate to corresponding seq number control 2006/7/12 ++ frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[UP2AC(skb->priority)+1]<<4 | i); ++ } else { ++ frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4 | i); ++ } ++ ++ /* Put a SNAP header on the first fragment */ ++ if (i == 0) { ++ ieee80211_put_snap( ++ skb_put(skb_frag, SNAP_SIZE + sizeof(u16)), ++ ether_type); ++ bytes -= SNAP_SIZE + sizeof(u16); ++ } ++ ++ memcpy(skb_put(skb_frag, bytes), skb->data, bytes); ++ ++ /* Advance the SKB... */ ++ skb_pull(skb, bytes); ++ ++ /* Encryption routine will move the header forward in order ++ * to insert the IV between the header and the payload */ ++ if (encrypt) ++ ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len); ++ if (ieee->config & ++ (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) ++ skb_put(skb_frag, 4); ++ } ++ ++ if(qos_actived) ++ { ++ if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF) ++ ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0; ++ else ++ ieee->seq_ctrl[UP2AC(skb->priority) + 1]++; ++ } else { ++ if (ieee->seq_ctrl[0] == 0xFFF) ++ ieee->seq_ctrl[0] = 0; ++ else ++ ieee->seq_ctrl[0]++; ++ } ++ }else{ ++ if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) { ++ printk(KERN_WARNING "%s: skb too small (%d).\n", ++ ieee->dev->name, skb->len); ++ goto success; ++ } ++ ++ txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC); ++ if(!txb){ ++ printk(KERN_WARNING "%s: Could not allocate TXB\n", ++ ieee->dev->name); ++ goto failed; ++ } ++ ++ txb->encrypted = 0; ++ txb->payload_size = skb->len; ++ memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len); ++ } ++ ++ success: ++//WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place. ++ if (txb) ++ { ++#if 1 ++ cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); ++ tcb_desc->bTxEnableFwCalcDur = 1; ++ if (is_multicast_ether_addr(header.addr1)) ++ tcb_desc->bMulticast = 1; ++ if (is_broadcast_ether_addr(header.addr1)) ++ tcb_desc->bBroadcast = 1; ++ ieee80211_txrate_selectmode(ieee, tcb_desc); ++ if ( tcb_desc->bMulticast || tcb_desc->bBroadcast) ++ tcb_desc->data_rate = ieee->basic_rate; ++ else ++ //tcb_desc->data_rate = CURRENT_RATE(ieee->current_network.mode, ieee->rate, ieee->HTCurrentOperaRate); ++ tcb_desc->data_rate = CURRENT_RATE(ieee->mode, ieee->rate, ieee->HTCurrentOperaRate); ++ ieee80211_qurey_ShortPreambleMode(ieee, tcb_desc); ++ ieee80211_tx_query_agg_cap(ieee, txb->fragments[0], tcb_desc); ++ ieee80211_query_HTCapShortGI(ieee, tcb_desc); ++ ieee80211_query_BandwidthMode(ieee, tcb_desc); ++ ieee80211_query_protectionmode(ieee, tcb_desc, txb->fragments[0]); ++ ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1); ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len); ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc)); ++#endif ++ } ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ dev_kfree_skb_any(skb); ++ if (txb) { ++ if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){ ++ ieee80211_softmac_xmit(txb, ieee); ++ }else{ ++ if ((*ieee->hard_start_xmit)(txb, dev) == 0) { ++ stats->tx_packets++; ++ stats->tx_bytes += txb->payload_size; ++ return 0; ++ } ++ ieee80211_txb_free(txb); ++ } ++ } ++ ++ return 0; ++ ++ failed: ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ netif_stop_queue(dev); ++ stats->tx_errors++; ++ return 1; ++ ++} ++ ++//EXPORT_SYMBOL(ieee80211_txb_free); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c +@@ -0,0 +1,1032 @@ ++/****************************************************************************** ++ ++ Copyright(c) 2004 Intel Corporation. All rights reserved. ++ ++ Portions of this file are based on the WEP enablement code provided by the ++ Host AP project hostap-drivers v0.1.3 ++ Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ ++ Copyright (c) 2002-2003, Jouni Malinen ++ ++ 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., 59 ++ Temple Place - Suite 330, Boston, MA 02111-1307, 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 ++ ++******************************************************************************/ ++#include ++#include ++#include ++#include ++ ++#include "ieee80211.h" ++#if 0 ++static const char *ieee80211_modes[] = { ++ "?", "a", "b", "ab", "g", "ag", "bg", "abg" ++}; ++#endif ++struct modes_unit { ++ char *mode_string; ++ int mode_size; ++}; ++struct modes_unit ieee80211_modes[] = { ++ {"a",1}, ++ {"b",1}, ++ {"g",1}, ++ {"?",1}, ++ {"N-24G",5}, ++ {"N-5G",4}, ++}; ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++static inline char * ++iwe_stream_add_event_rsl(char * stream, /* Stream of events */ ++ char * ends, /* End of stream */ ++ struct iw_event *iwe, /* Payload */ ++ int event_len) /* Real size of payload */ ++{ ++ /* Check if it's possible */ ++ if((stream + event_len) < ends) { ++ iwe->len = event_len; ++ ndelay(1); //new ++ memcpy(stream, (char *) iwe, event_len); ++ stream += event_len; ++ } ++ return stream; ++} ++#else ++#define iwe_stream_add_event_rsl iwe_stream_add_event ++#endif ++ ++#define MAX_CUSTOM_LEN 64 ++static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, ++ char *start, char *stop, ++ struct ieee80211_network *network, ++ struct iw_request_info *info) ++{ ++ char custom[MAX_CUSTOM_LEN]; ++ char proto_name[IFNAMSIZ]; ++ char *pname = proto_name; ++ char *p; ++ struct iw_event iwe; ++ int i, j; ++ u16 max_rate, rate; ++ static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; ++ ++ /* First entry *MUST* be the AP MAC address */ ++ iwe.cmd = SIOCGIWAP; ++ iwe.u.ap_addr.sa_family = ARPHRD_ETHER; ++ memcpy(iwe.u.ap_addr.sa_data, network->bssid, ETH_ALEN); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_ADDR_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_ADDR_LEN); ++#endif ++ /* Remaining entries will be displayed in the order we provide them */ ++ ++ /* Add the ESSID */ ++ iwe.cmd = SIOCGIWESSID; ++ iwe.u.data.flags = 1; ++// if (network->flags & NETWORK_EMPTY_ESSID) { ++ if (network->ssid_len == 0) { ++ iwe.u.data.length = sizeof(""); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, ""); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, ""); ++#endif ++ } else { ++ iwe.u.data.length = min(network->ssid_len, (u8)32); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, network->ssid); ++#endif ++ } ++ /* Add the protocol name */ ++ iwe.cmd = SIOCGIWNAME; ++ for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) { ++ if(network->mode&(1<= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN); ++#endif ++ /* Add mode */ ++ iwe.cmd = SIOCGIWMODE; ++ if (network->capability & ++ (WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) { ++ if (network->capability & WLAN_CAPABILITY_BSS) ++ iwe.u.mode = IW_MODE_MASTER; ++ else ++ iwe.u.mode = IW_MODE_ADHOC; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN); ++#endif ++ } ++ ++ /* Add frequency/channel */ ++ iwe.cmd = SIOCGIWFREQ; ++/* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode); ++ iwe.u.freq.e = 3; */ ++ iwe.u.freq.m = network->channel; ++ iwe.u.freq.e = 0; ++ iwe.u.freq.i = 0; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN); ++#endif ++ /* Add encryption capability */ ++ iwe.cmd = SIOCGIWENCODE; ++ if (network->capability & WLAN_CAPABILITY_PRIVACY) ++ iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; ++ else ++ iwe.u.data.flags = IW_ENCODE_DISABLED; ++ iwe.u.data.length = 0; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, network->ssid); ++#endif ++ /* Add basic and extended rates */ ++ max_rate = 0; ++ p = custom; ++ p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Rates (Mb/s): "); ++ for (i = 0, j = 0; i < network->rates_len; ) { ++ if (j < network->rates_ex_len && ++ ((network->rates_ex[j] & 0x7F) < ++ (network->rates[i] & 0x7F))) ++ rate = network->rates_ex[j++] & 0x7F; ++ else ++ rate = network->rates[i++] & 0x7F; ++ if (rate > max_rate) ++ max_rate = rate; ++ p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), ++ "%d%s ", rate >> 1, (rate & 1) ? ".5" : ""); ++ } ++ for (; j < network->rates_ex_len; j++) { ++ rate = network->rates_ex[j] & 0x7F; ++ p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), ++ "%d%s ", rate >> 1, (rate & 1) ? ".5" : ""); ++ if (rate > max_rate) ++ max_rate = rate; ++ } ++ ++ if (network->mode >= IEEE_N_24G)//add N rate here; ++ { ++ PHT_CAPABILITY_ELE ht_cap = NULL; ++ bool is40M = false, isShortGI = false; ++ u8 max_mcs = 0; ++ if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4)) ++ ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4]; ++ else ++ ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0]; ++ is40M = (ht_cap->ChlWidth)?1:0; ++ isShortGI = (ht_cap->ChlWidth)? ++ ((ht_cap->ShortGI40Mhz)?1:0): ++ ((ht_cap->ShortGI20Mhz)?1:0); ++ ++ max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL); ++ rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f]; ++ if (rate > max_rate) ++ max_rate = rate; ++ } ++#if 0 ++ printk("max rate:%d ===basic rate:\n", max_rate); ++ for (i=0;irates_len;i++) ++ printk(" %x", network->rates[i]); ++ printk("\n=======extend rate\n"); ++ for (i=0; irates_ex_len; i++) ++ printk(" %x", network->rates_ex[i]); ++ printk("\n"); ++#endif ++ iwe.cmd = SIOCGIWRATE; ++ iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0; ++ iwe.u.bitrate.value = max_rate * 500000; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, ++ IW_EV_PARAM_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, ++ IW_EV_PARAM_LEN); ++#endif ++ iwe.cmd = IWEVCUSTOM; ++ iwe.u.data.length = p - custom; ++ if (iwe.u.data.length) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, custom); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, custom); ++#endif ++ /* Add quality statistics */ ++ /* TODO: Fix these values... */ ++ iwe.cmd = IWEVQUAL; ++ iwe.u.qual.qual = network->stats.signal; ++ iwe.u.qual.level = network->stats.rssi; ++ iwe.u.qual.noise = network->stats.noise; ++ iwe.u.qual.updated = network->stats.mask & IEEE80211_STATMASK_WEMASK; ++ if (!(network->stats.mask & IEEE80211_STATMASK_RSSI)) ++ iwe.u.qual.updated |= IW_QUAL_LEVEL_INVALID; ++ if (!(network->stats.mask & IEEE80211_STATMASK_NOISE)) ++ iwe.u.qual.updated |= IW_QUAL_NOISE_INVALID; ++ if (!(network->stats.mask & IEEE80211_STATMASK_SIGNAL)) ++ iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID; ++ iwe.u.qual.updated = 7; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN); ++#else ++ start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN); ++#endif ++ iwe.cmd = IWEVCUSTOM; ++ p = custom; ++ ++ iwe.u.data.length = p - custom; ++ if (iwe.u.data.length) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, custom); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, custom); ++#endif ++#if (WIRELESS_EXT < 18) ++ if (ieee->wpa_enabled && network->wpa_ie_len){ ++ char buf[MAX_WPA_IE_LEN * 2 + 30]; ++ // printk("WPA IE\n"); ++ u8 *p = buf; ++ p += sprintf(p, "wpa_ie="); ++ for (i = 0; i < network->wpa_ie_len; i++) { ++ p += sprintf(p, "%02x", network->wpa_ie[i]); ++ } ++ ++ memset(&iwe, 0, sizeof(iwe)); ++ iwe.cmd = IWEVCUSTOM; ++ iwe.u.data.length = strlen(buf); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, buf); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, buf); ++#endif ++ } ++ ++ if (ieee->wpa_enabled && network->rsn_ie_len){ ++ char buf[MAX_WPA_IE_LEN * 2 + 30]; ++ ++ u8 *p = buf; ++ p += sprintf(p, "rsn_ie="); ++ for (i = 0; i < network->rsn_ie_len; i++) { ++ p += sprintf(p, "%02x", network->rsn_ie[i]); ++ } ++ ++ memset(&iwe, 0, sizeof(iwe)); ++ iwe.cmd = IWEVCUSTOM; ++ iwe.u.data.length = strlen(buf); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, buf); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, buf); ++#endif ++ } ++#else ++ memset(&iwe, 0, sizeof(iwe)); ++ if (network->wpa_ie_len) ++ { ++ char buf[MAX_WPA_IE_LEN]; ++ memcpy(buf, network->wpa_ie, network->wpa_ie_len); ++ iwe.cmd = IWEVGENIE; ++ iwe.u.data.length = network->wpa_ie_len; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, buf); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, buf); ++#endif ++ } ++ memset(&iwe, 0, sizeof(iwe)); ++ if (network->rsn_ie_len) ++ { ++ char buf[MAX_WPA_IE_LEN]; ++ memcpy(buf, network->rsn_ie, network->rsn_ie_len); ++ iwe.cmd = IWEVGENIE; ++ iwe.u.data.length = network->rsn_ie_len; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, buf); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, buf); ++#endif ++ } ++#endif ++ ++ ++ /* Add EXTRA: Age to display seconds since last beacon/probe response ++ * for given network. */ ++ iwe.cmd = IWEVCUSTOM; ++ p = custom; ++ p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), ++ " Last beacon: %lums ago", (jiffies - network->last_scanned) / (HZ / 100)); ++ iwe.u.data.length = p - custom; ++ if (iwe.u.data.length) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++ start = iwe_stream_add_point(info, start, stop, &iwe, custom); ++#else ++ start = iwe_stream_add_point(start, stop, &iwe, custom); ++#endif ++ ++ return start; ++} ++ ++int ieee80211_wx_get_scan(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct ieee80211_network *network; ++ unsigned long flags; ++ ++ char *ev = extra; ++// char *stop = ev + IW_SCAN_MAX_DATA; ++ char *stop = ev + wrqu->data.length;//IW_SCAN_MAX_DATA; ++ //char *stop = ev + IW_SCAN_MAX_DATA; ++ int i = 0; ++ int err = 0; ++ IEEE80211_DEBUG_WX("Getting scan\n"); ++ down(&ieee->wx_sem); ++ spin_lock_irqsave(&ieee->lock, flags); ++ ++ list_for_each_entry(network, &ieee->network_list, list) { ++ i++; ++ if((stop-ev)<200) ++ { ++ err = -E2BIG; ++ break; ++ } ++ if (ieee->scan_age == 0 || ++ time_after(network->last_scanned + ieee->scan_age, jiffies)) ++ ev = rtl819x_translate_scan(ieee, ev, stop, network, info); ++ else ++ IEEE80211_DEBUG_SCAN( ++ "Not showing network '%s (" ++ MAC_FMT ")' due to age (%lums).\n", ++ escape_essid(network->ssid, ++ network->ssid_len), ++ MAC_ARG(network->bssid), ++ (jiffies - network->last_scanned) / (HZ / 100)); ++ } ++ ++ spin_unlock_irqrestore(&ieee->lock, flags); ++ up(&ieee->wx_sem); ++ wrqu->data.length = ev - extra; ++ wrqu->data.flags = 0; ++ ++ IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i); ++ ++ return err; ++} ++ ++int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *keybuf) ++{ ++ struct iw_point *erq = &(wrqu->encoding); ++ struct net_device *dev = ieee->dev; ++ struct ieee80211_security sec = { ++ .flags = 0 ++ }; ++ int i, key, key_provided, len; ++ struct ieee80211_crypt_data **crypt; ++ ++ IEEE80211_DEBUG_WX("SET_ENCODE\n"); ++ ++ key = erq->flags & IW_ENCODE_INDEX; ++ if (key) { ++ if (key > WEP_KEYS) ++ return -EINVAL; ++ key--; ++ key_provided = 1; ++ } else { ++ key_provided = 0; ++ key = ieee->tx_keyidx; ++ } ++ ++ IEEE80211_DEBUG_WX("Key: %d [%s]\n", key, key_provided ? ++ "provided" : "default"); ++ crypt = &ieee->crypt[key]; ++ ++ if (erq->flags & IW_ENCODE_DISABLED) { ++ if (key_provided && *crypt) { ++ IEEE80211_DEBUG_WX("Disabling encryption on key %d.\n", ++ key); ++ ieee80211_crypt_delayed_deinit(ieee, crypt); ++ } else ++ IEEE80211_DEBUG_WX("Disabling encryption.\n"); ++ ++ /* Check all the keys to see if any are still configured, ++ * and if no key index was provided, de-init them all */ ++ for (i = 0; i < WEP_KEYS; i++) { ++ if (ieee->crypt[i] != NULL) { ++ if (key_provided) ++ break; ++ ieee80211_crypt_delayed_deinit( ++ ieee, &ieee->crypt[i]); ++ } ++ } ++ ++ if (i == WEP_KEYS) { ++ sec.enabled = 0; ++ sec.level = SEC_LEVEL_0; ++ sec.flags |= SEC_ENABLED | SEC_LEVEL; ++ } ++ ++ goto done; ++ } ++ ++ ++ ++ sec.enabled = 1; ++ sec.flags |= SEC_ENABLED; ++ ++ if (*crypt != NULL && (*crypt)->ops != NULL && ++ strcmp((*crypt)->ops->name, "WEP") != 0) { ++ /* changing to use WEP; deinit previously used algorithm ++ * on this key */ ++ ieee80211_crypt_delayed_deinit(ieee, crypt); ++ } ++ ++ if (*crypt == NULL) { ++ struct ieee80211_crypt_data *new_crypt; ++ ++ /* take WEP into use */ ++ new_crypt = kmalloc(sizeof(struct ieee80211_crypt_data), ++ GFP_KERNEL); ++ if (new_crypt == NULL) ++ return -ENOMEM; ++ memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); ++ new_crypt->ops = ieee80211_get_crypto_ops("WEP"); ++ if (!new_crypt->ops) { ++ request_module("ieee80211_crypt_wep"); ++ new_crypt->ops = ieee80211_get_crypto_ops("WEP"); ++ } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ++ if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) ++#else ++ if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) ++#endif ++ new_crypt->priv = new_crypt->ops->init(key); ++ ++ if (!new_crypt->ops || !new_crypt->priv) { ++ kfree(new_crypt); ++ new_crypt = NULL; ++ ++ printk(KERN_WARNING "%s: could not initialize WEP: " ++ "load module ieee80211_crypt_wep\n", ++ dev->name); ++ return -EOPNOTSUPP; ++ } ++ *crypt = new_crypt; ++ } ++ ++ /* If a new key was provided, set it up */ ++ if (erq->length > 0) { ++ len = erq->length <= 5 ? 5 : 13; ++ memcpy(sec.keys[key], keybuf, erq->length); ++ if (len > erq->length) ++ memset(sec.keys[key] + erq->length, 0, ++ len - erq->length); ++ IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", ++ key, escape_essid(sec.keys[key], len), ++ erq->length, len); ++ sec.key_sizes[key] = len; ++ (*crypt)->ops->set_key(sec.keys[key], len, NULL, ++ (*crypt)->priv); ++ sec.flags |= (1 << key); ++ /* This ensures a key will be activated if no key is ++ * explicitely set */ ++ if (key == sec.active_key) ++ sec.flags |= SEC_ACTIVE_KEY; ++ ieee->tx_keyidx = key; ++ ++ } else { ++ len = (*crypt)->ops->get_key(sec.keys[key], WEP_KEY_LEN, ++ NULL, (*crypt)->priv); ++ if (len == 0) { ++ /* Set a default key of all 0 */ ++ printk("Setting key %d to all zero.\n", ++ key); ++ ++ IEEE80211_DEBUG_WX("Setting key %d to all zero.\n", ++ key); ++ memset(sec.keys[key], 0, 13); ++ (*crypt)->ops->set_key(sec.keys[key], 13, NULL, ++ (*crypt)->priv); ++ sec.key_sizes[key] = 13; ++ sec.flags |= (1 << key); ++ } ++ ++ /* No key data - just set the default TX key index */ ++ if (key_provided) { ++ IEEE80211_DEBUG_WX( ++ "Setting key %d to default Tx key.\n", key); ++ ieee->tx_keyidx = key; ++ sec.active_key = key; ++ sec.flags |= SEC_ACTIVE_KEY; ++ } ++ } ++ ++ done: ++ ieee->open_wep = !(erq->flags & IW_ENCODE_RESTRICTED); ++ ieee->auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY; ++ sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY; ++ sec.flags |= SEC_AUTH_MODE; ++ IEEE80211_DEBUG_WX("Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ? ++ "OPEN" : "SHARED KEY"); ++ ++ /* For now we just support WEP, so only set that security level... ++ * TODO: When WPA is added this is one place that needs to change */ ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ ++ ++ if (ieee->set_security) ++ ieee->set_security(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)) { ++ printk(KERN_DEBUG "%s: reset_port failed\n", dev->name); ++ return -EINVAL; ++ } ++ return 0; ++} ++ ++int ieee80211_wx_get_encode(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *keybuf) ++{ ++ struct iw_point *erq = &(wrqu->encoding); ++ int len, key; ++ struct ieee80211_crypt_data *crypt; ++ ++ IEEE80211_DEBUG_WX("GET_ENCODE\n"); ++ ++ if(ieee->iw_mode == IW_MODE_MONITOR) ++ return -1; ++ ++ key = erq->flags & IW_ENCODE_INDEX; ++ if (key) { ++ if (key > WEP_KEYS) ++ return -EINVAL; ++ key--; ++ } else ++ key = ieee->tx_keyidx; ++ ++ crypt = ieee->crypt[key]; ++ erq->flags = key + 1; ++ ++ if (crypt == NULL || crypt->ops == NULL) { ++ erq->length = 0; ++ erq->flags |= IW_ENCODE_DISABLED; ++ return 0; ++ } ++#if 0 ++ if (strcmp(crypt->ops->name, "WEP") != 0) { ++ /* only WEP is supported with wireless extensions, so just ++ * report that encryption is used */ ++ erq->length = 0; ++ erq->flags |= IW_ENCODE_ENABLED; ++ return 0; ++ } ++#endif ++ len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv); ++ erq->length = (len >= 0 ? len : 0); ++ ++ erq->flags |= IW_ENCODE_ENABLED; ++ ++ if (ieee->open_wep) ++ erq->flags |= IW_ENCODE_OPEN; ++ else ++ erq->flags |= IW_ENCODE_RESTRICTED; ++ ++ return 0; ++} ++#if (WIRELESS_EXT >= 18) ++int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret = 0; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct net_device *dev = ieee->dev; ++ struct iw_point *encoding = &wrqu->encoding; ++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; ++ int i, idx; ++ int group_key = 0; ++ const char *alg, *module; ++ struct ieee80211_crypto_ops *ops; ++ struct ieee80211_crypt_data **crypt; ++ ++ struct ieee80211_security sec = { ++ .flags = 0, ++ }; ++ //printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg); ++ idx = encoding->flags & IW_ENCODE_INDEX; ++ if (idx) { ++ if (idx < 1 || idx > WEP_KEYS) ++ return -EINVAL; ++ idx--; ++ } else ++ idx = ieee->tx_keyidx; ++ ++ if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { ++ ++ crypt = &ieee->crypt[idx]; ++ ++ group_key = 1; ++ } else { ++ /* some Cisco APs use idx>0 for unicast in dynamic WEP */ ++ //printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg); ++ if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP) ++ return -EINVAL; ++ if (ieee->iw_mode == IW_MODE_INFRA) ++ ++ crypt = &ieee->crypt[idx]; ++ ++ else ++ return -EINVAL; ++ } ++ ++ sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT; ++ if ((encoding->flags & IW_ENCODE_DISABLED) || ++ ext->alg == IW_ENCODE_ALG_NONE) { ++ if (*crypt) ++ ieee80211_crypt_delayed_deinit(ieee, crypt); ++ ++ for (i = 0; i < WEP_KEYS; i++) ++ ++ if (ieee->crypt[i] != NULL) ++ ++ break; ++ ++ if (i == WEP_KEYS) { ++ sec.enabled = 0; ++ // sec.encrypt = 0; ++ sec.level = SEC_LEVEL_0; ++ sec.flags |= SEC_LEVEL; ++ } ++ //printk("disabled: flag:%x\n", encoding->flags); ++ goto done; ++ } ++ ++ sec.enabled = 1; ++ // sec.encrypt = 1; ++#if 0 ++ if (group_key ? !ieee->host_mc_decrypt : ++ !(ieee->host_encrypt || ieee->host_decrypt || ++ ieee->host_encrypt_msdu)) ++ goto skip_host_crypt; ++#endif ++ switch (ext->alg) { ++ case IW_ENCODE_ALG_WEP: ++ alg = "WEP"; ++ module = "ieee80211_crypt_wep"; ++ break; ++ case IW_ENCODE_ALG_TKIP: ++ alg = "TKIP"; ++ module = "ieee80211_crypt_tkip"; ++ break; ++ case IW_ENCODE_ALG_CCMP: ++ alg = "CCMP"; ++ module = "ieee80211_crypt_ccmp"; ++ break; ++ default: ++ IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", ++ dev->name, ext->alg); ++ ret = -EINVAL; ++ goto done; ++ } ++ printk("alg name:%s\n",alg); ++ ++ ops = ieee80211_get_crypto_ops(alg); ++ if (ops == NULL) { ++ request_module(module); ++ ops = ieee80211_get_crypto_ops(alg); ++ } ++ if (ops == NULL) { ++ IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", ++ dev->name, ext->alg); ++ printk("========>unknown crypto alg %d\n", ext->alg); ++ ret = -EINVAL; ++ goto done; ++ } ++ ++ if (*crypt == NULL || (*crypt)->ops != ops) { ++ struct ieee80211_crypt_data *new_crypt; ++ ++ ieee80211_crypt_delayed_deinit(ieee, crypt); ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) ++ new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); ++#else ++ new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); ++ memset(new_crypt,0,sizeof(*new_crypt)); ++#endif ++ if (new_crypt == NULL) { ++ ret = -ENOMEM; ++ goto done; ++ } ++ new_crypt->ops = ops; ++ if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) ++ new_crypt->priv = new_crypt->ops->init(idx); ++ if (new_crypt->priv == NULL) { ++ kfree(new_crypt); ++ ret = -EINVAL; ++ goto done; ++ } ++ *crypt = new_crypt; ++ ++ } ++ ++ if (ext->key_len > 0 && (*crypt)->ops->set_key && ++ (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq, ++ (*crypt)->priv) < 0) { ++ IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name); ++ printk("key setting failed\n"); ++ ret = -EINVAL; ++ goto done; ++ } ++#if 1 ++ //skip_host_crypt: ++ //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags); ++ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { ++ ieee->tx_keyidx = idx; ++ sec.active_key = idx; ++ sec.flags |= SEC_ACTIVE_KEY; ++ } ++ ++ if (ext->alg != IW_ENCODE_ALG_NONE) { ++ //memcpy(sec.keys[idx], ext->key, ext->key_len); ++ sec.key_sizes[idx] = ext->key_len; ++ sec.flags |= (1 << idx); ++ if (ext->alg == IW_ENCODE_ALG_WEP) { ++ // sec.encode_alg[idx] = SEC_ALG_WEP; ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_1; ++ } else if (ext->alg == IW_ENCODE_ALG_TKIP) { ++ // sec.encode_alg[idx] = SEC_ALG_TKIP; ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_2; ++ } else if (ext->alg == IW_ENCODE_ALG_CCMP) { ++ // sec.encode_alg[idx] = SEC_ALG_CCMP; ++ sec.flags |= SEC_LEVEL; ++ sec.level = SEC_LEVEL_3; ++ } ++ /* Don't set sec level for group keys. */ ++ if (group_key) ++ sec.flags &= ~SEC_LEVEL; ++ } ++#endif ++done: ++ if (ieee->set_security) ++ ieee->set_security(ieee->dev, &sec); ++ ++ if (ieee->reset_on_keychange && ++ ieee->iw_mode != IW_MODE_INFRA && ++ ieee->reset_port && ieee->reset_port(dev)) { ++ IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); ++ return -EINVAL; ++ } ++#endif ++ return ret; ++} ++ ++int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct iw_point *encoding = &wrqu->encoding; ++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; ++ struct ieee80211_crypt_data *crypt; ++ int idx, max_key_len; ++ ++ max_key_len = encoding->length - sizeof(*ext); ++ if (max_key_len < 0) ++ return -EINVAL; ++ ++ idx = encoding->flags & IW_ENCODE_INDEX; ++ if (idx) { ++ if (idx < 1 || idx > WEP_KEYS) ++ return -EINVAL; ++ idx--; ++ } else ++ idx = ieee->tx_keyidx; ++ ++ if (!ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY && ++ ext->alg != IW_ENCODE_ALG_WEP) ++ if (idx != 0 || ieee->iw_mode != IW_MODE_INFRA) ++ return -EINVAL; ++ ++ crypt = ieee->crypt[idx]; ++ encoding->flags = idx + 1; ++ memset(ext, 0, sizeof(*ext)); ++ ++ if (crypt == NULL || crypt->ops == NULL ) { ++ ext->alg = IW_ENCODE_ALG_NONE; ++ ext->key_len = 0; ++ encoding->flags |= IW_ENCODE_DISABLED; ++ } else { ++ if (strcmp(crypt->ops->name, "WEP") == 0 ) ++ ext->alg = IW_ENCODE_ALG_WEP; ++ else if (strcmp(crypt->ops->name, "TKIP")) ++ ext->alg = IW_ENCODE_ALG_TKIP; ++ else if (strcmp(crypt->ops->name, "CCMP")) ++ ext->alg = IW_ENCODE_ALG_CCMP; ++ else ++ return -EINVAL; ++ ext->key_len = crypt->ops->get_key(ext->key, SCM_KEY_LEN, NULL, crypt->priv); ++ encoding->flags |= IW_ENCODE_ENABLED; ++ if (ext->key_len && ++ (ext->alg == IW_ENCODE_ALG_TKIP || ++ ext->alg == IW_ENCODE_ALG_CCMP)) ++ ext->ext_flags |= IW_ENCODE_EXT_TX_SEQ_VALID; ++ ++ } ++ ++ return 0; ++} ++ ++int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct iw_mlme *mlme = (struct iw_mlme *) extra; ++ switch (mlme->cmd) { ++ case IW_MLME_DEAUTH: ++ case IW_MLME_DISASSOC: ++ ieee80211_disassociate(ieee); ++ break; ++ default: ++ return -EOPNOTSUPP; ++ } ++#endif ++ return 0; ++} ++ ++int ieee80211_wx_set_auth(struct ieee80211_device *ieee, ++ struct iw_request_info *info, ++ struct iw_param *data, char *extra) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ switch (data->flags & IW_AUTH_INDEX) { ++ case IW_AUTH_WPA_VERSION: ++ /*need to support wpa2 here*/ ++ //printk("wpa version:%x\n", data->value); ++ break; ++ case IW_AUTH_CIPHER_PAIRWISE: ++ case IW_AUTH_CIPHER_GROUP: ++ case IW_AUTH_KEY_MGMT: ++ /* ++ * * Host AP driver does not use these parameters and allows ++ * * wpa_supplicant to control them internally. ++ * */ ++ break; ++ case IW_AUTH_TKIP_COUNTERMEASURES: ++ ieee->tkip_countermeasures = data->value; ++ break; ++ case IW_AUTH_DROP_UNENCRYPTED: ++ ieee->drop_unencrypted = data->value; ++ break; ++ ++ case IW_AUTH_80211_AUTH_ALG: ++ //printk("======>%s():data->value is %d\n",__FUNCTION__,data->value); ++ // ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM)?1:0; ++ if(data->value & IW_AUTH_ALG_SHARED_KEY){ ++ ieee->open_wep = 0; ++ ieee->auth_mode = 1; ++ } ++ else if(data->value & IW_AUTH_ALG_OPEN_SYSTEM){ ++ ieee->open_wep = 1; ++ ieee->auth_mode = 0; ++ } ++ else if(data->value & IW_AUTH_ALG_LEAP){ ++ ieee->open_wep = 1; ++ ieee->auth_mode = 2; ++ //printk("hahahaa:LEAP\n"); ++ } ++ else ++ return -EINVAL; ++ //printk("open_wep:%d\n", ieee->open_wep); ++ break; ++ ++#if 1 ++ case IW_AUTH_WPA_ENABLED: ++ ieee->wpa_enabled = (data->value)?1:0; ++ //printk("enalbe wpa:%d\n", ieee->wpa_enabled); ++ break; ++ ++#endif ++ case IW_AUTH_RX_UNENCRYPTED_EAPOL: ++ ieee->ieee802_1x = data->value; ++ break; ++ case IW_AUTH_PRIVACY_INVOKED: ++ ieee->privacy_invoked = data->value; ++ break; ++ default: ++ return -EOPNOTSUPP; ++ } ++#endif ++ return 0; ++} ++#endif ++#if 1 ++int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) ++{ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#if 0 ++ printk("====>%s()\n", __FUNCTION__); ++ { ++ int i; ++ for (i=0; iMAX_WPA_IE_LEN || (len && ie == NULL)) ++ { ++ // printk("return error out, len:%d\n", len); ++ return -EINVAL; ++ } ++ ++ ++ if (len) ++ { ++ if (len != ie[1]+2) ++ { ++ printk("len:%d, ie:%d\n", len, ie[1]); ++ return -EINVAL; ++ } ++ buf = kmalloc(len, GFP_KERNEL); ++ if (buf == NULL) ++ return -ENOMEM; ++ memcpy(buf, ie, len); ++ kfree(ieee->wpa_ie); ++ ieee->wpa_ie = buf; ++ ieee->wpa_ie_len = len; ++ } ++ else{ ++ if (ieee->wpa_ie) ++ kfree(ieee->wpa_ie); ++ ieee->wpa_ie = NULL; ++ ieee->wpa_ie_len = 0; ++ } ++#endif ++ return 0; ++ ++} ++#endif ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++//EXPORT_SYMBOL(ieee80211_wx_set_gen_ie); ++#if (WIRELESS_EXT >= 18) ++//EXPORT_SYMBOL(ieee80211_wx_set_mlme); ++//EXPORT_SYMBOL(ieee80211_wx_set_auth); ++//EXPORT_SYMBOL(ieee80211_wx_set_encode_ext); ++//EXPORT_SYMBOL(ieee80211_wx_get_encode_ext); ++#endif ++//EXPORT_SYMBOL(ieee80211_wx_get_scan); ++//EXPORT_SYMBOL(ieee80211_wx_set_encode); ++//EXPORT_SYMBOL(ieee80211_wx_get_encode); ++#else ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_gen_ie); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mlme); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_auth); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode_ext); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_scan); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode); ++//EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_encode); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/internal.h +@@ -0,0 +1,115 @@ ++/* ++ * Cryptographic API. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++#ifndef _CRYPTO_INTERNAL_H ++#define _CRYPTO_INTERNAL_H ++ ++ ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) ++#define list_for_each_entry(pos, head, member) \ ++ for (pos = list_entry((head)->next, typeof(*pos), member), \ ++ prefetch(pos->member.next); \ ++ &pos->member != (head); \ ++ pos = list_entry(pos->member.next, typeof(*pos), member), \ ++ prefetch(pos->member.next)) ++ ++static inline void cond_resched(void) ++{ ++ if (need_resched()) { ++ set_current_state(TASK_RUNNING); ++ schedule(); ++ } ++} ++#endif ++ ++extern enum km_type crypto_km_types[]; ++ ++static inline enum km_type crypto_kmap_type(int out) ++{ ++ return crypto_km_types[(in_softirq() ? 2 : 0) + out]; ++} ++ ++static inline void *crypto_kmap(struct page *page, int out) ++{ ++ return kmap_atomic(page, crypto_kmap_type(out)); ++} ++ ++static inline void crypto_kunmap(void *vaddr, int out) ++{ ++ kunmap_atomic(vaddr, crypto_kmap_type(out)); ++} ++ ++static inline void crypto_yield(struct crypto_tfm *tfm) ++{ ++ if (!in_softirq()) ++ cond_resched(); ++} ++ ++static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) ++{ ++ return (void *)&tfm[1]; ++} ++ ++struct crypto_alg *crypto_alg_lookup(const char *name); ++ ++#ifdef CONFIG_KMOD ++void crypto_alg_autoload(const char *name); ++struct crypto_alg *crypto_alg_mod_lookup(const char *name); ++#else ++static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name) ++{ ++ return crypto_alg_lookup(name); ++} ++#endif ++ ++#ifdef CONFIG_CRYPTO_HMAC ++int crypto_alloc_hmac_block(struct crypto_tfm *tfm); ++void crypto_free_hmac_block(struct crypto_tfm *tfm); ++#else ++static inline int crypto_alloc_hmac_block(struct crypto_tfm *tfm) ++{ ++ return 0; ++} ++ ++static inline void crypto_free_hmac_block(struct crypto_tfm *tfm) ++{ } ++#endif ++ ++#ifdef CONFIG_PROC_FS ++void __init crypto_init_proc(void); ++#else ++static inline void crypto_init_proc(void) ++{ } ++#endif ++ ++int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags); ++int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags); ++int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags); ++ ++int crypto_init_digest_ops(struct crypto_tfm *tfm); ++int crypto_init_cipher_ops(struct crypto_tfm *tfm); ++int crypto_init_compress_ops(struct crypto_tfm *tfm); ++ ++void crypto_exit_digest_ops(struct crypto_tfm *tfm); ++void crypto_exit_cipher_ops(struct crypto_tfm *tfm); ++void crypto_exit_compress_ops(struct crypto_tfm *tfm); ++ ++#endif /* _CRYPTO_INTERNAL_H */ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/kmap_types.h +@@ -0,0 +1,20 @@ ++#ifndef __KMAP_TYPES_H ++ ++#define __KMAP_TYPES_H ++ ++ ++enum km_type { ++ KM_BOUNCE_READ, ++ KM_SKB_SUNRPC_DATA, ++ KM_SKB_DATA_SOFTIRQ, ++ KM_USER0, ++ KM_USER1, ++ KM_BH_IRQ, ++ KM_SOFTIRQ0, ++ KM_SOFTIRQ1, ++ KM_TYPE_NR ++}; ++ ++#define _ASM_KMAP_TYPES_H ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/michael_mic.c +@@ -0,0 +1,194 @@ ++/* ++ * Cryptographic API ++ * ++ * Michael MIC (IEEE 802.11i/TKIP) keyed digest ++ * ++ * Copyright (c) 2004 Jouni Malinen ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++//#include ++#include "rtl_crypto.h" ++ ++ ++struct michael_mic_ctx { ++ u8 pending[4]; ++ size_t pending_len; ++ ++ u32 l, r; ++}; ++ ++ ++static inline u32 rotl(u32 val, int bits) ++{ ++ return (val << bits) | (val >> (32 - bits)); ++} ++ ++ ++static inline u32 rotr(u32 val, int bits) ++{ ++ return (val >> bits) | (val << (32 - bits)); ++} ++ ++ ++static inline u32 xswap(u32 val) ++{ ++ return ((val & 0x00ff00ff) << 8) | ((val & 0xff00ff00) >> 8); ++} ++ ++ ++#define michael_block(l, r) \ ++do { \ ++ r ^= rotl(l, 17); \ ++ l += r; \ ++ r ^= xswap(l); \ ++ l += r; \ ++ r ^= rotl(l, 3); \ ++ l += r; \ ++ r ^= rotr(l, 2); \ ++ l += r; \ ++} while (0) ++ ++ ++static inline u32 get_le32(const u8 *p) ++{ ++ return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); ++} ++ ++ ++static inline void put_le32(u8 *p, u32 v) ++{ ++ p[0] = v; ++ p[1] = v >> 8; ++ p[2] = v >> 16; ++ p[3] = v >> 24; ++} ++ ++ ++static void michael_init(void *ctx) ++{ ++ struct michael_mic_ctx *mctx = ctx; ++ mctx->pending_len = 0; ++} ++ ++ ++static void michael_update(void *ctx, const u8 *data, unsigned int len) ++{ ++ struct michael_mic_ctx *mctx = ctx; ++ ++ if (mctx->pending_len) { ++ int flen = 4 - mctx->pending_len; ++ if (flen > len) ++ flen = len; ++ memcpy(&mctx->pending[mctx->pending_len], data, flen); ++ mctx->pending_len += flen; ++ data += flen; ++ len -= flen; ++ ++ if (mctx->pending_len < 4) ++ return; ++ ++ mctx->l ^= get_le32(mctx->pending); ++ michael_block(mctx->l, mctx->r); ++ mctx->pending_len = 0; ++ } ++ ++ while (len >= 4) { ++ mctx->l ^= get_le32(data); ++ michael_block(mctx->l, mctx->r); ++ data += 4; ++ len -= 4; ++ } ++ ++ if (len > 0) { ++ mctx->pending_len = len; ++ memcpy(mctx->pending, data, len); ++ } ++} ++ ++ ++static void michael_final(void *ctx, u8 *out) ++{ ++ struct michael_mic_ctx *mctx = ctx; ++ u8 *data = mctx->pending; ++ ++ /* Last block and padding (0x5a, 4..7 x 0) */ ++ switch (mctx->pending_len) { ++ case 0: ++ mctx->l ^= 0x5a; ++ break; ++ case 1: ++ mctx->l ^= data[0] | 0x5a00; ++ break; ++ case 2: ++ mctx->l ^= data[0] | (data[1] << 8) | 0x5a0000; ++ break; ++ case 3: ++ mctx->l ^= data[0] | (data[1] << 8) | (data[2] << 16) | ++ 0x5a000000; ++ break; ++ } ++ michael_block(mctx->l, mctx->r); ++ /* l ^= 0; */ ++ michael_block(mctx->l, mctx->r); ++ ++ put_le32(out, mctx->l); ++ put_le32(out + 4, mctx->r); ++} ++ ++ ++static int michael_setkey(void *ctx, const u8 *key, unsigned int keylen, ++ u32 *flags) ++{ ++ struct michael_mic_ctx *mctx = ctx; ++ if (keylen != 8) { ++ if (flags) ++ *flags = CRYPTO_TFM_RES_BAD_KEY_LEN; ++ return -EINVAL; ++ } ++ mctx->l = get_le32(key); ++ mctx->r = get_le32(key + 4); ++ return 0; ++} ++ ++ ++static struct crypto_alg michael_mic_alg = { ++ .cra_name = "michael_mic", ++ .cra_flags = CRYPTO_ALG_TYPE_DIGEST, ++ .cra_blocksize = 8, ++ .cra_ctxsize = sizeof(struct michael_mic_ctx), ++ .cra_module = THIS_MODULE, ++ .cra_list = LIST_HEAD_INIT(michael_mic_alg.cra_list), ++ .cra_u = { .digest = { ++ .dia_digestsize = 8, ++ .dia_init = michael_init, ++ .dia_update = michael_update, ++ .dia_final = michael_final, ++ .dia_setkey = michael_setkey } } ++}; ++ ++ ++static int __init michael_mic_init(void) ++{ ++ return crypto_register_alg(&michael_mic_alg); ++} ++ ++ ++static void __exit michael_mic_exit(void) ++{ ++ crypto_unregister_alg(&michael_mic_alg); ++} ++ ++ ++module_init(michael_mic_init); ++module_exit(michael_mic_exit); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_DESCRIPTION("Michael MIC"); ++MODULE_AUTHOR("Jouni Malinen "); +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/proc.c +@@ -0,0 +1,116 @@ ++/* ++ * Scatterlist Cryptographic API. ++ * ++ * Procfs information. ++ * ++ * Copyright (c) 2002 James Morris ++ * ++ * 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. ++ * ++ */ ++#include ++//#include ++#include "rtl_crypto.h" ++#include ++#include ++#include ++#include "internal.h" ++ ++extern struct list_head crypto_alg_list; ++extern struct rw_semaphore crypto_alg_sem; ++ ++static void *c_start(struct seq_file *m, loff_t *pos) ++{ ++ struct list_head *v; ++ loff_t n = *pos; ++ ++ down_read(&crypto_alg_sem); ++ list_for_each(v, &crypto_alg_list) ++ if (!n--) ++ return list_entry(v, struct crypto_alg, cra_list); ++ return NULL; ++} ++ ++static void *c_next(struct seq_file *m, void *p, loff_t *pos) ++{ ++ struct list_head *v = p; ++ ++ (*pos)++; ++ v = v->next; ++ return (v == &crypto_alg_list) ? ++ NULL : list_entry(v, struct crypto_alg, cra_list); ++} ++ ++static void c_stop(struct seq_file *m, void *p) ++{ ++ up_read(&crypto_alg_sem); ++} ++ ++static int c_show(struct seq_file *m, void *p) ++{ ++ struct crypto_alg *alg = (struct crypto_alg *)p; ++ ++ seq_printf(m, "name : %s\n", alg->cra_name); ++ seq_printf(m, "module : %s\n", ++ (alg->cra_module ? ++ alg->cra_module->name : ++ "kernel")); ++ ++ switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { ++ case CRYPTO_ALG_TYPE_CIPHER: ++ seq_printf(m, "type : cipher\n"); ++ seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); ++ seq_printf(m, "min keysize : %u\n", ++ alg->cra_cipher.cia_min_keysize); ++ seq_printf(m, "max keysize : %u\n", ++ alg->cra_cipher.cia_max_keysize); ++ break; ++ ++ case CRYPTO_ALG_TYPE_DIGEST: ++ seq_printf(m, "type : digest\n"); ++ seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); ++ seq_printf(m, "digestsize : %u\n", ++ alg->cra_digest.dia_digestsize); ++ break; ++ case CRYPTO_ALG_TYPE_COMPRESS: ++ seq_printf(m, "type : compression\n"); ++ break; ++ default: ++ seq_printf(m, "type : unknown\n"); ++ break; ++ } ++ ++ seq_putc(m, '\n'); ++ return 0; ++} ++ ++static struct seq_operations crypto_seq_ops = { ++ .start = c_start, ++ .next = c_next, ++ .stop = c_stop, ++ .show = c_show ++}; ++ ++static int crypto_info_open(struct inode *inode, struct file *file) ++{ ++ return seq_open(file, &crypto_seq_ops); ++} ++ ++static struct file_operations proc_crypto_ops = { ++ .open = crypto_info_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = seq_release ++}; ++ ++void __init crypto_init_proc(void) ++{ ++ struct proc_dir_entry *proc; ++ ++ proc = create_proc_entry("crypto", 0, NULL); ++ if (proc) ++ proc->proc_fops = &proc_crypto_ops; ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_BA.h +@@ -0,0 +1,69 @@ ++#ifndef _BATYPE_H_ ++#define _BATYPE_H_ ++ ++#define TOTAL_TXBA_NUM 16 ++#define TOTAL_RXBA_NUM 16 ++ ++#define BA_SETUP_TIMEOUT 200 ++#define BA_INACT_TIMEOUT 60000 ++ ++#define BA_POLICY_DELAYED 0 ++#define BA_POLICY_IMMEDIATE 1 ++ ++#define ADDBA_STATUS_SUCCESS 0 ++#define ADDBA_STATUS_REFUSED 37 ++#define ADDBA_STATUS_INVALID_PARAM 38 ++ ++#define DELBA_REASON_QSTA_LEAVING 36 ++#define DELBA_REASON_END_BA 37 ++#define DELBA_REASON_UNKNOWN_BA 38 ++#define DELBA_REASON_TIMEOUT 39 ++/* whether need define BA Action frames here? ++struct ieee80211_ADDBA_Req{ ++ struct ieee80211_header_data header; ++ u8 category; ++ u8 ++} __attribute__ ((packed)); ++*/ ++//Is this need?I put here just to make it easier to define structure BA_RECORD //WB ++typedef union _SEQUENCE_CONTROL{ ++ u16 ShortData; ++ struct ++ { ++ u16 FragNum:4; ++ u16 SeqNum:12; ++ }field; ++}SEQUENCE_CONTROL, *PSEQUENCE_CONTROL; ++ ++typedef union _BA_PARAM_SET { ++ u8 charData[2]; ++ u16 shortData; ++ struct { ++ u16 AMSDU_Support:1; ++ u16 BAPolicy:1; ++ u16 TID:4; ++ u16 BufferSize:10; ++ } field; ++} BA_PARAM_SET, *PBA_PARAM_SET; ++ ++typedef union _DELBA_PARAM_SET { ++ u8 charData[2]; ++ u16 shortData; ++ struct { ++ u16 Reserved:11; ++ u16 Initiator:1; ++ u16 TID:4; ++ } field; ++} DELBA_PARAM_SET, *PDELBA_PARAM_SET; ++ ++typedef struct _BA_RECORD { ++ struct timer_list Timer; ++ u8 bValid; ++ u8 DialogToken; ++ BA_PARAM_SET BaParamSet; ++ u16 BaTimeoutValue; ++ SEQUENCE_CONTROL BaStartSeqCtrl; ++} BA_RECORD, *PBA_RECORD; ++ ++#endif //end _BATYPE_H_ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c +@@ -0,0 +1,779 @@ ++/******************************************************************************************************************************** ++ * This file is created to process BA Action Frame. According to 802.11 spec, there are 3 BA action types at all. And as BA is ++ * related to TS, this part need some struture defined in QOS side code. Also TX RX is going to be resturctured, so how to send ++ * ADDBAREQ ADDBARSP and DELBA packet is still on consideration. Temporarily use MANAGE QUEUE instead of Normal Queue. ++ * WB 2008-05-27 ++ * *****************************************************************************************************************************/ ++#include "ieee80211.h" ++#include "rtl819x_BA.h" ++ ++/******************************************************************************************************************** ++ *function: Activate BA entry. And if Time is nozero, start timer. ++ * input: PBA_RECORD pBA //BA entry to be enabled ++ * u16 Time //indicate time delay. ++ * output: none ++********************************************************************************************************************/ ++void ActivateBAEntry(struct ieee80211_device* ieee, PBA_RECORD pBA, u16 Time) ++{ ++ pBA->bValid = true; ++ if(Time != 0) ++ mod_timer(&pBA->Timer, jiffies + MSECS(Time)); ++} ++ ++/******************************************************************************************************************** ++ *function: deactivate BA entry, including its timer. ++ * input: PBA_RECORD pBA //BA entry to be disabled ++ * output: none ++********************************************************************************************************************/ ++void DeActivateBAEntry( struct ieee80211_device* ieee, PBA_RECORD pBA) ++{ ++ pBA->bValid = false; ++ del_timer_sync(&pBA->Timer); ++} ++/******************************************************************************************************************** ++ *function: deactivete BA entry in Tx Ts, and send DELBA. ++ * input: ++ * PTX_TS_RECORD pTxTs //Tx Ts which is to deactivate BA entry. ++ * output: none ++ * notice: As PTX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME ++********************************************************************************************************************/ ++u8 TxTsDeleteBA( struct ieee80211_device* ieee, PTX_TS_RECORD pTxTs) ++{ ++ PBA_RECORD pAdmittedBa = &pTxTs->TxAdmittedBARecord; //These two BA entries must exist in TS structure ++ PBA_RECORD pPendingBa = &pTxTs->TxPendingBARecord; ++ u8 bSendDELBA = false; ++ ++ // Delete pending BA ++ if(pPendingBa->bValid) ++ { ++ DeActivateBAEntry(ieee, pPendingBa); ++ bSendDELBA = true; ++ } ++ ++ // Delete admitted BA ++ if(pAdmittedBa->bValid) ++ { ++ DeActivateBAEntry(ieee, pAdmittedBa); ++ bSendDELBA = true; ++ } ++ ++ return bSendDELBA; ++} ++ ++/******************************************************************************************************************** ++ *function: deactivete BA entry in Tx Ts, and send DELBA. ++ * input: ++ * PRX_TS_RECORD pRxTs //Rx Ts which is to deactivate BA entry. ++ * output: none ++ * notice: As PRX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME, same with above ++********************************************************************************************************************/ ++u8 RxTsDeleteBA( struct ieee80211_device* ieee, PRX_TS_RECORD pRxTs) ++{ ++ PBA_RECORD pBa = &pRxTs->RxAdmittedBARecord; ++ u8 bSendDELBA = false; ++ ++ if(pBa->bValid) ++ { ++ DeActivateBAEntry(ieee, pBa); ++ bSendDELBA = true; ++ } ++ ++ return bSendDELBA; ++} ++ ++/******************************************************************************************************************** ++ *function: reset BA entry ++ * input: ++ * PBA_RECORD pBA //entry to be reset ++ * output: none ++********************************************************************************************************************/ ++void ResetBaEntry( PBA_RECORD pBA) ++{ ++ pBA->bValid = false; ++ pBA->BaParamSet.shortData = 0; ++ pBA->BaTimeoutValue = 0; ++ pBA->DialogToken = 0; ++ pBA->BaStartSeqCtrl.ShortData = 0; ++} ++//These functions need porting here or not? ++/******************************************************************************************************************************* ++ *function: construct ADDBAREQ and ADDBARSP frame here together. ++ * input: u8* Dst //ADDBA frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA. ++ * u16 StatusCode //status code in RSP and I will use it to indicate whether it's RSP or REQ(will I?) ++ * u8 type //indicate whether it's RSP(ACT_ADDBARSP) ow REQ(ACT_ADDBAREQ) ++ * output: none ++ * return: sk_buff* skb //return constructed skb to xmit ++*******************************************************************************************************************************/ ++static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, PBA_RECORD pBA, u16 StatusCode, u8 type) ++{ ++ struct sk_buff *skb = NULL; ++ struct ieee80211_hdr_3addr* BAReq = NULL; ++ u8* tag = NULL; ++ u16 tmp = 0; ++ u16 len = ieee->tx_headroom + 9; ++ //category(1) + action field(1) + Dialog Token(1) + BA Parameter Set(2) + BA Timeout Value(2) + BA Start SeqCtrl(2)(or StatusCode(2)) ++ IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, "========>%s(), frame(%d) sentd to:"MAC_FMT", ieee->dev:%p\n", __FUNCTION__, type, MAC_ARG(Dst), ieee->dev); ++ if (pBA == NULL||ieee == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "pBA(%p) is NULL or ieee(%p) is NULL\n", pBA, ieee); ++ return NULL; ++ } ++ skb = dev_alloc_skb(len + sizeof( struct ieee80211_hdr_3addr)); //need to add something others? FIXME ++ if (skb == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); ++ return NULL; ++ } ++ ++ memset(skb->data, 0, sizeof( struct ieee80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb. ++ skb_reserve(skb, ieee->tx_headroom); ++ ++ BAReq = ( struct ieee80211_hdr_3addr *) skb_put(skb,sizeof( struct ieee80211_hdr_3addr)); ++ ++ memcpy(BAReq->addr1, Dst, ETH_ALEN); ++ memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN); ++ ++ memcpy(BAReq->addr3, ieee->current_network.bssid, ETH_ALEN); ++ ++ BAReq->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame ++ ++ //tag += sizeof( struct ieee80211_hdr_3addr); //move to action field ++ tag = (u8*)skb_put(skb, 9); ++ *tag ++= ACT_CAT_BA; ++ *tag ++= type; ++ // Dialog Token ++ *tag ++= pBA->DialogToken; ++ ++ if (ACT_ADDBARSP == type) ++ { ++ // Status Code ++ printk("=====>to send ADDBARSP\n"); ++ tmp = cpu_to_le16(StatusCode); ++ memcpy(tag, (u8*)&tmp, 2); ++ tag += 2; ++ } ++ // BA Parameter Set ++ tmp = cpu_to_le16(pBA->BaParamSet.shortData); ++ memcpy(tag, (u8*)&tmp, 2); ++ tag += 2; ++ // BA Timeout Value ++ tmp = cpu_to_le16(pBA->BaTimeoutValue); ++ memcpy(tag, (u8*)&tmp, 2); ++ tag += 2; ++ ++ if (ACT_ADDBAREQ == type) ++ { ++ // BA Start SeqCtrl ++ memcpy(tag,(u8*)&(pBA->BaStartSeqCtrl), 2); ++ tag += 2; ++ } ++ ++ IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); ++ return skb; ++ //return NULL; ++} ++ ++#if 0 //I try to merge ADDBA_REQ and ADDBA_RSP frames together.. ++/******************************************************************************************************************** ++ *function: construct ADDBAREQ frame ++ * input: u8* dst //ADDBARsp frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA_RSP. ++ * u16 StatusCode //status code. ++ * output: none ++ * return: sk_buff* skb //return constructed skb to xmit ++********************************************************************************************************************/ ++static struct sk_buff* ieee80211_ADDBA_Rsp( IN struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode) ++{ ++ OCTET_STRING osADDBAFrame, tmp; ++ ++ FillOctetString(osADDBAFrame, Buffer, 0); ++ *pLength = 0; ++ ++ ConstructMaFrameHdr( ++ Adapter, ++ Addr, ++ ACT_CAT_BA, ++ ACT_ADDBARSP, ++ &osADDBAFrame ); ++ ++ // Dialog Token ++ FillOctetString(tmp, &pBA->DialogToken, 1); ++ PacketAppendData(&osADDBAFrame, tmp); ++ ++ // Status Code ++ FillOctetString(tmp, &StatusCode, 2); ++ PacketAppendData(&osADDBAFrame, tmp); ++ ++ // BA Parameter Set ++ FillOctetString(tmp, &pBA->BaParamSet, 2); ++ PacketAppendData(&osADDBAFrame, tmp); ++ ++ // BA Timeout Value ++ FillOctetString(tmp, &pBA->BaTimeoutValue, 2); ++ PacketAppendData(&osADDBAFrame, tmp); ++ ++ *pLength = osADDBAFrame.Length; ++} ++#endif ++ ++/******************************************************************************************************************** ++ *function: construct DELBA frame ++ * input: u8* dst //DELBA frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA ++ * TR_SELECT TxRxSelect //TX RX direction ++ * u16 ReasonCode //status code. ++ * output: none ++ * return: sk_buff* skb //return constructed skb to xmit ++********************************************************************************************************************/ ++static struct sk_buff* ieee80211_DELBA( ++ struct ieee80211_device* ieee, ++ u8* dst, ++ PBA_RECORD pBA, ++ TR_SELECT TxRxSelect, ++ u16 ReasonCode ++ ) ++{ ++ DELBA_PARAM_SET DelbaParamSet; ++ struct sk_buff *skb = NULL; ++ struct ieee80211_hdr_3addr* Delba = NULL; ++ u8* tag = NULL; ++ u16 tmp = 0; ++ //len = head len + DELBA Parameter Set(2) + Reason Code(2) ++ u16 len = 6 + ieee->tx_headroom; ++ ++ if (net_ratelimit()) ++ IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, "========>%s(), ReasonCode(%d) sentd to:"MAC_FMT"\n", __FUNCTION__, ReasonCode, MAC_ARG(dst)); ++ ++ memset(&DelbaParamSet, 0, 2); ++ ++ DelbaParamSet.field.Initiator = (TxRxSelect==TX_DIR)?1:0; ++ DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; ++ ++ skb = dev_alloc_skb(len + sizeof( struct ieee80211_hdr_3addr)); //need to add something others? FIXME ++ if (skb == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); ++ return NULL; ++ } ++// memset(skb->data, 0, len+sizeof( struct ieee80211_hdr_3addr)); ++ skb_reserve(skb, ieee->tx_headroom); ++ ++ Delba = ( struct ieee80211_hdr_3addr *) skb_put(skb,sizeof( struct ieee80211_hdr_3addr)); ++ ++ memcpy(Delba->addr1, dst, ETH_ALEN); ++ memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN); ++ memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN); ++ Delba->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame ++ ++ tag = (u8*)skb_put(skb, 6); ++ ++ *tag ++= ACT_CAT_BA; ++ *tag ++= ACT_DELBA; ++ ++ // DELBA Parameter Set ++ tmp = cpu_to_le16(DelbaParamSet.shortData); ++ memcpy(tag, (u8*)&tmp, 2); ++ tag += 2; ++ // Reason Code ++ tmp = cpu_to_le16(ReasonCode); ++ memcpy(tag, (u8*)&tmp, 2); ++ tag += 2; ++ ++ IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); ++ if (net_ratelimit()) ++ IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, "<=====%s()\n", __FUNCTION__); ++ return skb; ++} ++ ++/******************************************************************************************************************** ++ *function: send ADDBAReq frame out ++ * input: u8* dst //ADDBAReq frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA ++ * output: none ++ * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ++********************************************************************************************************************/ ++void ieee80211_send_ADDBAReq(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA) ++{ ++ struct sk_buff *skb = NULL; ++ skb = ieee80211_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); //construct ACT_ADDBAREQ frames so set statuscode zero. ++ ++ if (skb) ++ { ++ softmac_mgmt_xmit(skb, ieee); ++ //add statistic needed here. ++ //and skb will be freed in softmac_mgmt_xmit(), so omit all dev_kfree_skb_any() outside softmac_mgmt_xmit() ++ //WB ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__); ++ } ++ return; ++} ++ ++/******************************************************************************************************************** ++ *function: send ADDBARSP frame out ++ * input: u8* dst //DELBA frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA ++ * u16 StatusCode //RSP StatusCode ++ * output: none ++ * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ++********************************************************************************************************************/ ++void ieee80211_send_ADDBARsp(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode) ++{ ++ struct sk_buff *skb = NULL; ++ skb = ieee80211_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); //construct ACT_ADDBARSP frames ++ if (skb) ++ { ++ softmac_mgmt_xmit(skb, ieee); ++ //same above ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__); ++ } ++ ++ return; ++ ++} ++/******************************************************************************************************************** ++ *function: send ADDBARSP frame out ++ * input: u8* dst //DELBA frame's destination ++ * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA ++ * TR_SELECT TxRxSelect //TX or RX ++ * u16 ReasonCode //DEL ReasonCode ++ * output: none ++ * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ++********************************************************************************************************************/ ++ ++void ieee80211_send_DELBA(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, TR_SELECT TxRxSelect, u16 ReasonCode) ++{ ++ struct sk_buff *skb = NULL; ++ skb = ieee80211_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); //construct ACT_ADDBARSP frames ++ if (skb) ++ { ++ softmac_mgmt_xmit(skb, ieee); ++ //same above ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__); ++ } ++ return ; ++} ++ ++/******************************************************************************************************************** ++ *function: RX ADDBAReq ++ * input: struct sk_buff * skb //incoming ADDBAReq skb. ++ * return: 0(pass), other(fail) ++ * notice: As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support. ++********************************************************************************************************************/ ++int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb) ++{ ++ struct ieee80211_hdr_3addr* req = NULL; ++ u16 rc = 0; ++ u8 * dst = NULL, *pDialogToken = NULL, *tag = NULL; ++ PBA_RECORD pBA = NULL; ++ PBA_PARAM_SET pBaParamSet = NULL; ++ u16* pBaTimeoutVal = NULL; ++ PSEQUENCE_CONTROL pBaStartSeqCtrl = NULL; ++ PRX_TS_RECORD pTS = NULL; ++ ++ if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BAREQ(%d / %d)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); ++ return -1; ++ } ++ ++ IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); ++ ++ req = ( struct ieee80211_hdr_3addr*) skb->data; ++ tag = (u8*)req; ++ dst = (u8*)(&req->addr2[0]); ++ tag += sizeof( struct ieee80211_hdr_3addr); ++ pDialogToken = tag + 2; //category+action ++ pBaParamSet = (PBA_PARAM_SET)(tag + 3); //+DialogToken ++ pBaTimeoutVal = (u16*)(tag + 5); ++ pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7); ++ ++ printk("====================>rx ADDBAREQ from :"MAC_FMT"\n", MAC_ARG(dst)); ++//some other capability is not ready now. ++ if( (ieee->current_network.qos_data.active == 0) || ++ (ieee->pHTInfo->bCurrentHTSupport == false)) //|| ++ // (ieee->pStaQos->bEnableRxImmBA == false) ) ++ { ++ rc = ADDBA_STATUS_REFUSED; ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport); ++ goto OnADDBAReq_Fail; ++ } ++ // Search for related traffic stream. ++ // If there is no matched TS, reject the ADDBA request. ++ if( !GetTs( ++ ieee, ++ (PTS_COMMON_INFO*)(&pTS), ++ dst, ++ (u8)(pBaParamSet->field.TID), ++ RX_DIR, ++ true) ) ++ { ++ rc = ADDBA_STATUS_REFUSED; ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't get TS in %s()\n", __FUNCTION__); ++ goto OnADDBAReq_Fail; ++ } ++ pBA = &pTS->RxAdmittedBARecord; ++ // To Determine the ADDBA Req content ++ // We can do much more check here, including BufferSize, AMSDU_Support, Policy, StartSeqCtrl... ++ // I want to check StartSeqCtrl to make sure when we start aggregation!!! ++ // ++ if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) ++ { ++ rc = ADDBA_STATUS_INVALID_PARAM; ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "BA Policy is not correct in %s()\n", __FUNCTION__); ++ goto OnADDBAReq_Fail; ++ } ++ // Admit the ADDBA Request ++ // ++ DeActivateBAEntry(ieee, pBA); ++ pBA->DialogToken = *pDialogToken; ++ pBA->BaParamSet = *pBaParamSet; ++ pBA->BaTimeoutValue = *pBaTimeoutVal; ++ pBA->BaStartSeqCtrl = *pBaStartSeqCtrl; ++ //for half N mode we only aggregate 1 frame ++ if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) ++ pBA->BaParamSet.field.BufferSize = 1; ++ else ++ pBA->BaParamSet.field.BufferSize = 32; ++ ActivateBAEntry(ieee, pBA, pBA->BaTimeoutValue); ++ ieee80211_send_ADDBARsp(ieee, dst, pBA, ADDBA_STATUS_SUCCESS); ++ ++ // End of procedure. ++ return 0; ++ ++OnADDBAReq_Fail: ++ { ++ BA_RECORD BA; ++ BA.BaParamSet = *pBaParamSet; ++ BA.BaTimeoutValue = *pBaTimeoutVal; ++ BA.DialogToken = *pDialogToken; ++ BA.BaParamSet.field.BAPolicy = BA_POLICY_IMMEDIATE; ++ ieee80211_send_ADDBARsp(ieee, dst, &BA, rc); ++ return 0; //we send RSP out. ++ } ++ ++} ++ ++/******************************************************************************************************************** ++ *function: RX ADDBARSP ++ * input: struct sk_buff * skb //incoming ADDBAReq skb. ++ * return: 0(pass), other(fail) ++ * notice: As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support. ++********************************************************************************************************************/ ++int ieee80211_rx_ADDBARsp( struct ieee80211_device* ieee, struct sk_buff *skb) ++{ ++ struct ieee80211_hdr_3addr* rsp = NULL; ++ PBA_RECORD pPendingBA, pAdmittedBA; ++ PTX_TS_RECORD pTS = NULL; ++ u8* dst = NULL, *pDialogToken = NULL, *tag = NULL; ++ u16* pStatusCode = NULL, *pBaTimeoutVal = NULL; ++ PBA_PARAM_SET pBaParamSet = NULL; ++ u16 ReasonCode; ++ ++ if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BARSP(%d / %d)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); ++ return -1; ++ } ++ rsp = ( struct ieee80211_hdr_3addr*)skb->data; ++ tag = (u8*)rsp; ++ dst = (u8*)(&rsp->addr2[0]); ++ tag += sizeof( struct ieee80211_hdr_3addr); ++ pDialogToken = tag + 2; ++ pStatusCode = (u16*)(tag + 3); ++ pBaParamSet = (PBA_PARAM_SET)(tag + 5); ++ pBaTimeoutVal = (u16*)(tag + 7); ++ ++ // Check the capability ++ // Since we can always receive A-MPDU, we just check if it is under HT mode. ++ if( ieee->current_network.qos_data.active == 0 || ++ ieee->pHTInfo->bCurrentHTSupport == false || ++ ieee->pHTInfo->bCurrentAMPDUEnable == false ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bCurrentAMPDUEnable); ++ ReasonCode = DELBA_REASON_UNKNOWN_BA; ++ goto OnADDBARsp_Reject; ++ } ++ ++ ++ // ++ // Search for related TS. ++ // If there is no TS found, we wil reject ADDBA Rsp by sending DELBA frame. ++ // ++ if (!GetTs( ++ ieee, ++ (PTS_COMMON_INFO*)(&pTS), ++ dst, ++ (u8)(pBaParamSet->field.TID), ++ TX_DIR, ++ false) ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't get TS in %s()\n", __FUNCTION__); ++ ReasonCode = DELBA_REASON_UNKNOWN_BA; ++ goto OnADDBARsp_Reject; ++ } ++ ++ pTS->bAddBaReqInProgress = false; ++ pPendingBA = &pTS->TxPendingBARecord; ++ pAdmittedBA = &pTS->TxAdmittedBARecord; ++ ++ ++ // ++ // Check if related BA is waiting for setup. ++ // If not, reject by sending DELBA frame. ++ // ++ if((pAdmittedBA->bValid==true)) ++ { ++ // Since BA is already setup, we ignore all other ADDBA Response. ++ IEEE80211_DEBUG(IEEE80211_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it! \n"); ++ return -1; ++ } ++ else if((pPendingBA->bValid == false) ||(*pDialogToken != pPendingBA->DialogToken)) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA! \n"); ++ ReasonCode = DELBA_REASON_UNKNOWN_BA; ++ goto OnADDBARsp_Reject; ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", *pStatusCode); ++ DeActivateBAEntry(ieee, pPendingBA); ++ } ++ ++ ++ if(*pStatusCode == ADDBA_STATUS_SUCCESS) ++ { ++ // ++ // Determine ADDBA Rsp content here. ++ // We can compare the value of BA parameter set that Peer returned and Self sent. ++ // If it is OK, then admitted. Or we can send DELBA to cancel BA mechanism. ++ // ++ if(pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) ++ { ++ // Since this is a kind of ADDBA failed, we delay next ADDBA process. ++ pTS->bAddBaReqDelayed = true; ++ DeActivateBAEntry(ieee, pAdmittedBA); ++ ReasonCode = DELBA_REASON_END_BA; ++ goto OnADDBARsp_Reject; ++ } ++ ++ ++ // ++ // Admitted condition ++ // ++ pAdmittedBA->DialogToken = *pDialogToken; ++ pAdmittedBA->BaTimeoutValue = *pBaTimeoutVal; ++ pAdmittedBA->BaStartSeqCtrl = pPendingBA->BaStartSeqCtrl; ++ pAdmittedBA->BaParamSet = *pBaParamSet; ++ DeActivateBAEntry(ieee, pAdmittedBA); ++ ActivateBAEntry(ieee, pAdmittedBA, *pBaTimeoutVal); ++ } ++ else ++ { ++ // Delay next ADDBA process. ++ pTS->bAddBaReqDelayed = true; ++ } ++ ++ // End of procedure ++ return 0; ++ ++OnADDBARsp_Reject: ++ { ++ BA_RECORD BA; ++ BA.BaParamSet = *pBaParamSet; ++ ieee80211_send_DELBA(ieee, dst, &BA, TX_DIR, ReasonCode); ++ return 0; ++ } ++ ++} ++ ++/******************************************************************************************************************** ++ *function: RX DELBA ++ * input: struct sk_buff * skb //incoming ADDBAReq skb. ++ * return: 0(pass), other(fail) ++ * notice: As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support. ++********************************************************************************************************************/ ++int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb) ++{ ++ struct ieee80211_hdr_3addr* delba = NULL; ++ PDELBA_PARAM_SET pDelBaParamSet = NULL; ++ u16* pReasonCode = NULL; ++ u8* dst = NULL; ++ ++ if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 6) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in DELBA(%d / %d)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 6)); ++ return -1; ++ } ++ ++ if(ieee->current_network.qos_data.active == 0 || ++ ieee->pHTInfo->bCurrentHTSupport == false ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "received DELBA while QOS or HT is not supported(%d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport); ++ return -1; ++ } ++ ++ IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); ++ delba = ( struct ieee80211_hdr_3addr*)skb->data; ++ dst = (u8*)(&delba->addr2[0]); ++ delba += sizeof( struct ieee80211_hdr_3addr); ++ pDelBaParamSet = (PDELBA_PARAM_SET)(delba+2); ++ pReasonCode = (u16*)(delba+4); ++ ++ if(pDelBaParamSet->field.Initiator == 1) ++ { ++ PRX_TS_RECORD pRxTs; ++ ++ if( !GetTs( ++ ieee, ++ (PTS_COMMON_INFO*)&pRxTs, ++ dst, ++ (u8)pDelBaParamSet->field.TID, ++ RX_DIR, ++ false) ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't get TS for RXTS in %s()\n", __FUNCTION__); ++ return -1; ++ } ++ ++ RxTsDeleteBA(ieee, pRxTs); ++ } ++ else ++ { ++ PTX_TS_RECORD pTxTs; ++ ++ if(!GetTs( ++ ieee, ++ (PTS_COMMON_INFO*)&pTxTs, ++ dst, ++ (u8)pDelBaParamSet->field.TID, ++ TX_DIR, ++ false) ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't get TS for TXTS in %s()\n", __FUNCTION__); ++ return -1; ++ } ++ ++ pTxTs->bUsingBa = false; ++ pTxTs->bAddBaReqInProgress = false; ++ pTxTs->bAddBaReqDelayed = false; ++ del_timer_sync(&pTxTs->TsAddBaTimer); ++ //PlatformCancelTimer(Adapter, &pTxTs->TsAddBaTimer); ++ TxTsDeleteBA(ieee, pTxTs); ++ } ++ return 0; ++} ++ ++// ++// ADDBA initiate. This can only be called by TX side. ++// ++void ++TsInitAddBA( ++ struct ieee80211_device* ieee, ++ PTX_TS_RECORD pTS, ++ u8 Policy, ++ u8 bOverwritePending ++ ) ++{ ++ PBA_RECORD pBA = &pTS->TxPendingBARecord; ++ ++ if(pBA->bValid==true && bOverwritePending==false) ++ return; ++ ++ // Set parameters to "Pending" variable set ++ DeActivateBAEntry(ieee, pBA); ++ ++ pBA->DialogToken++; // DialogToken: Only keep the latest dialog token ++ pBA->BaParamSet.field.AMSDU_Support = 0; // Do not support A-MSDU with A-MPDU now!! ++ pBA->BaParamSet.field.BAPolicy = Policy; // Policy: Delayed or Immediate ++ pBA->BaParamSet.field.TID = pTS->TsCommonInfo.TSpec.f.TSInfo.field.ucTSID; // TID ++ // BufferSize: This need to be set according to A-MPDU vector ++ pBA->BaParamSet.field.BufferSize = 32; // BufferSize: This need to be set according to A-MPDU vector ++ pBA->BaTimeoutValue = 0; // Timeout value: Set 0 to disable Timer ++ pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096; // Block Ack will start after 3 packets later. ++ ++ ActivateBAEntry(ieee, pBA, BA_SETUP_TIMEOUT); ++ ++ ieee80211_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA); ++} ++ ++void ++TsInitDelBA( struct ieee80211_device* ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect) ++{ ++ ++ if(TxRxSelect == TX_DIR) ++ { ++ PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)pTsCommonInfo; ++ ++ if(TxTsDeleteBA(ieee, pTxTs)) ++ ieee80211_send_DELBA( ++ ieee, ++ pTsCommonInfo->Addr, ++ (pTxTs->TxAdmittedBARecord.bValid)?(&pTxTs->TxAdmittedBARecord):(&pTxTs->TxPendingBARecord), ++ TxRxSelect, ++ DELBA_REASON_END_BA); ++ } ++ else if(TxRxSelect == RX_DIR) ++ { ++ PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)pTsCommonInfo; ++ if(RxTsDeleteBA(ieee, pRxTs)) ++ ieee80211_send_DELBA( ++ ieee, ++ pTsCommonInfo->Addr, ++ &pRxTs->RxAdmittedBARecord, ++ TxRxSelect, ++ DELBA_REASON_END_BA ); ++ } ++} ++/******************************************************************************************************************** ++ *function: BA setup timer ++ * input: unsigned long data //acturally we send TX_TS_RECORD or RX_TS_RECORD to these timer ++ * return: NULL ++ * notice: ++********************************************************************************************************************/ ++void BaSetupTimeOut(unsigned long data) ++{ ++ PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; ++ ++ pTxTs->bAddBaReqInProgress = false; ++ pTxTs->bAddBaReqDelayed = true; ++ pTxTs->TxPendingBARecord.bValid = false; ++} ++ ++void TxBaInactTimeout(unsigned long data) ++{ ++ PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; ++ struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[pTxTs->num]); ++ TxTsDeleteBA(ieee, pTxTs); ++ ieee80211_send_DELBA( ++ ieee, ++ pTxTs->TsCommonInfo.Addr, ++ &pTxTs->TxAdmittedBARecord, ++ TX_DIR, ++ DELBA_REASON_TIMEOUT); ++} ++ ++void RxBaInactTimeout(unsigned long data) ++{ ++ PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; ++ struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); ++ ++ RxTsDeleteBA(ieee, pRxTs); ++ ieee80211_send_DELBA( ++ ieee, ++ pRxTs->TsCommonInfo.Addr, ++ &pRxTs->RxAdmittedBARecord, ++ RX_DIR, ++ DELBA_REASON_TIMEOUT); ++ return ; ++} ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_HT.h +@@ -0,0 +1,481 @@ ++#ifndef _RTL819XU_HTTYPE_H_ ++#define _RTL819XU_HTTYPE_H_ ++ ++//------------------------------------------------------------ ++// The HT Capability element is present in beacons, association request, ++// reassociation request and probe response frames ++//------------------------------------------------------------ ++ ++// ++// Operation mode value ++// ++#define HT_OPMODE_NO_PROTECT 0 ++#define HT_OPMODE_OPTIONAL 1 ++#define HT_OPMODE_40MHZ_PROTECT 2 ++#define HT_OPMODE_MIXED 3 ++ ++// ++// MIMO Power Save Setings ++// ++#define MIMO_PS_STATIC 0 ++#define MIMO_PS_DYNAMIC 1 ++#define MIMO_PS_NOLIMIT 3 ++ ++ ++// ++// There should be 128 bits to cover all of the MCS rates. However, since ++// 8190 does not support too much rates, one integer is quite enough. ++// ++ ++#define sHTCLng 4 ++ ++ ++#define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff ++#define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00 ++#define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP ++ ++ ++typedef enum _HT_MCS_RATE{ ++ HT_MCS0 = 0x00000001, ++ HT_MCS1 = 0x00000002, ++ HT_MCS2 = 0x00000004, ++ HT_MCS3 = 0x00000008, ++ HT_MCS4 = 0x00000010, ++ HT_MCS5 = 0x00000020, ++ HT_MCS6 = 0x00000040, ++ HT_MCS7 = 0x00000080, ++ HT_MCS8 = 0x00000100, ++ HT_MCS9 = 0x00000200, ++ HT_MCS10 = 0x00000400, ++ HT_MCS11 = 0x00000800, ++ HT_MCS12 = 0x00001000, ++ HT_MCS13 = 0x00002000, ++ HT_MCS14 = 0x00004000, ++ HT_MCS15 = 0x00008000, ++ // Do not define MCS32 here although 8190 support MCS32 ++}HT_MCS_RATE,*PHT_MCS_RATE; ++ ++// ++// Represent Channel Width in HT Capabilities ++// ++typedef enum _HT_CHANNEL_WIDTH{ ++ HT_CHANNEL_WIDTH_20 = 0, ++ HT_CHANNEL_WIDTH_20_40 = 1, ++}HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH; ++ ++// ++// Represent Extention Channel Offset in HT Capabilities ++// This is available only in 40Mhz mode. ++// ++typedef enum _HT_EXTCHNL_OFFSET{ ++ HT_EXTCHNL_OFFSET_NO_EXT = 0, ++ HT_EXTCHNL_OFFSET_UPPER = 1, ++ HT_EXTCHNL_OFFSET_NO_DEF = 2, ++ HT_EXTCHNL_OFFSET_LOWER = 3, ++}HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET; ++ ++typedef enum _CHNLOP{ ++ CHNLOP_NONE = 0, // No Action now ++ CHNLOP_SCAN = 1, // Scan in progress ++ CHNLOP_SWBW = 2, // Bandwidth switching in progress ++ CHNLOP_SWCHNL = 3, // Software Channel switching in progress ++} CHNLOP, *PCHNLOP; ++ ++// Determine if the Channel Operation is in progress ++#define CHHLOP_IN_PROGRESS(_pHTInfo) \ ++ ((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE ++ ++/* ++typedef union _HT_CAPABILITY{ ++ u16 ShortData; ++ u8 CharData[2]; ++ struct ++ { ++ u16 AdvCoding:1; ++ u16 ChlWidth:1; ++ u16 MimoPwrSave:2; ++ u16 GreenField:1; ++ u16 ShortGI20Mhz:1; ++ u16 ShortGI40Mhz:1; ++ u16 STBC:1; ++ u16 BeamForm:1; ++ u16 DelayBA:1; ++ u16 MaxAMSDUSize:1; ++ u16 DssCCk:1; ++ u16 PSMP:1; ++ u16 Rsvd:3; ++ }Field; ++}HT_CAPABILITY, *PHT_CAPABILITY; ++ ++typedef union _HT_CAPABILITY_MACPARA{ ++ u8 ShortData; ++ u8 CharData[1]; ++ struct ++ { ++ u8 MaxRxAMPDU:2; ++ u8 MPDUDensity:2; ++ u8 Rsvd:4; ++ }Field; ++}HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA; ++*/ ++ ++typedef enum _HT_ACTION{ ++ ACT_RECOMMAND_WIDTH = 0, ++ ACT_MIMO_PWR_SAVE = 1, ++ ACT_PSMP = 2, ++ ACT_SET_PCO_PHASE = 3, ++ ACT_MIMO_CHL_MEASURE = 4, ++ ACT_RECIPROCITY_CORRECT = 5, ++ ACT_MIMO_CSI_MATRICS = 6, ++ ACT_MIMO_NOCOMPR_STEER = 7, ++ ACT_MIMO_COMPR_STEER = 8, ++ ACT_ANTENNA_SELECT = 9, ++} HT_ACTION, *PHT_ACTION; ++ ++ ++/* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */ ++typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{ ++ SC_MODE_DUPLICATE = 0, ++ SC_MODE_LOWER = 1, ++ SC_MODE_UPPER = 2, ++ SC_MODE_FULL40MHZ = 3, ++}HT_BW40_SC_E; ++ ++typedef struct _HT_CAPABILITY_ELE{ ++ ++ //HT capability info ++ u8 AdvCoding:1; ++ u8 ChlWidth:1; ++ u8 MimoPwrSave:2; ++ u8 GreenField:1; ++ u8 ShortGI20Mhz:1; ++ u8 ShortGI40Mhz:1; ++ u8 TxSTBC:1; ++ u8 RxSTBC:2; ++ u8 DelayBA:1; ++ u8 MaxAMSDUSize:1; ++ u8 DssCCk:1; ++ u8 PSMP:1; ++ u8 Rsvd1:1; ++ u8 LSigTxopProtect:1; ++ ++ //MAC HT parameters info ++ u8 MaxRxAMPDUFactor:2; ++ u8 MPDUDensity:3; ++ u8 Rsvd2:3; ++ ++ //Supported MCS set ++ u8 MCS[16]; ++ ++ ++ //Extended HT Capability Info ++ u16 ExtHTCapInfo; ++ ++ //TXBF Capabilities ++ u8 TxBFCap[4]; ++ ++ //Antenna Selection Capabilities ++ u8 ASCap; ++ ++} __attribute__ ((packed)) HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE; ++ ++//------------------------------------------------------------ ++// The HT Information element is present in beacons ++// Only AP is required to include this element ++//------------------------------------------------------------ ++ ++typedef struct _HT_INFORMATION_ELE{ ++ u8 ControlChl; ++ ++ u8 ExtChlOffset:2; ++ u8 RecommemdedTxWidth:1; ++ u8 RIFS:1; ++ u8 PSMPAccessOnly:1; ++ u8 SrvIntGranularity:3; ++ ++ u8 OptMode:2; ++ u8 NonGFDevPresent:1; ++ u8 Revd1:5; ++ u8 Revd2:8; ++ ++ u8 Rsvd3:6; ++ u8 DualBeacon:1; ++ u8 DualCTSProtect:1; ++ ++ u8 SecondaryBeacon:1; ++ u8 LSigTxopProtectFull:1; ++ u8 PcoActive:1; ++ u8 PcoPhase:1; ++ u8 Rsvd4:4; ++ ++ u8 BasicMSC[16]; ++} __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE; ++ ++// ++// MIMO Power Save control field. ++// This is appear in MIMO Power Save Action Frame ++// ++typedef struct _MIMOPS_CTRL{ ++ u8 MimoPsEnable:1; ++ u8 MimoPsMode:1; ++ u8 Reserved:6; ++} MIMOPS_CTRL, *PMIMOPS_CTRL; ++ ++typedef enum _HT_SPEC_VER{ ++ HT_SPEC_VER_IEEE = 0, ++ HT_SPEC_VER_EWC = 1, ++}HT_SPEC_VER, *PHT_SPEC_VER; ++ ++typedef enum _HT_AGGRE_MODE_E{ ++ HT_AGG_AUTO = 0, ++ HT_AGG_FORCE_ENABLE = 1, ++ HT_AGG_FORCE_DISABLE = 2, ++}HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E; ++ ++//------------------------------------------------------------ ++// The Data structure is used to keep HT related variables when card is ++// configured as non-AP STA mode. **Note** Current_xxx should be set ++// to default value in HTInitializeHTInfo() ++//------------------------------------------------------------ ++ ++typedef struct _RT_HIGH_THROUGHPUT{ ++ u8 bEnableHT; ++ u8 bCurrentHTSupport; ++ ++ u8 bRegBW40MHz; // Tx 40MHz channel capablity ++ u8 bCurBW40MHz; // Tx 40MHz channel capability ++ ++ u8 bRegShortGI40MHz; // Tx Short GI for 40Mhz ++ u8 bCurShortGI40MHz; // Tx Short GI for 40MHz ++ ++ u8 bRegShortGI20MHz; // Tx Short GI for 20MHz ++ u8 bCurShortGI20MHz; // Tx Short GI for 20MHz ++ ++ u8 bRegSuppCCK; // Tx CCK rate capability ++ u8 bCurSuppCCK; // Tx CCK rate capability ++ ++ // 802.11n spec version for "peer" ++ HT_SPEC_VER ePeerHTSpecVer; ++ ++ ++ // HT related information for "Self" ++ HT_CAPABILITY_ELE SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities. ++ HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities. ++ ++ // HT related information for "Peer" ++ u8 PeerHTCapBuf[32]; ++ u8 PeerHTInfoBuf[32]; ++ ++ ++ // A-MSDU related ++ u8 bAMSDU_Support; // This indicates Tx A-MSDU capability ++ u16 nAMSDU_MaxSize; // This indicates Tx A-MSDU capability ++ u8 bCurrent_AMSDU_Support; // This indicates Tx A-MSDU capability ++ u16 nCurrent_AMSDU_MaxSize; // This indicates Tx A-MSDU capability ++ ++ ++ // AMPDU related <2006.08.10 Emily> ++ u8 bAMPDUEnable; // This indicate Tx A-MPDU capability ++ u8 bCurrentAMPDUEnable; // This indicate Tx A-MPDU capability ++ u8 AMPDU_Factor; // This indicate Tx A-MPDU capability ++ u8 CurrentAMPDUFactor; // This indicate Tx A-MPDU capability ++ u8 MPDU_Density; // This indicate Tx A-MPDU capability ++ u8 CurrentMPDUDensity; // This indicate Tx A-MPDU capability ++ ++ // Forced A-MPDU enable ++ HT_AGGRE_MODE_E ForcedAMPDUMode; ++ u8 ForcedAMPDUFactor; ++ u8 ForcedMPDUDensity; ++ ++ // Forced A-MSDU enable ++ HT_AGGRE_MODE_E ForcedAMSDUMode; ++ u16 ForcedAMSDUMaxSize; ++ ++ u8 bForcedShortGI; ++ ++ u8 CurrentOpMode; ++ ++ // MIMO PS related ++ u8 SelfMimoPs; ++ u8 PeerMimoPs; ++ ++ // 40MHz Channel Offset settings. ++ HT_EXTCHNL_OFFSET CurSTAExtChnlOffset; ++ u8 bCurTxBW40MHz; // If we use 40 MHz to Tx ++ u8 PeerBandwidth; ++ ++ // For Bandwidth Switching ++ u8 bSwBwInProgress; ++ CHNLOP ChnlOp; // software switching channel in progress. By Bruce, 2008-02-15. ++ u8 SwBwStep; ++ //struct timer_list SwBwTimer; //moved to ieee80211_device. as timer_list need include some header file here. ++ ++ // For Realtek proprietary A-MPDU factor for aggregation ++ u8 bRegRT2RTAggregation; ++ u8 bCurrentRT2RTAggregation; ++ u8 bCurrentRT2RTLongSlotTime; ++ u8 szRT2RTAggBuffer[10]; ++ ++ // Rx Reorder control ++ u8 bRegRxReorderEnable; ++ u8 bCurRxReorderEnable; ++ u8 RxReorderWinSize; ++ u8 RxReorderPendingTime; ++ u16 RxReorderDropCounter; ++ ++#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ++ u8 UsbTxAggrNum; ++#endif ++#ifdef USB_RX_AGGREGATION_SUPPORT ++ u8 UsbRxFwAggrEn; ++ u8 UsbRxFwAggrPageNum; ++ u8 UsbRxFwAggrPacketNum; ++ u8 UsbRxFwAggrTimeout; ++#endif ++ ++ // Add for Broadcom(Linksys) IOT. Joseph ++ u8 bIsPeerBcm; ++ ++ // For IOT issue. ++ u8 IOTPeer; ++ u32 IOTAction; ++} __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT; ++ ++ ++//------------------------------------------------------------ ++// The Data structure is used to keep HT related variable for "each Sta" ++// when card is configured as "AP mode" ++//------------------------------------------------------------ ++ ++typedef struct _RT_HTINFO_STA_ENTRY{ ++ u8 bEnableHT; ++ ++ u8 bSupportCck; ++ ++ u16 AMSDU_MaxSize; ++ ++ u8 AMPDU_Factor; ++ u8 MPDU_Density; ++ ++ u8 HTHighestOperaRate; ++ ++ u8 bBw40MHz; ++ ++ u8 MimoPs; ++ ++ u8 McsRateSet[16]; ++ ++ ++}RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY; ++ ++ ++ ++ ++ ++//------------------------------------------------------------ ++// The Data structure is used to keep HT related variable for "each AP" ++// when card is configured as "STA mode" ++//------------------------------------------------------------ ++ ++typedef struct _BSS_HT{ ++ ++ u8 bdSupportHT; ++ ++ // HT related elements ++ u8 bdHTCapBuf[32]; ++ u16 bdHTCapLen; ++ u8 bdHTInfoBuf[32]; ++ u16 bdHTInfoLen; ++ ++ HT_SPEC_VER bdHTSpecVer; ++ //HT_CAPABILITY_ELE bdHTCapEle; ++ //HT_INFORMATION_ELE bdHTInfoEle; ++ ++ u8 bdRT2RTAggregation; ++ u8 bdRT2RTLongSlotTime; ++} __attribute__ ((packed)) BSS_HT, *PBSS_HT; ++ ++typedef struct _MIMO_RSSI{ ++ u32 EnableAntenna; ++ u32 AntennaA; ++ u32 AntennaB; ++ u32 AntennaC; ++ u32 AntennaD; ++ u32 Average; ++}MIMO_RSSI, *PMIMO_RSSI; ++ ++typedef struct _MIMO_EVM{ ++ u32 EVM1; ++ u32 EVM2; ++}MIMO_EVM, *PMIMO_EVM; ++ ++typedef struct _FALSE_ALARM_STATISTICS{ ++ u32 Cnt_Parity_Fail; ++ u32 Cnt_Rate_Illegal; ++ u32 Cnt_Crc8_fail; ++ u32 Cnt_all; ++}FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS; ++ ++ ++extern u8 MCS_FILTER_ALL[16]; ++extern u8 MCS_FILTER_1SS[16]; ++ ++/* 2007/07/11 MH Modify the macro. Becaus STA may link with a N-AP. If we set ++ STA in A/B/G mode and AP is still in N mode. The macro will be wrong. We have ++ to add a macro to judge wireless mode. */ ++#define PICK_RATE(_nLegacyRate, _nMcsRate) \ ++ (_nMcsRate==0)?(_nLegacyRate&0x7f):(_nMcsRate) ++/* 2007/07/12 MH We only define legacy and HT wireless mode now. */ ++#define LEGACY_WIRELESS_MODE IEEE_MODE_MASK ++ ++#define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \ ++ ((WirelessMode & (LEGACY_WIRELESS_MODE))!=0)?\ ++ (LegacyRate):\ ++ (PICK_RATE(LegacyRate, HTRate)) ++ ++ ++ ++// MCS Bw 40 {1~7, 12~15,32} ++#define RATE_ADPT_1SS_MASK 0xFF ++#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily ++#define RATE_ADPT_MCS32_MASK 0x01 ++ ++#define IS_11N_MCS_RATE(rate) (rate&0x80) ++ ++typedef enum _HT_AGGRE_SIZE{ ++ HT_AGG_SIZE_8K = 0, ++ HT_AGG_SIZE_16K = 1, ++ HT_AGG_SIZE_32K = 2, ++ HT_AGG_SIZE_64K = 3, ++}HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E; ++ ++/* Indicate different AP vendor for IOT issue */ ++typedef enum _HT_IOT_PEER ++{ ++ HT_IOT_PEER_UNKNOWN = 0, ++ HT_IOT_PEER_REALTEK = 1, ++ HT_IOT_PEER_BROADCOM = 2, ++ HT_IOT_PEER_RALINK = 3, ++ HT_IOT_PEER_ATHEROS = 4, ++ HT_IOT_PEER_CISCO= 5, ++ HT_IOT_PEER_MAX = 6 ++}HT_IOT_PEER_E, *PHTIOT_PEER_E; ++ ++// ++// IOT Action for different AP ++// ++typedef enum _HT_IOT_ACTION{ ++ HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001, ++ HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002, ++ HT_IOT_ACT_DISABLE_MCS14 = 0x00000004, ++ HT_IOT_ACT_DISABLE_MCS15 = 0x00000008, ++ HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010, ++ HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020, ++ HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040, ++ HT_IOT_ACT_CDD_FSYNC = 0x00000080, ++ HT_IOT_ACT_PURE_N_MODE = 0x00000100, ++ HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200, ++}HT_IOT_ACTION_E, *PHT_IOT_ACTION_E; ++ ++#endif //_RTL819XU_HTTYPE_H_ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_HTProc.c +@@ -0,0 +1,1719 @@ ++ ++//As this function is mainly ported from Windows driver, so leave the name little changed. If any confusion caused, tell me. Created by WB. 2008.05.08 ++#include "ieee80211.h" ++#include "rtl819x_HT.h" ++u8 MCS_FILTER_ALL[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ++ ++u8 MCS_FILTER_1SS[16] = {0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ++ ++u16 MCS_DATA_RATE[2][2][77] = ++ { { {13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78 ,104, 156, 208, 234, 260, ++ 39, 78, 117, 234, 312, 351, 390, 52, 104, 156, 208, 312, 416, 468, 520, ++ 0, 78, 104, 130, 117, 156, 195, 104, 130, 130, 156, 182, 182, 208, 156, 195, ++ 195, 234, 273, 273, 312, 130, 156, 181, 156, 181, 208, 234, 208, 234, 260, 260, ++ 286, 195, 234, 273, 234, 273, 312, 351, 312, 351, 390, 390, 429}, // Long GI, 20MHz ++ {14, 29, 43, 58, 87, 116, 130, 144, 29, 58, 87, 116, 173, 231, 260, 289, ++ 43, 87, 130, 173, 260, 347, 390, 433, 58, 116, 173, 231, 347, 462, 520, 578, ++ 0, 87, 116, 144, 130, 173, 217, 116, 144, 144, 173, 202, 202, 231, 173, 217, ++ 217, 260, 303, 303, 347, 144, 173, 202, 173, 202, 231, 260, 231, 260, 289, 289, ++ 318, 217, 260, 303, 260, 303, 347, 390, 347, 390, 433, 433, 477} }, // Short GI, 20MHz ++ { {27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540, ++ 81, 162, 243, 324, 486, 648, 729, 810, 108, 216, 324, 432, 648, 864, 972, 1080, ++ 12, 162, 216, 270, 243, 324, 405, 216, 270, 270, 324, 378, 378, 432, 324, 405, ++ 405, 486, 567, 567, 648, 270, 324, 378, 324, 378, 432, 486, 432, 486, 540, 540, ++ 594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 810, 891}, // Long GI, 40MHz ++ {30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, ++ 90, 180, 270, 360, 540, 720, 810, 900, 120, 240, 360, 480, 720, 960, 1080, 1200, ++ 13, 180, 240, 300, 270, 360, 450, 240, 300, 300, 360, 420, 420, 480, 360, 450, ++ 450, 540, 630, 630, 720, 300, 360, 420, 360, 420, 480, 540, 480, 540, 600, 600, ++ 660, 450, 540, 630, 540, 630, 720, 810, 720, 810, 900, 900, 990} } // Short GI, 40MHz ++ }; ++ ++static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf}; ++static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70}; ++static u8 LINKSYSWRT350_LINKSYSWRT150_BROADCOM[3] = {0x00, 0x1d, 0x7e}; ++static u8 NETGEAR834Bv2_BROADCOM[3] = {0x00, 0x1b, 0x2f}; ++static u8 BELKINF5D8233V1_RALINK[3] = {0x00, 0x17, 0x3f}; //cosa 03202008 ++static u8 BELKINF5D82334V3_RALINK[3] = {0x00, 0x1c, 0xdf}; ++static u8 PCI_RALINK[3] = {0x00, 0x90, 0xcc}; ++static u8 EDIMAX_RALINK[3] = {0x00, 0x0e, 0x2e}; ++static u8 AIRLINK_RALINK[3] = {0x00, 0x18, 0x02}; ++static u8 DLINK_ATHEROS[3] = {0x00, 0x1c, 0xf0}; ++static u8 CISCO_BROADCOM[3] = {0x00, 0x17, 0x94}; ++ ++// 2008/04/01 MH For Cisco G mode RX TP We need to change FW duration. Shoud we put the ++// code in other place?? ++//static u8 WIFI_CISCO_G_AP[3] = {0x00, 0x40, 0x96}; ++/******************************************************************************************************************** ++ *function: This function update default settings in pHTInfo structure ++ * input: PRT_HIGH_THROUGHPUT pHTInfo ++ * output: none ++ * return: none ++ * notice: These value need be modified if any changes. ++ * *****************************************************************************************************************/ ++void HTUpdateDefaultSetting(struct ieee80211_device* ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ //const typeof( ((struct ieee80211_device *)0)->pHTInfo ) *__mptr = &pHTInfo; ++ ++ //printk("pHTinfo:%p, &pHTinfo:%p, mptr:%p, offsetof:%x\n", pHTInfo, &pHTInfo, __mptr, offsetof(struct ieee80211_device, pHTInfo)); ++ //printk("===>ieee:%p,\n", ieee); ++ // ShortGI support ++ pHTInfo->bRegShortGI20MHz= 1; ++ pHTInfo->bRegShortGI40MHz= 1; ++ ++ // 40MHz channel support ++ pHTInfo->bRegBW40MHz = 1; ++ ++ // CCK rate support in 40MHz channel ++ if(pHTInfo->bRegBW40MHz) ++ pHTInfo->bRegSuppCCK = 1; ++ else ++ pHTInfo->bRegSuppCCK = true; ++ ++ // AMSDU related ++ pHTInfo->nAMSDU_MaxSize = 7935UL; ++ pHTInfo->bAMSDU_Support = 0; ++ ++ // AMPDU related ++ pHTInfo->bAMPDUEnable = 1; ++ pHTInfo->AMPDU_Factor = 2; //// 0: 2n13(8K), 1:2n14(16K), 2:2n15(32K), 3:2n16(64k) ++ pHTInfo->MPDU_Density = 0;// 0: No restriction, 1: 1/8usec, 2: 1/4usec, 3: 1/2usec, 4: 1usec, 5: 2usec, 6: 4usec, 7:8usec ++ ++ // MIMO Power Save ++ pHTInfo->SelfMimoPs = 3;// 0: Static Mimo Ps, 1: Dynamic Mimo Ps, 3: No Limitation, 2: Reserved(Set to 3 automatically.) ++ if(pHTInfo->SelfMimoPs == 2) ++ pHTInfo->SelfMimoPs = 3; ++ // 8190 only. Assign rate operation mode to firmware ++ ieee->bTxDisableRateFallBack = 0; ++ ieee->bTxUseDriverAssingedRate = 0; ++ ++#ifdef TO_DO_LIST ++ // 8190 only. Assign duration operation mode to firmware ++ pMgntInfo->bTxEnableFwCalcDur = (BOOLEAN)pNdisCommon->bRegTxEnableFwCalcDur; ++#endif ++ // 8190 only, Realtek proprietary aggregation mode ++ // Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others ++ pHTInfo->bRegRT2RTAggregation = 1;//0: Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others ++ ++ // For Rx Reorder Control ++ pHTInfo->bRegRxReorderEnable = 1; ++ pHTInfo->RxReorderWinSize = 64; ++ pHTInfo->RxReorderPendingTime = 30; ++ ++#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ++ pHTInfo->UsbTxAggrNum = 4; ++#endif ++#ifdef USB_RX_AGGREGATION_SUPPORT ++ pHTInfo->UsbRxFwAggrEn = 1; ++ pHTInfo->UsbRxFwAggrPageNum = 24; ++ pHTInfo->UsbRxFwAggrPacketNum = 8; ++ pHTInfo->UsbRxFwAggrTimeout = 16; ////usb rx FW aggregation timeout threshold.It's in units of 64us ++#endif ++ ++ ++} ++/******************************************************************************************************************** ++ *function: This function print out each field on HT capability IE mainly from (Beacon/ProbeRsp/AssocReq) ++ * input: u8* CapIE //Capability IE to be printed out ++ * u8* TitleString //mainly print out caller function ++ * output: none ++ * return: none ++ * notice: Driver should not print out this message by default. ++ * *****************************************************************************************************************/ ++void HTDebugHTCapability(u8* CapIE, u8* TitleString ) ++{ ++ ++ static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily ++ PHT_CAPABILITY_ELE pCapELE; ++ ++ if(!memcmp(CapIE, EWC11NHTCap, sizeof(EWC11NHTCap))) ++ { ++ //EWC IE ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __FUNCTION__); ++ pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[4]); ++ }else ++ pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[0]); ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, ". Called by %s\n", TitleString ); ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->ChlWidth)?"20MHz": "20/40MHz"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz)?"YES": "NO"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz)?"YES": "NO"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC)?"YES": "NO"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize)?"3839": "7935"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk)?"YES": "NO"); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\ ++ pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]); ++ return; ++ ++} ++/******************************************************************************************************************** ++ *function: This function print out each field on HT Information IE mainly from (Beacon/ProbeRsp) ++ * input: u8* InfoIE //Capability IE to be printed out ++ * u8* TitleString //mainly print out caller function ++ * output: none ++ * return: none ++ * notice: Driver should not print out this message by default. ++ * *****************************************************************************************************************/ ++void HTDebugHTInfo(u8* InfoIE, u8* TitleString) ++{ ++ ++ static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; // For 11n EWC definition, 2007.07.17, by Emily ++ PHT_INFORMATION_ELE pHTInfoEle; ++ ++ if(!memcmp(InfoIE, EWC11NHTInfo, sizeof(EWC11NHTInfo))) ++ { ++ // Not EWC IE ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __FUNCTION__); ++ pHTInfoEle = (PHT_INFORMATION_ELE)(&InfoIE[4]); ++ }else ++ pHTInfoEle = (PHT_INFORMATION_ELE)(&InfoIE[0]); ++ ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, ". Called by %s\n", TitleString); ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tPrimary channel = %d\n", pHTInfoEle->ControlChl); ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSenondary channel ="); ++ switch(pHTInfoEle->ExtChlOffset) ++ { ++ case 0: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "Not Present\n"); ++ break; ++ case 1: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "Upper channel\n"); ++ break; ++ case 2: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "Reserved. Eooro!!!\n"); ++ break; ++ case 3: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "Lower Channel\n"); ++ break; ++ } ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tRecommended channel width = %s\n", (pHTInfoEle->RecommemdedTxWidth)?"20Mhz": "40Mhz"); ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tOperation mode for protection = "); ++ switch(pHTInfoEle->OptMode) ++ { ++ case 0: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "No Protection\n"); ++ break; ++ case 1: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "HT non-member protection mode\n"); ++ break; ++ case 2: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "Suggest to open protection\n"); ++ break; ++ case 3: ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "HT mixed mode\n"); ++ break; ++ } ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tBasic MCS Rate Set = [%x][%x][%x][%x][%x]\n", pHTInfoEle->BasicMSC[0],\ ++ pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]); ++ return; ++} ++ ++/* ++* Return: true if station in half n mode and AP supports 40 bw ++*/ ++bool IsHTHalfNmode40Bandwidth(struct ieee80211_device* ieee) ++{ ++ bool retValue = false; ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode ++ retValue = false; ++ else if(pHTInfo->bRegBW40MHz == false) // station supports 40 bw ++ retValue = false; ++ else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode ++ retValue = false; ++ else if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw ++ retValue = true; ++ else ++ retValue = false; ++ ++ return retValue; ++} ++ ++bool IsHTHalfNmodeSGI(struct ieee80211_device* ieee, bool is40MHz) ++{ ++ bool retValue = false; ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode ++ retValue = false; ++ else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode ++ retValue = false; ++ else if(is40MHz) // ap support 40 bw ++ { ++ if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI ++ retValue = true; ++ else ++ retValue = false; ++ } ++ else ++ { ++ if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI ++ retValue = true; ++ else ++ retValue = false; ++ } ++ ++ return retValue; ++} ++ ++u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate) ++{ ++ ++ u8 is40MHz; ++ u8 isShortGI; ++ ++ is40MHz = (IsHTHalfNmode40Bandwidth(ieee))?1:0; ++ isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz))? 1:0; ++ ++ return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)]; ++} ++ ++ ++u16 HTMcsToDataRate( struct ieee80211_device* ieee, u8 nMcsRate) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ u8 is40MHz = (pHTInfo->bCurBW40MHz)?1:0; ++ u8 isShortGI = (pHTInfo->bCurBW40MHz)? ++ ((pHTInfo->bCurShortGI40MHz)?1:0): ++ ((pHTInfo->bCurShortGI20MHz)?1:0); ++ return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)]; ++} ++ ++/******************************************************************************************************************** ++ *function: This function returns current datarate. ++ * input: struct ieee80211_device* ieee ++ * u8 nDataRate ++ * output: none ++ * return: tx rate ++ * notice: quite unsure about how to use this function //wb ++ * *****************************************************************************************************************/ ++u16 TxCountToDataRate( struct ieee80211_device* ieee, u8 nDataRate) ++{ ++ //PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ u16 CCKOFDMRate[12] = {0x02 , 0x04 , 0x0b , 0x16 , 0x0c , 0x12 , 0x18 , 0x24 , 0x30 , 0x48 , 0x60 , 0x6c}; ++ u8 is40MHz = 0; ++ u8 isShortGI = 0; ++ ++ if(nDataRate < 12) ++ { ++ return CCKOFDMRate[nDataRate]; ++ } ++ else ++ { ++ if (nDataRate >= 0x10 && nDataRate <= 0x1f)//if(nDataRate > 11 && nDataRate < 28 ) ++ { ++ is40MHz = 0; ++ isShortGI = 0; ++ ++ // nDataRate = nDataRate - 12; ++ } ++ else if(nDataRate >=0x20 && nDataRate <= 0x2f ) //(27, 44) ++ { ++ is40MHz = 1; ++ isShortGI = 0; ++ ++ //nDataRate = nDataRate - 28; ++ } ++ else if(nDataRate >= 0x30 && nDataRate <= 0x3f ) //(43, 60) ++ { ++ is40MHz = 0; ++ isShortGI = 1; ++ ++ //nDataRate = nDataRate - 44; ++ } ++ else if(nDataRate >= 0x40 && nDataRate <= 0x4f ) //(59, 76) ++ { ++ is40MHz = 1; ++ isShortGI = 1; ++ ++ //nDataRate = nDataRate - 60; ++ } ++ return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate&0xf]; ++ } ++} ++ ++ ++ ++bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee) ++{ ++ bool retValue = false; ++ struct ieee80211_network* net = &ieee->current_network; ++#if 0 ++ if(pMgntInfo->bHalfNMode == false) ++ retValue = false; ++ else ++#endif ++ if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) || ++ (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) || ++ (memcmp(net->bssid, PCI_RALINK, 3)==0) || ++ (memcmp(net->bssid, EDIMAX_RALINK, 3)==0) || ++ (memcmp(net->bssid, AIRLINK_RALINK, 3)==0) || ++ (net->ralink_cap_exist)) ++ retValue = true; ++ else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) || ++ (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| ++ (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| ++ (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) || ++ (net->broadcom_cap_exist)) ++ retValue = true; ++ else if(net->bssht.bdRT2RTAggregation) ++ retValue = true; ++ else ++ retValue = false; ++ ++ return retValue; ++} ++ ++/******************************************************************************************************************** ++ *function: This function returns peer IOT. ++ * input: struct ieee80211_device* ieee ++ * output: none ++ * return: ++ * notice: ++ * *****************************************************************************************************************/ ++void HTIOTPeerDetermine(struct ieee80211_device* ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ struct ieee80211_network* net = &ieee->current_network; ++ if(net->bssht.bdRT2RTAggregation) ++ pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK; ++ else if(net->broadcom_cap_exist) ++ pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; ++ else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) || ++ (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| ++ (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| ++ (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ) ++ pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; ++ else if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) || ++ (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) || ++ (memcmp(net->bssid, PCI_RALINK, 3)==0) || ++ (memcmp(net->bssid, EDIMAX_RALINK, 3)==0) || ++ (memcmp(net->bssid, AIRLINK_RALINK, 3)==0) || ++ net->ralink_cap_exist) ++ pHTInfo->IOTPeer = HT_IOT_PEER_RALINK; ++ else if((net->atheros_cap_exist )|| (memcmp(net->bssid, DLINK_ATHEROS, 3) == 0)) ++ pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS; ++ else if(memcmp(net->bssid, CISCO_BROADCOM, 3)==0) ++ pHTInfo->IOTPeer = HT_IOT_PEER_CISCO; ++ else ++ pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; ++ ++ IEEE80211_DEBUG(IEEE80211_DL_IOT, "Joseph debug!! IOTPEER: %x\n", pHTInfo->IOTPeer); ++} ++/******************************************************************************************************************** ++ *function: Check whether driver should declare received rate up to MCS13 only since some chipset is not good ++ * at receiving MCS14~15 frame from some AP. ++ * input: struct ieee80211_device* ieee ++ * u8 * PeerMacAddr ++ * output: none ++ * return: return 1 if driver should declare MCS13 only(otherwise return 0) ++ * *****************************************************************************************************************/ ++u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr) ++{ ++ u8 ret = 0; ++#if 0 ++ // Apply for 819u only ++#if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE) ++ if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || ++ (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ++ ) ++ { ++ ret = 1; ++ } ++ ++ ++ if(pHTInfo->bCurrentRT2RTAggregation) ++ { ++ // The parameter of pHTInfo->bCurrentRT2RTAggregation must be decided previously ++ ret = 1; ++ } ++#endif ++#endif ++ return ret; ++ } ++ ++ ++/** ++* Function: HTIOTActIsDisableMCS15 ++* ++* Overview: Check whether driver should declare capability of receving MCS15 ++* ++* Input: ++* PADAPTER Adapter, ++* ++* Output: None ++* Return: true if driver should disable MCS15 ++* 2008.04.15 Emily ++*/ ++bool HTIOTActIsDisableMCS15(struct ieee80211_device* ieee) ++{ ++ bool retValue = false; ++ ++#ifdef TODO ++ // Apply for 819u only ++#if (HAL_CODE_BASE==RTL8192) ++ ++#if (DEV_BUS_TYPE == USB_INTERFACE) ++ // Alway disable MCS15 by Jerry Chang's request.by Emily, 2008.04.15 ++ retValue = true; ++#elif (DEV_BUS_TYPE == PCI_INTERFACE) ++ // Enable MCS15 if the peer is Cisco AP. by Emily, 2008.05.12 ++// if(pBssDesc->bCiscoCapExist) ++// retValue = false; ++// else ++ retValue = false; ++#endif ++#endif ++#endif ++ // Jerry Chang suggest that 8190 1x2 does not need to disable MCS15 ++ ++ return retValue; ++} ++ ++/** ++* Function: HTIOTActIsDisableMCSTwoSpatialStream ++* ++* Overview: Check whether driver should declare capability of receving All 2 ss packets ++* ++* Input: ++* PADAPTER Adapter, ++* ++* Output: None ++* Return: true if driver should disable all two spatial stream packet ++* 2008.04.21 Emily ++*/ ++bool HTIOTActIsDisableMCSTwoSpatialStream(struct ieee80211_device* ieee, u8 *PeerMacAddr) ++{ ++ bool retValue = false; ++ ++#ifdef TODO ++ // Apply for 819u only ++//#if (HAL_CODE_BASE==RTL8192) ++ ++ //This rule only apply to Belkin(Ralink) AP ++ if(IS_UNDER_11N_AES_MODE(Adapter)) ++ { ++ if((PlatformCompareMemory(PeerMacAddr, BELKINF5D8233V1_RALINK, 3)==0) || ++ (PlatformCompareMemory(PeerMacAddr, PCI_RALINK, 3)==0) || ++ (PlatformCompareMemory(PeerMacAddr, EDIMAX_RALINK, 3)==0)) ++ { ++ //Set True to disable this function. Disable by default, Emily, 2008.04.23 ++ retValue = false; ++ } ++ } ++ ++//#endif ++#endif ++ return retValue; ++} ++ ++/******************************************************************************************************************** ++ *function: Check whether driver should disable EDCA turbo mode ++ * input: struct ieee80211_device* ieee ++ * u8* PeerMacAddr ++ * output: none ++ * return: return 1 if driver should disable EDCA turbo mode(otherwise return 0) ++ * *****************************************************************************************************************/ ++u8 HTIOTActIsDisableEDCATurbo(struct ieee80211_device* ieee, u8* PeerMacAddr) ++{ ++ u8 retValue = false; // default enable EDCA Turbo mode. ++ // Set specific EDCA parameter for different AP in DM handler. ++ ++ return retValue; ++#if 0 ++ if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0)|| ++ (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| ++ (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| ++ (memcmp(PeerMacAddr, NETGEAR834Bv2_BROADCOM, 3)==0)) ++ ++ { ++ retValue = 1; //Linksys disable EDCA turbo mode ++ } ++ ++ return retValue; ++#endif ++} ++ ++/******************************************************************************************************************** ++ *function: Check whether we need to use OFDM to sned MGNT frame for broadcom AP ++ * input: struct ieee80211_network *network //current network we live ++ * output: none ++ * return: return 1 if true ++ * *****************************************************************************************************************/ ++u8 HTIOTActIsMgntUseCCK6M(struct ieee80211_network *network) ++{ ++ u8 retValue = 0; ++ ++ // 2008/01/25 MH Judeg if we need to use OFDM to sned MGNT frame for broadcom AP. ++ // 2008/01/28 MH We must prevent that we select null bssid to link. ++ ++ if(network->broadcom_cap_exist) ++ { ++ retValue = 1; ++ } ++ ++ return retValue; ++} ++ ++u8 HTIOTActIsCCDFsync(u8* PeerMacAddr) ++{ ++ u8 retValue = 0; ++ if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || ++ (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) || ++ (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0)) ++ { ++ retValue = 1; ++ } ++ ++ return retValue; ++} ++ ++void HTResetIOTSetting( ++ PRT_HIGH_THROUGHPUT pHTInfo ++) ++{ ++ pHTInfo->IOTAction = 0; ++ pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; ++} ++ ++ ++/******************************************************************************************************************** ++ *function: Construct Capablility Element in Beacon... if HTEnable is turned on ++ * input: struct ieee80211_device* ieee ++ * u8* posHTCap //pointer to store Capability Ele ++ * u8* len //store length of CE ++ * u8 IsEncrypt //whether encrypt, needed further ++ * output: none ++ * return: none ++ * notice: posHTCap can't be null and should be initialized before. ++ * *****************************************************************************************************************/ ++void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u8* len, u8 IsEncrypt) ++{ ++ PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo; ++ PHT_CAPABILITY_ELE pCapELE = NULL; ++ //u8 bIsDeclareMCS13; ++ ++ if ((posHTCap == NULL) || (pHT == NULL)) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTCap or pHTInfo can't be null in HTConstructCapabilityElement()\n"); ++ return; ++ } ++ memset(posHTCap, 0, *len); ++ if(pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC) ++ { ++ u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily ++ memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); ++ pCapELE = (PHT_CAPABILITY_ELE)&(posHTCap[4]); ++ }else ++ { ++ pCapELE = (PHT_CAPABILITY_ELE)posHTCap; ++ } ++ ++ ++ //HT capability info ++ pCapELE->AdvCoding = 0; // This feature is not supported now!! ++ if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) ++ { ++ pCapELE->ChlWidth = 0; ++ } ++ else ++ { ++ pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); ++ } ++ ++// pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); ++ pCapELE->MimoPwrSave = pHT->SelfMimoPs; ++ pCapELE->GreenField = 0; // This feature is not supported now!! ++ pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!! ++ pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! ++ //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", ++ //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); ++ pCapELE->TxSTBC = 1; ++ pCapELE->RxSTBC = 0; ++ pCapELE->DelayBA = 0; // Do not support now!! ++ pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE>=7935)?1:0; ++ pCapELE->DssCCk = ((pHT->bRegBW40MHz)?(pHT->bRegSuppCCK?1:0):0); ++ pCapELE->PSMP = 0; // Do not support now!! ++ pCapELE->LSigTxopProtect = 0; // Do not support now!! ++ ++ ++ //MAC HT parameters info ++ // TODO: Nedd to take care of this part ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk); ++ ++ if( IsEncrypt) ++ { ++ pCapELE->MPDUDensity = 7; // 8us ++ pCapELE->MaxRxAMPDUFactor = 2; // 2 is for 32 K and 3 is 64K ++ } ++ else ++ { ++ pCapELE->MaxRxAMPDUFactor = 3; // 2 is for 32 K and 3 is 64K ++ pCapELE->MPDUDensity = 0; // no density ++ } ++ ++ //Supported MCS set ++ memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16); ++ if(pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS15) ++ pCapELE->MCS[1] &= 0x7f; ++ ++ if(pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS14) ++ pCapELE->MCS[1] &= 0xbf; ++ ++ if(pHT->IOTAction & HT_IOT_ACT_DISABLE_ALL_2SS) ++ pCapELE->MCS[1] &= 0x00; ++ ++ // 2008.06.12 ++ // For RTL819X, if pairwisekey = wep/tkip, ap is ralink, we support only MCS0~7. ++ if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) ++ { ++ int i; ++ for(i = 1; i< 16; i++) ++ pCapELE->MCS[i] = 0; ++ } ++ ++ //Extended HT Capability Info ++ memset(&pCapELE->ExtHTCapInfo, 0, 2); ++ ++ ++ //TXBF Capabilities ++ memset(pCapELE->TxBFCap, 0, 4); ++ ++ //Antenna Selection Capabilities ++ pCapELE->ASCap = 0; ++//add 2 to give space for element ID and len when construct frames ++ if(pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC) ++ *len = 30 + 2; ++ else ++ *len = 26 + 2; ++ ++ ++ ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_HT, posHTCap, *len -2); ++ ++ //Print each field in detail. Driver should not print out this message by default ++// HTDebugHTCapability(posHTCap, (u8*)"HTConstructCapability()"); ++ return; ++ ++} ++/******************************************************************************************************************** ++ *function: Construct Information Element in Beacon... if HTEnable is turned on ++ * input: struct ieee80211_device* ieee ++ * u8* posHTCap //pointer to store Information Ele ++ * u8* len //store len of ++ * u8 IsEncrypt //whether encrypt, needed further ++ * output: none ++ * return: none ++ * notice: posHTCap can't be null and be initialized before. only AP and IBSS sta should do this ++ * *****************************************************************************************************************/ ++void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* len, u8 IsEncrypt) ++{ ++ PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo; ++ PHT_INFORMATION_ELE pHTInfoEle = (PHT_INFORMATION_ELE)posHTInfo; ++ if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTInfo or pHTInfoEle can't be null in HTConstructInfoElement()\n"); ++ return; ++ } ++ ++ memset(posHTInfo, 0, *len); ++ if ( (ieee->iw_mode == IW_MODE_ADHOC) || (ieee->iw_mode == IW_MODE_MASTER)) //ap mode is not currently supported ++ { ++ pHTInfoEle->ControlChl = ieee->current_network.channel; ++ pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false)?HT_EXTCHNL_OFFSET_NO_EXT: ++ (ieee->current_network.channel<=6)? ++ HT_EXTCHNL_OFFSET_UPPER:HT_EXTCHNL_OFFSET_LOWER); ++ pHTInfoEle->RecommemdedTxWidth = pHT->bRegBW40MHz; ++ pHTInfoEle->RIFS = 0; ++ pHTInfoEle->PSMPAccessOnly = 0; ++ pHTInfoEle->SrvIntGranularity = 0; ++ pHTInfoEle->OptMode = pHT->CurrentOpMode; ++ pHTInfoEle->NonGFDevPresent = 0; ++ pHTInfoEle->DualBeacon = 0; ++ pHTInfoEle->SecondaryBeacon = 0; ++ pHTInfoEle->LSigTxopProtectFull = 0; ++ pHTInfoEle->PcoActive = 0; ++ pHTInfoEle->PcoPhase = 0; ++ ++ memset(pHTInfoEle->BasicMSC, 0, 16); ++ ++ ++ *len = 22 + 2; //same above ++ ++ } ++ else ++ { ++ //STA should not generate High Throughput Information Element ++ *len = 0; ++ } ++ //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_HT, posHTInfo, *len - 2); ++ //HTDebugHTInfo(posHTInfo, "HTConstructInforElement"); ++ return; ++} ++ ++/* ++ * According to experiment, Realtek AP to STA (based on rtl8190) may achieve best performance ++ * if both STA and AP set limitation of aggregation size to 32K, that is, set AMPDU density to 2 ++ * (Ref: IEEE 11n specification). However, if Realtek STA associates to other AP, STA should set ++ * limitation of aggregation size to 8K, otherwise, performance of traffic stream from STA to AP ++ * will be much less than the traffic stream from AP to STA if both of the stream runs concurrently ++ * at the same time. ++ * ++ * Frame Format ++ * Element ID Length OUI Type1 Reserved ++ * 1 byte 1 byte 3 bytes 1 byte 1 byte ++ * ++ * OUI = 0x00, 0xe0, 0x4c, ++ * Type = 0x02 ++ * Reserved = 0x00 ++ * ++ * 2007.8.21 by Emily ++*/ ++/******************************************************************************************************************** ++ *function: Construct Information Element in Beacon... in RT2RT condition ++ * input: struct ieee80211_device* ieee ++ * u8* posRT2RTAgg //pointer to store Information Ele ++ * u8* len //store len ++ * output: none ++ * return: none ++ * notice: ++ * *****************************************************************************************************************/ ++void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg, u8* len) ++{ ++ if (posRT2RTAgg == NULL) { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "posRT2RTAgg can't be null in HTConstructRT2RTAggElement()\n"); ++ return; ++ } ++ memset(posRT2RTAgg, 0, *len); ++ *posRT2RTAgg++ = 0x00; ++ *posRT2RTAgg++ = 0xe0; ++ *posRT2RTAgg++ = 0x4c; ++ *posRT2RTAgg++ = 0x02; ++ *posRT2RTAgg++ = 0x01; ++ *posRT2RTAgg = 0x10;//*posRT2RTAgg = 0x02; ++ ++ if(ieee->bSupportRemoteWakeUp) { ++ *posRT2RTAgg |= 0x08;//RT_HT_CAP_USE_WOW; ++ } ++ ++ *len = 6 + 2; ++ return; ++#ifdef TODO ++#if(HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE) ++ /* ++ //Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this ++ section of code. ++ if(IS_UNDER_11N_AES_MODE(Adapter)) ++ { ++ posRT2RTAgg->Octet[5] |=RT_HT_CAP_USE_AMPDU; ++ }else ++ { ++ posRT2RTAgg->Octet[5] &= 0xfb; ++ } ++ */ ++ ++#else ++ // Do Nothing ++#endif ++ ++ posRT2RTAgg->Length = 6; ++#endif ++ ++ ++ ++ ++} ++ ++ ++/******************************************************************************************************************** ++ *function: Pick the right Rate Adaptive table to use ++ * input: struct ieee80211_device* ieee ++ * u8* pOperateMCS //A pointer to MCS rate bitmap ++ * return: always we return true ++ * notice: ++ * *****************************************************************************************************************/ ++u8 HT_PickMCSRate(struct ieee80211_device* ieee, u8* pOperateMCS) ++{ ++ u8 i; ++ if (pOperateMCS == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in HT_PickMCSRate()\n"); ++ return false; ++ } ++ ++ switch(ieee->mode) ++ { ++ case IEEE_A: ++ case IEEE_B: ++ case IEEE_G: ++ //legacy rate routine handled at selectedrate ++ ++ //no MCS rate ++ for(i=0;i<=15;i++){ ++ pOperateMCS[i] = 0; ++ } ++ break; ++ ++ case IEEE_N_24G: //assume CCK rate ok ++ case IEEE_N_5G: ++ // Legacy part we only use 6, 5.5,2,1 for N_24G and 6 for N_5G. ++ // Legacy part shall be handled at SelectRateSet(). ++ ++ //HT part ++ // TODO: may be different if we have different number of antenna ++ pOperateMCS[0] &=RATE_ADPT_1SS_MASK; //support MCS 0~7 ++ pOperateMCS[1] &=RATE_ADPT_2SS_MASK; ++ pOperateMCS[3] &=RATE_ADPT_MCS32_MASK; ++ break; ++ ++ //should never reach here ++ default: ++ ++ break; ++ ++ } ++ ++ return true; ++} ++ ++/* ++* Description: ++* This function will get the highest speed rate in input MCS set. ++* ++* /param Adapter Pionter to Adapter entity ++* pMCSRateSet Pointer to MCS rate bitmap ++* pMCSFilter Pointer to MCS rate filter ++* ++* /return Highest MCS rate included in pMCSRateSet and filtered by pMCSFilter. ++* ++*/ ++/******************************************************************************************************************** ++ *function: This function will get the highest speed rate in input MCS set. ++ * input: struct ieee80211_device* ieee ++ * u8* pMCSRateSet //Pointer to MCS rate bitmap ++ * u8* pMCSFilter //Pointer to MCS rate filter ++ * return: Highest MCS rate included in pMCSRateSet and filtered by pMCSFilter ++ * notice: ++ * *****************************************************************************************************************/ ++u8 HTGetHighestMCSRate(struct ieee80211_device* ieee, u8* pMCSRateSet, u8* pMCSFilter) ++{ ++ u8 i, j; ++ u8 bitMap; ++ u8 mcsRate = 0; ++ u8 availableMcsRate[16]; ++ if (pMCSRateSet == NULL || pMCSFilter == NULL) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "pMCSRateSet or pMCSFilter can't be null in HTGetHighestMCSRate()\n"); ++ return false; ++ } ++ for(i=0; i<16; i++) ++ availableMcsRate[i] = pMCSRateSet[i] & pMCSFilter[i]; ++ ++ for(i = 0; i < 16; i++) ++ { ++ if(availableMcsRate[i] != 0) ++ break; ++ } ++ if(i == 16) ++ return false; ++ ++ for(i = 0; i < 16; i++) ++ { ++ if(availableMcsRate[i] != 0) ++ { ++ bitMap = availableMcsRate[i]; ++ for(j = 0; j < 8; j++) ++ { ++ if((bitMap%2) != 0) ++ { ++ if(HTMcsToDataRate(ieee, (8*i+j)) > HTMcsToDataRate(ieee, mcsRate)) ++ mcsRate = (8*i+j); ++ } ++ bitMap = bitMap>>1; ++ } ++ } ++ } ++ return (mcsRate|0x80); ++} ++ ++ ++ ++/* ++** ++**1.Filter our operation rate set with AP's rate set ++**2.shall reference channel bandwidth, STBC, Antenna number ++**3.generate rate adative table for firmware ++**David 20060906 ++** ++** \pHTSupportedCap: the connected STA's supported rate Capability element ++*/ ++u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperateMCS) ++{ ++ ++ u8 i=0; ++ ++ // filter out operational rate set not supported by AP, the lenth of it is 16 ++ for(i=0;i<=15;i++){ ++ pOperateMCS[i] = ieee->Regdot11HTOperationalRateSet[i]&pSupportMCS[i]; ++ } ++ ++ ++ // TODO: adjust our operational rate set according to our channel bandwidth, STBC and Antenna number ++ ++ // TODO: fill suggested rate adaptive rate index and give firmware info using Tx command packet ++ // we also shall suggested the first start rate set according to our singal strength ++ HT_PickMCSRate(ieee, pOperateMCS); ++ ++ // For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7. ++ if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) ++ pOperateMCS[1] = 0; ++ ++ // ++ // For RTL819X, we support only MCS0~15. ++ // And also, we do not know how to use MCS32 now. ++ // ++ for(i=2; i<=15; i++) ++ pOperateMCS[i] = 0; ++ ++ return true; ++} ++void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++#if 0 ++//I need move this function to other places, such as rx? ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void HTOnAssocRsp_wq(struct work_struct *work) ++{ ++ struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, ht_onAssRsp); ++#else ++void HTOnAssocRsp_wq(struct ieee80211_device *ieee) ++{ ++#endif ++#endif ++void HTOnAssocRsp(struct ieee80211_device *ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ PHT_CAPABILITY_ELE pPeerHTCap = NULL; ++ PHT_INFORMATION_ELE pPeerHTInfo = NULL; ++ u16 nMaxAMSDUSize = 0; ++ u8* pMcsFilter = NULL; ++ ++ static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily ++ static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; // For 11n EWC definition, 2007.07.17, by Emily ++ ++ if( pHTInfo->bCurrentHTSupport == false ) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "<=== HTOnAssocRsp(): HT_DISABLE\n"); ++ return; ++ } ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n"); ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTCapBuf, sizeof(HT_CAPABILITY_ELE)); ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTInfoBuf, sizeof(HT_INFORMATION_ELE)); ++ ++// HTDebugHTCapability(pHTInfo->PeerHTCapBuf,"HTOnAssocRsp_wq"); ++// HTDebugHTInfo(pHTInfo->PeerHTInfoBuf,"HTOnAssocRsp_wq"); ++ // ++ if(!memcmp(pHTInfo->PeerHTCapBuf,EWC11NHTCap, sizeof(EWC11NHTCap))) ++ pPeerHTCap = (PHT_CAPABILITY_ELE)(&pHTInfo->PeerHTCapBuf[4]); ++ else ++ pPeerHTCap = (PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf); ++ ++ if(!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) ++ pPeerHTInfo = (PHT_INFORMATION_ELE)(&pHTInfo->PeerHTInfoBuf[4]); ++ else ++ pPeerHTInfo = (PHT_INFORMATION_ELE)(pHTInfo->PeerHTInfoBuf); ++ ++ ++ //////////////////////////////////////////////////////// ++ // Configurations: ++ //////////////////////////////////////////////////////// ++ IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTCap, sizeof(HT_CAPABILITY_ELE)); ++// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTInfo, sizeof(HT_INFORMATION_ELE)); ++ // Config Supported Channel Width setting ++ // ++ HTSetConnectBwMode(ieee, (HT_CHANNEL_WIDTH)(pPeerHTCap->ChlWidth), (HT_EXTCHNL_OFFSET)(pPeerHTInfo->ExtChlOffset)); ++ ++// if(pHTInfo->bCurBW40MHz == true) ++ pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1)?true:false); ++ ++ // ++ // Update short GI/ long GI setting ++ // ++ // TODO: ++ pHTInfo->bCurShortGI20MHz= ++ ((pHTInfo->bRegShortGI20MHz)?((pPeerHTCap->ShortGI20Mhz==1)?true:false):false); ++ pHTInfo->bCurShortGI40MHz= ++ ((pHTInfo->bRegShortGI40MHz)?((pPeerHTCap->ShortGI40Mhz==1)?true:false):false); ++ ++ // ++ // Config TX STBC setting ++ // ++ // TODO: ++ ++ // ++ // Config DSSS/CCK mode in 40MHz mode ++ // ++ // TODO: ++ pHTInfo->bCurSuppCCK = ++ ((pHTInfo->bRegSuppCCK)?((pPeerHTCap->DssCCk==1)?true:false):false); ++ ++ ++ // ++ // Config and configure A-MSDU setting ++ // ++ pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; ++ ++ nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize==0)?3839:7935; ++ ++ if(pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize ) ++ pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; ++ else ++ pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; ++ ++ ++ // ++ // Config A-MPDU setting ++ // ++ pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; ++ ++ // <1> Decide AMPDU Factor ++ ++ // By Emily ++ if(!pHTInfo->bRegRT2RTAggregation) ++ { ++ // Decide AMPDU Factor according to protocol handshake ++ if(pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) ++ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor; ++ else ++ pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; ++ ++ }else ++ { ++ // Set MPDU density to 2 to Realtek AP, and set it to 0 for others ++ // Replace MPDU factor declared in original association response frame format. 2007.08.20 by Emily ++#if 0 ++ osTmp= PacketGetElement( asocpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE); ++ if(osTmp.Length >= 5) //00:e0:4c:02:00 ++#endif ++ if (ieee->current_network.bssht.bdRT2RTAggregation) ++ { ++ if( ieee->pairwise_key_type != KEY_TYPE_NA) ++ // Realtek may set 32k in security mode and 64k for others ++ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor; ++ else ++ pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K; ++ }else ++ { ++ if(pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K) ++ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor; ++ else ++ pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K; ++ } ++ } ++ ++ // <2> Set AMPDU Minimum MPDU Start Spacing ++ // 802.11n 3.0 section 9.7d.3 ++#if 1 ++ if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) ++ pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; ++ else ++ pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity; ++ if(ieee->pairwise_key_type != KEY_TYPE_NA ) ++ pHTInfo->CurrentMPDUDensity = 7; // 8us ++#else ++ if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) ++ pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; ++ else ++ pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity; ++#endif ++ // Force TX AMSDU ++ ++ // Lanhsin: mark for tmp to avoid deauth by ap from s3 ++ //if(memcmp(pMgntInfo->Bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ++ if(0) ++ { ++ ++ pHTInfo->bCurrentAMPDUEnable = false; ++ pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; ++ pHTInfo->ForcedAMSDUMaxSize = 7935; ++ ++ pHTInfo->IOTAction |= HT_IOT_ACT_TX_USE_AMSDU_8K; ++ } ++ ++ // Rx Reorder Setting ++ pHTInfo->bCurRxReorderEnable = pHTInfo->bRegRxReorderEnable; ++ ++ // ++ // Filter out unsupported HT rate for this AP ++ // Update RATR table ++ // This is only for 8190 ,8192 or later product which using firmware to handle rate adaptive mechanism. ++ // ++ ++ // Handle Ralink AP bad MCS rate set condition. Joseph. ++ // This fix the bug of Ralink AP. This may be removed in the future. ++ if(pPeerHTCap->MCS[0] == 0) ++ pPeerHTCap->MCS[0] = 0xff; ++ ++ HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet); ++ ++ // ++ // Config MIMO Power Save setting ++ // ++ pHTInfo->PeerMimoPs = pPeerHTCap->MimoPwrSave; ++ if(pHTInfo->PeerMimoPs == MIMO_PS_STATIC) ++ pMcsFilter = MCS_FILTER_1SS; ++ else ++ pMcsFilter = MCS_FILTER_ALL; ++ //WB add for MCS8 bug ++// pMcsFilter = MCS_FILTER_1SS; ++ ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, ieee->dot11HTOperationalRateSet, pMcsFilter); ++ ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; ++ ++ // ++ // Config current operation mode. ++ // ++ pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode; ++ ++ ++ ++} ++ ++void HTSetConnectBwModeCallback(struct ieee80211_device* ieee); ++/******************************************************************************************************************** ++ *function: initialize HT info(struct PRT_HIGH_THROUGHPUT) ++ * input: struct ieee80211_device* ieee ++ * output: none ++ * return: none ++ * notice: This function is called when * (1) MPInitialization Phase * (2) Receiving of Deauthentication from AP ++********************************************************************************************************************/ ++// TODO: Should this funciton be called when receiving of Disassociation? ++void HTInitializeHTInfo(struct ieee80211_device* ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ // ++ // These parameters will be reset when receiving deauthentication packet ++ // ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "===========>%s()\n", __FUNCTION__); ++ pHTInfo->bCurrentHTSupport = false; ++ ++ // 40MHz channel support ++ pHTInfo->bCurBW40MHz = false; ++ pHTInfo->bCurTxBW40MHz = false; ++ ++ // Short GI support ++ pHTInfo->bCurShortGI20MHz = false; ++ pHTInfo->bCurShortGI40MHz = false; ++ pHTInfo->bForcedShortGI = false; ++ ++ // CCK rate support ++ // This flag is set to true to support CCK rate by default. ++ // It will be affected by "pHTInfo->bRegSuppCCK" and AP capabilities only when associate to ++ // 11N BSS. ++ pHTInfo->bCurSuppCCK = true; ++ ++ // AMSDU related ++ pHTInfo->bCurrent_AMSDU_Support = false; ++ pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; ++ ++ // AMPUD related ++ pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; ++ pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; ++ ++ ++ ++ // Initialize all of the parameters related to 11n ++ memset((void*)(&(pHTInfo->SelfHTCap)), 0, sizeof(pHTInfo->SelfHTCap)); ++ memset((void*)(&(pHTInfo->SelfHTInfo)), 0, sizeof(pHTInfo->SelfHTInfo)); ++ memset((void*)(&(pHTInfo->PeerHTCapBuf)), 0, sizeof(pHTInfo->PeerHTCapBuf)); ++ memset((void*)(&(pHTInfo->PeerHTInfoBuf)), 0, sizeof(pHTInfo->PeerHTInfoBuf)); ++ ++ pHTInfo->bSwBwInProgress = false; ++ pHTInfo->ChnlOp = CHNLOP_NONE; ++ ++ // Set default IEEE spec for Draft N ++ pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE; ++ ++ // Realtek proprietary aggregation mode ++ pHTInfo->bCurrentRT2RTAggregation = false; ++ pHTInfo->bCurrentRT2RTLongSlotTime = false; ++ pHTInfo->IOTPeer = 0; ++ pHTInfo->IOTAction = 0; ++ ++ //MCS rate initialized here ++ { ++ u8* RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]); ++ RegHTSuppRateSets[0] = 0xFF; //support MCS 0~7 ++ RegHTSuppRateSets[1] = 0xFF; //support MCS 8~15 ++ RegHTSuppRateSets[4] = 0x01; //support MCS 32 ++ } ++} ++/******************************************************************************************************************** ++ *function: initialize Bss HT structure(struct PBSS_HT) ++ * input: PBSS_HT pBssHT //to be initialized ++ * output: none ++ * return: none ++ * notice: This function is called when initialize network structure ++********************************************************************************************************************/ ++void HTInitializeBssDesc(PBSS_HT pBssHT) ++{ ++ ++ pBssHT->bdSupportHT = false; ++ memset(pBssHT->bdHTCapBuf, 0, sizeof(pBssHT->bdHTCapBuf)); ++ pBssHT->bdHTCapLen = 0; ++ memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf)); ++ pBssHT->bdHTInfoLen = 0; ++ ++ pBssHT->bdHTSpecVer= HT_SPEC_VER_IEEE; ++ ++ pBssHT->bdRT2RTAggregation = false; ++ pBssHT->bdRT2RTLongSlotTime = false; ++} ++#if 0 ++//below function has merged into ieee80211_network_init() in ieee80211_rx.c ++void ++HTParsingHTCapElement( ++ IN PADAPTER Adapter, ++ IN OCTET_STRING HTCapIE, ++ OUT PRT_WLAN_BSS pBssDesc ++) ++{ ++ PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; ++ ++ if( HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf) ) ++ { ++ RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTCapElement(): HT Capability Element length is too long!\n") ); ++ return; ++ } ++ ++ // TODO: Check the correctness of HT Cap ++ //Print each field in detail. Driver should not print out this message by default ++ if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc) ++ HTDebugHTCapability(DBG_TRACE, Adapter, &HTCapIE, (pu8)"HTParsingHTCapElement()"); ++ ++ HTCapIE.Length = HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf)?\ ++ sizeof(pBssDesc->BssHT.bdHTCapBuf):HTCapIE.Length; //prevent from overflow ++ ++ CopyMem(pBssDesc->BssHT.bdHTCapBuf, HTCapIE.Octet, HTCapIE.Length); ++ pBssDesc->BssHT.bdHTCapLen = HTCapIE.Length; ++ ++} ++ ++ ++void ++HTParsingHTInfoElement( ++ PADAPTER Adapter, ++ OCTET_STRING HTInfoIE, ++ PRT_WLAN_BSS pBssDesc ++) ++{ ++ PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; ++ ++ if( HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)) ++ { ++ RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTInfoElement(): HT Information Element length is too long!\n") ); ++ return; ++ } ++ ++ // TODO: Check the correctness of HT Info ++ //Print each field in detail. Driver should not print out this message by default ++ if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc) ++ HTDebugHTInfo(DBG_TRACE, Adapter, &HTInfoIE, (pu8)"HTParsingHTInfoElement()"); ++ ++ HTInfoIE.Length = HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)?\ ++ sizeof(pBssDesc->BssHT.bdHTInfoBuf):HTInfoIE.Length; //prevent from overflow ++ ++ CopyMem( pBssDesc->BssHT.bdHTInfoBuf, HTInfoIE.Octet, HTInfoIE.Length); ++ pBssDesc->BssHT.bdHTInfoLen = HTInfoIE.Length; ++} ++ ++/* ++ * Get HT related information from beacon and save it in BssDesc ++ * ++ * (1) Parse HTCap, and HTInfo, and record whether it is 11n AP ++ * (2) If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() ++ * (3) Check whether peer is Realtek AP (for Realtek proprietary aggregation mode). ++ * Input: ++ * PADAPTER Adapter ++ * ++ * Output: ++ * PRT_TCB BssDesc ++ * ++*/ ++void HTGetValueFromBeaconOrProbeRsp( ++ PADAPTER Adapter, ++ POCTET_STRING pSRCmmpdu, ++ PRT_WLAN_BSS bssDesc ++) ++{ ++ PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; ++ PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pMgntInfo); ++ OCTET_STRING HTCapIE, HTInfoIE, HTRealtekAgg, mmpdu; ++ OCTET_STRING BroadcomElement, CiscoElement; ++ ++ mmpdu.Octet = pSRCmmpdu->Octet; ++ mmpdu.Length = pSRCmmpdu->Length; ++ ++ //2Note: ++ // Mark for IOT testing using Linksys WRT350N, This AP does not contain WMM IE when ++ // it is configured at pure-N mode. ++ // if(bssDesc->BssQos.bdQoSMode & QOS_WMM) ++ // ++ ++ HTInitializeBssDesc (&bssDesc->BssHT); ++ ++ //2<1> Parse HTCap, and HTInfo ++ // Get HT Capability IE: (1) Get IEEE Draft N IE or (2) Get EWC IE ++ HTCapIE = PacketGetElement(mmpdu, EID_HTCapability, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE); ++ if(HTCapIE.Length == 0) ++ { ++ HTCapIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_CAP, OUI_SUBTYPE_DONT_CARE); ++ if(HTCapIE.Length != 0) ++ bssDesc->BssHT.bdHTSpecVer= HT_SPEC_VER_EWC; ++ } ++ if(HTCapIE.Length != 0) ++ HTParsingHTCapElement(Adapter, HTCapIE, bssDesc); ++ ++ // Get HT Information IE: (1) Get IEEE Draft N IE or (2) Get EWC IE ++ HTInfoIE = PacketGetElement(mmpdu, EID_HTInfo, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE); ++ if(HTInfoIE.Length == 0) ++ { ++ HTInfoIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_INFO, OUI_SUBTYPE_DONT_CARE); ++ if(HTInfoIE.Length != 0) ++ bssDesc->BssHT.bdHTSpecVer = HT_SPEC_VER_EWC; ++ } ++ if(HTInfoIE.Length != 0) ++ HTParsingHTInfoElement(Adapter, HTInfoIE, bssDesc); ++ ++ //2<2>If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() ++ if(HTCapIE.Length != 0) ++ { ++ bssDesc->BssHT.bdSupportHT = true; ++ if(bssDesc->BssQos.bdQoSMode == QOS_DISABLE) ++ QosSetLegacyWMMParamWithHT(Adapter, bssDesc); ++ } ++ else ++ { ++ bssDesc->BssHT.bdSupportHT = false; ++ } ++ ++ //2<3>Check whether the peer is Realtek AP/STA ++ if(pHTInfo->bRegRT2RTAggregation) ++ { ++ if(bssDesc->BssHT.bdSupportHT) ++ { ++ HTRealtekAgg = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE); ++ if(HTRealtekAgg.Length >=5 ) ++ { ++ bssDesc->BssHT.bdRT2RTAggregation = true; ++ ++ if((HTRealtekAgg.Octet[4]==1) && (HTRealtekAgg.Octet[5] & 0x02)) ++ bssDesc->BssHT.bdRT2RTLongSlotTime = true; ++ } ++ } ++ } ++ ++ // ++ // 2008/01/25 MH Get Broadcom AP IE for manamgent frame CCK rate problem. ++ // AP can not receive CCK managemtn from from 92E. ++ // ++ ++ // Initialize every new bss broadcom cap exist as false.. ++ bssDesc->bBroadcomCapExist= false; ++ ++ if(HTCapIE.Length != 0 || HTInfoIE.Length != 0) ++ { ++ u4Byte Length = 0; ++ ++ FillOctetString(BroadcomElement, NULL, 0); ++ ++ BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_1, OUI_SUBTYPE_DONT_CARE); ++ Length += BroadcomElement.Length; ++ BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_2, OUI_SUBTYPE_DONT_CARE); ++ Length += BroadcomElement.Length; ++ BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_3, OUI_SUBTYPE_DONT_CARE); ++ Length += BroadcomElement.Length; ++ ++ if(Length > 0) ++ bssDesc->bBroadcomCapExist = true; ++ } ++ ++ ++ // For Cisco IOT issue ++ CiscoElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_CISCO_IE, OUI_SUBTYPE_DONT_CARE); ++ if(CiscoElement.Length != 0){ // 3: 0x00, 0x40, 0x96 .... ++ bssDesc->bCiscoCapExist = true; ++ }else{ ++ bssDesc->bCiscoCapExist = false; ++ } ++} ++ ++ ++#endif ++/******************************************************************************************************************** ++ *function: initialize Bss HT structure(struct PBSS_HT) ++ * input: struct ieee80211_device *ieee ++ * struct ieee80211_network *pNetwork //usually current network we are live in ++ * output: none ++ * return: none ++ * notice: This function should ONLY be called before association ++********************************************************************************************************************/ ++void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++// u16 nMaxAMSDUSize; ++// PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf; ++// PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf; ++// u8* pMcsFilter; ++ u8 bIOTAction = 0; ++ ++ // ++ // Save Peer Setting before Association ++ // ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "==============>%s()\n", __FUNCTION__); ++ /*unmark bEnableHT flag here is the same reason why unmarked in function ieee80211_softmac_new_net. WB 2008.09.10*/ ++// if( pHTInfo->bEnableHT && pNetwork->bssht.bdSupportHT) ++ if (pNetwork->bssht.bdSupportHT) ++ { ++ pHTInfo->bCurrentHTSupport = true; ++ pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bdHTSpecVer; ++ ++ // Save HTCap and HTInfo information Element ++ if(pNetwork->bssht.bdHTCapLen > 0 && pNetwork->bssht.bdHTCapLen <= sizeof(pHTInfo->PeerHTCapBuf)) ++ memcpy(pHTInfo->PeerHTCapBuf, pNetwork->bssht.bdHTCapBuf, pNetwork->bssht.bdHTCapLen); ++ ++ if(pNetwork->bssht.bdHTInfoLen > 0 && pNetwork->bssht.bdHTInfoLen <= sizeof(pHTInfo->PeerHTInfoBuf)) ++ memcpy(pHTInfo->PeerHTInfoBuf, pNetwork->bssht.bdHTInfoBuf, pNetwork->bssht.bdHTInfoLen); ++ ++ // Check whether RT to RT aggregation mode is enabled ++ if(pHTInfo->bRegRT2RTAggregation) ++ { ++ pHTInfo->bCurrentRT2RTAggregation = pNetwork->bssht.bdRT2RTAggregation; ++ pHTInfo->bCurrentRT2RTLongSlotTime = pNetwork->bssht.bdRT2RTLongSlotTime; ++ } ++ else ++ { ++ pHTInfo->bCurrentRT2RTAggregation = false; ++ pHTInfo->bCurrentRT2RTLongSlotTime = false; ++ } ++ ++ // Determine the IOT Peer Vendor. ++ HTIOTPeerDetermine(ieee); ++ ++ // Decide IOT Action ++ // Must be called after the parameter of pHTInfo->bCurrentRT2RTAggregation is decided ++ pHTInfo->IOTAction = 0; ++ bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_MCS14; ++ ++ bIOTAction = HTIOTActIsDisableMCS15(ieee); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_MCS15; ++ ++ bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee, pNetwork->bssid); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_ALL_2SS; ++ ++ ++ bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_EDCA_TURBO; ++ ++ bIOTAction = HTIOTActIsMgntUseCCK6M(pNetwork); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_MGNT_USE_CCK_6M; ++ ++ bIOTAction = HTIOTActIsCCDFsync(pNetwork->bssid); ++ if(bIOTAction) ++ pHTInfo->IOTAction |= HT_IOT_ACT_CDD_FSYNC; ++ ++ ++ } ++ else ++ { ++ pHTInfo->bCurrentHTSupport = false; ++ pHTInfo->bCurrentRT2RTAggregation = false; ++ pHTInfo->bCurrentRT2RTLongSlotTime = false; ++ ++ pHTInfo->IOTAction = 0; ++ } ++ ++} ++ ++void HTUpdateSelfAndPeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++// PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf; ++ PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf; ++ ++ if(pHTInfo->bCurrentHTSupport) ++ { ++ // ++ // Config current operation mode. ++ // ++ if(pNetwork->bssht.bdHTInfoLen != 0) ++ pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode; ++ ++ // ++ // ++ // ++ } ++} ++ ++void HTUseDefaultSetting(struct ieee80211_device* ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++// u8 regBwOpMode; ++ ++ if(pHTInfo->bEnableHT) ++ { ++ pHTInfo->bCurrentHTSupport = true; ++ ++ pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK; ++ ++ pHTInfo->bCurBW40MHz = pHTInfo->bRegBW40MHz; ++ ++ pHTInfo->bCurShortGI20MHz= pHTInfo->bRegShortGI20MHz; ++ ++ pHTInfo->bCurShortGI40MHz= pHTInfo->bRegShortGI40MHz; ++ ++ pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; ++ ++ pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; ++ ++ pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; ++ ++ pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; ++ ++ pHTInfo->CurrentMPDUDensity = pHTInfo->CurrentMPDUDensity; ++ ++ // Set BWOpMode register ++ ++ //update RATR index0 ++ HTFilterMCSRate(ieee, ieee->Regdot11HTOperationalRateSet, ieee->dot11HTOperationalRateSet); ++ //function below is not implemented at all. WB ++#ifdef TODO ++ Adapter->HalFunc.InitHalRATRTableHandler( Adapter, &pMgntInfo->dot11OperationalRateSet, pMgntInfo->dot11HTOperationalRateSet); ++#endif ++ ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, ieee->dot11HTOperationalRateSet, MCS_FILTER_ALL); ++ ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; ++ ++ } ++ else ++ { ++ pHTInfo->bCurrentHTSupport = false; ++ } ++ return; ++} ++/******************************************************************************************************************** ++ *function: check whether HT control field exists ++ * input: struct ieee80211_device *ieee ++ * u8* pFrame //coming skb->data ++ * output: none ++ * return: return true if HT control field exists(false otherwise) ++ * notice: ++********************************************************************************************************************/ ++u8 HTCCheck(struct ieee80211_device* ieee, u8* pFrame) ++{ ++ if(ieee->pHTInfo->bCurrentHTSupport) ++ { ++ if( (IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "HT CONTROL FILED EXIST!!\n"); ++ return true; ++ } ++ } ++ return false; ++} ++ ++// ++// This function set bandwidth mode in protocol layer. ++// ++void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++// u32 flags = 0; ++ ++ if(pHTInfo->bRegBW40MHz == false) ++ return; ++ ++ ++ ++ // To reduce dummy operation ++// if((pHTInfo->bCurBW40MHz==false && Bandwidth==HT_CHANNEL_WIDTH_20) || ++// (pHTInfo->bCurBW40MHz==true && Bandwidth==HT_CHANNEL_WIDTH_20_40 && Offset==pHTInfo->CurSTAExtChnlOffset)) ++// return; ++ ++// spin_lock_irqsave(&(ieee->bw_spinlock), flags); ++ if(pHTInfo->bSwBwInProgress) { ++// spin_unlock_irqrestore(&(ieee->bw_spinlock), flags); ++ return; ++ } ++ //if in half N mode, set to 20M bandwidth please 09.08.2008 WB. ++ if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))) ++ { ++ // Handle Illegal extention channel offset!! ++ if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER) ++ Offset = HT_EXTCHNL_OFFSET_NO_EXT; ++ if(Offset==HT_EXTCHNL_OFFSET_UPPER || Offset==HT_EXTCHNL_OFFSET_LOWER) { ++ pHTInfo->bCurBW40MHz = true; ++ pHTInfo->CurSTAExtChnlOffset = Offset; ++ } else { ++ pHTInfo->bCurBW40MHz = false; ++ pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; ++ } ++ } else { ++ pHTInfo->bCurBW40MHz = false; ++ pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; ++ } ++ ++ pHTInfo->bSwBwInProgress = true; ++ ++ // TODO: 2007.7.13 by Emily Wait 2000ms in order to garantee that switching ++ // bandwidth is executed after scan is finished. It is a temporal solution ++ // because software should ganrantee the last operation of switching bandwidth ++ // is executed properlly. ++ HTSetConnectBwModeCallback(ieee); ++ ++// spin_unlock_irqrestore(&(ieee->bw_spinlock), flags); ++} ++ ++void HTSetConnectBwModeCallback(struct ieee80211_device* ieee) ++{ ++ PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ++ ++ IEEE80211_DEBUG(IEEE80211_DL_HT, "======>%s()\n", __FUNCTION__); ++ ++ if(pHTInfo->bCurBW40MHz) ++ { ++ if(pHTInfo->CurSTAExtChnlOffset==HT_EXTCHNL_OFFSET_UPPER) ++ ieee->set_chan(ieee->dev, ieee->current_network.channel+2); ++ else if(pHTInfo->CurSTAExtChnlOffset==HT_EXTCHNL_OFFSET_LOWER) ++ ieee->set_chan(ieee->dev, ieee->current_network.channel-2); ++ else ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ++ ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset); ++ } else { ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ++ } ++ ++ pHTInfo->bSwBwInProgress = false; ++} ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++//EXPORT_SYMBOL_NOVERS(HTUpdateSelfAndPeerSetting); ++#else ++//EXPORT_SYMBOL(HTUpdateSelfAndPeerSetting); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_Qos.h +@@ -0,0 +1,749 @@ ++#ifndef __INC_QOS_TYPE_H ++#define __INC_QOS_TYPE_H ++ ++//#include "EndianFree.h" ++#define BIT0 0x00000001 ++#define BIT1 0x00000002 ++#define BIT2 0x00000004 ++#define BIT3 0x00000008 ++#define BIT4 0x00000010 ++#define BIT5 0x00000020 ++#define BIT6 0x00000040 ++#define BIT7 0x00000080 ++#define BIT8 0x00000100 ++#define BIT9 0x00000200 ++#define BIT10 0x00000400 ++#define BIT11 0x00000800 ++#define BIT12 0x00001000 ++#define BIT13 0x00002000 ++#define BIT14 0x00004000 ++#define BIT15 0x00008000 ++#define BIT16 0x00010000 ++#define BIT17 0x00020000 ++#define BIT18 0x00040000 ++#define BIT19 0x00080000 ++#define BIT20 0x00100000 ++#define BIT21 0x00200000 ++#define BIT22 0x00400000 ++#define BIT23 0x00800000 ++#define BIT24 0x01000000 ++#define BIT25 0x02000000 ++#define BIT26 0x04000000 ++#define BIT27 0x08000000 ++#define BIT28 0x10000000 ++#define BIT29 0x20000000 ++#define BIT30 0x40000000 ++#define BIT31 0x80000000 ++ ++#define MAX_WMMELE_LENGTH 64 ++ ++// ++// QoS mode. ++// enum 0, 1, 2, 4: since we can use the OR(|) operation. ++// ++// QOS_MODE is redefined for enum can't be ++, | under C++ compiler, 2006.05.17, by rcnjko. ++//typedef enum _QOS_MODE{ ++// QOS_DISABLE = 0, ++// QOS_WMM = 1, ++// QOS_EDCA = 2, ++// QOS_HCCA = 4, ++//}QOS_MODE,*PQOS_MODE; ++// ++typedef u32 QOS_MODE, *PQOS_MODE; ++#define QOS_DISABLE 0 ++#define QOS_WMM 1 ++#define QOS_WMMSA 2 ++#define QOS_EDCA 4 ++#define QOS_HCCA 8 ++#define QOS_WMM_UAPSD 16 //WMM Power Save, 2006-06-14 Isaiah ++ ++#define AC_PARAM_SIZE 4 ++#define WMM_PARAM_ELE_BODY_LEN 18 ++ ++// ++// QoS ACK Policy Field Values ++// Ref: WMM spec 2.1.6: QoS Control Field, p.10. ++// ++typedef enum _ACK_POLICY{ ++ eAckPlc0_ACK = 0x00, ++ eAckPlc1_NoACK = 0x01, ++}ACK_POLICY,*PACK_POLICY; ++ ++#define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE)) ++#if 0 ++#define GET_QOS_CTRL(_pStart) ReadEF2Byte((u8 *)(_pStart) + 24) ++#define SET_QOS_CTRL(_pStart, _value) WriteEF2Byte((u8 *)(_pStart) + 24, _value) ++ ++// WMM control field. ++#define GET_QOS_CTRL_WMM_UP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 3)) ++#define SET_QOS_CTRL_WMM_UP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 3, (u8)(_value)) ++ ++#define GET_QOS_CTRL_WMM_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) ++#define SET_QOS_CTRL_WMM_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) ++ ++#define GET_QOS_CTRL_WMM_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) ++#define SET_QOS_CTRL_WMM_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) ++ ++// 802.11e control field (by STA, data) ++#define GET_QOS_CTRL_STA_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) ++#define SET_QOS_CTRL_STA_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) ++ ++#define GET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) ++#define SET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) ++ ++#define GET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) ++#define SET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) ++ ++#define GET_QOS_CTRL_STA_DATA_TXOP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) ++#define SET_QOS_CTRL_STA_DATA_TXOP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) ++ ++#define GET_QOS_CTRL_STA_DATA_QSIZE(_pStart) GET_QOS_CTRL_STA_DATA_TXOP(_pStart) ++#define SET_QOS_CTRL_STA_DATA_QSIZE(_pStart, _value) SET_QOS_CTRL_STA_DATA_TXOP(_pStart) ++ ++// 802.11e control field (by HC, data) ++#define GET_QOS_CTRL_HC_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) ++#define SET_QOS_CTRL_HC_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_DATA_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) ++#define SET_QOS_CTRL_HC_DATA_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) ++#define SET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) ++#define SET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) ++ ++// 802.11e control field (by HC, CFP) ++#define GET_QOS_CTRL_HC_CFP_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) ++#define SET_QOS_CTRL_HC_CFP_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_CFP_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) ++#define SET_QOS_CTRL_HC_CFP_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) ++#define SET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) ++ ++#define GET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) ++#define SET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) ++ ++#define SET_WMM_QOS_INFO_FIELD(_pStart, _val) WriteEF1Byte(_pStart, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 4) ++#define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 7, 1) ++#define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 1) ++#define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 1, 1) ++#define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 2, 1) ++#define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 3, 1) ++#define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val) ++ ++#define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) LE_BITS_TO_1BYTE(_pStart, 5, 2) ++#define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val) ++ ++ ++#define WMM_INFO_ELEMENT_SIZE 7 ++ ++#define GET_WMM_INFO_ELE_OUI(_pStart) ((u8 *)(_pStart)) ++#define SET_WMM_INFO_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3); ++ ++#define GET_WMM_INFO_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) ) ++#define SET_WMM_INFO_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) ) ++ ++#define GET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) ) ++#define SET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) ) ++ ++#define GET_WMM_INFO_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) ) ++#define SET_WMM_INFO_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) ) ++ ++#define GET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) ) ++#define SET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) ) ++ ++ ++ ++#define GET_WMM_AC_PARAM_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 4) ) ++#define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val) ++ ++#define GET_WMM_AC_PARAM_ACM(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 4, 1) ) ++#define SET_WMM_AC_PARAM_ACM(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val) ++ ++#define GET_WMM_AC_PARAM_ACI(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 5, 2) ) ++#define SET_WMM_AC_PARAM_ACI(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val) ++ ++#define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 8) ) ++#define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) SET_BTIS_TO_LE_4BYTE(_pStart, 0, 8, _val) ++ ++#define GET_WMM_AC_PARAM_ECWMIN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 8, 4) ) ++#define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val) ++ ++#define GET_WMM_AC_PARAM_ECWMAX(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 12, 4) ) ++#define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val) ++ ++#define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) ( (u16)LE_BITS_TO_4BYTE(_pStart, 16, 16) ) ++#define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val) ++ ++ ++ ++ ++#define GET_WMM_PARAM_ELE_OUI(_pStart) ((u8 *)(_pStart)) ++#define SET_WMM_PARAM_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3) ++ ++#define GET_WMM_PARAM_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) ) ++#define SET_WMM_PARAM_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) ) ++ ++#define GET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) ) ++#define SET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) ) ++ ++#define GET_WMM_PARAM_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) ) ++#define SET_WMM_PARAM_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) ) ++ ++#define GET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) ) ++#define SET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) ) ++ ++#define GET_WMM_PARAM_ELE_AC_PARAM(_pStart) ( (u8 *)(_pStart)+8 ) ++#define SET_WMM_PARAM_ELE_AC_PARAM(_pStart, _pVal) PlatformMoveMemory((_pStart)+8, _pVal, 16) ++#endif ++ ++// ++// QoS Control Field ++// Ref: ++// 1. WMM spec 2.1.6: QoS Control Field, p.9. ++// 2. 802.11e/D13.0 7.1.3.5, p.26. ++// ++typedef union _QOS_CTRL_FIELD{ ++ u8 charData[2]; ++ u16 shortData; ++ ++ // WMM spec ++ struct ++ { ++ u8 UP:3; ++ u8 usRsvd1:1; ++ u8 EOSP:1; ++ u8 AckPolicy:2; ++ u8 usRsvd2:1; ++ u8 ucRsvdByte; ++ }WMM; ++ ++ // 802.11e: QoS data type frame sent by non-AP QSTAs. ++ struct ++ { ++ u8 TID:4; ++ u8 bIsQsize:1;// 0: BIT[8:15] is TXOP Duration Requested, 1: BIT[8:15] is Queue Size. ++ u8 AckPolicy:2; ++ u8 usRsvd:1; ++ u8 TxopOrQsize; // (BIT4=0)TXOP Duration Requested or (BIT4=1)Queue Size. ++ }BySta; ++ ++ // 802.11e: QoS data, QoS Null, and QoS Data+CF-Ack frames sent by HC. ++ struct ++ { ++ u8 TID:4; ++ u8 EOSP:1; ++ u8 AckPolicy:2; ++ u8 usRsvd:1; ++ u8 PSBufState; // QAP PS Buffer State. ++ }ByHc_Data; ++ ++ // 802.11e: QoS (+) CF-Poll frames sent by HC. ++ struct ++ { ++ u8 TID:4; ++ u8 EOSP:1; ++ u8 AckPolicy:2; ++ u8 usRsvd:1; ++ u8 TxopLimit; // TXOP Limit. ++ }ByHc_CFP; ++ ++}QOS_CTRL_FIELD, *PQOS_CTRL_FIELD; ++ ++ ++// ++// QoS Info Field ++// Ref: ++// 1. WMM spec 2.2.1: WME Information Element, p.11. ++// 2. 8185 QoS code: QOS_INFO [def. in QoS_mp.h] ++// ++typedef union _QOS_INFO_FIELD{ ++ u8 charData; ++ ++ struct ++ { ++ u8 ucParameterSetCount:4; ++ u8 ucReserved:4; ++ }WMM; ++ ++ struct ++ { ++ //Ref WMM_Specification_1-1.pdf, 2006-06-13 Isaiah ++ u8 ucAC_VO_UAPSD:1; ++ u8 ucAC_VI_UAPSD:1; ++ u8 ucAC_BE_UAPSD:1; ++ u8 ucAC_BK_UAPSD:1; ++ u8 ucReserved1:1; ++ u8 ucMaxSPLen:2; ++ u8 ucReserved2:1; ++ ++ }ByWmmPsSta; ++ ++ struct ++ { ++ //Ref WMM_Specification_1-1.pdf, 2006-06-13 Isaiah ++ u8 ucParameterSetCount:4; ++ u8 ucReserved:3; ++ u8 ucApUapsd:1; ++ }ByWmmPsAp; ++ ++ struct ++ { ++ u8 ucAC3_UAPSD:1; ++ u8 ucAC2_UAPSD:1; ++ u8 ucAC1_UAPSD:1; ++ u8 ucAC0_UAPSD:1; ++ u8 ucQAck:1; ++ u8 ucMaxSPLen:2; ++ u8 ucMoreDataAck:1; ++ } By11eSta; ++ ++ struct ++ { ++ u8 ucParameterSetCount:4; ++ u8 ucQAck:1; ++ u8 ucQueueReq:1; ++ u8 ucTXOPReq:1; ++ u8 ucReserved:1; ++ } By11eAp; ++ ++ struct ++ { ++ u8 ucReserved1:4; ++ u8 ucQAck:1; ++ u8 ucReserved2:2; ++ u8 ucMoreDataAck:1; ++ } ByWmmsaSta; ++ ++ struct ++ { ++ u8 ucReserved1:4; ++ u8 ucQAck:1; ++ u8 ucQueueReq:1; ++ u8 ucTXOPReq:1; ++ u8 ucReserved2:1; ++ } ByWmmsaAp; ++ ++ struct ++ { ++ u8 ucAC3_UAPSD:1; ++ u8 ucAC2_UAPSD:1; ++ u8 ucAC1_UAPSD:1; ++ u8 ucAC0_UAPSD:1; ++ u8 ucQAck:1; ++ u8 ucMaxSPLen:2; ++ u8 ucMoreDataAck:1; ++ } ByAllSta; ++ ++ struct ++ { ++ u8 ucParameterSetCount:4; ++ u8 ucQAck:1; ++ u8 ucQueueReq:1; ++ u8 ucTXOPReq:1; ++ u8 ucApUapsd:1; ++ } ByAllAp; ++ ++}QOS_INFO_FIELD, *PQOS_INFO_FIELD; ++ ++#if 0 ++// ++// WMM Information Element ++// Ref: WMM spec 2.2.1: WME Information Element, p.10. ++// ++typedef struct _WMM_INFO_ELEMENT{ ++// u8 ElementID; ++// u8 Length; ++ u8 OUI[3]; ++ u8 OUI_Type; ++ u8 OUI_SubType; ++ u8 Version; ++ QOS_INFO_FIELD QosInfo; ++}WMM_INFO_ELEMENT, *PWMM_INFO_ELEMENT; ++#endif ++ ++// ++// ACI to AC coding. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.13. ++// ++// AC_CODING is redefined for enum can't be ++, | under C++ compiler, 2006.05.17, by rcnjko. ++//typedef enum _AC_CODING{ ++// AC0_BE = 0, // ACI: 0x00 // Best Effort ++// AC1_BK = 1, // ACI: 0x01 // Background ++// AC2_VI = 2, // ACI: 0x10 // Video ++// AC3_VO = 3, // ACI: 0x11 // Voice ++// AC_MAX = 4, // Max: define total number; Should not to be used as a real enum. ++//}AC_CODING,*PAC_CODING; ++// ++typedef u32 AC_CODING; ++#define AC0_BE 0 // ACI: 0x00 // Best Effort ++#define AC1_BK 1 // ACI: 0x01 // Background ++#define AC2_VI 2 // ACI: 0x10 // Video ++#define AC3_VO 3 // ACI: 0x11 // Voice ++#define AC_MAX 4 // Max: define total number; Should not to be used as a real enum. ++ ++// ++// ACI/AIFSN Field. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.12. ++// ++typedef union _ACI_AIFSN{ ++ u8 charData; ++ ++ struct ++ { ++ u8 AIFSN:4; ++ u8 ACM:1; ++ u8 ACI:2; ++ u8 Reserved:1; ++ }f; // Field ++}ACI_AIFSN, *PACI_AIFSN; ++ ++// ++// ECWmin/ECWmax field. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.13. ++// ++typedef union _ECW{ ++ u8 charData; ++ struct ++ { ++ u8 ECWmin:4; ++ u8 ECWmax:4; ++ }f; // Field ++}ECW, *PECW; ++ ++// ++// AC Parameters Record Format. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.12. ++// ++typedef union _AC_PARAM{ ++ u32 longData; ++ u8 charData[4]; ++ ++ struct ++ { ++ ACI_AIFSN AciAifsn; ++ ECW Ecw; ++ u16 TXOPLimit; ++ }f; // Field ++}AC_PARAM, *PAC_PARAM; ++ ++ ++ ++// ++// QoS element subtype ++// ++typedef enum _QOS_ELE_SUBTYPE{ ++ QOSELE_TYPE_INFO = 0x00, // 0x00: Information element ++ QOSELE_TYPE_PARAM = 0x01, // 0x01: parameter element ++}QOS_ELE_SUBTYPE,*PQOS_ELE_SUBTYPE; ++ ++ ++// ++// Direction Field Values. ++// Ref: WMM spec 2.2.11: WME TSPEC Element, p.18. ++// ++typedef enum _DIRECTION_VALUE{ ++ DIR_UP = 0, // 0x00 // UpLink ++ DIR_DOWN = 1, // 0x01 // DownLink ++ DIR_DIRECT = 2, // 0x10 // DirectLink ++ DIR_BI_DIR = 3, // 0x11 // Bi-Direction ++}DIRECTION_VALUE,*PDIRECTION_VALUE; ++ ++ ++// ++// TS Info field in WMM TSPEC Element. ++// Ref: ++// 1. WMM spec 2.2.11: WME TSPEC Element, p.18. ++// 2. 8185 QoS code: QOS_TSINFO [def. in QoS_mp.h] ++// ++typedef union _QOS_TSINFO{ ++ u8 charData[3]; ++ struct { ++ u8 ucTrafficType:1; //WMM is reserved ++ u8 ucTSID:4; ++ u8 ucDirection:2; ++ u8 ucAccessPolicy:2; //WMM: bit8=0, bit7=1 ++ u8 ucAggregation:1; //WMM is reserved ++ u8 ucPSB:1; //WMMSA is APSD ++ u8 ucUP:3; ++ u8 ucTSInfoAckPolicy:2; //WMM is reserved ++ u8 ucSchedule:1; //WMM is reserved ++ u8 ucReserved:7; ++ }field; ++}QOS_TSINFO, *PQOS_TSINFO; ++ ++// ++// WMM TSPEC Body. ++// Ref: WMM spec 2.2.11: WME TSPEC Element, p.16. ++// ++typedef union _TSPEC_BODY{ ++ u8 charData[55]; ++ ++ struct ++ { ++ QOS_TSINFO TSInfo; //u8 TSInfo[3]; ++ u16 NominalMSDUsize; ++ u16 MaxMSDUsize; ++ u32 MinServiceItv; ++ u32 MaxServiceItv; ++ u32 InactivityItv; ++ u32 SuspenItv; ++ u32 ServiceStartTime; ++ u32 MinDataRate; ++ u32 MeanDataRate; ++ u32 PeakDataRate; ++ u32 MaxBurstSize; ++ u32 DelayBound; ++ u32 MinPhyRate; ++ u16 SurplusBandwidthAllowance; ++ u16 MediumTime; ++ } f; // Field ++}TSPEC_BODY, *PTSPEC_BODY; ++ ++ ++// ++// WMM TSPEC Element. ++// Ref: WMM spec 2.2.11: WME TSPEC Element, p.16. ++// ++typedef struct _WMM_TSPEC{ ++ u8 ID; ++ u8 Length; ++ u8 OUI[3]; ++ u8 OUI_Type; ++ u8 OUI_SubType; ++ u8 Version; ++ TSPEC_BODY Body; ++} WMM_TSPEC, *PWMM_TSPEC; ++ ++// ++// ACM implementation method. ++// Annie, 2005-12-13. ++// ++typedef enum _ACM_METHOD{ ++ eAcmWay0_SwAndHw = 0, // By SW and HW. ++ eAcmWay1_HW = 1, // By HW. ++ eAcmWay2_SW = 2, // By SW. ++}ACM_METHOD,*PACM_METHOD; ++ ++ ++typedef struct _ACM{ ++// u8 RegEnableACM; ++ u64 UsedTime; ++ u64 MediumTime; ++ u8 HwAcmCtl; // TRUE: UsedTime exceed => Do NOT USE this AC. It wll be written to ACM_CONTROL(0xBF BIT 0/1/2 in 8185B). ++}ACM, *PACM; ++ ++typedef u8 AC_UAPSD, *PAC_UAPSD; ++ ++#define GET_VO_UAPSD(_apsd) ((_apsd) & BIT0) ++#define SET_VO_UAPSD(_apsd) ((_apsd) |= BIT0) ++ ++#define GET_VI_UAPSD(_apsd) ((_apsd) & BIT1) ++#define SET_VI_UAPSD(_apsd) ((_apsd) |= BIT1) ++ ++#define GET_BK_UAPSD(_apsd) ((_apsd) & BIT2) ++#define SET_BK_UAPSD(_apsd) ((_apsd) |= BIT2) ++ ++#define GET_BE_UAPSD(_apsd) ((_apsd) & BIT3) ++#define SET_BE_UAPSD(_apsd) ((_apsd) |= BIT3) ++ ++ ++//typedef struct _TCLASS{ ++// TODO ++//} TCLASS, *PTCLASS; ++typedef union _QOS_TCLAS{ ++ ++ struct _TYPE_GENERAL{ ++ u8 Priority; ++ u8 ClassifierType; ++ u8 Mask; ++ } TYPE_GENERAL; ++ ++ struct _TYPE0_ETH{ ++ u8 Priority; ++ u8 ClassifierType; ++ u8 Mask; ++ u8 SrcAddr[6]; ++ u8 DstAddr[6]; ++ u16 Type; ++ } TYPE0_ETH; ++ ++ struct _TYPE1_IPV4{ ++ u8 Priority; ++ u8 ClassifierType; ++ u8 Mask; ++ u8 Version; ++ u8 SrcIP[4]; ++ u8 DstIP[4]; ++ u16 SrcPort; ++ u16 DstPort; ++ u8 DSCP; ++ u8 Protocol; ++ u8 Reserved; ++ } TYPE1_IPV4; ++ ++ struct _TYPE1_IPV6{ ++ u8 Priority; ++ u8 ClassifierType; ++ u8 Mask; ++ u8 Version; ++ u8 SrcIP[16]; ++ u8 DstIP[16]; ++ u16 SrcPort; ++ u16 DstPort; ++ u8 FlowLabel[3]; ++ } TYPE1_IPV6; ++ ++ struct _TYPE2_8021Q{ ++ u8 Priority; ++ u8 ClassifierType; ++ u8 Mask; ++ u16 TagType; ++ } TYPE2_8021Q; ++} QOS_TCLAS, *PQOS_TCLAS; ++ ++//typedef struct _WMM_TSTREAM{ ++// ++//- TSPEC ++//- AC (which to mapping) ++//} WMM_TSTREAM, *PWMM_TSTREAM; ++typedef struct _QOS_TSTREAM{ ++ u8 AC; ++ WMM_TSPEC TSpec; ++ QOS_TCLAS TClass; ++} QOS_TSTREAM, *PQOS_TSTREAM; ++ ++//typedef struct _U_APSD{ ++//- TriggerEnable [4] ++//- MaxSPLength ++//- HighestAcBuffered ++//} U_APSD, *PU_APSD; ++ ++//joseph TODO: ++// UAPSD function should be implemented by 2 data structure ++// "Qos control field" and "Qos info field" ++//typedef struct _QOS_UAPSD{ ++// u8 bTriggerEnable[4]; ++// u8 MaxSPLength; ++// u8 HighestBufAC; ++//} QOS_UAPSD, *PQOS_APSD; ++ ++//---------------------------------------------------------------------------- ++// 802.11 Management frame Status Code field ++//---------------------------------------------------------------------------- ++typedef struct _OCTET_STRING{ ++ u8 *Octet; ++ u16 Length; ++}OCTET_STRING, *POCTET_STRING; ++#if 0 ++#define FillOctetString(_os,_octet,_len) \ ++ (_os).Octet=(u8 *)(_octet); \ ++ (_os).Length=(_len); ++ ++#define WMM_ELEM_HDR_LEN 6 ++#define WMMElemSkipHdr(_osWMMElem) \ ++ (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \ ++ (_osWMMElem).Length -= WMM_ELEM_HDR_LEN; ++#endif ++// ++// STA QoS data. ++// Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h] ++// ++typedef struct _STA_QOS{ ++ //DECLARE_RT_OBJECT(STA_QOS); ++ u8 WMMIEBuf[MAX_WMMELE_LENGTH]; ++ u8* WMMIE; ++ ++ // Part 1. Self QoS Mode. ++ QOS_MODE QosCapability; //QoS Capability, 2006-06-14 Isaiah ++ QOS_MODE CurrentQosMode; ++ ++ // For WMM Power Save Mode : ++ // ACs are trigger/delivery enabled or legacy power save enabled. 2006-06-13 Isaiah ++ AC_UAPSD b4ac_Uapsd; //VoUapsd(bit0), ViUapsd(bit1), BkUapsd(bit2), BeUapsd(bit3), ++ AC_UAPSD Curr4acUapsd; ++ u8 bInServicePeriod; ++ u8 MaxSPLength; ++ int NumBcnBeforeTrigger; ++ ++ // Part 2. EDCA Parameter (perAC) ++ u8 * pWMMInfoEle; ++ u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE]; ++ u8 WMMPELength; ++ ++ // ++ //2 ToDo: remove the Qos Info Field and replace it by the above WMM Info element. ++ // By Bruce, 2008-01-30. ++ // Part 2. EDCA Parameter (perAC) ++ QOS_INFO_FIELD QosInfoField_STA; // Maintained by STA ++ QOS_INFO_FIELD QosInfoField_AP; // Retrieved from AP ++ ++ AC_PARAM CurAcParameters[4]; ++ ++ // Part 3. ACM ++ ACM acm[4]; ++ ACM_METHOD AcmMethod; ++ ++ // Part 4. Per TID (Part 5: TCLASS will be described by TStream) ++ QOS_TSTREAM TStream[16]; ++ WMM_TSPEC TSpec; ++ ++ u32 QBssWirelessMode; ++ ++ // No Ack Setting ++ u8 bNoAck; ++ ++ // Enable/Disable Rx immediate BA capability. ++ u8 bEnableRxImmBA; ++ ++}STA_QOS, *PSTA_QOS; ++ ++// ++// BSS QOS data. ++// Ref: BssDscr in 8185 code. [def. in BssDscr.h] ++// ++typedef struct _BSS_QOS{ ++ QOS_MODE bdQoSMode; ++ ++ u8 bdWMMIEBuf[MAX_WMMELE_LENGTH]; ++ u8* bdWMMIE; ++ ++ QOS_ELE_SUBTYPE EleSubType; ++ ++ u8 * pWMMInfoEle; ++ u8 * pWMMParamEle; ++ ++ QOS_INFO_FIELD QosInfoField; ++ AC_PARAM AcParameter[4]; ++}BSS_QOS, *PBSS_QOS; ++ ++ ++// ++// Ref: sQoSCtlLng and QoSCtl definition in 8185 QoS code. ++//#define QoSCtl (( (Adapter->bRegQoS) && (Adapter->dot11QoS.QoSMode &(QOS_EDCA|QOS_HCCA)) ) ?sQoSCtlLng:0) ++// ++#define sQoSCtlLng 2 ++#define QOS_CTRL_LEN(_QosMode) ((_QosMode > QOS_DISABLE)? sQoSCtlLng : 0) ++ ++ ++//Added by joseph ++//UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP ++//#define UP2AC(up) ((up<3)?((up==0)?1:0):(up>>1)) ++#define IsACValid(ac) ((ac<=7 )?true:false ) ++ ++#endif // #ifndef __INC_QOS_TYPE_H +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_TS.h +@@ -0,0 +1,56 @@ ++#ifndef _TSTYPE_H_ ++#define _TSTYPE_H_ ++#include "rtl819x_Qos.h" ++#define TS_SETUP_TIMEOUT 60 // In millisecond ++#define TS_INACT_TIMEOUT 60 ++#define TS_ADDBA_DELAY 60 ++ ++#define TOTAL_TS_NUM 16 ++#define TCLAS_NUM 4 ++ ++// This define the Tx/Rx directions ++typedef enum _TR_SELECT { ++ TX_DIR = 0, ++ RX_DIR = 1, ++} TR_SELECT, *PTR_SELECT; ++ ++typedef struct _TS_COMMON_INFO{ ++ struct list_head List; ++ struct timer_list SetupTimer; ++ struct timer_list InactTimer; ++ u8 Addr[6]; ++ TSPEC_BODY TSpec; ++ QOS_TCLAS TClass[TCLAS_NUM]; ++ u8 TClasProc; ++ u8 TClasNum; ++} TS_COMMON_INFO, *PTS_COMMON_INFO; ++ ++typedef struct _TX_TS_RECORD{ ++ TS_COMMON_INFO TsCommonInfo; ++ u16 TxCurSeq; ++ BA_RECORD TxPendingBARecord; // For BA Originator ++ BA_RECORD TxAdmittedBARecord; // For BA Originator ++// QOS_DL_RECORD DLRecord; ++ u8 bAddBaReqInProgress; ++ u8 bAddBaReqDelayed; ++ u8 bUsingBa; ++ struct timer_list TsAddBaTimer; ++ u8 num; ++} TX_TS_RECORD, *PTX_TS_RECORD; ++ ++typedef struct _RX_TS_RECORD { ++ TS_COMMON_INFO TsCommonInfo; ++ u16 RxIndicateSeq; ++ u16 RxTimeoutIndicateSeq; ++ struct list_head RxPendingPktList; ++ struct timer_list RxPktPendingTimer; ++ BA_RECORD RxAdmittedBARecord; // For BA Recepient ++ u16 RxLastSeqNum; ++ u8 RxLastFragNum; ++ u8 num; ++// QOS_DL_RECORD DLRecord; ++} RX_TS_RECORD, *PRX_TS_RECORD; ++ ++ ++#endif ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl819x_TSProc.c +@@ -0,0 +1,659 @@ ++#include "ieee80211.h" ++#include ++#include "rtl819x_TS.h" ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++#define list_for_each_entry_safe(pos, n, head, member) \ ++ for (pos = list_entry((head)->next, typeof(*pos), member), \ ++ n = list_entry(pos->member.next, typeof(*pos), member); \ ++ &pos->member != (head); \ ++ pos = n, n = list_entry(n->member.next, typeof(*n), member)) ++#endif ++void TsSetupTimeOut(unsigned long data) ++{ ++ // Not implement yet ++ // This is used for WMMSA and ACM , that would send ADDTSReq frame. ++} ++ ++void TsInactTimeout(unsigned long data) ++{ ++ // Not implement yet ++ // This is used for WMMSA and ACM. ++ // This function would be call when TS is no Tx/Rx for some period of time. ++} ++ ++/******************************************************************************************************************** ++ *function: I still not understand this function, so wait for further implementation ++ * input: unsigned long data //acturally we send TX_TS_RECORD or RX_TS_RECORD to these timer ++ * return: NULL ++ * notice: ++********************************************************************************************************************/ ++#if 1 ++void RxPktPendingTimeout(unsigned long data) ++{ ++ PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; ++ struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); ++ ++ PRX_REORDER_ENTRY pReorderEntry = NULL; ++ ++ //u32 flags = 0; ++ unsigned long flags = 0; ++ struct ieee80211_rxb *stats_IndicateArray[REORDER_WIN_SIZE]; ++ u8 index = 0; ++ bool bPktInBuf = false; ++ ++ ++ spin_lock_irqsave(&(ieee->reorder_spinlock), flags); ++ //PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"==================>%s()\n",__FUNCTION__); ++ if(pRxTs->RxTimeoutIndicateSeq != 0xffff) ++ { ++ // Indicate the pending packets sequentially according to SeqNum until meet the gap. ++ while(!list_empty(&pRxTs->RxPendingPktList)) ++ { ++ pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->RxPendingPktList.prev,RX_REORDER_ENTRY,List); ++ if(index == 0) ++ pRxTs->RxIndicateSeq = pReorderEntry->SeqNum; ++ ++ if( SN_LESS(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) || ++ SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) ) ++ { ++ list_del_init(&pReorderEntry->List); ++ ++ if(SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq)) ++ pRxTs->RxIndicateSeq = (pRxTs->RxIndicateSeq + 1) % 4096; ++ ++ IEEE80211_DEBUG(IEEE80211_DL_REORDER,"RxPktPendingTimeout(): IndicateSeq: %d\n", pReorderEntry->SeqNum); ++ stats_IndicateArray[index] = pReorderEntry->prxb; ++ index++; ++ ++ list_add_tail(&pReorderEntry->List, &ieee->RxReorder_Unused_List); ++ } ++ else ++ { ++ bPktInBuf = true; ++ break; ++ } ++ } ++ } ++ ++ if(index>0) ++ { ++ // Set RxTimeoutIndicateSeq to 0xffff to indicate no pending packets in buffer now. ++ pRxTs->RxTimeoutIndicateSeq = 0xffff; ++ ++ // Indicate packets ++ if(index > REORDER_WIN_SIZE){ ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorer buffer full!! \n"); ++ spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); ++ return; ++ } ++ ieee80211_indicate_packets(ieee, stats_IndicateArray, index); ++ bPktInBuf = false; ++ } ++ ++ if(bPktInBuf && (pRxTs->RxTimeoutIndicateSeq==0xffff)) ++ { ++ pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq; ++#if 0 ++ if(timer_pending(&pRxTs->RxPktPendingTimer)) ++ del_timer_sync(&pRxTs->RxPktPendingTimer); ++ pRxTs->RxPktPendingTimer.expires = jiffies + ieee->pHTInfo->RxReorderPendingTime; ++ add_timer(&pRxTs->RxPktPendingTimer); ++#else ++ mod_timer(&pRxTs->RxPktPendingTimer, jiffies + MSECS(ieee->pHTInfo->RxReorderPendingTime)); ++#endif ++ } ++ spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); ++ //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); ++} ++#endif ++ ++/******************************************************************************************************************** ++ *function: Add BA timer function ++ * input: unsigned long data //acturally we send TX_TS_RECORD or RX_TS_RECORD to these timer ++ * return: NULL ++ * notice: ++********************************************************************************************************************/ ++void TsAddBaProcess(unsigned long data) ++{ ++ PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; ++ u8 num = pTxTs->num; ++ struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[num]); ++ ++ TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); ++ IEEE80211_DEBUG(IEEE80211_DL_BA, "TsAddBaProcess(): ADDBA Req is started!! \n"); ++} ++ ++ ++void ResetTsCommonInfo(PTS_COMMON_INFO pTsCommonInfo) ++{ ++ memset(pTsCommonInfo->Addr, 0, 6); ++ memset(&pTsCommonInfo->TSpec, 0, sizeof(TSPEC_BODY)); ++ memset(&pTsCommonInfo->TClass, 0, sizeof(QOS_TCLAS)*TCLAS_NUM); ++ pTsCommonInfo->TClasProc = 0; ++ pTsCommonInfo->TClasNum = 0; ++} ++ ++void ResetTxTsEntry(PTX_TS_RECORD pTS) ++{ ++ ResetTsCommonInfo(&pTS->TsCommonInfo); ++ pTS->TxCurSeq = 0; ++ pTS->bAddBaReqInProgress = false; ++ pTS->bAddBaReqDelayed = false; ++ pTS->bUsingBa = false; ++ ResetBaEntry(&pTS->TxAdmittedBARecord); //For BA Originator ++ ResetBaEntry(&pTS->TxPendingBARecord); ++} ++ ++void ResetRxTsEntry(PRX_TS_RECORD pTS) ++{ ++ ResetTsCommonInfo(&pTS->TsCommonInfo); ++ pTS->RxIndicateSeq = 0xffff; // This indicate the RxIndicateSeq is not used now!! ++ pTS->RxTimeoutIndicateSeq = 0xffff; // This indicate the RxTimeoutIndicateSeq is not used now!! ++ ResetBaEntry(&pTS->RxAdmittedBARecord); // For BA Recepient ++} ++ ++void TSInitialize(struct ieee80211_device *ieee) ++{ ++ PTX_TS_RECORD pTxTS = ieee->TxTsRecord; ++ PRX_TS_RECORD pRxTS = ieee->RxTsRecord; ++ PRX_REORDER_ENTRY pRxReorderEntry = ieee->RxReorderEntry; ++ u8 count = 0; ++ IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __FUNCTION__); ++ // Initialize Tx TS related info. ++ INIT_LIST_HEAD(&ieee->Tx_TS_Admit_List); ++ INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List); ++ INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List); ++ ++ for(count = 0; count < TOTAL_TS_NUM; count++) ++ { ++ // ++ pTxTS->num = count; ++ // The timers for the operation of Traffic Stream and Block Ack. ++ // DLS related timer will be add here in the future!! ++ init_timer(&pTxTS->TsCommonInfo.SetupTimer); ++ pTxTS->TsCommonInfo.SetupTimer.data = (unsigned long)pTxTS; ++ pTxTS->TsCommonInfo.SetupTimer.function = TsSetupTimeOut; ++ ++ init_timer(&pTxTS->TsCommonInfo.InactTimer); ++ pTxTS->TsCommonInfo.InactTimer.data = (unsigned long)pTxTS; ++ pTxTS->TsCommonInfo.InactTimer.function = TsInactTimeout; ++ ++ init_timer(&pTxTS->TsAddBaTimer); ++ pTxTS->TsAddBaTimer.data = (unsigned long)pTxTS; ++ pTxTS->TsAddBaTimer.function = TsAddBaProcess; ++ ++ init_timer(&pTxTS->TxPendingBARecord.Timer); ++ pTxTS->TxPendingBARecord.Timer.data = (unsigned long)pTxTS; ++ pTxTS->TxPendingBARecord.Timer.function = BaSetupTimeOut; ++ ++ init_timer(&pTxTS->TxAdmittedBARecord.Timer); ++ pTxTS->TxAdmittedBARecord.Timer.data = (unsigned long)pTxTS; ++ pTxTS->TxAdmittedBARecord.Timer.function = TxBaInactTimeout; ++ ++ ResetTxTsEntry(pTxTS); ++ list_add_tail(&pTxTS->TsCommonInfo.List, &ieee->Tx_TS_Unused_List); ++ pTxTS++; ++ } ++ ++ // Initialize Rx TS related info. ++ INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List); ++ INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List); ++ INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List); ++ for(count = 0; count < TOTAL_TS_NUM; count++) ++ { ++ pRxTS->num = count; ++ INIT_LIST_HEAD(&pRxTS->RxPendingPktList); ++ ++ init_timer(&pRxTS->TsCommonInfo.SetupTimer); ++ pRxTS->TsCommonInfo.SetupTimer.data = (unsigned long)pRxTS; ++ pRxTS->TsCommonInfo.SetupTimer.function = TsSetupTimeOut; ++ ++ init_timer(&pRxTS->TsCommonInfo.InactTimer); ++ pRxTS->TsCommonInfo.InactTimer.data = (unsigned long)pRxTS; ++ pRxTS->TsCommonInfo.InactTimer.function = TsInactTimeout; ++ ++ init_timer(&pRxTS->RxAdmittedBARecord.Timer); ++ pRxTS->RxAdmittedBARecord.Timer.data = (unsigned long)pRxTS; ++ pRxTS->RxAdmittedBARecord.Timer.function = RxBaInactTimeout; ++ ++ init_timer(&pRxTS->RxPktPendingTimer); ++ pRxTS->RxPktPendingTimer.data = (unsigned long)pRxTS; ++ pRxTS->RxPktPendingTimer.function = RxPktPendingTimeout; ++ ++ ResetRxTsEntry(pRxTS); ++ list_add_tail(&pRxTS->TsCommonInfo.List, &ieee->Rx_TS_Unused_List); ++ pRxTS++; ++ } ++ // Initialize unused Rx Reorder List. ++ INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); ++//#ifdef TO_DO_LIST ++ for(count = 0; count < REORDER_ENTRY_NUM; count++) ++ { ++ list_add_tail( &pRxReorderEntry->List,&ieee->RxReorder_Unused_List); ++ if(count == (REORDER_ENTRY_NUM-1)) ++ break; ++ pRxReorderEntry = &ieee->RxReorderEntry[count+1]; ++ } ++//#endif ++ ++} ++ ++void AdmitTS(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, u32 InactTime) ++{ ++ del_timer_sync(&pTsCommonInfo->SetupTimer); ++ del_timer_sync(&pTsCommonInfo->InactTimer); ++ ++ if(InactTime!=0) ++ mod_timer(&pTsCommonInfo->InactTimer, jiffies + MSECS(InactTime)); ++} ++ ++ ++PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee, u8* Addr, u8 TID, TR_SELECT TxRxSelect) ++{ ++ //DIRECTION_VALUE dir; ++ u8 dir; ++ bool search_dir[4] = {0, 0, 0, 0}; ++ struct list_head* psearch_list; //FIXME ++ PTS_COMMON_INFO pRet = NULL; ++ if(ieee->iw_mode == IW_MODE_MASTER) //ap mode ++ { ++ if(TxRxSelect == TX_DIR) ++ { ++ search_dir[DIR_DOWN] = true; ++ search_dir[DIR_BI_DIR]= true; ++ } ++ else ++ { ++ search_dir[DIR_UP] = true; ++ search_dir[DIR_BI_DIR]= true; ++ } ++ } ++ else if(ieee->iw_mode == IW_MODE_ADHOC) ++ { ++ if(TxRxSelect == TX_DIR) ++ search_dir[DIR_UP] = true; ++ else ++ search_dir[DIR_DOWN] = true; ++ } ++ else ++ { ++ if(TxRxSelect == TX_DIR) ++ { ++ search_dir[DIR_UP] = true; ++ search_dir[DIR_BI_DIR]= true; ++ search_dir[DIR_DIRECT]= true; ++ } ++ else ++ { ++ search_dir[DIR_DOWN] = true; ++ search_dir[DIR_BI_DIR]= true; ++ search_dir[DIR_DIRECT]= true; ++ } ++ } ++ ++ if(TxRxSelect == TX_DIR) ++ psearch_list = &ieee->Tx_TS_Admit_List; ++ else ++ psearch_list = &ieee->Rx_TS_Admit_List; ++ ++ //for(dir = DIR_UP; dir <= DIR_BI_DIR; dir++) ++ for(dir = 0; dir <= DIR_BI_DIR; dir++) ++ { ++ if(search_dir[dir] ==false ) ++ continue; ++ list_for_each_entry(pRet, psearch_list, List){ ++ // IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:"MAC_FMT", TID:%d, dir:%d\n", MAC_ARG(pRet->Addr), pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection); ++ if (memcmp(pRet->Addr, Addr, 6) == 0) ++ if (pRet->TSpec.f.TSInfo.field.ucTSID == TID) ++ if(pRet->TSpec.f.TSInfo.field.ucDirection == dir) ++ { ++ // printk("Bingo! got it\n"); ++ break; ++ } ++ ++ } ++ if(&pRet->List != psearch_list) ++ break; ++ } ++ ++ if(&pRet->List != psearch_list){ ++ return pRet ; ++ } ++ else ++ return NULL; ++} ++ ++void MakeTSEntry( ++ PTS_COMMON_INFO pTsCommonInfo, ++ u8* Addr, ++ PTSPEC_BODY pTSPEC, ++ PQOS_TCLAS pTCLAS, ++ u8 TCLAS_Num, ++ u8 TCLAS_Proc ++ ) ++{ ++ u8 count; ++ ++ if(pTsCommonInfo == NULL) ++ return; ++ ++ memcpy(pTsCommonInfo->Addr, Addr, 6); ++ ++ if(pTSPEC != NULL) ++ memcpy((u8*)(&(pTsCommonInfo->TSpec)), (u8*)pTSPEC, sizeof(TSPEC_BODY)); ++ ++ for(count = 0; count < TCLAS_Num; count++) ++ memcpy((u8*)(&(pTsCommonInfo->TClass[count])), (u8*)pTCLAS, sizeof(QOS_TCLAS)); ++ ++ pTsCommonInfo->TClasProc = TCLAS_Proc; ++ pTsCommonInfo->TClasNum = TCLAS_Num; ++} ++ ++ ++bool GetTs( ++ struct ieee80211_device* ieee, ++ PTS_COMMON_INFO *ppTS, ++ u8* Addr, ++ u8 TID, ++ TR_SELECT TxRxSelect, //Rx:1, Tx:0 ++ bool bAddNewTs ++ ) ++{ ++ u8 UP = 0; ++ // ++ // We do not build any TS for Broadcast or Multicast stream. ++ // So reject these kinds of search here. ++ // ++ if(is_broadcast_ether_addr(Addr) || is_multicast_ether_addr(Addr)) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n"); ++ return false; ++ } ++#if 0 ++ if(ieee->pStaQos->CurrentQosMode == QOS_DISABLE) ++ { UP = 0; } //only use one TS ++ else if(ieee->pStaQos->CurrentQosMode & QOS_WMM) ++ { ++#else ++ if (ieee->current_network.qos_data.supported == 0) ++ UP = 0; ++ else ++ { ++#endif ++ // In WMM case: we use 4 TID only ++ if (!IsACValid(TID)) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, " in %s(), TID(%d) is not valid\n", __FUNCTION__, TID); ++ return false; ++ } ++ ++ switch(TID) ++ { ++ case 0: ++ case 3: ++ UP = 0; ++ break; ++ ++ case 1: ++ case 2: ++ UP = 2; ++ break; ++ ++ case 4: ++ case 5: ++ UP = 5; ++ break; ++ ++ case 6: ++ case 7: ++ UP = 7; ++ break; ++ } ++ } ++ ++ *ppTS = SearchAdmitTRStream( ++ ieee, ++ Addr, ++ UP, ++ TxRxSelect); ++ if(*ppTS != NULL) ++ { ++ return true; ++ } ++ else ++ { ++ if(bAddNewTs == false) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_TS, "add new TS failed(tid:%d)\n", UP); ++ return false; ++ } ++ else ++ { ++ // ++ // Create a new Traffic stream for current Tx/Rx ++ // This is for EDCA and WMM to add a new TS. ++ // For HCCA or WMMSA, TS cannot be addmit without negotiation. ++ // ++ TSPEC_BODY TSpec; ++ PQOS_TSINFO pTSInfo = &TSpec.f.TSInfo; ++ struct list_head* pUnusedList = ++ (TxRxSelect == TX_DIR)? ++ (&ieee->Tx_TS_Unused_List): ++ (&ieee->Rx_TS_Unused_List); ++ ++ struct list_head* pAddmitList = ++ (TxRxSelect == TX_DIR)? ++ (&ieee->Tx_TS_Admit_List): ++ (&ieee->Rx_TS_Admit_List); ++ ++ DIRECTION_VALUE Dir = (ieee->iw_mode == IW_MODE_MASTER)? ++ ((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP): ++ ((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN); ++ IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n"); ++ if(!list_empty(pUnusedList)) ++ { ++ (*ppTS) = list_entry(pUnusedList->next, TS_COMMON_INFO, List); ++ list_del_init(&(*ppTS)->List); ++ if(TxRxSelect==TX_DIR) ++ { ++ PTX_TS_RECORD tmp = container_of(*ppTS, TX_TS_RECORD, TsCommonInfo); ++ ResetTxTsEntry(tmp); ++ } ++ else{ ++ PRX_TS_RECORD tmp = container_of(*ppTS, RX_TS_RECORD, TsCommonInfo); ++ ResetRxTsEntry(tmp); ++ } ++ ++ IEEE80211_DEBUG(IEEE80211_DL_TS, "to init current TS, UP:%d, Dir:%d, addr:"MAC_FMT"\n", UP, Dir, MAC_ARG(Addr)); ++ // Prepare TS Info releated field ++ pTSInfo->field.ucTrafficType = 0; // Traffic type: WMM is reserved in this field ++ pTSInfo->field.ucTSID = UP; // TSID ++ pTSInfo->field.ucDirection = Dir; // Direction: if there is DirectLink, this need additional consideration. ++ pTSInfo->field.ucAccessPolicy = 1; // Access policy ++ pTSInfo->field.ucAggregation = 0; // Aggregation ++ pTSInfo->field.ucPSB = 0; // Aggregation ++ pTSInfo->field.ucUP = UP; // User priority ++ pTSInfo->field.ucTSInfoAckPolicy = 0; // Ack policy ++ pTSInfo->field.ucSchedule = 0; // Schedule ++ ++ MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); ++ AdmitTS(ieee, *ppTS, 0); ++ list_add_tail(&((*ppTS)->List), pAddmitList); ++ // if there is DirectLink, we need to do additional operation here!! ++ ++ return true; ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "in function %s() There is not enough TS record to be used!!", __FUNCTION__); ++ return false; ++ } ++ } ++ } ++} ++ ++void RemoveTsEntry( ++ struct ieee80211_device* ieee, ++ PTS_COMMON_INFO pTs, ++ TR_SELECT TxRxSelect ++ ) ++{ ++ //u32 flags = 0; ++ unsigned long flags = 0; ++ del_timer_sync(&pTs->SetupTimer); ++ del_timer_sync(&pTs->InactTimer); ++ TsInitDelBA(ieee, pTs, TxRxSelect); ++ ++ if(TxRxSelect == RX_DIR) ++ { ++//#ifdef TO_DO_LIST ++ PRX_REORDER_ENTRY pRxReorderEntry; ++ PRX_TS_RECORD pRxTS = (PRX_TS_RECORD)pTs; ++ if(timer_pending(&pRxTS->RxPktPendingTimer)) ++ del_timer_sync(&pRxTS->RxPktPendingTimer); ++ ++ while(!list_empty(&pRxTS->RxPendingPktList)) ++ { ++ // PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); ++ spin_lock_irqsave(&(ieee->reorder_spinlock), flags); ++ //pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); ++ pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); ++ list_del_init(&pRxReorderEntry->List); ++ { ++ int i = 0; ++ struct ieee80211_rxb * prxb = pRxReorderEntry->prxb; ++ if (unlikely(!prxb)) ++ { ++ spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); ++ return; ++ } ++ for(i =0; i < prxb->nr_subframes; i++) { ++ dev_kfree_skb(prxb->subframes[i]); ++ } ++ kfree(prxb); ++ prxb = NULL; ++ } ++ list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); ++ //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); ++ spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); ++ } ++ ++//#endif ++ } ++ else ++ { ++ PTX_TS_RECORD pTxTS = (PTX_TS_RECORD)pTs; ++ del_timer_sync(&pTxTS->TsAddBaTimer); ++ } ++} ++ ++void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr) ++{ ++ PTS_COMMON_INFO pTS, pTmpTS; ++ printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr)); ++#if 1 ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) ++ { ++ if (memcmp(pTS->Addr, Addr, 6) == 0) ++ { ++ RemoveTsEntry(ieee, pTS, TX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); ++ } ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) ++ { ++ if (memcmp(pTS->Addr, Addr, 6) == 0) ++ { ++ printk("====>remove Tx_TS_admin_list\n"); ++ RemoveTsEntry(ieee, pTS, TX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); ++ } ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) ++ { ++ if (memcmp(pTS->Addr, Addr, 6) == 0) ++ { ++ RemoveTsEntry(ieee, pTS, RX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); ++ } ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) ++ { ++ if (memcmp(pTS->Addr, Addr, 6) == 0) ++ { ++ RemoveTsEntry(ieee, pTS, RX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); ++ } ++ } ++#endif ++} ++ ++void RemoveAllTS(struct ieee80211_device* ieee) ++{ ++ PTS_COMMON_INFO pTS, pTmpTS; ++#if 1 ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) ++ { ++ RemoveTsEntry(ieee, pTS, TX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) ++ { ++ RemoveTsEntry(ieee, pTS, TX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) ++ { ++ RemoveTsEntry(ieee, pTS, RX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); ++ } ++ ++ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) ++ { ++ RemoveTsEntry(ieee, pTS, RX_DIR); ++ list_del_init(&pTS->List); ++ list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); ++ } ++#endif ++} ++ ++void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) ++{ ++ if(pTxTS->bAddBaReqInProgress == false) ++ { ++ pTxTS->bAddBaReqInProgress = true; ++#if 1 ++ if(pTxTS->bAddBaReqDelayed) ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); ++ mod_timer(&pTxTS->TsAddBaTimer, jiffies + MSECS(TS_ADDBA_DELAY)); ++ } ++ else ++ { ++ IEEE80211_DEBUG(IEEE80211_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n"); ++ mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); //set 10 ticks ++ } ++#endif ++ } ++ else ++ IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __FUNCTION__); ++} ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++EXPORT_SYMBOL_NOVERS(RemovePeerTS); ++#else ++//EXPORT_SYMBOL(RemovePeerTS); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/rtl_crypto.h +@@ -0,0 +1,399 @@ ++/* ++ * Scatterlist Cryptographic API. ++ * ++ * Copyright (c) 2002 James Morris ++ * Copyright (c) 2002 David S. Miller (davem@redhat.com) ++ * ++ * Portions derived from Cryptoapi, by Alexander Kjeldaas ++ * and Nettle, by Niels M鰈ler. ++ * ++ * 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. ++ * ++ */ ++#ifndef _LINUX_CRYPTO_H ++#define _LINUX_CRYPTO_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define crypto_register_alg crypto_register_alg_rsl ++#define crypto_unregister_alg crypto_unregister_alg_rsl ++#define crypto_alloc_tfm crypto_alloc_tfm_rsl ++#define crypto_free_tfm crypto_free_tfm_rsl ++#define crypto_alg_available crypto_alg_available_rsl ++ ++/* ++ * Algorithm masks and types. ++ */ ++#define CRYPTO_ALG_TYPE_MASK 0x000000ff ++#define CRYPTO_ALG_TYPE_CIPHER 0x00000001 ++#define CRYPTO_ALG_TYPE_DIGEST 0x00000002 ++#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004 ++ ++/* ++ * Transform masks and values (for crt_flags). ++ */ ++#define CRYPTO_TFM_MODE_MASK 0x000000ff ++#define CRYPTO_TFM_REQ_MASK 0x000fff00 ++#define CRYPTO_TFM_RES_MASK 0xfff00000 ++ ++#define CRYPTO_TFM_MODE_ECB 0x00000001 ++#define CRYPTO_TFM_MODE_CBC 0x00000002 ++#define CRYPTO_TFM_MODE_CFB 0x00000004 ++#define CRYPTO_TFM_MODE_CTR 0x00000008 ++ ++#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 ++#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 ++#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 ++#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 ++#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000 ++#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000 ++ ++/* ++ * Miscellaneous stuff. ++ */ ++#define CRYPTO_UNSPEC 0 ++#define CRYPTO_MAX_ALG_NAME 64 ++ ++struct scatterlist; ++ ++/* ++ * Algorithms: modular crypto algorithm implementations, managed ++ * via crypto_register_alg() and crypto_unregister_alg(). ++ */ ++struct cipher_alg { ++ unsigned int cia_min_keysize; ++ unsigned int cia_max_keysize; ++ int (*cia_setkey)(void *ctx, const u8 *key, ++ unsigned int keylen, u32 *flags); ++ void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); ++ void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); ++}; ++ ++struct digest_alg { ++ unsigned int dia_digestsize; ++ void (*dia_init)(void *ctx); ++ void (*dia_update)(void *ctx, const u8 *data, unsigned int len); ++ void (*dia_final)(void *ctx, u8 *out); ++ int (*dia_setkey)(void *ctx, const u8 *key, ++ unsigned int keylen, u32 *flags); ++}; ++ ++struct compress_alg { ++ int (*coa_init)(void *ctx); ++ void (*coa_exit)(void *ctx); ++ int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen); ++ int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen); ++}; ++ ++#define cra_cipher cra_u.cipher ++#define cra_digest cra_u.digest ++#define cra_compress cra_u.compress ++ ++struct crypto_alg { ++ struct list_head cra_list; ++ u32 cra_flags; ++ unsigned int cra_blocksize; ++ unsigned int cra_ctxsize; ++ const char cra_name[CRYPTO_MAX_ALG_NAME]; ++ ++ union { ++ struct cipher_alg cipher; ++ struct digest_alg digest; ++ struct compress_alg compress; ++ } cra_u; ++ ++ struct module *cra_module; ++}; ++ ++/* ++ * Algorithm registration interface. ++ */ ++int crypto_register_alg(struct crypto_alg *alg); ++int crypto_unregister_alg(struct crypto_alg *alg); ++ ++/* ++ * Algorithm query interface. ++ */ ++int crypto_alg_available(const char *name, u32 flags); ++ ++/* ++ * Transforms: user-instantiated objects which encapsulate algorithms ++ * and core processing logic. Managed via crypto_alloc_tfm() and ++ * crypto_free_tfm(), as well as the various helpers below. ++ */ ++struct crypto_tfm; ++ ++struct cipher_tfm { ++ void *cit_iv; ++ unsigned int cit_ivsize; ++ u32 cit_mode; ++ int (*cit_setkey)(struct crypto_tfm *tfm, ++ const u8 *key, unsigned int keylen); ++ int (*cit_encrypt)(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes); ++ int (*cit_encrypt_iv)(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv); ++ int (*cit_decrypt)(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes); ++ int (*cit_decrypt_iv)(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv); ++ void (*cit_xor_block)(u8 *dst, const u8 *src); ++}; ++ ++struct digest_tfm { ++ void (*dit_init)(struct crypto_tfm *tfm); ++ void (*dit_update)(struct crypto_tfm *tfm, ++ struct scatterlist *sg, unsigned int nsg); ++ void (*dit_final)(struct crypto_tfm *tfm, u8 *out); ++ void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, ++ unsigned int nsg, u8 *out); ++ int (*dit_setkey)(struct crypto_tfm *tfm, ++ const u8 *key, unsigned int keylen); ++#ifdef CONFIG_CRYPTO_HMAC ++ void *dit_hmac_block; ++#endif ++}; ++ ++struct compress_tfm { ++ int (*cot_compress)(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen); ++ int (*cot_decompress)(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen); ++}; ++ ++#define crt_cipher crt_u.cipher ++#define crt_digest crt_u.digest ++#define crt_compress crt_u.compress ++ ++struct crypto_tfm { ++ ++ u32 crt_flags; ++ ++ union { ++ struct cipher_tfm cipher; ++ struct digest_tfm digest; ++ struct compress_tfm compress; ++ } crt_u; ++ ++ struct crypto_alg *__crt_alg; ++}; ++ ++/* ++ * Transform user interface. ++ */ ++ ++/* ++ * crypto_alloc_tfm() will first attempt to locate an already loaded algorithm. ++ * If that fails and the kernel supports dynamically loadable modules, it ++ * will then attempt to load a module of the same name or alias. A refcount ++ * is grabbed on the algorithm which is then associated with the new transform. ++ * ++ * crypto_free_tfm() frees up the transform and any associated resources, ++ * then drops the refcount on the associated algorithm. ++ */ ++struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); ++void crypto_free_tfm(struct crypto_tfm *tfm); ++ ++/* ++ * Transform helpers which query the underlying algorithm. ++ */ ++static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm) ++{ ++ return tfm->__crt_alg->cra_name; ++} ++ ++static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm) ++{ ++ struct crypto_alg *alg = tfm->__crt_alg; ++ ++ if (alg->cra_module) ++ return alg->cra_module->name; ++ else ++ return NULL; ++} ++ ++static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) ++{ ++ return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; ++} ++ ++static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->__crt_alg->cra_cipher.cia_min_keysize; ++} ++ ++static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->__crt_alg->cra_cipher.cia_max_keysize; ++} ++ ++static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_ivsize; ++} ++ ++static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) ++{ ++ return tfm->__crt_alg->cra_blocksize; ++} ++ ++static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ return tfm->__crt_alg->cra_digest.dia_digestsize; ++} ++ ++/* ++ * API wrappers. ++ */ ++static inline void crypto_digest_init(struct crypto_tfm *tfm) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ tfm->crt_digest.dit_init(tfm); ++} ++ ++static inline void crypto_digest_update(struct crypto_tfm *tfm, ++ struct scatterlist *sg, ++ unsigned int nsg) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ tfm->crt_digest.dit_update(tfm, sg, nsg); ++} ++ ++static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ tfm->crt_digest.dit_final(tfm, out); ++} ++ ++static inline void crypto_digest_digest(struct crypto_tfm *tfm, ++ struct scatterlist *sg, ++ unsigned int nsg, u8 *out) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ tfm->crt_digest.dit_digest(tfm, sg, nsg, out); ++} ++ ++static inline int crypto_digest_setkey(struct crypto_tfm *tfm, ++ const u8 *key, unsigned int keylen) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); ++ if (tfm->crt_digest.dit_setkey == NULL) ++ return -ENOSYS; ++ return tfm->crt_digest.dit_setkey(tfm, key, keylen); ++} ++ ++static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, ++ const u8 *key, unsigned int keylen) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_setkey(tfm, key, keylen); ++} ++ ++static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); ++} ++ ++static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); ++ return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv); ++} ++ ++static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); ++} ++ ++static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, ++ struct scatterlist *dst, ++ struct scatterlist *src, ++ unsigned int nbytes, u8 *iv) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); ++ return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv); ++} ++ ++static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int len) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ memcpy(tfm->crt_cipher.cit_iv, src, len); ++} ++ ++static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, ++ u8 *dst, unsigned int len) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); ++ memcpy(dst, tfm->crt_cipher.cit_iv, len); ++} ++ ++static inline int crypto_comp_compress(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); ++ return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); ++} ++ ++static inline int crypto_comp_decompress(struct crypto_tfm *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dst, unsigned int *dlen) ++{ ++ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); ++ return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); ++} ++ ++/* ++ * HMAC support. ++ */ ++#ifdef CONFIG_CRYPTO_HMAC ++void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen); ++void crypto_hmac_update(struct crypto_tfm *tfm, ++ struct scatterlist *sg, unsigned int nsg); ++void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key, ++ unsigned int *keylen, u8 *out); ++void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen, ++ struct scatterlist *sg, unsigned int nsg, u8 *out); ++#endif /* CONFIG_CRYPTO_HMAC */ ++ ++#endif /* _LINUX_CRYPTO_H */ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/scatterwalk.c +@@ -0,0 +1,126 @@ ++/* ++ * Cryptographic API. ++ * ++ * Cipher operations. ++ * ++ * Copyright (c) 2002 James Morris ++ * 2002 Adam J. Richter ++ * 2004 Jean-Luc Cooke ++ * ++ * 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. ++ * ++ */ ++#include "kmap_types.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include "internal.h" ++#include "scatterwalk.h" ++ ++enum km_type crypto_km_types[] = { ++ KM_USER0, ++ KM_USER1, ++ KM_SOFTIRQ0, ++ KM_SOFTIRQ1, ++}; ++ ++void *scatterwalk_whichbuf(struct scatter_walk *walk, unsigned int nbytes, void *scratch) ++{ ++ if (nbytes <= walk->len_this_page && ++ (((unsigned long)walk->data) & (PAGE_CACHE_SIZE - 1)) + nbytes <= ++ PAGE_CACHE_SIZE) ++ return walk->data; ++ else ++ return scratch; ++} ++ ++static void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) ++{ ++ if (out) ++ memcpy(sgdata, buf, nbytes); ++ else ++ memcpy(buf, sgdata, nbytes); ++} ++ ++void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg) ++{ ++ unsigned int rest_of_page; ++ ++ walk->sg = sg; ++ ++ walk->page = sg->page; ++ walk->len_this_segment = sg->length; ++ ++ rest_of_page = PAGE_CACHE_SIZE - (sg->offset & (PAGE_CACHE_SIZE - 1)); ++ walk->len_this_page = min(sg->length, rest_of_page); ++ walk->offset = sg->offset; ++} ++ ++void scatterwalk_map(struct scatter_walk *walk, int out) ++{ ++ walk->data = crypto_kmap(walk->page, out) + walk->offset; ++} ++ ++static void scatterwalk_pagedone(struct scatter_walk *walk, int out, ++ unsigned int more) ++{ ++ /* walk->data may be pointing the first byte of the next page; ++ however, we know we transfered at least one byte. So, ++ walk->data - 1 will be a virtual address in the mapped page. */ ++ ++ if (out) ++ flush_dcache_page(walk->page); ++ ++ if (more) { ++ walk->len_this_segment -= walk->len_this_page; ++ ++ if (walk->len_this_segment) { ++ walk->page++; ++ walk->len_this_page = min(walk->len_this_segment, ++ (unsigned)PAGE_CACHE_SIZE); ++ walk->offset = 0; ++ } ++ else ++ scatterwalk_start(walk, sg_next(walk->sg)); ++ } ++} ++ ++void scatterwalk_done(struct scatter_walk *walk, int out, int more) ++{ ++ crypto_kunmap(walk->data, out); ++ if (walk->len_this_page == 0 || !more) ++ scatterwalk_pagedone(walk, out, more); ++} ++ ++/* ++ * Do not call this unless the total length of all of the fragments ++ * has been verified as multiple of the block size. ++ */ ++int scatterwalk_copychunks(void *buf, struct scatter_walk *walk, ++ size_t nbytes, int out) ++{ ++ if (buf != walk->data) { ++ while (nbytes > walk->len_this_page) { ++ memcpy_dir(buf, walk->data, walk->len_this_page, out); ++ buf += walk->len_this_page; ++ nbytes -= walk->len_this_page; ++ ++ crypto_kunmap(walk->data, out); ++ scatterwalk_pagedone(walk, out, 1); ++ scatterwalk_map(walk, out); ++ } ++ ++ memcpy_dir(buf, walk->data, nbytes, out); ++ } ++ ++ walk->offset += nbytes; ++ walk->len_this_page -= nbytes; ++ walk->len_this_segment -= nbytes; ++ return 0; ++} +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211/scatterwalk.h +@@ -0,0 +1,51 @@ ++/* ++ * Cryptographic API. ++ * ++ * Copyright (c) 2002 James Morris ++ * Copyright (c) 2002 Adam J. Richter ++ * Copyright (c) 2004 Jean-Luc Cooke ++ * ++ * 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. ++ * ++ */ ++ ++#ifndef _CRYPTO_SCATTERWALK_H ++#define _CRYPTO_SCATTERWALK_H ++#include ++#include ++ ++struct scatter_walk { ++ struct scatterlist *sg; ++ struct page *page; ++ void *data; ++ unsigned int len_this_page; ++ unsigned int len_this_segment; ++ unsigned int offset; ++}; ++ ++/* Define sg_next is an inline routine now in case we want to change ++ scatterlist to a linked list later. */ ++static inline struct scatterlist *sg_next(struct scatterlist *sg) ++{ ++ return sg + 1; ++} ++ ++static inline int scatterwalk_samebuf(struct scatter_walk *walk_in, ++ struct scatter_walk *walk_out, ++ void *src_p, void *dst_p) ++{ ++ return walk_in->page == walk_out->page && ++ walk_in->offset == walk_out->offset && ++ walk_in->data == src_p && walk_out->data == dst_p; ++} ++ ++void *scatterwalk_whichbuf(struct scatter_walk *walk, unsigned int nbytes, void *scratch); ++void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg); ++int scatterwalk_copychunks(void *buf, struct scatter_walk *walk, size_t nbytes, int out); ++void scatterwalk_map(struct scatter_walk *walk, int out); ++void scatterwalk_done(struct scatter_walk *walk, int out, int more); ++ ++#endif /* _CRYPTO_SCATTERWALK_H */ +--- /dev/null ++++ b/drivers/staging/rtl8192e/ieee80211_crypt.h +@@ -0,0 +1,86 @@ ++/* ++ * Original code based on Host AP (software wireless LAN access point) driver ++ * for Intersil Prism2/2.5/3. ++ * ++ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen ++ * ++ * Copyright (c) 2002-2003, Jouni Malinen ++ * ++ * Adaption to a generic IEEE 802.11 stack by James Ketrenos ++ * ++ * ++ * Copyright (c) 2004, Intel Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. See README and COPYING for ++ * more details. ++ */ ++ ++/* ++ * This file defines the interface to the ieee80211 crypto module. ++ */ ++#ifndef IEEE80211_CRYPT_H ++#define IEEE80211_CRYPT_H ++ ++#include ++ ++struct ieee80211_crypto_ops { ++ const char *name; ++ ++ /* init new crypto context (e.g., allocate private data space, ++ * select IV, etc.); returns NULL on failure or pointer to allocated ++ * private data on success */ ++ void * (*init)(int keyidx); ++ ++ /* deinitialize crypto context and free allocated private data */ ++ void (*deinit)(void *priv); ++ ++ /* encrypt/decrypt return < 0 on error or >= 0 on success. The return ++ * value from decrypt_mpdu is passed as the keyidx value for ++ * decrypt_msdu. skb must have enough head and tail room for the ++ * encryption; if not, error will be returned; these functions are ++ * called for all MPDUs (i.e., fragments). ++ */ ++ int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ ++ /* These functions are called for full MSDUs, i.e. full frames. ++ * These can be NULL if full MSDU operations are not needed. */ ++ int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); ++ int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, ++ void *priv); ++ ++ int (*set_key)(void *key, int len, u8 *seq, void *priv); ++ int (*get_key)(void *key, int len, u8 *seq, void *priv); ++ ++ /* procfs handler for printing out key information and possible ++ * statistics */ ++ char * (*print_stats)(char *p, void *priv); ++ ++ /* maximum number of bytes added by encryption; encrypt buf is ++ * allocated with extra_prefix_len bytes, copy of in_buf, and ++ * extra_postfix_len; encrypt need not use all this space, but ++ * the result must start at the beginning of the buffer and correct ++ * length must be returned */ ++ int extra_prefix_len, extra_postfix_len; ++ ++ struct module *owner; ++}; ++ ++struct ieee80211_crypt_data { ++ struct list_head list; /* delayed deletion list */ ++ struct ieee80211_crypto_ops *ops; ++ void *priv; ++ atomic_t refcnt; ++}; ++ ++int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); ++int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); ++struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); ++void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); ++void ieee80211_crypt_deinit_handler(unsigned long); ++void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, ++ struct ieee80211_crypt_data **crypt); ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8180_93cx6.c +@@ -0,0 +1,146 @@ ++/* ++ This files contains card eeprom (93c46 or 93c56) programming routines, ++ memory is addressed by 16 bits words. ++ ++ This is part of rtl8180 OpenSource driver. ++ Copyright (C) Andrea Merello 2004 ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part of the ++ official realtek driver. ++ ++ Parts of this driver are based on the rtl8180 driver skeleton ++ from Patric Schenke & Andres Salomon. ++ ++ Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. ++ ++ We want to tanks the Authors of those projects and the Ndiswrapper ++ project Authors. ++*/ ++ ++#include "r8180_93cx6.h" ++ ++static void eprom_cs(struct net_device *dev, short bit) ++{ ++ if(bit) ++ write_nic_byte(dev, EPROM_CMD, ++ (1<epromtype==EPROM_93c56){ ++ addr_str[7]=addr & 1; ++ addr_str[6]=addr & (1<<1); ++ addr_str[5]=addr & (1<<2); ++ addr_str[4]=addr & (1<<3); ++ addr_str[3]=addr & (1<<4); ++ addr_str[2]=addr & (1<<5); ++ addr_str[1]=addr & (1<<6); ++ addr_str[0]=addr & (1<<7); ++ addr_len=8; ++ }else{ ++ addr_str[5]=addr & 1; ++ addr_str[4]=addr & (1<<1); ++ addr_str[3]=addr & (1<<2); ++ addr_str[2]=addr & (1<<3); ++ addr_str[1]=addr & (1<<4); ++ addr_str[0]=addr & (1<<5); ++ addr_len=6; ++ } ++ eprom_cs(dev, 1); ++ eprom_ck_cycle(dev); ++ eprom_send_bits_string(dev, read_cmd, 3); ++ eprom_send_bits_string(dev, addr_str, addr_len); ++ ++ //keep chip pin D to low state while reading. ++ //I'm unsure if it is necessary, but anyway shouldn't hurt ++ eprom_w(dev, 0); ++ ++ for(i=0;i<16;i++){ ++ //eeprom needs a clk cycle between writing opcode&adr ++ //and reading data. (eeprom outs a dummy 0) ++ eprom_ck_cycle(dev); ++ ret |= (eprom_r(dev)<<(15-i)); ++ } ++ ++ eprom_cs(dev, 0); ++ eprom_ck_cycle(dev); ++ ++ //disable EPROM programming ++ write_nic_byte(dev, EPROM_CMD, ++ (EPROM_CMD_NORMAL< ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part of the official realtek driver ++ Parts of this driver are based on the rtl8180 driver skeleton from Patric Schenke & Andres Salomon ++ Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver ++ ++ We want to tanks the Authors of such projects and the Ndiswrapper project Authors. ++*/ ++ ++/*This files contains card eeprom (93c46 or 93c56) programming routines*/ ++/*memory is addressed by WORDS*/ ++ ++#include "r8192E.h" ++#include "r8192E_hw.h" ++ ++#define EPROM_DELAY 10 ++ ++#define EPROM_ANAPARAM_ADDRLWORD 0xd ++#define EPROM_ANAPARAM_ADDRHWORD 0xe ++ ++#define EPROM_RFCHIPID 0x6 ++#define EPROM_TXPW_BASE 0x05 ++#define EPROM_RFCHIPID_RTL8225U 5 ++#define EPROM_RF_PARAM 0x4 ++#define EPROM_CONFIG2 0xc ++ ++#define EPROM_VERSION 0x1E ++#define MAC_ADR 0x7 ++ ++#define CIS 0x18 ++ ++#define EPROM_TXPW0 0x16 ++#define EPROM_TXPW2 0x1b ++#define EPROM_TXPW1 0x3d ++ ++ ++u32 eprom_read(struct net_device *dev,u32 addr); //reads a 16 bits word +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8190_rtl8256.c +@@ -0,0 +1,1161 @@ ++/* ++ This is part of the rtl8192 driver ++ released under the GPL (See file COPYING for details). ++ ++ This files contains programming code for the rtl8256 ++ radio frontend. ++ ++ *Many* thanks to Realtek Corp. for their great support! ++ ++*/ ++ ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#include "r819xE_phyreg.h" ++#include "r819xE_phy.h" ++#include "r8190_rtl8256.h" ++ ++/*-------------------------------------------------------------------------- ++ * Overview: set RF band width (20M or 40M) ++ * Input: struct net_device* dev ++ * WIRELESS_BANDWIDTH_E Bandwidth //20M or 40M ++ * Output: NONE ++ * Return: NONE ++ * Note: 8226 support both 20M and 40 MHz ++ *---------------------------------------------------------------------------*/ ++void PHY_SetRF8256Bandwidth(struct net_device* dev , HT_CHANNEL_WIDTH Bandwidth) //20M or 40M ++{ ++ u8 eRFPath; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ //for(eRFPath = RF90_PATH_A; eRFPath NumTotalRFPath; eRFPath++) ++ for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) ++ { ++ if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath)) ++ continue; ++ ++ switch(Bandwidth) ++ { ++ case HT_CHANNEL_WIDTH_20: ++ if(priv->card_8192_version == VERSION_8190_BD || priv->card_8192_version == VERSION_8190_BE)// 8256 D-cut, E-cut, xiong: consider it later! ++ { ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x100); //phy para:1ba ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7); ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x0e, bMask12Bits, 0x021); ++ ++ //cosa add for sd3's request 01/23/2008 ++ //rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x5ab); ++ } ++ else ++ { ++ RT_TRACE(COMP_ERR, "PHY_SetRF8256Bandwidth(): unknown hardware version\n"); ++ } ++ ++ break; ++ case HT_CHANNEL_WIDTH_20_40: ++ if(priv->card_8192_version == VERSION_8190_BD ||priv->card_8192_version == VERSION_8190_BE)// 8256 D-cut, E-cut, xiong: consider it later! ++ { ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x300); //phy para:3ba ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3ff); ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x0e, bMask12Bits, 0x0e1); ++ ++ //cosa add for sd3's request 01/23/2008 ++ #if 0 ++ if(priv->chan == 3 || priv->chan == 9) //I need to set priv->chan whenever current channel changes ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x59b); ++ else ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x5ab); ++ #endif ++ } ++ else ++ { ++ RT_TRACE(COMP_ERR, "PHY_SetRF8256Bandwidth(): unknown hardware version\n"); ++ } ++ ++ ++ break; ++ default: ++ RT_TRACE(COMP_ERR, "PHY_SetRF8256Bandwidth(): unknown Bandwidth: %#X\n",Bandwidth ); ++ break; ++ ++ } ++ } ++ return; ++} ++/*-------------------------------------------------------------------------- ++ * Overview: Interface to config 8256 ++ * Input: struct net_device* dev ++ * Output: NONE ++ * Return: NONE ++ *---------------------------------------------------------------------------*/ ++RT_STATUS PHY_RF8256_Config(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ // Initialize general global value ++ // ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ // TODO: Extend RF_PATH_C and RF_PATH_D in the future ++ priv->NumTotalRFPath = RTL819X_TOTAL_RF_PATH; ++ // Config BB and RF ++ rtStatus = phy_RF8256_Config_ParaFile(dev); ++ ++ return rtStatus; ++} ++/*-------------------------------------------------------------------------- ++ * Overview: Interface to config 8256 ++ * Input: struct net_device* dev ++ * Output: NONE ++ * Return: NONE ++ *---------------------------------------------------------------------------*/ ++RT_STATUS phy_RF8256_Config_ParaFile(struct net_device* dev) ++{ ++ u32 u4RegValue = 0; ++ u8 eRFPath; ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ BB_REGISTER_DEFINITION_T *pPhyReg; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 RegOffSetToBeCheck = 0x3; ++ u32 RegValueToBeCheck = 0x7f1; ++ u32 RF3_Final_Value = 0; ++ u8 ConstRetryTimes = 5, RetryTimes = 5; ++ u8 ret = 0; ++ //3//----------------------------------------------------------------- ++ //3// <2> Initialize RF ++ //3//----------------------------------------------------------------- ++ for(eRFPath = (RF90_RADIO_PATH_E)RF90_PATH_A; eRFPath NumTotalRFPath; eRFPath++) ++ { ++ if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath)) ++ continue; ++ ++ pPhyReg = &priv->PHYRegDef[eRFPath]; ++ ++ // Joseph test for shorten RF config ++ // pHalData->RfReg0Value[eRFPath] = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, rGlobalCtrl, bMaskDWord); ++ ++ /*----Store original RFENV control type----*/ ++ switch(eRFPath) ++ { ++ case RF90_PATH_A: ++ case RF90_PATH_C: ++ u4RegValue = rtl8192_QueryBBReg(dev, pPhyReg->rfintfs, bRFSI_RFENV); ++ break; ++ case RF90_PATH_B : ++ case RF90_PATH_D: ++ u4RegValue = rtl8192_QueryBBReg(dev, pPhyReg->rfintfs, bRFSI_RFENV<<16); ++ break; ++ } ++ ++ /*----Set RF_ENV enable----*/ ++ rtl8192_setBBreg(dev, pPhyReg->rfintfe, bRFSI_RFENV<<16, 0x1); ++ ++ /*----Set RF_ENV output high----*/ ++ rtl8192_setBBreg(dev, pPhyReg->rfintfo, bRFSI_RFENV, 0x1); ++ ++ /* Set bit number of Address and Data for RF register */ ++ rtl8192_setBBreg(dev, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0); // Set 0 to 4 bits for Z-serial and set 1 to 6 bits for 8258 ++ rtl8192_setBBreg(dev, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); // Set 0 to 12 bits for Z-serial and 8258, and set 1 to 14 bits for ??? ++ ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E) eRFPath, 0x0, bMask12Bits, 0xbf); ++ ++ /*----Check RF block (for FPGA platform only)----*/ ++ // TODO: this function should be removed on ASIC , Emily 2007.2.2 ++ rtStatus = rtl8192_phy_checkBBAndRF(dev, HW90_BLOCK_RF, (RF90_RADIO_PATH_E)eRFPath); ++ if(rtStatus!= RT_STATUS_SUCCESS) ++ { ++ RT_TRACE(COMP_ERR, "PHY_RF8256_Config():Check Radio[%d] Fail!!\n", eRFPath); ++ goto phy_RF8256_Config_ParaFile_Fail; ++ } ++ ++ RetryTimes = ConstRetryTimes; ++ RF3_Final_Value = 0; ++ /*----Initialize RF fom connfiguration file----*/ ++ switch(eRFPath) ++ { ++ case RF90_PATH_A: ++ while(RF3_Final_Value!=RegValueToBeCheck && RetryTimes!=0) ++ { ++ ret = rtl8192_phy_ConfigRFWithHeaderFile(dev,(RF90_RADIO_PATH_E)eRFPath); ++ RF3_Final_Value = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, RegOffSetToBeCheck, bMask12Bits); ++ RT_TRACE(COMP_RF, "RF %d %d register final value: %x\n", eRFPath, RegOffSetToBeCheck, RF3_Final_Value); ++ RetryTimes--; ++ } ++ break; ++ case RF90_PATH_B: ++ while(RF3_Final_Value!=RegValueToBeCheck && RetryTimes!=0) ++ { ++ ret = rtl8192_phy_ConfigRFWithHeaderFile(dev,(RF90_RADIO_PATH_E)eRFPath); ++ RF3_Final_Value = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, RegOffSetToBeCheck, bMask12Bits); ++ RT_TRACE(COMP_RF, "RF %d %d register final value: %x\n", eRFPath, RegOffSetToBeCheck, RF3_Final_Value); ++ RetryTimes--; ++ } ++ break; ++ case RF90_PATH_C: ++ while(RF3_Final_Value!=RegValueToBeCheck && RetryTimes!=0) ++ { ++ ret = rtl8192_phy_ConfigRFWithHeaderFile(dev,(RF90_RADIO_PATH_E)eRFPath); ++ RF3_Final_Value = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, RegOffSetToBeCheck, bMask12Bits); ++ RT_TRACE(COMP_RF, "RF %d %d register final value: %x\n", eRFPath, RegOffSetToBeCheck, RF3_Final_Value); ++ RetryTimes--; ++ } ++ break; ++ case RF90_PATH_D: ++ while(RF3_Final_Value!=RegValueToBeCheck && RetryTimes!=0) ++ { ++ ret = rtl8192_phy_ConfigRFWithHeaderFile(dev,(RF90_RADIO_PATH_E)eRFPath); ++ RF3_Final_Value = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, RegOffSetToBeCheck, bMask12Bits); ++ RT_TRACE(COMP_RF, "RF %d %d register final value: %x\n", eRFPath, RegOffSetToBeCheck, RF3_Final_Value); ++ RetryTimes--; ++ } ++ break; ++ } ++ ++ /*----Restore RFENV control type----*/; ++ switch(eRFPath) ++ { ++ case RF90_PATH_A: ++ case RF90_PATH_C: ++ rtl8192_setBBreg(dev, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue); ++ break; ++ case RF90_PATH_B : ++ case RF90_PATH_D: ++ rtl8192_setBBreg(dev, pPhyReg->rfintfs, bRFSI_RFENV<<16, u4RegValue); ++ break; ++ } ++ ++ if(ret){ ++ RT_TRACE(COMP_ERR, "phy_RF8256_Config_ParaFile():Radio[%d] Fail!!", eRFPath); ++ goto phy_RF8256_Config_ParaFile_Fail; ++ } ++ ++ } ++ ++ RT_TRACE(COMP_PHY, "PHY Initialization Success\n") ; ++ return RT_STATUS_SUCCESS; ++ ++phy_RF8256_Config_ParaFile_Fail: ++ RT_TRACE(COMP_ERR, "PHY Initialization failed\n") ; ++ return RT_STATUS_FAILURE; ++} ++ ++ ++void PHY_SetRF8256CCKTxPower(struct net_device* dev, u8 powerlevel) ++{ ++ u32 TxAGC=0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef RTL8190P ++ u8 byte0, byte1; ++ ++ TxAGC |= ((powerlevel<<8)|powerlevel); ++ TxAGC += priv->CCKTxPowerLevelOriginalOffset; ++ ++ if(priv->bDynamicTxLowPower == true //cosa 04282008 for cck long range ++ /*pMgntInfo->bScanInProgress == TRUE*/ ) //cosa 05/22/2008 for scan ++ { ++ if(priv->CustomerID == RT_CID_819x_Netcore) ++ TxAGC = 0x2222; ++ else ++ TxAGC += ((priv->CckPwEnl<<8)|priv->CckPwEnl); ++ } ++ ++ byte0 = (u8)(TxAGC & 0xff); ++ byte1 = (u8)((TxAGC & 0xff00)>>8); ++ if(byte0 > 0x24) ++ byte0 = 0x24; ++ if(byte1 > 0x24) ++ byte1 = 0x24; ++ if(priv->rf_type == RF_2T4R) //Only 2T4R you have to care the Antenna Tx Power offset ++ { // check antenna C over the max index 0x24 ++ if(priv->RF_C_TxPwDiff > 0) ++ { ++ if( (byte0 + (u8)priv->RF_C_TxPwDiff) > 0x24) ++ byte0 = 0x24 - priv->RF_C_TxPwDiff; ++ if( (byte1 + (u8)priv->RF_C_TxPwDiff) > 0x24) ++ byte1 = 0x24 - priv->RF_C_TxPwDiff; ++ } ++ } ++ TxAGC = (byte1<<8) |byte0; ++ write_nic_dword(dev, CCK_TXAGC, TxAGC); ++#else ++ #ifdef RTL8192E ++ ++ TxAGC = powerlevel; ++ if(priv->bDynamicTxLowPower == true)//cosa 04282008 for cck long range ++ { ++ if(priv->CustomerID == RT_CID_819x_Netcore) ++ TxAGC = 0x22; ++ else ++ TxAGC += priv->CckPwEnl; ++ } ++ if(TxAGC > 0x24) ++ TxAGC = 0x24; ++ rtl8192_setBBreg(dev, rTxAGC_CCK_Mcs32, bTxAGCRateCCK, TxAGC); ++ #endif ++#endif ++} ++ ++ ++void PHY_SetRF8256OFDMTxPower(struct net_device* dev, u8 powerlevel) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //Joseph TxPower for 8192 testing ++#ifdef RTL8190P ++ u32 TxAGC1=0, TxAGC2=0, TxAGC2_tmp = 0; ++ u8 i, byteVal1[4], byteVal2[4], byteVal3[4]; ++ ++ if(priv->bDynamicTxHighPower == true) //Add by Jacken 2008/03/06 ++ { ++ TxAGC1 |= ((powerlevel<<24)|(powerlevel<<16)|(powerlevel<<8)|powerlevel); ++ //for tx power track ++ TxAGC2_tmp = TxAGC1; ++ ++ TxAGC1 += priv->MCSTxPowerLevelOriginalOffset[0]; ++ TxAGC2 =0x03030303; ++ ++ //for tx power track ++ TxAGC2_tmp += priv->MCSTxPowerLevelOriginalOffset[1]; ++ } ++ else ++ { ++ TxAGC1 |= ((powerlevel<<24)|(powerlevel<<16)|(powerlevel<<8)|powerlevel); ++ TxAGC2 = TxAGC1; ++ ++ TxAGC1 += priv->MCSTxPowerLevelOriginalOffset[0]; ++ TxAGC2 += priv->MCSTxPowerLevelOriginalOffset[1]; ++ ++ TxAGC2_tmp = TxAGC2; ++ ++ } ++ for(i=0; i<4; i++) ++ { ++ byteVal1[i] = (u8)( (TxAGC1 & (0xff<<(i*8))) >>(i*8) ); ++ if(byteVal1[i] > 0x24) ++ byteVal1[i] = 0x24; ++ byteVal2[i] = (u8)( (TxAGC2 & (0xff<<(i*8))) >>(i*8) ); ++ if(byteVal2[i] > 0x24) ++ byteVal2[i] = 0x24; ++ ++ //for tx power track ++ byteVal3[i] = (u8)( (TxAGC2_tmp & (0xff<<(i*8))) >>(i*8) ); ++ if(byteVal3[i] > 0x24) ++ byteVal3[i] = 0x24; ++ } ++ ++ if(priv->rf_type == RF_2T4R) //Only 2T4R you have to care the Antenna Tx Power offset ++ { // check antenna C over the max index 0x24 ++ if(priv->RF_C_TxPwDiff > 0) ++ { ++ for(i=0; i<4; i++) ++ { ++ if( (byteVal1[i] + (u8)priv->RF_C_TxPwDiff) > 0x24) ++ byteVal1[i] = 0x24 - priv->RF_C_TxPwDiff; ++ if( (byteVal2[i] + (u8)priv->RF_C_TxPwDiff) > 0x24) ++ byteVal2[i] = 0x24 - priv->RF_C_TxPwDiff; ++ if( (byteVal3[i] + (u8)priv->RF_C_TxPwDiff) > 0x24) ++ byteVal3[i] = 0x24 - priv->RF_C_TxPwDiff; ++ } ++ } ++ } ++ ++ TxAGC1 = (byteVal1[3]<<24) | (byteVal1[2]<<16) |(byteVal1[1]<<8) |byteVal1[0]; ++ TxAGC2 = (byteVal2[3]<<24) | (byteVal2[2]<<16) |(byteVal2[1]<<8) |byteVal2[0]; ++ ++ //for tx power track ++ TxAGC2_tmp = (byteVal3[3]<<24) | (byteVal3[2]<<16) |(byteVal3[1]<<8) |byteVal3[0]; ++ priv->Pwr_Track = TxAGC2_tmp; ++ //DbgPrint("TxAGC2_tmp = 0x%x\n", TxAGC2_tmp); ++ ++ //DbgPrint("TxAGC1/TxAGC2 = 0x%x/0x%x\n", TxAGC1, TxAGC2); ++ write_nic_dword(dev, MCS_TXAGC, TxAGC1); ++ write_nic_dword(dev, MCS_TXAGC+4, TxAGC2); ++#else ++#ifdef RTL8192E ++ u32 writeVal, powerBase0, powerBase1, writeVal_tmp; ++ u8 index = 0; ++ u16 RegOffset[6] = {0xe00, 0xe04, 0xe10, 0xe14, 0xe18, 0xe1c}; ++ u8 byte0, byte1, byte2, byte3; ++ ++ powerBase0 = powerlevel + priv->LegacyHTTxPowerDiff; //OFDM rates ++ powerBase0 = (powerBase0<<24) | (powerBase0<<16) |(powerBase0<<8) |powerBase0; ++ powerBase1 = powerlevel; //MCS rates ++ powerBase1 = (powerBase1<<24) | (powerBase1<<16) |(powerBase1<<8) |powerBase1; ++ ++ for(index=0; index<6; index++) ++ { ++ writeVal = priv->MCSTxPowerLevelOriginalOffset[index] + ((index<2)?powerBase0:powerBase1); ++ byte0 = (u8)(writeVal & 0x7f); ++ byte1 = (u8)((writeVal & 0x7f00)>>8); ++ byte2 = (u8)((writeVal & 0x7f0000)>>16); ++ byte3 = (u8)((writeVal & 0x7f000000)>>24); ++ if(byte0 > 0x24) // Max power index = 0x24 ++ byte0 = 0x24; ++ if(byte1 > 0x24) ++ byte1 = 0x24; ++ if(byte2 > 0x24) ++ byte2 = 0x24; ++ if(byte3 > 0x24) ++ byte3 = 0x24; ++ ++ if(index == 3) ++ { ++ writeVal_tmp = (byte3<<24) | (byte2<<16) |(byte1<<8) |byte0; ++ priv->Pwr_Track = writeVal_tmp; ++ } ++ ++ if(priv->bDynamicTxHighPower == true) //Add by Jacken 2008/03/06 //when DM implement, add this ++ { ++ writeVal = 0x03030303; ++ } ++ else ++ { ++ writeVal = (byte3<<24) | (byte2<<16) |(byte1<<8) |byte0; ++ } ++ rtl8192_setBBreg(dev, RegOffset[index], 0x7f7f7f7f, writeVal); ++ } ++ ++#endif ++#endif ++ return; ++} ++ ++#define MAX_DOZE_WAITING_TIMES_9x 64 ++static bool ++SetRFPowerState8190( ++ struct net_device* dev, ++ RT_RF_POWER_STATE eRFPowerState ++ ) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl)); ++ bool bResult = true; ++ //u8 eRFPath; ++ u8 i = 0, QueueID = 0; ++ ptx_ring head=NULL,tail=NULL; ++ ++ if(priv->SetRFPowerStateInProgress == true) ++ return false; ++ RT_TRACE(COMP_POWER, "===========> SetRFPowerState8190()!\n"); ++ priv->SetRFPowerStateInProgress = true; ++ ++ switch(priv->rf_chip) ++ { ++ case RF_8256: ++ switch( eRFPowerState ) ++ { ++ case eRfOn: ++ RT_TRACE(COMP_POWER, "SetRFPowerState8190() eRfOn !\n"); ++ //RXTX enable control: On ++ //for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) ++ // PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x2); ++ #ifdef RTL8190P ++ if(priv->rf_type == RF_2T4R) ++ { ++ //enable RF-Chip A/B ++ rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4] ++ //enable RF-Chip C/D ++ rtl8192_setBBreg(dev, rFPGA0_XC_RFInterfaceOE, BIT4, 0x1); // 0x868[4] ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0xf);// 0x88c[11:8] ++ //digital to analog on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x1e0, 0xf); // 0x880[8:5] ++ //rx antenna on ++ rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0xf);// 0xc04[3:0] ++ //rx antenna on ++ rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0xf);// 0xd04[3:0] ++ //analog to digital part2 on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x1e00, 0xf); // 0x880[12:9] ++ } ++ else if(priv->rf_type == RF_1T2R) //RF-C, RF-D ++ { ++ //enable RF-Chip C/D ++ rtl8192_setBBreg(dev, rFPGA0_XC_RFInterfaceOE, BIT4, 0x1); // 0x868[4] ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xc00, 0x3);// 0x88c[11:10] ++ //digital to analog on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x180, 0x3); // 0x880[8:7] ++ //rx antenna on ++ rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xc, 0x3);// 0xc04[3:2] ++ //rx antenna on ++ rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xc, 0x3);// 0xd04[3:2] ++ //analog to digital part2 on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x1800, 0x3); // 0x880[12:11] ++ } ++ #else ++ write_nic_byte(dev, ANAPAR, 0x37);//160MHz ++ write_nic_byte(dev, MacBlkCtrl, 0x17); // 0x403 ++ mdelay(1); ++ //enable clock 80/88 MHz ++ ++ priv->bHwRfOffAction = 0; ++ //} ++ ++ // Baseband reset 2008.09.30 add ++ write_nic_byte(dev, BB_RESET, (read_nic_byte(dev, BB_RESET)|BIT0)); ++ ++ //2 AFE ++ // 2008.09.30 add ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x20000000, 0x1); // 0x884 ++ //analog to digital part2 on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x3); // 0x880[6:5] ++ //digital to analog on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x98, 0x13); // 0x880[4:3] ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf03, 0xf03);// 0x88c[9:8] ++ //rx antenna on ++ //PHY_SetBBReg(Adapter, rOFDM0_TRxPathEnable, 0x3, 0x3);// 0xc04[1:0] ++ //rx antenna on 2008.09.30 mark ++ //PHY_SetBBReg(Adapter, rOFDM1_TRxPathEnable, 0x3, 0x3);// 0xd04[1:0] ++ ++ //2 RF ++ //enable RF-Chip A/B ++ rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4] ++ rtl8192_setBBreg(dev, rFPGA0_XB_RFInterfaceOE, BIT4, 0x1); // 0x864[4] ++ #endif ++ break; ++ ++ // ++ // In current solution, RFSleep=RFOff in order to save power under 802.11 power save. ++ // By Bruce, 2008-01-16. ++ // ++ case eRfSleep: ++ case eRfOff: ++ RT_TRACE(COMP_POWER, "SetRFPowerState8190() eRfOff/Sleep !\n"); ++ if (pPSC->bLeisurePs) ++ { ++ for(QueueID = 0, i = 0; QueueID < MAX_TX_QUEUE; ) ++ { ++ switch(QueueID) { ++ case MGNT_QUEUE: ++ tail=priv->txmapringtail; ++ head=priv->txmapringhead; ++ break; ++ ++ case BK_QUEUE: ++ tail=priv->txbkpringtail; ++ head=priv->txbkpringhead; ++ break; ++ ++ case BE_QUEUE: ++ tail=priv->txbepringtail; ++ head=priv->txbepringhead; ++ break; ++ ++ case VI_QUEUE: ++ tail=priv->txvipringtail; ++ head=priv->txvipringhead; ++ break; ++ ++ case VO_QUEUE: ++ tail=priv->txvopringtail; ++ head=priv->txvopringhead; ++ break; ++ ++ default: ++ tail=head=NULL; ++ break; ++ } ++ if(tail == head) ++ { ++ //DbgPrint("QueueID = %d", QueueID); ++ QueueID++; ++ continue; ++ } ++ else ++ { ++ RT_TRACE(COMP_POWER, "eRf Off/Sleep: %d times BusyQueue[%d] !=0 before doze!\n", (i+1), QueueID); ++ udelay(10); ++ i++; ++ } ++ ++ if(i >= MAX_DOZE_WAITING_TIMES_9x) ++ { ++ RT_TRACE(COMP_POWER, "\n\n\n TimeOut!! SetRFPowerState8190(): eRfOff: %d times BusyQueue[%d] != 0 !!!\n\n\n", MAX_DOZE_WAITING_TIMES_9x, QueueID); ++ break; ++ } ++ } ++ } ++ #ifdef RTL8190P ++ if(priv->rf_type == RF_2T4R) ++ { ++ //disable RF-Chip A/B ++ rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4] ++ } ++ //disable RF-Chip C/D ++ rtl8192_setBBreg(dev, rFPGA0_XC_RFInterfaceOE, BIT4, 0x0); // 0x868[4] ++ //analog to digital off, for power save ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++ //digital to analog off, for power save ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x1e0, 0x0); // 0x880[8:5] ++ //rx antenna off ++ rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0x0);// 0xc04[3:0] ++ //rx antenna off ++ rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0x0);// 0xd04[3:0] ++ //analog to digital part2 off, for power save ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x1e00, 0x0); // 0x880[12:9] ++#else //8192E ++ //2 RF ++ //disable RF-Chip A/B ++ rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4] ++ rtl8192_setBBreg(dev, rFPGA0_XB_RFInterfaceOE, BIT4, 0x0); // 0x864[4] ++ //2 AFE ++ //analog to digital off, for power save ++ //PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf03, 0x0); // 2008.09.30 Modify ++ //digital to analog off, for power save ++ //PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter1, 0x18, 0x0); // 0x880[4:3] ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x98, 0x0); // 0x880 2008.09.30 Modify ++ //rx antenna off 2008.09.30 mark ++ //PHY_SetBBReg(Adapter, rOFDM0_TRxPathEnable, 0xf, 0x0);// 0xc04[3:0] ++ //rx antenna off 2008.09.30 mark ++ //PHY_SetBBReg(Adapter, rOFDM1_TRxPathEnable, 0xf, 0x0);// 0xd04[3:0] ++ //analog to digital part2 off, for power save ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x0); // 0x880[6:5] ++ // 2008.09.30 add ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x20000000, 0x0); // 0x884 ++ ++ ++ //disable clock 80/88 MHz 2008.09.30 mark ++ //PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter1, 0x4, 0x0); // 0x880[2] ++ //2 BB ++ // Baseband reset 2008.09.30 add ++ write_nic_byte(dev, BB_RESET, (read_nic_byte(dev, BB_RESET)|BIT0)); // 0x101 ++ //MAC: off ++ write_nic_byte(dev, MacBlkCtrl, 0x0); // 0x403 ++ //slow down cpu/lbus clock from 160MHz to Lower ++ write_nic_byte(dev, ANAPAR, 0x07); // 0x 17 40MHz ++ priv->bHwRfOffAction = 0; ++ //} ++ #endif ++ break; ++ ++ default: ++ bResult = false; ++ RT_TRACE(COMP_ERR, "SetRFPowerState8190(): unknow state to set: 0x%X!!!\n", eRFPowerState); ++ break; ++ } ++ ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "SetRFPowerState8190(): Unknown RF type\n"); ++ break; ++ } ++ ++ if(bResult) ++ { ++ // Update current RF state variable. ++ priv->ieee80211->eRFPowerState = eRFPowerState; ++ ++ switch(priv->rf_chip ) ++ { ++ case RF_8256: ++ switch(priv->ieee80211->eRFPowerState) ++ { ++ case eRfOff: ++ // ++ //If Rf off reason is from IPS, Led should blink with no link, by Maddest 071015 ++ // ++ if(priv->ieee80211->RfOffReason==RF_CHANGE_BY_IPS ) ++ { ++ #ifdef TO_DO ++ Adapter->HalFunc.LedControlHandler(Adapter,LED_CTL_NO_LINK); ++ #endif ++ } ++ else ++ { ++ // Turn off LED if RF is not ON. ++ #ifdef TO_DO ++ Adapter->HalFunc.LedControlHandler(Adapter, LED_CTL_POWER_OFF); ++ #endif ++ } ++ break; ++ ++ case eRfOn: ++ // Turn on RF we are still linked, which might happen when ++ // we quickly turn off and on HW RF. 2006.05.12, by rcnjko. ++ if( priv->ieee80211->state == IEEE80211_LINKED) ++ { ++ #ifdef TO_DO ++ Adapter->HalFunc.LedControlHandler(Adapter, LED_CTL_LINK); ++ #endif ++ } ++ else ++ { ++ // Turn off LED if RF is not ON. ++ #ifdef TO_DO ++ Adapter->HalFunc.LedControlHandler(Adapter, LED_CTL_NO_LINK); ++ #endif ++ } ++ break; ++ ++ default: ++ // do nothing. ++ break; ++ }// Switch RF state ++ ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "SetRFPowerState8190(): Unknown RF type\n"); ++ break; ++ }// Switch RFChipID ++ } ++ ++ priv->SetRFPowerStateInProgress = false; ++ RT_TRACE(COMP_POWER, "<=========== SetRFPowerState8190() bResult = %d!\n", bResult); ++ return bResult; ++} ++ ++ ++ ++// ++// Description: ++// Change RF power state. ++// ++// Assumption: ++// This function must be executed in re-schdulable context, ++// ie. PASSIVE_LEVEL. ++// ++// 050823, by rcnjko. ++// ++static bool ++SetRFPowerState( ++ struct net_device* dev, ++ RT_RF_POWER_STATE eRFPowerState ++ ) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ bool bResult = false; ++ ++ RT_TRACE(COMP_RF,"---------> SetRFPowerState(): eRFPowerState(%d)\n", eRFPowerState); ++#ifdef RTL8192E ++ if(eRFPowerState == priv->ieee80211->eRFPowerState && priv->bHwRfOffAction == 0) ++#else ++ if(eRFPowerState == priv->ieee80211->eRFPowerState) ++#endif ++ { ++ RT_TRACE(COMP_POWER, "<--------- SetRFPowerState(): discard the request for eRFPowerState(%d) is the same.\n", eRFPowerState); ++ return bResult; ++ } ++ ++ bResult = SetRFPowerState8190(dev, eRFPowerState); ++ ++ RT_TRACE(COMP_POWER, "<--------- SetRFPowerState(): bResult(%d)\n", bResult); ++ ++ return bResult; ++} ++ ++static void ++MgntDisconnectIBSS( ++ struct net_device* dev ++) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //RT_OP_MODE OpMode; ++ u8 i; ++ bool bFilterOutNonAssociatedBSSID = false; ++ ++ //IEEE80211_DEBUG(IEEE80211_DL_TRACE, "XXXXXXXXXX MgntDisconnect IBSS\n"); ++ ++ priv->ieee80211->state = IEEE80211_NOLINK; ++ ++// PlatformZeroMemory( pMgntInfo->Bssid, 6 ); ++ for(i=0;i<6;i++) priv->ieee80211->current_network.bssid[i]= 0x55; ++ priv->OpMode = RT_OP_MODE_NO_LINK; ++ write_nic_word(dev, BSSIDR, ((u16*)priv->ieee80211->current_network.bssid)[0]); ++ write_nic_dword(dev, BSSIDR+2, ((u32*)(priv->ieee80211->current_network.bssid+2))[0]); ++ { ++ RT_OP_MODE OpMode = priv->OpMode; ++ //LED_CTL_MODE LedAction = LED_CTL_NO_LINK; ++ u8 btMsr = read_nic_byte(dev, MSR); ++ ++ btMsr &= 0xfc; ++ ++ switch(OpMode) ++ { ++ case RT_OP_MODE_INFRASTRUCTURE: ++ btMsr |= MSR_LINK_MANAGED; ++ //LedAction = LED_CTL_LINK; ++ break; ++ ++ case RT_OP_MODE_IBSS: ++ btMsr |= MSR_LINK_ADHOC; ++ // led link set seperate ++ break; ++ ++ case RT_OP_MODE_AP: ++ btMsr |= MSR_LINK_MASTER; ++ //LedAction = LED_CTL_LINK; ++ break; ++ ++ default: ++ btMsr |= MSR_LINK_NONE; ++ break; ++ } ++ ++ write_nic_byte(dev, MSR, btMsr); ++ ++ // LED control ++ //Adapter->HalFunc.LedControlHandler(Adapter, LedAction); ++ } ++ ieee80211_stop_send_beacons(priv->ieee80211); ++ ++ // If disconnect, clear RCR CBSSID bit ++ bFilterOutNonAssociatedBSSID = false; ++ { ++ u32 RegRCR, Type; ++ Type = bFilterOutNonAssociatedBSSID; ++ RegRCR = read_nic_dword(dev,RCR); ++ priv->ReceiveConfig = RegRCR; ++ if (Type == true) ++ RegRCR |= (RCR_CBSSID); ++ else if (Type == false) ++ RegRCR &= (~RCR_CBSSID); ++ ++ { ++ write_nic_dword(dev, RCR,RegRCR); ++ priv->ReceiveConfig = RegRCR; ++ } ++ ++ } ++ //MgntIndicateMediaStatus( Adapter, RT_MEDIA_DISCONNECT, GENERAL_INDICATE ); ++ notify_wx_assoc_event(priv->ieee80211); ++ ++} ++ ++static void ++MlmeDisassociateRequest( ++ struct net_device* dev, ++ u8* asSta, ++ u8 asRsn ++ ) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 i; ++ ++ RemovePeerTS(priv->ieee80211, asSta); ++ ++ SendDisassociation( priv->ieee80211, asSta, asRsn ); ++ ++ if(memcpy(priv->ieee80211->current_network.bssid,asSta,6) == NULL) ++ { ++ //ShuChen TODO: change media status. ++ //ShuChen TODO: What to do when disassociate. ++ priv->ieee80211->state = IEEE80211_NOLINK; ++ //pMgntInfo->AsocTimestamp = 0; ++ for(i=0;i<6;i++) priv->ieee80211->current_network.bssid[i] = 0x22; ++// pMgntInfo->mBrates.Length = 0; ++// Adapter->HalFunc.SetHwRegHandler( Adapter, HW_VAR_BASIC_RATE, (pu1Byte)(&pMgntInfo->mBrates) ); ++ priv->OpMode = RT_OP_MODE_NO_LINK; ++ { ++ RT_OP_MODE OpMode = priv->OpMode; ++ //LED_CTL_MODE LedAction = LED_CTL_NO_LINK; ++ u8 btMsr = read_nic_byte(dev, MSR); ++ ++ btMsr &= 0xfc; ++ ++ switch(OpMode) ++ { ++ case RT_OP_MODE_INFRASTRUCTURE: ++ btMsr |= MSR_LINK_MANAGED; ++ //LedAction = LED_CTL_LINK; ++ break; ++ ++ case RT_OP_MODE_IBSS: ++ btMsr |= MSR_LINK_ADHOC; ++ // led link set seperate ++ break; ++ ++ case RT_OP_MODE_AP: ++ btMsr |= MSR_LINK_MASTER; ++ //LedAction = LED_CTL_LINK; ++ break; ++ ++ default: ++ btMsr |= MSR_LINK_NONE; ++ break; ++ } ++ ++ write_nic_byte(dev, MSR, btMsr); ++ ++ // LED control ++ //Adapter->HalFunc.LedControlHandler(Adapter, LedAction); ++ } ++ ieee80211_disassociate(priv->ieee80211); ++ ++ write_nic_word(dev, BSSIDR, ((u16*)priv->ieee80211->current_network.bssid)[0]); ++ write_nic_dword(dev, BSSIDR+2, ((u32*)(priv->ieee80211->current_network.bssid+2))[0]); ++ ++ } ++ ++} ++ ++ ++static void ++MgntDisconnectAP( ++ struct net_device* dev, ++ u8 asRsn ++) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool bFilterOutNonAssociatedBSSID = false; ++ ++// ++// Commented out by rcnjko, 2005.01.27: ++// I move SecClearAllKeys() to MgntActSet_802_11_DISASSOCIATE(). ++// ++// //2004/09/15, kcwu, the key should be cleared, or the new handshaking will not success ++// SecClearAllKeys(Adapter); ++ ++ // In WPA WPA2 need to Clear all key ... because new key will set after new handshaking. ++#ifdef TO_DO ++ if( pMgntInfo->SecurityInfo.AuthMode > RT_802_11AuthModeAutoSwitch || ++ (pMgntInfo->bAPSuportCCKM && pMgntInfo->bCCX8021xenable) ) // In CCKM mode will Clear key ++ { ++ SecClearAllKeys(Adapter); ++ RT_TRACE(COMP_SEC, DBG_LOUD,("======>CCKM clear key...")) ++ } ++#endif ++ // If disconnect, clear RCR CBSSID bit ++ bFilterOutNonAssociatedBSSID = false; ++ { ++ u32 RegRCR, Type; ++ ++ Type = bFilterOutNonAssociatedBSSID; ++ //Adapter->HalFunc.GetHwRegHandler(Adapter, HW_VAR_RCR, (pu1Byte)(&RegRCR)); ++ RegRCR = read_nic_dword(dev,RCR); ++ priv->ReceiveConfig = RegRCR; ++ ++ if (Type == true) ++ RegRCR |= (RCR_CBSSID); ++ else if (Type == false) ++ RegRCR &= (~RCR_CBSSID); ++ ++ write_nic_dword(dev, RCR,RegRCR); ++ priv->ReceiveConfig = RegRCR; ++ ++ ++ } ++ // 2004.10.11, by rcnjko. ++ //MlmeDisassociateRequest( Adapter, pMgntInfo->Bssid, disas_lv_ss ); ++ MlmeDisassociateRequest( dev, priv->ieee80211->current_network.bssid, asRsn ); ++ ++ priv->ieee80211->state = IEEE80211_NOLINK; ++ //pMgntInfo->AsocTimestamp = 0; ++} ++ ++ ++static bool ++MgntDisconnect( ++ struct net_device* dev, ++ u8 asRsn ++) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ // ++ // Schedule an workitem to wake up for ps mode, 070109, by rcnjko. ++ // ++#ifdef TO_DO ++ if(pMgntInfo->mPss != eAwake) ++ { ++ // ++ // Using AwkaeTimer to prevent mismatch ps state. ++ // In the timer the state will be changed according to the RF is being awoke or not. By Bruce, 2007-10-31. ++ // ++ // PlatformScheduleWorkItem( &(pMgntInfo->AwakeWorkItem) ); ++ PlatformSetTimer( Adapter, &(pMgntInfo->AwakeTimer), 0 ); ++ } ++#endif ++ // Follow 8180 AP mode, 2005.05.30, by rcnjko. ++#ifdef TO_DO ++ if(pMgntInfo->mActingAsAp) ++ { ++ RT_TRACE(COMP_MLME, DBG_LOUD, ("MgntDisconnect() ===> AP_DisassociateAllStation\n")); ++ AP_DisassociateAllStation(Adapter, unspec_reason); ++ return TRUE; ++ } ++#endif ++ // Indication of disassociation event. ++ //DrvIFIndicateDisassociation(Adapter, asRsn); ++ ++ // In adhoc mode, update beacon frame. ++ if( priv->ieee80211->state == IEEE80211_LINKED ) ++ { ++ if( priv->ieee80211->iw_mode == IW_MODE_ADHOC ) ++ { ++ //RT_TRACE(COMP_MLME, "MgntDisconnect() ===> MgntDisconnectIBSS\n"); ++ MgntDisconnectIBSS(dev); ++ } ++ if( priv->ieee80211->iw_mode == IW_MODE_INFRA ) ++ { ++ // We clear key here instead of MgntDisconnectAP() because that ++ // MgntActSet_802_11_DISASSOCIATE() is an interface called by OS, ++ // e.g. OID_802_11_DISASSOCIATE in Windows while as MgntDisconnectAP() is ++ // used to handle disassociation related things to AP, e.g. send Disassoc ++ // frame to AP. 2005.01.27, by rcnjko. ++ //IEEE80211_DEBUG(IEEE80211_DL_TRACE,"MgntDisconnect() ===> MgntDisconnectAP\n"); ++ MgntDisconnectAP(dev, asRsn); ++ } ++ ++ // Inidicate Disconnect, 2005.02.23, by rcnjko. ++ //MgntIndicateMediaStatus( Adapter, RT_MEDIA_DISCONNECT, GENERAL_INDICATE); ++ } ++ ++ return true; ++} ++ ++// ++// Description: ++// Chang RF Power State. ++// Note that, only MgntActSet_RF_State() is allowed to set HW_VAR_RF_STATE. ++// ++// Assumption: ++// PASSIVE LEVEL. ++// ++bool ++MgntActSet_RF_State( ++ struct net_device* dev, ++ RT_RF_POWER_STATE StateToSet, ++ RT_RF_CHANGE_SOURCE ChangeSource ++ ) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool bActionAllowed = false; ++ bool bConnectBySSID = false; ++ RT_RF_POWER_STATE rtState; ++ u16 RFWaitCounter = 0; ++ unsigned long flag; ++ RT_TRACE(COMP_POWER, "===>MgntActSet_RF_State(): StateToSet(%d)\n",StateToSet); ++ ++ //1// ++ //1//<1>Prevent the race condition of RF state change. ++ //1// ++ // Only one thread can change the RF state at one time, and others should wait to be executed. By Bruce, 2007-11-28. ++ ++ while(true) ++ { ++ spin_lock_irqsave(&priv->rf_ps_lock,flag); ++ if(priv->RFChangeInProgress) ++ { ++ spin_unlock_irqrestore(&priv->rf_ps_lock,flag); ++ RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): RF Change in progress! Wait to set..StateToSet(%d).\n", StateToSet); ++ ++ // Set RF after the previous action is done. ++ while(priv->RFChangeInProgress) ++ { ++ RFWaitCounter ++; ++ RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Wait 1 ms (%d times)...\n", RFWaitCounter); ++ udelay(1000); // 1 ms ++ ++ // Wait too long, return FALSE to avoid to be stuck here. ++ if(RFWaitCounter > 100) ++ { ++ RT_TRACE(COMP_ERR, "MgntActSet_RF_State(): Wait too logn to set RF\n"); ++ // TODO: Reset RF state? ++ return false; ++ } ++ } ++ } ++ else ++ { ++ priv->RFChangeInProgress = true; ++ spin_unlock_irqrestore(&priv->rf_ps_lock,flag); ++ break; ++ } ++ } ++ ++ rtState = priv->ieee80211->eRFPowerState; ++ ++ switch(StateToSet) ++ { ++ case eRfOn: ++ // ++ // Turn On RF no matter the IPS setting because we need to update the RF state to Ndis under Vista, or ++ // the Windows does not allow the driver to perform site survey any more. By Bruce, 2007-10-02. ++ // ++ ++ priv->ieee80211->RfOffReason &= (~ChangeSource); ++ ++ if(! priv->ieee80211->RfOffReason) ++ { ++ priv->ieee80211->RfOffReason = 0; ++ bActionAllowed = true; ++ ++ ++ if(rtState == eRfOff && ChangeSource >=RF_CHANGE_BY_HW ) ++ { ++ bConnectBySSID = true; ++ } ++ } ++ else ++ RT_TRACE(COMP_POWER, "MgntActSet_RF_State - eRfon reject pMgntInfo->RfOffReason= 0x%x, ChangeSource=0x%X\n", priv->ieee80211->RfOffReason, ChangeSource); ++ ++ break; ++ ++ case eRfOff: ++ ++ if (priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS) ++ { ++ // ++ // 060808, Annie: ++ // Disconnect to current BSS when radio off. Asked by QuanTa. ++ // ++ // Set all link status falg, by Bruce, 2007-06-26. ++ //MgntActSet_802_11_DISASSOCIATE( Adapter, disas_lv_ss ); ++ MgntDisconnect(dev, disas_lv_ss); ++ ++ // Clear content of bssDesc[] and bssDesc4Query[] to avoid reporting old bss to UI. ++ // 2007.05.28, by shien chang. ++ ++ } ++ ++ ++ priv->ieee80211->RfOffReason |= ChangeSource; ++ bActionAllowed = true; ++ break; ++ ++ case eRfSleep: ++ priv->ieee80211->RfOffReason |= ChangeSource; ++ bActionAllowed = true; ++ break; ++ ++ default: ++ break; ++ } ++ ++ if(bActionAllowed) ++ { ++ RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n", StateToSet, priv->ieee80211->RfOffReason); ++ // Config HW to the specified mode. ++ SetRFPowerState(dev, StateToSet); ++ // Turn on RF. ++ if(StateToSet == eRfOn) ++ { ++ //Adapter->HalFunc.HalEnableRxHandler(Adapter); ++ if(bConnectBySSID) ++ { ++ //MgntActSet_802_11_SSID(Adapter, Adapter->MgntInfo.Ssid.Octet, Adapter->MgntInfo.Ssid.Length, TRUE ); ++ } ++ } ++ // Turn off RF. ++ else if(StateToSet == eRfOff) ++ { ++ //Adapter->HalFunc.HalDisableRxHandler(Adapter); ++ } ++ } ++ else ++ { ++ RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is rejected.... StateToSet(%d), ChangeSource(%#X), RfOffReason(%#X)\n", StateToSet, ChangeSource, priv->ieee80211->RfOffReason); ++ } ++ ++ // Release RF spinlock ++ spin_lock_irqsave(&priv->rf_ps_lock,flag); ++ priv->RFChangeInProgress = false; ++ spin_unlock_irqrestore(&priv->rf_ps_lock,flag); ++ ++ RT_TRACE(COMP_POWER, "<===MgntActSet_RF_State()\n"); ++ return bActionAllowed; ++} ++ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8190_rtl8256.h +@@ -0,0 +1,28 @@ ++/* ++ This is part of the rtl8180-sa2400 driver ++ released under the GPL (See file COPYING for details). ++ Copyright (c) 2005 Andrea Merello ++ ++ This files contains programming code for the rtl8256 ++ radio frontend. ++ ++ *Many* thanks to Realtek Corp. for their great support! ++ ++*/ ++ ++#ifndef RTL8225H ++#define RTL8225H ++ ++#ifdef RTL8190P ++#define RTL819X_TOTAL_RF_PATH 4 ++#else ++#define RTL819X_TOTAL_RF_PATH 2 //for 8192E ++#endif ++extern void PHY_SetRF8256Bandwidth(struct net_device* dev , HT_CHANNEL_WIDTH Bandwidth); ++extern RT_STATUS PHY_RF8256_Config(struct net_device* dev); ++extern RT_STATUS phy_RF8256_Config_ParaFile(struct net_device* dev); ++extern void PHY_SetRF8256CCKTxPower(struct net_device* dev, u8 powerlevel); ++extern void PHY_SetRF8256OFDMTxPower(struct net_device* dev, u8 powerlevel); ++extern bool MgntActSet_RF_State(struct net_device* dev, RT_RF_POWER_STATE StateToSet, RT_RF_CHANGE_SOURCE ChangeSource); ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E.h +@@ -0,0 +1,1554 @@ ++/* ++ This is part of rtl8187 OpenSource driver. ++ Copyright (C) Andrea Merello 2004-2005 ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part of the ++ official realtek driver ++ ++ Parts of this driver are based on the rtl8192 driver skeleton ++ from Patric Schenke & Andres Salomon ++ ++ Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver ++ ++ We want to tanks the Authors of those projects and the Ndiswrapper ++ project Authors. ++*/ ++ ++#ifndef R819xU_H ++#define R819xU_H ++ ++#include ++#include ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include //for rtnl_lock() ++#include ++#include ++#include // Necessary because we use the proc fs ++#include ++#include ++#include ++#include ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) ++#include ++#endif ++#include "ieee80211.h" ++ ++ ++ ++ ++#define RTL819xE_MODULE_NAME "rtl819xE" ++//added for HW security, john.0629 ++#define FALSE 0 ++#define TRUE 1 ++#define MAX_KEY_LEN 61 ++#define KEY_BUF_SIZE 5 ++ ++#define BIT0 0x00000001 ++#define BIT1 0x00000002 ++#define BIT2 0x00000004 ++#define BIT3 0x00000008 ++#define BIT4 0x00000010 ++#define BIT5 0x00000020 ++#define BIT6 0x00000040 ++#define BIT7 0x00000080 ++#define BIT8 0x00000100 ++#define BIT9 0x00000200 ++#define BIT10 0x00000400 ++#define BIT11 0x00000800 ++#define BIT12 0x00001000 ++#define BIT13 0x00002000 ++#define BIT14 0x00004000 ++#define BIT15 0x00008000 ++#define BIT16 0x00010000 ++#define BIT17 0x00020000 ++#define BIT18 0x00040000 ++#define BIT19 0x00080000 ++#define BIT20 0x00100000 ++#define BIT21 0x00200000 ++#define BIT22 0x00400000 ++#define BIT23 0x00800000 ++#define BIT24 0x01000000 ++#define BIT25 0x02000000 ++#define BIT26 0x04000000 ++#define BIT27 0x08000000 ++#define BIT28 0x10000000 ++#define BIT29 0x20000000 ++#define BIT30 0x40000000 ++#define BIT31 0x80000000 ++// Rx smooth factor ++#define Rx_Smooth_Factor 20 ++/* 2007/06/04 MH Define sliding window for RSSI history. */ ++#define PHY_RSSI_SLID_WIN_MAX 100 ++#define PHY_Beacon_RSSI_SLID_WIN_MAX 10 ++ ++#define IC_VersionCut_D 0x3 ++#define IC_VersionCut_E 0x4 ++ ++#if 0 //we need to use RT_TRACE instead DMESG as RT_TRACE will clearly show debug level wb. ++#define DMESG(x,a...) printk(KERN_INFO RTL819xE_MODULE_NAME ": " x "\n", ## a) ++#define DMESGW(x,a...) printk(KERN_WARNING RTL819xE_MODULE_NAME ": WW:" x "\n", ## a) ++#define DMESGE(x,a...) printk(KERN_WARNING RTL819xE_MODULE_NAME ": EE:" x "\n", ## a) ++#else ++#define DMESG(x,a...) ++#define DMESGW(x,a...) ++#define DMESGE(x,a...) ++extern u32 rt_global_debug_component; ++#define RT_TRACE(component, x, args...) \ ++do { if(rt_global_debug_component & component) \ ++ printk(KERN_DEBUG RTL819xE_MODULE_NAME ":" x "\n" , \ ++ ##args);\ ++}while(0); ++ ++#define COMP_TRACE BIT0 // For function call tracing. ++#define COMP_DBG BIT1 // Only for temporary debug message. ++#define COMP_INIT BIT2 // during driver initialization / halt / reset. ++ ++ ++#define COMP_RECV BIT3 // Reveive part data path. ++#define COMP_SEND BIT4 // Send part path. ++#define COMP_IO BIT5 // I/O Related. Added by Annie, 2006-03-02. ++#define COMP_POWER BIT6 // 802.11 Power Save mode or System/Device Power state related. ++#define COMP_EPROM BIT7 // 802.11 link related: join/start BSS, leave BSS. ++#define COMP_SWBW BIT8 // For bandwidth switch. ++#define COMP_SEC BIT9// For Security. ++ ++ ++#define COMP_TURBO BIT10 // For Turbo Mode related. By Annie, 2005-10-21. ++#define COMP_QOS BIT11 // For QoS. ++ ++#define COMP_RATE BIT12 // For Rate Adaptive mechanism, 2006.07.02, by rcnjko. #define COMP_EVENTS 0x00000080 // Event handling ++#define COMP_RXDESC BIT13 // Show Rx desc information for SD3 debug. Added by Annie, 2006-07-15. ++#define COMP_PHY BIT14 ++#define COMP_DIG BIT15 // For DIG, 2006.09.25, by rcnjko. ++#define COMP_TXAGC BIT16 // For Tx power, 060928, by rcnjko. ++#define COMP_HALDM BIT17 // For HW Dynamic Mechanism, 061010, by rcnjko. ++#define COMP_POWER_TRACKING BIT18 //FOR 8190 TX POWER TRACKING ++#define COMP_EVENTS BIT19 // Event handling ++ ++#define COMP_RF BIT20 // For RF. ++//1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++//1//1Attention Please!!!<11n or 8190 specific code should be put below this line> ++//1!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ ++#define COMP_FIRMWARE BIT21 //for firmware downloading ++#define COMP_HT BIT22 // For 802.11n HT related information. by Emily 2006-8-11 ++ ++#define COMP_RESET BIT23 ++#define COMP_CMDPKT BIT24 ++#define COMP_SCAN BIT25 ++#define COMP_IPS BIT26 ++#define COMP_DOWN BIT27 // for rm driver module ++#define COMP_INTR BIT28 // for interrupt ++#define COMP_ERR BIT31 // for error out, always on ++#endif ++ ++#define RTL819x_DEBUG ++#ifdef RTL819x_DEBUG ++#define assert(expr) \ ++ if (!(expr)) { \ ++ printk( "Assertion failed! %s,%s,%s,line=%d\n", \ ++ #expr,__FILE__,__FUNCTION__,__LINE__); \ ++ } ++//wb added to debug out data buf ++//if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA ++#define RT_DEBUG_DATA(level, data, datalen) \ ++ do{ if ((rt_global_debug_component & (level)) == (level)) \ ++ { \ ++ int i; \ ++ u8* pdata = (u8*) data; \ ++ printk(KERN_DEBUG RTL819xE_MODULE_NAME ": %s()\n", __FUNCTION__); \ ++ for(i=0; i<(int)(datalen); i++) \ ++ { \ ++ printk("%2x ", pdata[i]); \ ++ if ((i+1)%16 == 0) printk("\n"); \ ++ } \ ++ printk("\n"); \ ++ } \ ++ } while (0) ++#else ++#define assert(expr) do {} while (0) ++#define RT_DEBUG_DATA(level, data, datalen) do {} while(0) ++#endif /* RTL8169_DEBUG */ ++ ++ ++// ++// Queue Select Value in TxDesc ++// ++#define QSLT_BK 0x1 ++#define QSLT_BE 0x0 ++#define QSLT_VI 0x4 ++#define QSLT_VO 0x6 ++#define QSLT_BEACON 0x10 ++#define QSLT_HIGH 0x11 ++#define QSLT_MGNT 0x12 ++#define QSLT_CMD 0x13 ++ ++#define DESC90_RATE1M 0x00 ++#define DESC90_RATE2M 0x01 ++#define DESC90_RATE5_5M 0x02 ++#define DESC90_RATE11M 0x03 ++#define DESC90_RATE6M 0x04 ++#define DESC90_RATE9M 0x05 ++#define DESC90_RATE12M 0x06 ++#define DESC90_RATE18M 0x07 ++#define DESC90_RATE24M 0x08 ++#define DESC90_RATE36M 0x09 ++#define DESC90_RATE48M 0x0a ++#define DESC90_RATE54M 0x0b ++#define DESC90_RATEMCS0 0x00 ++#define DESC90_RATEMCS1 0x01 ++#define DESC90_RATEMCS2 0x02 ++#define DESC90_RATEMCS3 0x03 ++#define DESC90_RATEMCS4 0x04 ++#define DESC90_RATEMCS5 0x05 ++#define DESC90_RATEMCS6 0x06 ++#define DESC90_RATEMCS7 0x07 ++#define DESC90_RATEMCS8 0x08 ++#define DESC90_RATEMCS9 0x09 ++#define DESC90_RATEMCS10 0x0a ++#define DESC90_RATEMCS11 0x0b ++#define DESC90_RATEMCS12 0x0c ++#define DESC90_RATEMCS13 0x0d ++#define DESC90_RATEMCS14 0x0e ++#define DESC90_RATEMCS15 0x0f ++#define DESC90_RATEMCS32 0x20 ++ ++#define RTL819X_DEFAULT_RF_TYPE RF_1T2R ++#define EEPROM_Default_LegacyHTTxPowerDiff 0x4 ++#define IEEE80211_WATCH_DOG_TIME 2000 ++ ++/* For rtl819x */ ++typedef struct _tx_desc_819x_pci { ++ //DWORD 0 ++ u16 PktSize; ++ u8 Offset; ++ u8 Reserved1:3; ++ u8 CmdInit:1; ++ u8 LastSeg:1; ++ u8 FirstSeg:1; ++ u8 LINIP:1; ++ u8 OWN:1; ++ ++ //DWORD 1 ++ u8 TxFWInfoSize; ++ u8 RATid:3; ++ u8 DISFB:1; ++ u8 USERATE:1; ++ u8 MOREFRAG:1; ++ u8 NoEnc:1; ++ u8 PIFS:1; ++ u8 QueueSelect:5; ++ u8 NoACM:1; ++ u8 Resv:2; ++ u8 SecCAMID:5; ++ u8 SecDescAssign:1; ++ u8 SecType:2; ++ ++ //DWORD 2 ++ u16 TxBufferSize; ++ u8 PktId:7; ++ u8 Resv1:1; ++ u8 Reserved2; ++ ++ //DWORD 3 ++ u32 TxBuffAddr; ++ ++ //DWORD 4 ++ u32 NextDescAddress; ++ ++ //DWORD 5,6,7 ++ u32 Reserved5; ++ u32 Reserved6; ++ u32 Reserved7; ++}tx_desc_819x_pci, *ptx_desc_819x_pci; ++ ++ ++typedef struct _tx_desc_cmd_819x_pci { ++ //DWORD 0 ++ u16 PktSize; ++ u8 Reserved1; ++ u8 CmdType:3; ++ u8 CmdInit:1; ++ u8 LastSeg:1; ++ u8 FirstSeg:1; ++ u8 LINIP:1; ++ u8 OWN:1; ++ ++ //DOWRD 1 ++ u16 ElementReport; ++ u16 Reserved2; ++ ++ //DOWRD 2 ++ u16 TxBufferSize; ++ u16 Reserved3; ++ ++ //DWORD 3,4,5 ++ u32 TxBufferAddr; ++ u32 NextDescAddress; ++ u32 Reserved4; ++ u32 Reserved5; ++ u32 Reserved6; ++}tx_desc_cmd_819x_pci, *ptx_desc_cmd_819x_pci; ++ ++ ++typedef struct _tx_fwinfo_819x_pci { ++ //DOWRD 0 ++ u8 TxRate:7; ++ u8 CtsEnable:1; ++ u8 RtsRate:7; ++ u8 RtsEnable:1; ++ u8 TxHT:1; ++ u8 Short:1; //Short PLCP for CCK, or short GI for 11n MCS ++ u8 TxBandwidth:1; // This is used for HT MCS rate only. ++ u8 TxSubCarrier:2; // This is used for legacy OFDM rate only. ++ u8 STBC:2; ++ u8 AllowAggregation:1; ++ u8 RtsHT:1; //Interpre RtsRate field as high throughput data rate ++ u8 RtsShort:1; //Short PLCP for CCK, or short GI for 11n MCS ++ u8 RtsBandwidth:1; // This is used for HT MCS rate only. ++ u8 RtsSubcarrier:2; // This is used for legacy OFDM rate only. ++ u8 RtsSTBC:2; ++ u8 EnableCPUDur:1; //Enable firmware to recalculate and assign packet duration ++ ++ //DWORD 1 ++ u8 RxMF:2; ++ u8 RxAMD:3; ++ u8 Reserved1:3; ++ u8 Reserved2; ++ u8 Reserved3; ++ u8 Reserved4; ++ ++ //u32 Reserved; ++}tx_fwinfo_819x_pci, *ptx_fwinfo_819x_pci; ++ ++typedef struct rtl8192_rx_info { ++ struct urb *urb; ++ struct net_device *dev; ++ u8 out_pipe; ++}rtl8192_rx_info ; ++typedef struct _rx_desc_819x_pci{ ++ //DOWRD 0 ++ u16 Length:14; ++ u16 CRC32:1; ++ u16 ICV:1; ++ u8 RxDrvInfoSize; ++ u8 Shift:2; ++ u8 PHYStatus:1; ++ u8 SWDec:1; ++ u8 LastSeg:1; ++ u8 FirstSeg:1; ++ u8 EOR:1; ++ u8 OWN:1; ++ ++ //DWORD 1 ++ u32 Reserved2; ++ ++ //DWORD 2 ++ u32 Reserved3; ++ ++ //DWORD 3 ++ u32 BufferAddress; ++ ++}rx_desc_819x_pci, *prx_desc_819x_pci; ++ ++typedef struct _rx_fwinfo_819x_pci{ ++ //DWORD 0 ++ u16 Reserved1:12; ++ u16 PartAggr:1; ++ u16 FirstAGGR:1; ++ u16 Reserved2:2; ++ ++ u8 RxRate:7; ++ u8 RxHT:1; ++ ++ u8 BW:1; ++ u8 SPLCP:1; ++ u8 Reserved3:2; ++ u8 PAM:1; ++ u8 Mcast:1; ++ u8 Bcast:1; ++ u8 Reserved4:1; ++ ++ //DWORD 1 ++ u32 TSFL; ++ ++}rx_fwinfo_819x_pci, *prx_fwinfo_819x_pci; ++ ++#define MAX_DEV_ADDR_SIZE 8 /* support till 64 bit bus width OS */ ++#define MAX_FIRMWARE_INFORMATION_SIZE 32 /*2006/04/30 by Emily forRTL8190*/ ++#define MAX_802_11_HEADER_LENGTH (40 + MAX_FIRMWARE_INFORMATION_SIZE) ++#define ENCRYPTION_MAX_OVERHEAD 128 ++//#define USB_HWDESC_HEADER_LEN sizeof(tx_desc_819x_usb) ++//#define TX_PACKET_SHIFT_BYTES (USB_HWDESC_HEADER_LEN + sizeof(tx_fwinfo_819x_usb)) ++#define MAX_FRAGMENT_COUNT 8 ++#define MAX_TRANSMIT_BUFFER_SIZE (1600+(MAX_802_11_HEADER_LENGTH+ENCRYPTION_MAX_OVERHEAD)*MAX_FRAGMENT_COUNT) ++ ++#define scrclng 4 // octets for crc32 (FCS, ICV) ++/* 8190 Loopback Mode definition */ ++typedef enum _rtl819x_loopback{ ++ RTL819X_NO_LOOPBACK = 0, ++ RTL819X_MAC_LOOPBACK = 1, ++ RTL819X_DMA_LOOPBACK = 2, ++ RTL819X_CCK_LOOPBACK = 3, ++}rtl819x_loopback_e; ++ ++/* due to rtl8192 firmware */ ++typedef enum _desc_packet_type_e{ ++ DESC_PACKET_TYPE_INIT = 0, ++ DESC_PACKET_TYPE_NORMAL = 1, ++}desc_packet_type_e; ++ ++typedef enum _firmware_source{ ++ FW_SOURCE_IMG_FILE = 0, ++ FW_SOURCE_HEADER_FILE = 1, //from header file ++}firmware_source_e, *pfirmware_source_e; ++ ++typedef enum _firmware_status{ ++ FW_STATUS_0_INIT = 0, ++ FW_STATUS_1_MOVE_BOOT_CODE = 1, ++ FW_STATUS_2_MOVE_MAIN_CODE = 2, ++ FW_STATUS_3_TURNON_CPU = 3, ++ FW_STATUS_4_MOVE_DATA_CODE = 4, ++ FW_STATUS_5_READY = 5, ++}firmware_status_e; ++ ++typedef struct _rt_firmare_seg_container { ++ u16 seg_size; ++ u8 *seg_ptr; ++}fw_seg_container, *pfw_seg_container; ++ ++typedef struct _rt_firmware{ ++ firmware_status_e firmware_status; ++ u16 cmdpacket_frag_thresold; ++#define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000 //64k ++#define MAX_FW_INIT_STEP 3 ++ u8 firmware_buf[MAX_FW_INIT_STEP][RTL8190_MAX_FIRMWARE_CODE_SIZE]; ++ u16 firmware_buf_size[MAX_FW_INIT_STEP]; ++}rt_firmware, *prt_firmware; ++//+by amy 080507 ++#define MAX_RECEIVE_BUFFER_SIZE 9100 // Add this to 9100 bytes to receive A-MSDU from RT-AP ++ ++/* Firmware Queue Layout */ ++#define NUM_OF_FIRMWARE_QUEUE 10 ++#define NUM_OF_PAGES_IN_FW 0x100 ++#define NUM_OF_PAGE_IN_FW_QUEUE_BE 0x0aa ++#define NUM_OF_PAGE_IN_FW_QUEUE_BK 0x007 ++#define NUM_OF_PAGE_IN_FW_QUEUE_VI 0x024 ++#define NUM_OF_PAGE_IN_FW_QUEUE_VO 0x007 ++#define NUM_OF_PAGE_IN_FW_QUEUE_HCCA 0 ++#define NUM_OF_PAGE_IN_FW_QUEUE_CMD 0x2 ++#define NUM_OF_PAGE_IN_FW_QUEUE_MGNT 0x10 ++#define NUM_OF_PAGE_IN_FW_QUEUE_HIGH 0 ++#define NUM_OF_PAGE_IN_FW_QUEUE_BCN 0x4 ++#define NUM_OF_PAGE_IN_FW_QUEUE_PUB 0xd ++#define APPLIED_RESERVED_QUEUE_IN_FW 0x80000000 ++#define RSVD_FW_QUEUE_PAGE_BK_SHIFT 0x00 ++#define RSVD_FW_QUEUE_PAGE_BE_SHIFT 0x08 ++#define RSVD_FW_QUEUE_PAGE_VI_SHIFT 0x10 ++#define RSVD_FW_QUEUE_PAGE_VO_SHIFT 0x18 ++#define RSVD_FW_QUEUE_PAGE_MGNT_SHIFT 0x10 ++#define RSVD_FW_QUEUE_PAGE_CMD_SHIFT 0x08 ++#define RSVD_FW_QUEUE_PAGE_BCN_SHIFT 0x00 ++#define RSVD_FW_QUEUE_PAGE_PUB_SHIFT 0x08 ++ ++//8187B Security ++//#define RWCAM 0xA0 // Software read/write CAM config ++//#define WCAMI 0xA4 // Software write CAM input content ++//#define RCAMO 0xA8 // Output value from CAM according to 0xa0 setting ++#define DCAM 0xAC // Debug CAM Interface ++#define AESMSK_FC 0xB2 // AES Mask register for frame control (0xB2~0xB3). Added by Annie, 2006-03-06. ++ ++ ++#define CAM_CONTENT_COUNT 8 ++//#define CFG_DEFAULT_KEY BIT5 ++#define CFG_VALID BIT15 ++#if 0 ++//---------------------------------------------------------------------------- ++// 8187B WPA Config Register (offset 0xb0, 1 byte) ++//---------------------------------------------------------------------------- ++#define SCR_UseDK 0x01 ++#define SCR_TxSecEnable 0x02 ++#define SCR_RxSecEnable 0x04 ++ ++//---------------------------------------------------------------------------- ++// 8187B CAM Config Setting (offset 0xb0, 1 byte) ++//---------------------------------------------------------------------------- ++#define CAM_VALID 0x8000 ++#define CAM_NOTVALID 0x0000 ++#define CAM_USEDK 0x0020 ++ ++ ++#define CAM_NONE 0x0 ++#define CAM_WEP40 0x01 ++#define CAM_TKIP 0x02 ++#define CAM_AES 0x04 ++#define CAM_WEP104 0x05 ++ ++//#define CAM_SIZE 16 ++#define TOTAL_CAM_ENTRY 16 ++#define CAM_ENTRY_LEN_IN_DW 6 // 6, unit: in u4byte. Added by Annie, 2006-05-25. ++#define CAM_ENTRY_LEN_IN_BYTE (CAM_ENTRY_LEN_IN_DW*sizeof(u32)) // 24, unit: in u1byte. Added by Annie, 2006-05-25. ++ ++#define CAM_CONFIG_USEDK 1 ++#define CAM_CONFIG_NO_USEDK 0 ++ ++#define CAM_WRITE 0x00010000 ++#define CAM_READ 0x00000000 ++#define CAM_POLLINIG 0x80000000 ++ ++//================================================================= ++//================================================================= ++ ++#endif ++#define EPROM_93c46 0 ++#define EPROM_93c56 1 ++ ++#define DEFAULT_FRAG_THRESHOLD 2342U ++#define MIN_FRAG_THRESHOLD 256U ++#define DEFAULT_BEACONINTERVAL 0x64U ++#define DEFAULT_BEACON_ESSID "Rtl819xU" ++ ++#define DEFAULT_SSID "" ++#define DEFAULT_RETRY_RTS 7 ++#define DEFAULT_RETRY_DATA 7 ++#define PRISM_HDR_SIZE 64 ++ ++#define PHY_RSSI_SLID_WIN_MAX 100 ++ ++ ++typedef enum _WIRELESS_MODE { ++ WIRELESS_MODE_UNKNOWN = 0x00, ++ WIRELESS_MODE_A = 0x01, ++ WIRELESS_MODE_B = 0x02, ++ WIRELESS_MODE_G = 0x04, ++ WIRELESS_MODE_AUTO = 0x08, ++ WIRELESS_MODE_N_24G = 0x10, ++ WIRELESS_MODE_N_5G = 0x20 ++} WIRELESS_MODE; ++ ++#define RTL_IOCTL_WPA_SUPPLICANT SIOCIWFIRSTPRIV+30 ++ ++typedef struct buffer ++{ ++ struct buffer *next; ++ u32 *buf; ++ dma_addr_t dma; ++ ++} buffer; ++ ++typedef struct rtl_reg_debug{ ++ unsigned int cmd; ++ struct { ++ unsigned char type; ++ unsigned char addr; ++ unsigned char page; ++ unsigned char length; ++ } head; ++ unsigned char buf[0xff]; ++}rtl_reg_debug; ++ ++#if 0 ++ ++typedef struct tx_pendingbuf ++{ ++ struct ieee80211_txb *txb; ++ short ispending; ++ short descfrag; ++} tx_pendigbuf; ++ ++#endif ++ ++typedef struct _rt_9x_tx_rate_history { ++ u32 cck[4]; ++ u32 ofdm[8]; ++ // HT_MCS[0][]: BW=0 SG=0 ++ // HT_MCS[1][]: BW=1 SG=0 ++ // HT_MCS[2][]: BW=0 SG=1 ++ // HT_MCS[3][]: BW=1 SG=1 ++ u32 ht_mcs[4][16]; ++}rt_tx_rahis_t, *prt_tx_rahis_t; ++ ++typedef struct _RT_SMOOTH_DATA_4RF { ++ char elements[4][100];//array to store values ++ u32 index; //index to current array to store ++ u32 TotalNum; //num of valid elements ++ u32 TotalVal[4]; //sum of valid elements ++}RT_SMOOTH_DATA_4RF, *PRT_SMOOTH_DATA_4RF; ++ ++typedef enum _tag_TxCmd_Config_Index{ ++ TXCMD_TXRA_HISTORY_CTRL = 0xFF900000, ++ TXCMD_RESET_TX_PKT_BUFF = 0xFF900001, ++ TXCMD_RESET_RX_PKT_BUFF = 0xFF900002, ++ TXCMD_SET_TX_DURATION = 0xFF900003, ++ TXCMD_SET_RX_RSSI = 0xFF900004, ++ TXCMD_SET_TX_PWR_TRACKING = 0xFF900005, ++ TXCMD_XXXX_CTRL, ++}DCMD_TXCMD_OP; ++ ++typedef struct Stats ++{ ++ unsigned long txrdu; ++ unsigned long rxrdu; ++ //unsigned long rxnolast; ++ //unsigned long rxnodata; ++// unsigned long rxreset; ++// unsigned long rxnopointer; ++ unsigned long rxok; ++ unsigned long rxframgment; ++ unsigned long rxcmdpkt[4]; //08/05/08 amy rx cmd element txfeedback/bcn report/cfg set/query ++ unsigned long rxurberr; ++ unsigned long rxstaterr; ++ unsigned long rxcrcerrmin;//crc error (0-500) ++ unsigned long rxcrcerrmid;//crc error (500-1000) ++ unsigned long rxcrcerrmax;//crc error (>1000) ++ unsigned long received_rate_histogram[4][32]; //0: Total, 1:OK, 2:CRC, 3:ICV, 2007 07 03 cosa ++ unsigned long received_preamble_GI[2][32]; //0: Long preamble/GI, 1:Short preamble/GI ++ unsigned long rx_AMPDUsize_histogram[5]; // level: (<4K), (4K~8K), (8K~16K), (16K~32K), (32K~64K) ++ unsigned long rx_AMPDUnum_histogram[5]; // level: (<5), (5~10), (10~20), (20~40), (>40) ++ unsigned long numpacket_matchbssid; // debug use only. ++ unsigned long numpacket_toself; // debug use only. ++ unsigned long num_process_phyinfo; // debug use only. ++ unsigned long numqry_phystatus; ++ unsigned long numqry_phystatusCCK; ++ unsigned long numqry_phystatusHT; ++ unsigned long received_bwtype[5]; //0: 20M, 1: funn40M, 2: upper20M, 3: lower20M, 4: duplicate ++ unsigned long txnperr; ++ unsigned long txnpdrop; ++ unsigned long txresumed; ++// unsigned long rxerr; ++ unsigned long rxoverflow; ++ unsigned long rxint; ++ unsigned long txnpokint; ++// unsigned long txhpokint; ++// unsigned long txhperr; ++ unsigned long ints; ++ unsigned long shints; ++ unsigned long txoverflow; ++// unsigned long rxdmafail; ++// unsigned long txbeacon; ++// unsigned long txbeaconerr; ++ unsigned long txlpokint; ++ unsigned long txlpdrop; ++ unsigned long txlperr; ++ unsigned long txbeokint; ++ unsigned long txbedrop; ++ unsigned long txbeerr; ++ unsigned long txbkokint; ++ unsigned long txbkdrop; ++ unsigned long txbkerr; ++ unsigned long txviokint; ++ unsigned long txvidrop; ++ unsigned long txvierr; ++ unsigned long txvookint; ++ unsigned long txvodrop; ++ unsigned long txvoerr; ++ unsigned long txbeaconokint; ++ unsigned long txbeacondrop; ++ unsigned long txbeaconerr; ++ unsigned long txmanageokint; ++ unsigned long txmanagedrop; ++ unsigned long txmanageerr; ++ unsigned long txcmdpktokint; ++ unsigned long txdatapkt; ++ unsigned long txfeedback; ++ unsigned long txfeedbackok; ++ unsigned long txoktotal; ++ unsigned long txokbytestotal; ++ unsigned long txokinperiod; ++ unsigned long txmulticast; ++ unsigned long txbytesmulticast; ++ unsigned long txbroadcast; ++ unsigned long txbytesbroadcast; ++ unsigned long txunicast; ++ unsigned long txbytesunicast; ++ unsigned long rxbytesunicast; ++ unsigned long txfeedbackfail; ++ unsigned long txerrtotal; ++ unsigned long txerrbytestotal; ++ unsigned long txerrmulticast; ++ unsigned long txerrbroadcast; ++ unsigned long txerrunicast; ++ unsigned long txretrycount; ++ unsigned long txfeedbackretry; ++ u8 last_packet_rate; ++ unsigned long slide_signal_strength[100]; ++ unsigned long slide_evm[100]; ++ unsigned long slide_rssi_total; // For recording sliding window's RSSI value ++ unsigned long slide_evm_total; // For recording sliding window's EVM value ++ long signal_strength; // Transformed, in dbm. Beautified signal strength for UI, not correct. ++ long signal_quality; ++ long last_signal_strength_inpercent; ++ long recv_signal_power; // Correct smoothed ss in Dbm, only used in driver to report real power now. ++ u8 rx_rssi_percentage[4]; ++ u8 rx_evm_percentage[2]; ++ long rxSNRdB[4]; ++ rt_tx_rahis_t txrate; ++ u32 Slide_Beacon_pwdb[100]; //cosa add for beacon rssi ++ u32 Slide_Beacon_Total; //cosa add for beacon rssi ++ RT_SMOOTH_DATA_4RF cck_adc_pwdb; ++ u32 CurrentShowTxate; ++ ++ ++} Stats; ++ ++ ++// Bandwidth Offset ++#define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 ++#define HAL_PRIME_CHNL_OFFSET_LOWER 1 ++#define HAL_PRIME_CHNL_OFFSET_UPPER 2 ++ ++//+by amy 080507 ++ ++typedef struct ChnlAccessSetting { ++ u16 SIFS_Timer; ++ u16 DIFS_Timer; ++ u16 SlotTimeTimer; ++ u16 EIFS_Timer; ++ u16 CWminIndex; ++ u16 CWmaxIndex; ++}*PCHANNEL_ACCESS_SETTING,CHANNEL_ACCESS_SETTING; ++ ++typedef struct _BB_REGISTER_DEFINITION{ ++ u32 rfintfs; // set software control: // 0x870~0x877[8 bytes] ++ u32 rfintfi; // readback data: // 0x8e0~0x8e7[8 bytes] ++ u32 rfintfo; // output data: // 0x860~0x86f [16 bytes] ++ u32 rfintfe; // output enable: // 0x860~0x86f [16 bytes] ++ u32 rf3wireOffset; // LSSI data: // 0x840~0x84f [16 bytes] ++ u32 rfLSSI_Select; // BB Band Select: // 0x878~0x87f [8 bytes] ++ u32 rfTxGainStage; // Tx gain stage: // 0x80c~0x80f [4 bytes] ++ u32 rfHSSIPara1; // wire parameter control1 : // 0x820~0x823,0x828~0x82b, 0x830~0x833, 0x838~0x83b [16 bytes] ++ u32 rfHSSIPara2; // wire parameter control2 : // 0x824~0x827,0x82c~0x82f, 0x834~0x837, 0x83c~0x83f [16 bytes] ++ u32 rfSwitchControl; //Tx Rx antenna control : // 0x858~0x85f [16 bytes] ++ u32 rfAGCControl1; //AGC parameter control1 : // 0xc50~0xc53,0xc58~0xc5b, 0xc60~0xc63, 0xc68~0xc6b [16 bytes] ++ u32 rfAGCControl2; //AGC parameter control2 : // 0xc54~0xc57,0xc5c~0xc5f, 0xc64~0xc67, 0xc6c~0xc6f [16 bytes] ++ u32 rfRxIQImbalance; //OFDM Rx IQ imbalance matrix : // 0xc14~0xc17,0xc1c~0xc1f, 0xc24~0xc27, 0xc2c~0xc2f [16 bytes] ++ u32 rfRxAFE; //Rx IQ DC ofset and Rx digital filter, Rx DC notch filter : // 0xc10~0xc13,0xc18~0xc1b, 0xc20~0xc23, 0xc28~0xc2b [16 bytes] ++ u32 rfTxIQImbalance; //OFDM Tx IQ imbalance matrix // 0xc80~0xc83,0xc88~0xc8b, 0xc90~0xc93, 0xc98~0xc9b [16 bytes] ++ u32 rfTxAFE; //Tx IQ DC Offset and Tx DFIR type // 0xc84~0xc87,0xc8c~0xc8f, 0xc94~0xc97, 0xc9c~0xc9f [16 bytes] ++ u32 rfLSSIReadBack; //LSSI RF readback data // 0x8a0~0x8af [16 bytes] ++}BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T; ++ ++typedef enum _RT_RF_TYPE_819xU{ ++ RF_TYPE_MIN = 0, ++ RF_8225, ++ RF_8256, ++ RF_8258, ++ RF_PSEUDO_11N = 4, ++}RT_RF_TYPE_819xU, *PRT_RF_TYPE_819xU; ++ ++ ++typedef struct _rate_adaptive ++{ ++ u8 rate_adaptive_disabled; ++ u8 ratr_state; ++ u16 reserve; ++ ++ u32 high_rssi_thresh_for_ra; ++ u32 high2low_rssi_thresh_for_ra; ++ u8 low2high_rssi_thresh_for_ra40M; ++ u32 low_rssi_thresh_for_ra40M; ++ u8 low2high_rssi_thresh_for_ra20M; ++ u32 low_rssi_thresh_for_ra20M; ++ u32 upper_rssi_threshold_ratr; ++ u32 middle_rssi_threshold_ratr; ++ u32 low_rssi_threshold_ratr; ++ u32 low_rssi_threshold_ratr_40M; ++ u32 low_rssi_threshold_ratr_20M; ++ u8 ping_rssi_enable; //cosa add for test ++ u32 ping_rssi_ratr; //cosa add for test ++ u32 ping_rssi_thresh_for_ra;//cosa add for test ++ u32 last_ratr; ++ ++} rate_adaptive, *prate_adaptive; ++#define TxBBGainTableLength 37 ++#define CCKTxBBGainTableLength 23 ++typedef struct _txbbgain_struct ++{ ++ long txbb_iq_amplifygain; ++ u32 txbbgain_value; ++} txbbgain_struct, *ptxbbgain_struct; ++ ++typedef struct _ccktxbbgain_struct ++{ ++ //The Value is from a22 to a29 one Byte one time is much Safer ++ u8 ccktxbb_valuearray[8]; ++} ccktxbbgain_struct,*pccktxbbgain_struct; ++ ++ ++typedef struct _init_gain ++{ ++ u8 xaagccore1; ++ u8 xbagccore1; ++ u8 xcagccore1; ++ u8 xdagccore1; ++ u8 cca; ++ ++} init_gain, *pinit_gain; ++ ++/* 2007/11/02 MH Define RF mode temporarily for test. */ ++typedef enum tag_Rf_Operatetion_State ++{ ++ RF_STEP_INIT = 0, ++ RF_STEP_NORMAL, ++ RF_STEP_MAX ++}RF_STEP_E; ++ ++typedef enum _RT_STATUS{ ++ RT_STATUS_SUCCESS, ++ RT_STATUS_FAILURE, ++ RT_STATUS_PENDING, ++ RT_STATUS_RESOURCE ++}RT_STATUS,*PRT_STATUS; ++ ++typedef enum _RT_CUSTOMER_ID ++{ ++ RT_CID_DEFAULT = 0, ++ RT_CID_8187_ALPHA0 = 1, ++ RT_CID_8187_SERCOMM_PS = 2, ++ RT_CID_8187_HW_LED = 3, ++ RT_CID_8187_NETGEAR = 4, ++ RT_CID_WHQL = 5, ++ RT_CID_819x_CAMEO = 6, ++ RT_CID_819x_RUNTOP = 7, ++ RT_CID_819x_Senao = 8, ++ RT_CID_TOSHIBA = 9, // Merge by Jacken, 2008/01/31. ++ RT_CID_819x_Netcore = 10, ++ RT_CID_Nettronix = 11, ++ RT_CID_DLINK = 12, ++ RT_CID_PRONET = 13, ++ RT_CID_COREGA = 14, ++}RT_CUSTOMER_ID, *PRT_CUSTOMER_ID; ++ ++//================================================================================ ++// LED customization. ++//================================================================================ ++ ++typedef enum _LED_STRATEGY_8190{ ++ SW_LED_MODE0, // SW control 1 LED via GPIO0. It is default option. ++ SW_LED_MODE1, // SW control for PCI Express ++ SW_LED_MODE2, // SW control for Cameo. ++ SW_LED_MODE3, // SW contorl for RunTop. ++ SW_LED_MODE4, // SW control for Netcore ++ SW_LED_MODE5, //added by vivi, for led new mode, DLINK ++ SW_LED_MODE6, //added by vivi, for led new mode, PRONET ++ HW_LED, // HW control 2 LEDs, LED0 and LED1 (there are 4 different control modes) ++}LED_STRATEGY_8190, *PLED_STRATEGY_8190; ++ ++#define CHANNEL_PLAN_LEN 10 ++ ++#define sCrcLng 4 ++ ++typedef struct _TX_FWINFO_STRUCUTRE{ ++ //DOWRD 0 ++ u8 TxRate:7; ++ u8 CtsEnable:1; ++ u8 RtsRate:7; ++ u8 RtsEnable:1; ++ u8 TxHT:1; ++ u8 Short:1; ++ u8 TxBandwidth:1; ++ u8 TxSubCarrier:2; ++ u8 STBC:2; ++ u8 AllowAggregation:1; ++ u8 RtsHT:1; ++ u8 RtsShort:1; ++ u8 RtsBandwidth:1; ++ u8 RtsSubcarrier:2; ++ u8 RtsSTBC:2; ++ u8 EnableCPUDur:1; ++ ++ //DWORD 1 ++ u32 RxMF:2; ++ u32 RxAMD:3; ++ u32 Reserved1:3; ++ u32 TxAGCOffset:4; ++ u32 TxAGCSign:1; ++ u32 Tx_INFO_RSVD:6; ++ u32 PacketID:13; ++}TX_FWINFO_T; ++ ++ ++typedef struct _TX_FWINFO_8190PCI{ ++ //DOWRD 0 ++ u8 TxRate:7; ++ u8 CtsEnable:1; ++ u8 RtsRate:7; ++ u8 RtsEnable:1; ++ u8 TxHT:1; ++ u8 Short:1; //Short PLCP for CCK, or short GI for 11n MCS ++ u8 TxBandwidth:1; // This is used for HT MCS rate only. ++ u8 TxSubCarrier:2; // This is used for legacy OFDM rate only. ++ u8 STBC:2; ++ u8 AllowAggregation:1; ++ u8 RtsHT:1; //Interpre RtsRate field as high throughput data rate ++ u8 RtsShort:1; //Short PLCP for CCK, or short GI for 11n MCS ++ u8 RtsBandwidth:1; // This is used for HT MCS rate only. ++ u8 RtsSubcarrier:2; // This is used for legacy OFDM rate only. ++ u8 RtsSTBC:2; ++ u8 EnableCPUDur:1; //Enable firmware to recalculate and assign packet duration ++ ++ //DWORD 1 ++ u32 RxMF:2; ++ u32 RxAMD:3; ++ u32 TxPerPktInfoFeedback:1; // 1: indicate that the transimission info of this packet should be gathered by Firmware and retured by Rx Cmd. ++ u32 Reserved1:2; ++ u32 TxAGCOffset:4; // Only 90 support ++ u32 TxAGCSign:1; // Only 90 support ++ u32 RAW_TXD:1; // MAC will send data in txpktbuffer without any processing,such as CRC check ++ u32 Retry_Limit:4; // CCX Support relative retry limit FW page only support 4 bits now. ++ u32 Reserved2:1; ++ u32 PacketID:13; ++ ++ // DW 2 ++ ++}TX_FWINFO_8190PCI, *PTX_FWINFO_8190PCI; ++ ++typedef struct _phy_ofdm_rx_status_report_819xpci ++{ ++ u8 trsw_gain_X[4]; ++ u8 pwdb_all; ++ u8 cfosho_X[4]; ++ u8 cfotail_X[4]; ++ u8 rxevm_X[2]; ++ u8 rxsnr_X[4]; ++ u8 pdsnr_X[2]; ++ u8 csi_current_X[2]; ++ u8 csi_target_X[2]; ++ u8 sigevm; ++ u8 max_ex_pwr; ++ u8 sgi_en; ++ u8 rxsc_sgien_exflg; ++}phy_sts_ofdm_819xpci_t; ++ ++typedef struct _phy_cck_rx_status_report_819xpci ++{ ++ /* For CCK rate descriptor. This is a unsigned 8:1 variable. LSB bit presend ++ 0.5. And MSB 7 bts presend a signed value. Range from -64~+63.5. */ ++ u8 adc_pwdb_X[4]; ++ u8 sq_rpt; ++ u8 cck_agc_rpt; ++}phy_sts_cck_819xpci_t; ++ ++typedef struct _phy_ofdm_rx_status_rxsc_sgien_exintfflag{ ++ u8 reserved:4; ++ u8 rxsc:2; ++ u8 sgi_en:1; ++ u8 ex_intf_flag:1; ++}phy_ofdm_rx_status_rxsc_sgien_exintfflag; ++ ++typedef enum _RT_OP_MODE{ ++ RT_OP_MODE_AP, ++ RT_OP_MODE_INFRASTRUCTURE, ++ RT_OP_MODE_IBSS, ++ RT_OP_MODE_NO_LINK, ++}RT_OP_MODE, *PRT_OP_MODE; ++ ++ ++/* 2007/11/02 MH Define RF mode temporarily for test. */ ++typedef enum tag_Rf_OpType ++{ ++ RF_OP_By_SW_3wire = 0, ++ RF_OP_By_FW, ++ RF_OP_MAX ++}RF_OpType_E; ++ ++typedef enum _RESET_TYPE { ++ RESET_TYPE_NORESET = 0x00, ++ RESET_TYPE_NORMAL = 0x01, ++ RESET_TYPE_SILENT = 0x02 ++} RESET_TYPE; ++ ++typedef struct _tx_ring{ ++ u32 * desc; ++ u8 nStuckCount; ++ struct _tx_ring * next; ++}__attribute__ ((packed)) tx_ring, * ptx_ring; ++ ++struct rtl8192_tx_ring { ++ tx_desc_819x_pci *desc; ++ dma_addr_t dma; ++ unsigned int idx; ++ unsigned int entries; ++ struct sk_buff_head queue; ++}; ++ ++#define NIC_SEND_HANG_THRESHOLD_NORMAL 4 ++#define NIC_SEND_HANG_THRESHOLD_POWERSAVE 8 ++#define MAX_TX_QUEUE 9 // BK, BE, VI, VO, HCCA, MANAGEMENT, COMMAND, HIGH, BEACON. ++ ++#define MAX_RX_COUNT 64 ++#define MAX_TX_QUEUE_COUNT 9 ++ ++typedef struct r8192_priv ++{ ++ struct pci_dev *pdev; ++ //added for maintain info from eeprom ++ short epromtype; ++ u16 eeprom_vid; ++ u16 eeprom_did; ++ u8 eeprom_CustomerID; ++ u16 eeprom_ChannelPlan; ++ RT_CUSTOMER_ID CustomerID; ++ LED_STRATEGY_8190 LedStrategy; ++ //bool bDcut; ++ u8 IC_Cut; ++ int irq; ++ short irq_enabled; ++ struct ieee80211_device *ieee80211; ++ bool being_init_adapter; ++ u8 Rf_Mode; ++ short card_8192; /* O: rtl8192, 1:rtl8185 V B/C, 2:rtl8185 V D */ ++ u8 card_8192_version; /* if TCR reports card V B/C this discriminates */ ++// short phy_ver; /* meaningful for rtl8225 1:A 2:B 3:C */ ++ short enable_gpio0; ++ enum card_type {PCI,MINIPCI,CARDBUS,USB/*rtl8187*/}card_type; ++ short hw_plcp_len; ++ short plcp_preamble_mode; ++ u8 ScanDelay; ++ spinlock_t irq_lock; ++ spinlock_t irq_th_lock; ++ spinlock_t tx_lock; ++ spinlock_t rf_ps_lock; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) ++ struct semaphore mutex; ++#else ++ struct mutex mutex; ++#endif ++ spinlock_t rf_lock; //used to lock rf write operation added by wb ++ spinlock_t ps_lock; ++ ++ u32 irq_mask; ++// short irq_enabled; ++// struct net_device *dev; //comment this out. ++ short chan; ++ short sens; ++ short max_sens; ++ u32 rx_prevlen; ++/*RX stuff*/ ++ rx_desc_819x_pci *rx_ring; ++ dma_addr_t rx_ring_dma; ++ unsigned int rx_idx; ++ struct sk_buff *rx_buf[MAX_RX_COUNT]; ++ int rxringcount; ++ u16 rxbuffersize; ++ ++ ++ struct sk_buff *rx_skb; ++ u32 *rxring; ++ u32 *rxringtail; ++ dma_addr_t rxringdma; ++ struct buffer *rxbuffer; ++ struct buffer *rxbufferhead; ++ short rx_skb_complete; ++/*TX stuff*/ ++ struct rtl8192_tx_ring tx_ring[MAX_TX_QUEUE_COUNT]; ++ int txringcount; ++//{ ++ int txbuffsize; ++ int txfwbuffersize; ++ //struct tx_pendingbuf txnp_pending; ++ //struct tasklet_struct irq_tx_tasklet; ++ struct tasklet_struct irq_rx_tasklet; ++ struct tasklet_struct irq_tx_tasklet; ++ struct tasklet_struct irq_prepare_beacon_tasklet; ++ struct buffer *txmapbufs; ++ struct buffer *txbkpbufs; ++ struct buffer *txbepbufs; ++ struct buffer *txvipbufs; ++ struct buffer *txvopbufs; ++ struct buffer *txcmdbufs; ++ struct buffer *txmapbufstail; ++ struct buffer *txbkpbufstail; ++ struct buffer *txbepbufstail; ++ struct buffer *txvipbufstail; ++ struct buffer *txvopbufstail; ++ struct buffer *txcmdbufstail; ++ /* adhoc/master mode stuff */ ++ ptx_ring txbeaconringtail; ++ dma_addr_t txbeaconringdma; ++ ptx_ring txbeaconring; ++ int txbeaconcount; ++ struct buffer *txbeaconbufs; ++ struct buffer *txbeaconbufstail; ++ ptx_ring txmapring; ++ ptx_ring txbkpring; ++ ptx_ring txbepring; ++ ptx_ring txvipring; ++ ptx_ring txvopring; ++ ptx_ring txcmdring; ++ ptx_ring txmapringtail; ++ ptx_ring txbkpringtail; ++ ptx_ring txbepringtail; ++ ptx_ring txvipringtail; ++ ptx_ring txvopringtail; ++ ptx_ring txcmdringtail; ++ ptx_ring txmapringhead; ++ ptx_ring txbkpringhead; ++ ptx_ring txbepringhead; ++ ptx_ring txvipringhead; ++ ptx_ring txvopringhead; ++ ptx_ring txcmdringhead; ++ dma_addr_t txmapringdma; ++ dma_addr_t txbkpringdma; ++ dma_addr_t txbepringdma; ++ dma_addr_t txvipringdma; ++ dma_addr_t txvopringdma; ++ dma_addr_t txcmdringdma; ++ // u8 chtxpwr[15]; //channels from 1 to 14, 0 not used ++// u8 chtxpwr_ofdm[15]; //channels from 1 to 14, 0 not used ++// u8 cck_txpwr_base; ++// u8 ofdm_txpwr_base; ++// u8 challow[15]; //channels from 1 to 14, 0 not used ++ short up; ++ short crcmon; //if 1 allow bad crc frame reception in monitor mode ++// short prism_hdr; ++ ++// struct timer_list scan_timer; ++ /*short scanpending; ++ short stopscan;*/ ++// spinlock_t scan_lock; ++// u8 active_probe; ++ //u8 active_scan_num; ++ struct semaphore wx_sem; ++ struct semaphore rf_sem; //used to lock rf write operation added by wb, modified by david ++// short hw_wep; ++ ++// short digphy; ++// short antb; ++// short diversity; ++// u8 cs_treshold; ++// short rcr_csense; ++ u8 rf_type; //0 means 1T2R, 1 means 2T4R ++ RT_RF_TYPE_819xU rf_chip; ++ ++// u32 key0[4]; ++ short (*rf_set_sens)(struct net_device *dev,short sens); ++ u8 (*rf_set_chan)(struct net_device *dev,u8 ch); ++ void (*rf_close)(struct net_device *dev); ++ void (*rf_init)(struct net_device *dev); ++ //short rate; ++ short promisc; ++ /*stats*/ ++ struct Stats stats; ++ struct iw_statistics wstats; ++ struct proc_dir_entry *dir_dev; ++ ++ /*RX stuff*/ ++// u32 *rxring; ++// u32 *rxringtail; ++// dma_addr_t rxringdma; ++ ++#ifdef THOMAS_BEACON ++ u32 *oldaddr; ++#endif ++#ifdef THOMAS_TASKLET ++ atomic_t irt_counter;//count for irq_rx_tasklet ++#endif ++#ifdef JACKSON_NEW_RX ++ struct sk_buff **pp_rxskb; ++ int rx_inx; ++#endif ++ ++/* modified by davad for Rx process */ ++ struct sk_buff_head rx_queue; ++ struct sk_buff_head skb_queue; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++ struct tq_struct qos_activate; ++#else ++ struct work_struct qos_activate; ++#endif ++ short tx_urb_index; ++ atomic_t tx_pending[0x10];//UART_PRIORITY+1 ++ ++ struct urb *rxurb_task; ++ ++ //2 Tx Related variables ++ u16 ShortRetryLimit; ++ u16 LongRetryLimit; ++ u32 TransmitConfig; ++ u8 RegCWinMin; // For turbo mode CW adaptive. Added by Annie, 2005-10-27. ++ ++ u32 LastRxDescTSFHigh; ++ u32 LastRxDescTSFLow; ++ ++ ++ //2 Rx Related variables ++ u16 EarlyRxThreshold; ++ u32 ReceiveConfig; ++ u8 AcmControl; ++ ++ u8 RFProgType; ++ ++ u8 retry_data; ++ u8 retry_rts; ++ u16 rts; ++ ++ struct ChnlAccessSetting ChannelAccessSetting; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct work_struct reset_wq; ++#else ++ struct tq_struct reset_wq; ++#endif ++ ++/**********************************************************/ ++//for rtl819xPci ++ // Data Rate Config. Added by Annie, 2006-04-13. ++ u16 basic_rate; ++ u8 short_preamble; ++ u8 slot_time; ++ u16 SifsTime; ++/* WirelessMode*/ ++ u8 RegWirelessMode; ++/*Firmware*/ ++ prt_firmware pFirmware; ++ rtl819x_loopback_e LoopbackMode; ++ firmware_source_e firmware_source; ++ bool AutoloadFailFlag; ++ u16 EEPROMTxPowerDiff; ++ u16 EEPROMAntPwDiff; // Antenna gain offset from B/C/D to A ++ u8 EEPROMThermalMeter; ++ u8 EEPROMPwDiff; ++ u8 EEPROMCrystalCap; ++ u8 EEPROM_Def_Ver; ++ u8 EEPROMTxPowerLevelCCK[14];// CCK channel 1~14 ++ // The following definition is for eeprom 93c56 ++ u8 EEPROMRfACCKChnl1TxPwLevel[3]; //RF-A CCK Tx Power Level at channel 7 ++ u8 EEPROMRfAOfdmChnlTxPwLevel[3];//RF-A CCK Tx Power Level at [0],[1],[2] = channel 1,7,13 ++ u8 EEPROMRfCCCKChnl1TxPwLevel[3]; //RF-C CCK Tx Power Level at channel 7 ++ u8 EEPROMRfCOfdmChnlTxPwLevel[3];//RF-C CCK Tx Power Level at [0],[1],[2] = channel 1,7,13 ++ u8 EEPROMTxPowerLevelCCK_V1[3]; ++ u8 EEPROMTxPowerLevelOFDM24G[14]; // OFDM 2.4G channel 1~14 ++ u8 EEPROMTxPowerLevelOFDM5G[24]; // OFDM 5G ++ u8 EEPROMLegacyHTTxPowerDiff; // Legacy to HT rate power diff ++ bool bTXPowerDataReadFromEEPORM; ++/*channel plan*/ ++ u16 RegChannelPlan; // Channel Plan specifed by user, 15: following setting of EEPROM, 0-14: default channel plan index specified by user. ++ u16 ChannelPlan; ++/*PS related*/ ++ bool RegRfOff; ++ // Rf off action for power save ++ u8 bHwRfOffAction; //0:No action, 1:By GPIO, 2:By Disable ++/*PHY related*/ ++ BB_REGISTER_DEFINITION_T PHYRegDef[4]; //Radio A/B/C/D ++ // Read/write are allow for following hardware information variables ++ u32 MCSTxPowerLevelOriginalOffset[6]; ++ u32 CCKTxPowerLevelOriginalOffset; ++ u8 TxPowerLevelCCK[14]; // CCK channel 1~14 ++ u8 TxPowerLevelCCK_A[14]; // RF-A, CCK channel 1~14 ++ u8 TxPowerLevelCCK_C[14]; ++ u8 TxPowerLevelOFDM24G[14]; // OFDM 2.4G channel 1~14 ++ u8 TxPowerLevelOFDM5G[14]; // OFDM 5G ++ u8 TxPowerLevelOFDM24G_A[14]; // RF-A, OFDM 2.4G channel 1~14 ++ u8 TxPowerLevelOFDM24G_C[14]; // RF-C, OFDM 2.4G channel 1~14 ++ u8 LegacyHTTxPowerDiff; // Legacy to HT rate power diff ++ u8 TxPowerDiff; ++ char RF_C_TxPwDiff; // Antenna gain offset, rf-c to rf-a ++ u8 AntennaTxPwDiff[3]; // Antenna gain offset, index 0 for B, 1 for C, and 2 for D ++ u8 CrystalCap; // CrystalCap. ++ u8 ThermalMeter[2]; // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1 ++ //05/27/2008 cck power enlarge ++ u8 CckPwEnl; ++ u16 TSSI_13dBm; ++ u32 Pwr_Track; ++ u8 CCKPresentAttentuation_20Mdefault; ++ u8 CCKPresentAttentuation_40Mdefault; ++ char CCKPresentAttentuation_difference; ++ char CCKPresentAttentuation; ++ // Use to calculate PWBD. ++ u8 bCckHighPower; ++ long undecorated_smoothed_pwdb; ++ long undecorated_smoothed_cck_adc_pwdb[4]; ++ //for set channel ++ u8 SwChnlInProgress; ++ u8 SwChnlStage; ++ u8 SwChnlStep; ++ u8 SetBWModeInProgress; ++ HT_CHANNEL_WIDTH CurrentChannelBW; ++ ++ // 8190 40MHz mode ++ // ++ u8 nCur40MhzPrimeSC; // Control channel sub-carrier ++ // Joseph test for shorten RF configuration time. ++ // We save RF reg0 in this variable to reduce RF reading. ++ // ++ u32 RfReg0Value[4]; ++ u8 NumTotalRFPath; ++ bool brfpath_rxenable[4]; ++//+by amy 080507 ++ struct timer_list watch_dog_timer; ++ ++//+by amy 080515 for dynamic mechenism ++ //Add by amy Tx Power Control for Near/Far Range 2008/05/15 ++ bool bdynamic_txpower; //bDynamicTxPower ++ bool bDynamicTxHighPower; // Tx high power state ++ bool bDynamicTxLowPower; // Tx low power state ++ bool bLastDTPFlag_High; ++ bool bLastDTPFlag_Low; ++ ++ bool bstore_last_dtpflag; ++ bool bstart_txctrl_bydtp; //Define to discriminate on High power State or on sitesuvey to change Tx gain index ++ //Add by amy for Rate Adaptive ++ rate_adaptive rate_adaptive; ++ //Add by amy for TX power tracking ++ //2008/05/15 Mars OPEN/CLOSE TX POWER TRACKING ++ txbbgain_struct txbbgain_table[TxBBGainTableLength]; ++ u8 txpower_count;//For 6 sec do tracking again ++ bool btxpower_trackingInit; ++ u8 OFDM_index; ++ u8 CCK_index; ++ u8 Record_CCK_20Mindex; ++ u8 Record_CCK_40Mindex; ++ //2007/09/10 Mars Add CCK TX Power Tracking ++ ccktxbbgain_struct cck_txbbgain_table[CCKTxBBGainTableLength]; ++ ccktxbbgain_struct cck_txbbgain_ch14_table[CCKTxBBGainTableLength]; ++ u8 rfa_txpowertrackingindex; ++ u8 rfa_txpowertrackingindex_real; ++ u8 rfa_txpowertracking_default; ++ u8 rfc_txpowertrackingindex; ++ u8 rfc_txpowertrackingindex_real; ++ u8 rfc_txpowertracking_default; ++ bool btxpower_tracking; ++ bool bcck_in_ch14; ++ ++ //For Backup Initial Gain ++ init_gain initgain_backup; ++ u8 DefaultInitialGain[4]; ++ // For EDCA Turbo mode, Added by amy 080515. ++ bool bis_any_nonbepkts; ++ bool bcurrent_turbo_EDCA; ++ ++ bool bis_cur_rdlstate; ++ struct timer_list fsync_timer; ++ bool bfsync_processing; // 500ms Fsync timer is active or not ++ u32 rate_record; ++ u32 rateCountDiffRecord; ++ u32 ContiuneDiffCount; ++ bool bswitch_fsync; ++ ++ u8 framesync; ++ u32 framesyncC34; ++ u8 framesyncMonitor; ++ //Added by amy 080516 for RX related ++ u16 nrxAMPDU_size; ++ u8 nrxAMPDU_aggr_num; ++ ++ /*Last RxDesc TSF value*/ ++ u32 last_rxdesc_tsf_high; ++ u32 last_rxdesc_tsf_low; ++ ++ //by amy for gpio ++ bool bHwRadioOff; ++ //by amy for ps ++ bool RFChangeInProgress; // RF Chnage in progress, by Bruce, 2007-10-30 ++ bool SetRFPowerStateInProgress; ++ RT_OP_MODE OpMode; ++ //by amy for reset_count ++ u32 reset_count; ++ bool bpbc_pressed; ++ //by amy for debug ++ u32 txpower_checkcnt; ++ u32 txpower_tracking_callback_cnt; ++ u8 thermal_read_val[40]; ++ u8 thermal_readback_index; ++ u32 ccktxpower_adjustcnt_not_ch14; ++ u32 ccktxpower_adjustcnt_ch14; ++ u8 tx_fwinfo_force_subcarriermode; ++ u8 tx_fwinfo_force_subcarrierval; ++ ++ //by amy for silent reset ++ RESET_TYPE ResetProgress; ++ bool bForcedSilentReset; ++ bool bDisableNormalResetCheck; ++ u16 TxCounter; ++ u16 RxCounter; ++ int IrpPendingCount; ++ bool bResetInProgress; ++ bool force_reset; ++ u8 InitialGainOperateType; ++ ++ //define work item by amy 080526 ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ struct delayed_work update_beacon_wq; ++ struct delayed_work watch_dog_wq; ++ struct delayed_work txpower_tracking_wq; ++ struct delayed_work rfpath_check_wq; ++ struct delayed_work gpio_change_rf_wq; ++ struct delayed_work initialgain_operate_wq; ++#else ++ struct work_struct update_beacon_wq; ++ struct work_struct watch_dog_wq; ++ struct work_struct txpower_tracking_wq; ++ struct work_struct rfpath_check_wq; ++ struct work_struct gpio_change_rf_wq; ++ struct work_struct initialgain_operate_wq; ++#endif ++ struct workqueue_struct *priv_wq; ++#else ++ struct tq_struct update_beacon_wq; ++ /* used for periodly scan */ ++ struct tq_struct txpower_tracking_wq; ++ struct tq_struct rfpath_check_wq; ++ struct tq_struct watch_dog_wq; ++ struct tq_struct gpio_change_rf_wq; ++ struct tq_struct initialgain_operate_wq; ++#endif ++}r8192_priv; ++ ++// for rtl8187 ++// now mirging to rtl8187B ++/* ++typedef enum{ ++ LOW_PRIORITY = 0x02, ++ NORM_PRIORITY ++ } priority_t; ++*/ ++//for rtl8187B ++#if 0 ++typedef enum{ ++ BULK_PRIORITY = 0x01, ++ //RSVD0, ++ //RSVD1, ++ LOW_PRIORITY, ++ NORM_PRIORITY, ++ VO_PRIORITY, ++ VI_PRIORITY, //0x05 ++ BE_PRIORITY, ++ BK_PRIORITY, ++ CMD_PRIORITY,//0x8 ++ RSVD3, ++ BEACON_PRIORITY, //0x0A ++ HIGH_PRIORITY, ++ MANAGE_PRIORITY, ++ RSVD4, ++ RSVD5, ++ UART_PRIORITY //0x0F ++} priority_t; ++#endif ++typedef enum{ ++ NIC_8192E = 1, ++ } nic_t; ++ ++ ++#if 0 //defined in Qos.h ++//typedef u32 AC_CODING; ++#define AC0_BE 0 // ACI: 0x00 // Best Effort ++#define AC1_BK 1 // ACI: 0x01 // Background ++#define AC2_VI 2 // ACI: 0x10 // Video ++#define AC3_VO 3 // ACI: 0x11 // Voice ++#define AC_MAX 4 // Max: define total number; Should not to be used as a real enum. ++ ++// ++// ECWmin/ECWmax field. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.13. ++// ++typedef union _ECW{ ++ u8 charData; ++ struct ++ { ++ u8 ECWmin:4; ++ u8 ECWmax:4; ++ }f; // Field ++}ECW, *PECW; ++ ++// ++// ACI/AIFSN Field. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.12. ++// ++typedef union _ACI_AIFSN{ ++ u8 charData; ++ ++ struct ++ { ++ u8 AIFSN:4; ++ u8 ACM:1; ++ u8 ACI:2; ++ u8 Reserved:1; ++ }f; // Field ++}ACI_AIFSN, *PACI_AIFSN; ++ ++// ++// AC Parameters Record Format. ++// Ref: WMM spec 2.2.2: WME Parameter Element, p.12. ++// ++typedef union _AC_PARAM{ ++ u32 longData; ++ u8 charData[4]; ++ ++ struct ++ { ++ ACI_AIFSN AciAifsn; ++ ECW Ecw; ++ u16 TXOPLimit; ++ }f; // Field ++}AC_PARAM, *PAC_PARAM; ++ ++#endif ++bool init_firmware(struct net_device *dev); ++void rtl819xE_tx_cmd(struct net_device *dev, struct sk_buff *skb); ++short rtl8192_tx(struct net_device *dev, struct sk_buff* skb); ++u32 read_cam(struct net_device *dev, u8 addr); ++void write_cam(struct net_device *dev, u8 addr, u32 data); ++u8 read_nic_byte(struct net_device *dev, int x); ++u8 read_nic_byte_E(struct net_device *dev, int x); ++u32 read_nic_dword(struct net_device *dev, int x); ++u16 read_nic_word(struct net_device *dev, int x) ; ++void write_nic_byte(struct net_device *dev, int x,u8 y); ++void write_nic_byte_E(struct net_device *dev, int x,u8 y); ++void write_nic_word(struct net_device *dev, int x,u16 y); ++void write_nic_dword(struct net_device *dev, int x,u32 y); ++void force_pci_posting(struct net_device *dev); ++ ++void rtl8192_rtx_disable(struct net_device *); ++void rtl8192_rx_enable(struct net_device *); ++void rtl8192_tx_enable(struct net_device *); ++ ++void rtl8192_disassociate(struct net_device *dev); ++//void fix_rx_fifo(struct net_device *dev); ++void rtl8185_set_rf_pins_enable(struct net_device *dev,u32 a); ++ ++void rtl8192_set_anaparam(struct net_device *dev,u32 a); ++void rtl8185_set_anaparam2(struct net_device *dev,u32 a); ++void rtl8192_update_msr(struct net_device *dev); ++int rtl8192_down(struct net_device *dev); ++int rtl8192_up(struct net_device *dev); ++void rtl8192_commit(struct net_device *dev); ++void rtl8192_set_chan(struct net_device *dev,short ch); ++void write_phy(struct net_device *dev, u8 adr, u8 data); ++void write_phy_cck(struct net_device *dev, u8 adr, u32 data); ++void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data); ++void rtl8185_tx_antenna(struct net_device *dev, u8 ant); ++void rtl8187_set_rxconf(struct net_device *dev); ++//short check_nic_enough_desc(struct net_device *dev, priority_t priority); ++void rtl8192_start_beacon(struct net_device *dev); ++void CamResetAllEntry(struct net_device* dev); ++void EnableHWSecurityConfig8192(struct net_device *dev); ++void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, u8 *MacAddr, u8 DefaultKey, u32 *KeyContent ); ++void CamPrintDbgReg(struct net_device* dev); ++extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); ++extern void firmware_init_param(struct net_device *dev); ++extern RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void rtl8192_hw_wakeup_wq (struct work_struct *work); ++#else ++void rtl8192_hw_wakeup_wq(struct net_device *dev); ++#endif ++ ++short rtl8192_is_tx_queue_empty(struct net_device *dev); ++#ifdef ENABLE_IPS ++void IPSEnter(struct net_device *dev); ++void IPSLeave(struct net_device *dev); ++#endif ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_core.c +@@ -0,0 +1,6928 @@ ++/****************************************************************************** ++ * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. ++ * Linux device driver for RTL8190P / RTL8192E ++ * ++ * Based on the r8180 driver, which is: ++ * Copyright 2004-2005 Andrea Merello , et al. ++ * 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: ++ * Jerry chuang ++ */ ++ ++ ++#undef LOOP_TEST ++#undef RX_DONT_PASS_UL ++#undef DEBUG_EPROM ++#undef DEBUG_RX_VERBOSE ++#undef DUMMY_RX ++#undef DEBUG_ZERO_RX ++#undef DEBUG_RX_SKB ++#undef DEBUG_TX_FRAG ++#undef DEBUG_RX_FRAG ++#undef DEBUG_TX_FILLDESC ++#undef DEBUG_TX ++#undef DEBUG_IRQ ++#undef DEBUG_RX ++#undef DEBUG_RXALLOC ++#undef DEBUG_REGISTERS ++#undef DEBUG_RING ++#undef DEBUG_IRQ_TASKLET ++#undef DEBUG_TX_ALLOC ++#undef DEBUG_TX_DESC ++ ++//#define CONFIG_RTL8192_IO_MAP ++#include ++#include "r8192E_hw.h" ++#include "r8192E.h" ++#include "r8190_rtl8256.h" /* RTL8225 Radio frontend */ ++#include "r8180_93cx6.h" /* Card EEPROM */ ++#include "r8192E_wx.h" ++#include "r819xE_phy.h" //added by WB 4.30.2008 ++#include "r819xE_phyreg.h" ++#include "r819xE_cmdpkt.h" ++#include "r8192E_dm.h" ++//#include "r8192xU_phyreg.h" ++//#include ++// FIXME: check if 2.6.7 is ok ++ ++#ifdef CONFIG_PM_RTL ++#include "r8192_pm.h" ++#endif ++ ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++ ++//set here to open your trace code. //WB ++u32 rt_global_debug_component = \ ++ // COMP_INIT | ++ // COMP_EPROM | ++ // COMP_PHY | ++ // COMP_RF | ++ COMP_FIRMWARE | ++ // COMP_TRACE | ++ // COMP_DOWN | ++ // COMP_SWBW | ++ // COMP_SEC | ++// COMP_QOS | ++// COMP_RATE | ++ // COMP_RECV | ++ // COMP_SEND | ++ // COMP_POWER | ++ // COMP_EVENTS | ++ // COMP_RESET | ++ // COMP_CMDPKT | ++ // COMP_POWER_TRACKING | ++ // COMP_INTR | ++ COMP_ERR ; //always open err flags on ++#ifndef PCI_DEVICE ++#define PCI_DEVICE(vend,dev)\ ++ .vendor=(vend),.device=(dev),\ ++ .subvendor=PCI_ANY_ID,.subdevice=PCI_ANY_ID ++#endif ++static struct pci_device_id rtl8192_pci_id_tbl[] __devinitdata = { ++#ifdef RTL8190P ++ /* Realtek */ ++ /* Dlink */ ++ { PCI_DEVICE(0x10ec, 0x8190) }, ++ /* Corega */ ++ { PCI_DEVICE(0x07aa, 0x0045) }, ++ { PCI_DEVICE(0x07aa, 0x0046) }, ++#else ++ /* Realtek */ ++ { PCI_DEVICE(0x10ec, 0x8192) }, ++ ++ /* Corega */ ++ { PCI_DEVICE(0x07aa, 0x0044) }, ++ { PCI_DEVICE(0x07aa, 0x0047) }, ++#endif ++ {} ++}; ++ ++static char* ifname = "wlan%d"; ++#if 0 ++static int hwseqnum = 0; ++static int hwwep = 0; ++#endif ++static int hwwep = 1; //default use hw. set 0 to use software security ++static int channels = 0x3fff; ++ ++MODULE_LICENSE("GPL"); ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++MODULE_VERSION("V 1.1"); ++#endif ++MODULE_DEVICE_TABLE(pci, rtl8192_pci_id_tbl); ++//MODULE_AUTHOR("Andrea Merello "); ++MODULE_DESCRIPTION("Linux driver for Realtek RTL819x WiFi cards"); ++ ++#if 0 ++MODULE_PARM(ifname,"s"); ++MODULE_PARM_DESC(devname," Net interface name, wlan%d=default"); ++ ++MODULE_PARM(hwseqnum,"i"); ++MODULE_PARM_DESC(hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default"); ++ ++MODULE_PARM(hwwep,"i"); ++MODULE_PARM_DESC(hwwep," Try to use hardware WEP support. Still broken and not available on all cards"); ++ ++MODULE_PARM(channels,"i"); ++MODULE_PARM_DESC(channels," Channel bitmask for specific locales. NYI"); ++#endif ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) ++module_param(ifname, charp, S_IRUGO|S_IWUSR ); ++//module_param(hwseqnum,int, S_IRUGO|S_IWUSR); ++module_param(hwwep,int, S_IRUGO|S_IWUSR); ++module_param(channels,int, S_IRUGO|S_IWUSR); ++#else ++MODULE_PARM(ifname, "s"); ++//MODULE_PARM(hwseqnum,"i"); ++MODULE_PARM(hwwep,"i"); ++MODULE_PARM(channels,"i"); ++#endif ++ ++MODULE_PARM_DESC(ifname," Net interface name, wlan%d=default"); ++//MODULE_PARM_DESC(hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default"); ++MODULE_PARM_DESC(hwwep," Try to use hardware WEP support. Still broken and not available on all cards"); ++MODULE_PARM_DESC(channels," Channel bitmask for specific locales. NYI"); ++ ++static int __devinit rtl8192_pci_probe(struct pci_dev *pdev, ++ const struct pci_device_id *id); ++static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev); ++ ++static struct pci_driver rtl8192_pci_driver = { ++ .name = RTL819xE_MODULE_NAME, /* Driver name */ ++ .id_table = rtl8192_pci_id_tbl, /* PCI_ID table */ ++ .probe = rtl8192_pci_probe, /* probe fn */ ++ .remove = __devexit_p(rtl8192_pci_disconnect), /* remove fn */ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0) ++#ifdef CONFIG_PM_RTL ++ .suspend = rtl8192E_suspend, /* PM suspend fn */ ++ .resume = rtl8192E_resume, /* PM resume fn */ ++#else ++ .suspend = NULL, /* PM suspend fn */ ++ .resume = NULL, /* PM resume fn */ ++#endif ++#endif ++}; ++ ++#ifdef ENABLE_DOT11D ++ ++typedef struct _CHANNEL_LIST ++{ ++ u8 Channel[32]; ++ u8 Len; ++}CHANNEL_LIST, *PCHANNEL_LIST; ++ ++static CHANNEL_LIST ChannelPlan[] = { ++ {{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,149,153,157,161,165},24}, //FCC ++ {{1,2,3,4,5,6,7,8,9,10,11},11}, //IC ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64},21}, //ETSI ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, //Spain. Change to ETSI. ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, //France. Change to ETSI. ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22}, //MKK //MKK ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22},//MKK1 ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, //Israel. ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22}, // For 11a , TELEC ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64}, 22}, //MIC ++ {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14} //For Global Domain. 1-11:active scan, 12-14 passive scan. //+YJ, 080626 ++}; ++ ++static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv* priv) ++{ ++ int i, max_chan=-1, min_chan=-1; ++ struct ieee80211_device* ieee = priv->ieee80211; ++ switch (channel_plan) ++ { ++ case COUNTRY_CODE_FCC: ++ case COUNTRY_CODE_IC: ++ case COUNTRY_CODE_ETSI: ++ case COUNTRY_CODE_SPAIN: ++ case COUNTRY_CODE_FRANCE: ++ case COUNTRY_CODE_MKK: ++ case COUNTRY_CODE_MKK1: ++ case COUNTRY_CODE_ISRAEL: ++ case COUNTRY_CODE_TELEC: ++ case COUNTRY_CODE_MIC: ++ { ++ Dot11d_Init(ieee); ++ ieee->bGlobalDomain = false; ++ //acturally 8225 & 8256 rf chip only support B,G,24N mode ++ if ((priv->rf_chip == RF_8225) || (priv->rf_chip == RF_8256)) ++ { ++ min_chan = 1; ++ max_chan = 14; ++ } ++ else ++ { ++ RT_TRACE(COMP_ERR, "unknown rf chip, can't set channel map in function:%s()\n", __FUNCTION__); ++ } ++ if (ChannelPlan[channel_plan].Len != 0){ ++ // Clear old channel map ++ memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map)); ++ // Set new channel map ++ for (i=0;i max_chan) ++ break; ++ GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1; ++ } ++ } ++ break; ++ } ++ case COUNTRY_CODE_GLOBAL_DOMAIN: ++ { ++ GET_DOT11D_INFO(ieee)->bEnabled = 0; //this flag enabled to follow 11d country IE setting, otherwise, it shall follow global domain setting ++ Dot11d_Reset(ieee); ++ ieee->bGlobalDomain = true; ++ break; ++ } ++ default: ++ break; ++ } ++} ++#endif ++ ++ ++#define eqMacAddr(a,b) ( ((a)[0]==(b)[0] && (a)[1]==(b)[1] && (a)[2]==(b)[2] && (a)[3]==(b)[3] && (a)[4]==(b)[4] && (a)[5]==(b)[5]) ? 1:0 ) ++/* 2007/07/25 MH Defien temp tx fw info. */ ++static TX_FWINFO_T Tmp_TxFwInfo; ++ ++ ++#define rx_hal_is_cck_rate(_pdrvinfo)\ ++ (_pdrvinfo->RxRate == DESC90_RATE1M ||\ ++ _pdrvinfo->RxRate == DESC90_RATE2M ||\ ++ _pdrvinfo->RxRate == DESC90_RATE5_5M ||\ ++ _pdrvinfo->RxRate == DESC90_RATE11M) &&\ ++ !_pdrvinfo->RxHT\ ++ ++ ++void CamResetAllEntry(struct net_device *dev) ++{ ++ //u8 ucIndex; ++ u32 ulcommand = 0; ++ ++#if 1 ++ ulcommand |= BIT31|BIT30; ++ write_nic_dword(dev, RWCAM, ulcommand); ++#else ++ for(ucIndex=0;ucIndexbase_addr +x); ++} ++ ++u32 read_nic_dword(struct net_device *dev, int x) ++{ ++ return inl(dev->base_addr +x); ++} ++ ++u16 read_nic_word(struct net_device *dev, int x) ++{ ++ return inw(dev->base_addr +x); ++} ++ ++void write_nic_byte(struct net_device *dev, int x,u8 y) ++{ ++ outb(y&0xff,dev->base_addr +x); ++} ++ ++void write_nic_word(struct net_device *dev, int x,u16 y) ++{ ++ outw(y,dev->base_addr +x); ++} ++ ++void write_nic_dword(struct net_device *dev, int x,u32 y) ++{ ++ outl(y,dev->base_addr +x); ++} ++ ++#else /* RTL_IO_MAP */ ++ ++u8 read_nic_byte(struct net_device *dev, int x) ++{ ++ return 0xff&readb((u8*)dev->mem_start +x); ++} ++ ++u32 read_nic_dword(struct net_device *dev, int x) ++{ ++ return readl((u8*)dev->mem_start +x); ++} ++ ++u16 read_nic_word(struct net_device *dev, int x) ++{ ++ return readw((u8*)dev->mem_start +x); ++} ++ ++void write_nic_byte(struct net_device *dev, int x,u8 y) ++{ ++ writeb(y,(u8*)dev->mem_start +x); ++ udelay(20); ++} ++ ++void write_nic_dword(struct net_device *dev, int x,u32 y) ++{ ++ writel(y,(u8*)dev->mem_start +x); ++ udelay(20); ++} ++ ++void write_nic_word(struct net_device *dev, int x,u16 y) ++{ ++ writew(y,(u8*)dev->mem_start +x); ++ udelay(20); ++} ++ ++#endif /* RTL_IO_MAP */ ++ ++ ++/////////////////////////////////////////////////////////// ++ ++//u8 read_phy_cck(struct net_device *dev, u8 adr); ++//u8 read_phy_ofdm(struct net_device *dev, u8 adr); ++/* this might still called in what was the PHY rtl8185/rtl8192 common code ++ * plans are to possibilty turn it again in one common code... ++ */ ++inline void force_pci_posting(struct net_device *dev) ++{ ++} ++ ++ ++//warning message WB ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++void rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs); ++#else ++irqreturn_t rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs); ++#endif ++#else ++irqreturn_t rtl8192_interrupt(int irq, void *netdev); ++#endif ++//static struct net_device_stats *rtl8192_stats(struct net_device *dev); ++void rtl8192_commit(struct net_device *dev); ++//void rtl8192_restart(struct net_device *dev); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void rtl8192_restart(struct work_struct *work); ++//void rtl8192_rq_tx_ack(struct work_struct *work); ++#else ++ void rtl8192_restart(struct net_device *dev); ++// //void rtl8192_rq_tx_ack(struct net_device *dev); ++ #endif ++ ++void watch_dog_timer_callback(unsigned long data); ++#ifdef ENABLE_IPS ++void IPSEnter(struct net_device *dev); ++void IPSLeave(struct net_device *dev); ++void InactivePsWorkItemCallback(struct net_device *dev); ++#endif ++/**************************************************************************** ++ -----------------------------PROCFS STUFF------------------------- ++*****************************************************************************/ ++ ++static struct proc_dir_entry *rtl8192_proc = NULL; ++ ++ ++ ++static int proc_get_stats_ap(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct ieee80211_device *ieee = priv->ieee80211; ++ struct ieee80211_network *target; ++ ++ int len = 0; ++ ++ list_for_each_entry(target, &ieee->network_list, list) { ++ ++ len += snprintf(page + len, count - len, ++ "%s ", target->ssid); ++ ++ if(target->wpa_ie_len>0 || target->rsn_ie_len>0){ ++ len += snprintf(page + len, count - len, ++ "WPA\n"); ++ } ++ else{ ++ len += snprintf(page + len, count - len, ++ "non_WPA\n"); ++ } ++ ++ } ++ ++ *eof = 1; ++ return len; ++} ++ ++static int proc_get_registers(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ int i,n; ++ ++ int max=0xff; ++ ++ /* This dump the current register page */ ++ len += snprintf(page + len, count - len, ++ "\n####################page 0##################\n "); ++ ++ for(n=0;n<=max;) ++ { ++ //printk( "\nD: %2x> ", n); ++ len += snprintf(page + len, count - len, ++ "\nD: %2x > ",n); ++ ++ for(i=0;i<16 && n<=max;i++,n++) ++ len += snprintf(page + len, count - len, ++ "%2x ",read_nic_byte(dev,n)); ++ ++ // printk("%2x ",read_nic_byte(dev,n)); ++ } ++ len += snprintf(page + len, count - len,"\n"); ++ len += snprintf(page + len, count - len, ++ "\n####################page 1##################\n "); ++ for(n=0;n<=max;) ++ { ++ //printk( "\nD: %2x> ", n); ++ len += snprintf(page + len, count - len, ++ "\nD: %2x > ",n); ++ ++ for(i=0;i<16 && n<=max;i++,n++) ++ len += snprintf(page + len, count - len, ++ "%2x ",read_nic_byte(dev,0x100|n)); ++ ++ // printk("%2x ",read_nic_byte(dev,n)); ++ } ++ ++ len += snprintf(page + len, count - len, ++ "\n####################page 3##################\n "); ++ for(n=0;n<=max;) ++ { ++ //printk( "\nD: %2x> ", n); ++ len += snprintf(page + len, count - len, ++ "\nD: %2x > ",n); ++ ++ for(i=0;i<16 && n<=max;i++,n++) ++ len += snprintf(page + len, count - len, ++ "%2x ",read_nic_byte(dev,0x300|n)); ++ ++ // printk("%2x ",read_nic_byte(dev,n)); ++ } ++ ++ ++ *eof = 1; ++ return len; ++ ++} ++ ++ ++#if 0 ++static int proc_get_cck_reg(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ int i,n; ++ ++ int max = 0x5F; ++ ++ /* This dump the current register page */ ++ for(n=0;n<=max;) ++ { ++ //printk( "\nD: %2x> ", n); ++ len += snprintf(page + len, count - len, ++ "\nD: %2x > ",n); ++ ++ for(i=0;i<16 && n<=max;i++,n++) ++ len += snprintf(page + len, count - len, ++ "%2x ",read_phy_cck(dev,n)); ++ ++ // printk("%2x ",read_nic_byte(dev,n)); ++ } ++ len += snprintf(page + len, count - len,"\n"); ++ ++ ++ *eof = 1; ++ return len; ++} ++ ++#endif ++ ++#if 0 ++static int proc_get_ofdm_reg(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ ++ struct net_device *dev = data; ++// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ int i,n; ++ ++ //int max=0xff; ++ int max = 0x40; ++ ++ /* This dump the current register page */ ++ for(n=0;n<=max;) ++ { ++ //printk( "\nD: %2x> ", n); ++ len += snprintf(page + len, count - len, ++ "\nD: %2x > ",n); ++ ++ for(i=0;i<16 && n<=max;i++,n++) ++ len += snprintf(page + len, count - len, ++ "%2x ",read_phy_ofdm(dev,n)); ++ ++ // printk("%2x ",read_nic_byte(dev,n)); ++ } ++ len += snprintf(page + len, count - len,"\n"); ++ ++ ++ ++ *eof = 1; ++ return len; ++} ++ ++#endif ++ ++#if 0 ++static int proc_get_stats_hw(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ ++ len += snprintf(page + len, count - len, ++ "NIC int: %lu\n" ++ "Total int: %lu\n", ++ priv->stats.ints, ++ priv->stats.shints); ++ ++ *eof = 1; ++ return len; ++} ++#endif ++ ++static int proc_get_stats_tx(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ ++ len += snprintf(page + len, count - len, ++ "TX VI priority ok int: %lu\n" ++// "TX VI priority error int: %lu\n" ++ "TX VO priority ok int: %lu\n" ++// "TX VO priority error int: %lu\n" ++ "TX BE priority ok int: %lu\n" ++// "TX BE priority error int: %lu\n" ++ "TX BK priority ok int: %lu\n" ++// "TX BK priority error int: %lu\n" ++ "TX MANAGE priority ok int: %lu\n" ++// "TX MANAGE priority error int: %lu\n" ++ "TX BEACON priority ok int: %lu\n" ++ "TX BEACON priority error int: %lu\n" ++ "TX CMDPKT priority ok int: %lu\n" ++// "TX high priority ok int: %lu\n" ++// "TX high priority failed error int: %lu\n" ++// "TX queue resume: %lu\n" ++ "TX queue stopped?: %d\n" ++ "TX fifo overflow: %lu\n" ++// "TX beacon: %lu\n" ++// "TX VI queue: %d\n" ++// "TX VO queue: %d\n" ++// "TX BE queue: %d\n" ++// "TX BK queue: %d\n" ++// "TX HW queue: %d\n" ++// "TX VI dropped: %lu\n" ++// "TX VO dropped: %lu\n" ++// "TX BE dropped: %lu\n" ++// "TX BK dropped: %lu\n" ++ "TX total data packets %lu\n" ++ "TX total data bytes :%lu\n", ++// "TX beacon aborted: %lu\n", ++ priv->stats.txviokint, ++// priv->stats.txvierr, ++ priv->stats.txvookint, ++// priv->stats.txvoerr, ++ priv->stats.txbeokint, ++// priv->stats.txbeerr, ++ priv->stats.txbkokint, ++// priv->stats.txbkerr, ++ priv->stats.txmanageokint, ++// priv->stats.txmanageerr, ++ priv->stats.txbeaconokint, ++ priv->stats.txbeaconerr, ++ priv->stats.txcmdpktokint, ++// priv->stats.txhpokint, ++// priv->stats.txhperr, ++// priv->stats.txresumed, ++ netif_queue_stopped(dev), ++ priv->stats.txoverflow, ++// priv->stats.txbeacon, ++// atomic_read(&(priv->tx_pending[VI_QUEUE])), ++// atomic_read(&(priv->tx_pending[VO_QUEUE])), ++// atomic_read(&(priv->tx_pending[BE_QUEUE])), ++// atomic_read(&(priv->tx_pending[BK_QUEUE])), ++// read_nic_byte(dev, TXFIFOCOUNT), ++// priv->stats.txvidrop, ++// priv->stats.txvodrop, ++ priv->ieee80211->stats.tx_packets, ++ priv->ieee80211->stats.tx_bytes ++ ++ ++// priv->stats.txbedrop, ++// priv->stats.txbkdrop ++ // priv->stats.txdatapkt ++// priv->stats.txbeaconerr ++ ); ++ ++ *eof = 1; ++ return len; ++} ++ ++ ++ ++static int proc_get_stats_rx(char *page, char **start, ++ off_t offset, int count, ++ int *eof, void *data) ++{ ++ struct net_device *dev = data; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ int len = 0; ++ ++ len += snprintf(page + len, count - len, ++ "RX packets: %lu\n" ++ "RX desc err: %lu\n" ++ "RX rx overflow error: %lu\n" ++ "RX invalid urb error: %lu\n", ++ priv->stats.rxint, ++ priv->stats.rxrdu, ++ priv->stats.rxoverflow, ++ priv->stats.rxurberr); ++ ++ *eof = 1; ++ return len; ++} ++ ++static void rtl8192_proc_module_init(void) ++{ ++ RT_TRACE(COMP_INIT, "Initializing proc filesystem"); ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ rtl8192_proc=create_proc_entry(RTL819xE_MODULE_NAME, S_IFDIR, proc_net); ++#else ++ rtl8192_proc=create_proc_entry(RTL819xE_MODULE_NAME, S_IFDIR, init_net.proc_net); ++#endif ++} ++ ++ ++static void rtl8192_proc_module_remove(void) ++{ ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) ++ remove_proc_entry(RTL819xE_MODULE_NAME, proc_net); ++#else ++ remove_proc_entry(RTL819xE_MODULE_NAME, init_net.proc_net); ++#endif ++} ++ ++ ++static void rtl8192_proc_remove_one(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ printk("dev name=======> %s\n",dev->name); ++ ++ if (priv->dir_dev) { ++ // remove_proc_entry("stats-hw", priv->dir_dev); ++ remove_proc_entry("stats-tx", priv->dir_dev); ++ remove_proc_entry("stats-rx", priv->dir_dev); ++ // remove_proc_entry("stats-ieee", priv->dir_dev); ++ remove_proc_entry("stats-ap", priv->dir_dev); ++ remove_proc_entry("registers", priv->dir_dev); ++ // remove_proc_entry("cck-registers",priv->dir_dev); ++ // remove_proc_entry("ofdm-registers",priv->dir_dev); ++ //remove_proc_entry(dev->name, rtl8192_proc); ++ remove_proc_entry("wlan0", rtl8192_proc); ++ priv->dir_dev = NULL; ++ } ++} ++ ++ ++static void rtl8192_proc_init_one(struct net_device *dev) ++{ ++ struct proc_dir_entry *e; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ priv->dir_dev = create_proc_entry(dev->name, ++ S_IFDIR | S_IRUGO | S_IXUGO, ++ rtl8192_proc); ++ if (!priv->dir_dev) { ++ RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", ++ dev->name); ++ return; ++ } ++ #if 0 ++ e = create_proc_read_entry("stats-hw", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_stats_hw, dev); ++ ++ if (!e) { ++ DMESGE("Unable to initialize " ++ "/proc/net/rtl8192/%s/stats-hw\n", ++ dev->name); ++ } ++ #endif ++ e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_stats_rx, dev); ++ ++ if (!e) { ++ RT_TRACE(COMP_ERR,"Unable to initialize " ++ "/proc/net/rtl8192/%s/stats-rx\n", ++ dev->name); ++ } ++ ++ ++ e = create_proc_read_entry("stats-tx", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_stats_tx, dev); ++ ++ if (!e) { ++ RT_TRACE(COMP_ERR, "Unable to initialize " ++ "/proc/net/rtl8192/%s/stats-tx\n", ++ dev->name); ++ } ++ #if 0 ++ e = create_proc_read_entry("stats-ieee", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_stats_ieee, dev); ++ ++ if (!e) { ++ DMESGE("Unable to initialize " ++ "/proc/net/rtl8192/%s/stats-ieee\n", ++ dev->name); ++ } ++ ++ #endif ++ ++ e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_stats_ap, dev); ++ ++ if (!e) { ++ RT_TRACE(COMP_ERR, "Unable to initialize " ++ "/proc/net/rtl8192/%s/stats-ap\n", ++ dev->name); ++ } ++ ++ e = create_proc_read_entry("registers", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_registers, dev); ++ if (!e) { ++ RT_TRACE(COMP_ERR, "Unable to initialize " ++ "/proc/net/rtl8192/%s/registers\n", ++ dev->name); ++ } ++#if 0 ++ e = create_proc_read_entry("cck-registers", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_cck_reg, dev); ++ if (!e) { ++ RT_TRACE(COMP_ERR, "Unable to initialize " ++ "/proc/net/rtl8192/%s/cck-registers\n", ++ dev->name); ++ } ++ ++ e = create_proc_read_entry("ofdm-registers", S_IFREG | S_IRUGO, ++ priv->dir_dev, proc_get_ofdm_reg, dev); ++ if (!e) { ++ RT_TRACE(COMP_ERR, "Unable to initialize " ++ "/proc/net/rtl8192/%s/ofdm-registers\n", ++ dev->name); ++ } ++#endif ++} ++/**************************************************************************** ++ -----------------------------MISC STUFF------------------------- ++*****************************************************************************/ ++ ++short check_nic_enough_desc(struct net_device *dev, int prio) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct rtl8192_tx_ring *ring = &priv->tx_ring[prio]; ++ ++ /* for now we reserve two free descriptor as a safety boundary ++ * between the tail and the head ++ */ ++ if (ring->entries - skb_queue_len(&ring->queue) >= 2) { ++ return 1; ++ } else { ++ return 0; ++ } ++} ++ ++static void tx_timeout(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //rtl8192_commit(dev); ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ schedule_work(&priv->reset_wq); ++#else ++ schedule_task(&priv->reset_wq); ++#endif ++ printk("TXTIMEOUT"); ++} ++ ++ ++/**************************************************************************** ++ ------------------------------HW STUFF--------------------------- ++*****************************************************************************/ ++ ++ ++static void rtl8192_irq_enable(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ priv->irq_enabled = 1; ++ write_nic_dword(dev,INTA_MASK, priv->irq_mask); ++} ++ ++ ++static void rtl8192_irq_disable(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ write_nic_dword(dev,INTA_MASK,0); ++ force_pci_posting(dev); ++ priv->irq_enabled = 0; ++} ++ ++ ++static void rtl8192_set_mode(struct net_device *dev,int mode) ++{ ++ u8 ecmd; ++ ecmd=read_nic_byte(dev, EPROM_CMD); ++ ecmd=ecmd &~ EPROM_CMD_OPERATING_MODE_MASK; ++ ecmd=ecmd | (mode<ieee80211->state == IEEE80211_LINKED){ ++ ++ if (priv->ieee80211->iw_mode == IW_MODE_INFRA) ++ msr |= (MSR_LINK_MANAGED<ieee80211->iw_mode == IW_MODE_ADHOC) ++ msr |= (MSR_LINK_ADHOC<ieee80211->iw_mode == IW_MODE_MASTER) ++ msr |= (MSR_LINK_MASTER<%s()====ch:%d\n", __FUNCTION__, ch); ++ priv->chan=ch; ++#if 0 ++ if(priv->ieee80211->iw_mode == IW_MODE_ADHOC || ++ priv->ieee80211->iw_mode == IW_MODE_MASTER){ ++ ++ priv->ieee80211->link_state = WLAN_LINK_ASSOCIATED; ++ priv->ieee80211->master_chan = ch; ++ rtl8192_update_beacon_ch(dev); ++ } ++#endif ++ ++ /* this hack should avoid frame TX during channel setting*/ ++ ++ ++ // tx = read_nic_dword(dev,TX_CONF); ++ // tx &= ~TX_LOOPBACK_MASK; ++ ++#ifndef LOOP_TEST ++ //TODO ++ // write_nic_dword(dev,TX_CONF, tx |( TX_LOOPBACK_MAC<rf_set_chan) ++ priv->rf_set_chan(dev,priv->chan); ++ // mdelay(10); ++ // write_nic_dword(dev,TX_CONF,tx | (TX_LOOPBACK_NONE<rx_ring_dma); ++} ++ ++/* the TX_DESC_BASE setting is according to the following queue index ++ * BK_QUEUE ===> 0 ++ * BE_QUEUE ===> 1 ++ * VI_QUEUE ===> 2 ++ * VO_QUEUE ===> 3 ++ * HCCA_QUEUE ===> 4 ++ * TXCMD_QUEUE ===> 5 ++ * MGNT_QUEUE ===> 6 ++ * HIGH_QUEUE ===> 7 ++ * BEACON_QUEUE ===> 8 ++ * */ ++static u32 TX_DESC_BASE[] = {BKQDA, BEQDA, VIQDA, VOQDA, HCCAQDA, CQDA, MQDA, HQDA, BQDA}; ++void rtl8192_tx_enable(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ u32 i; ++ for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) ++ write_nic_dword(dev, TX_DESC_BASE[i], priv->tx_ring[i].dma); ++ ++ ieee80211_reset_queue(priv->ieee80211); ++} ++ ++#if 0 ++void rtl8192_beacon_tx_enable(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ u32 reg; ++ ++ reg = read_nic_dword(priv->ieee80211->dev,INTA_MASK); ++ ++ /* enable Beacon realted interrupt signal */ ++ reg |= (IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER); ++ write_nic_byte(dev,reg); ++} ++#endif ++ ++static void rtl8192_free_rx_ring(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int i; ++ ++ for (i = 0; i < priv->rxringcount; i++) { ++ struct sk_buff *skb = priv->rx_buf[i]; ++ if (!skb) ++ continue; ++ ++ pci_unmap_single(priv->pdev, ++ *((dma_addr_t *)skb->cb), ++ priv->rxbuffersize, PCI_DMA_FROMDEVICE); ++ kfree_skb(skb); ++ } ++ ++ pci_free_consistent(priv->pdev, sizeof(*priv->rx_ring) * priv->rxringcount, ++ priv->rx_ring, priv->rx_ring_dma); ++ priv->rx_ring = NULL; ++} ++ ++static void rtl8192_free_tx_ring(struct net_device *dev, unsigned int prio) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct rtl8192_tx_ring *ring = &priv->tx_ring[prio]; ++ ++ while (skb_queue_len(&ring->queue)) { ++ tx_desc_819x_pci *entry = &ring->desc[ring->idx]; ++ struct sk_buff *skb = __skb_dequeue(&ring->queue); ++ ++ pci_unmap_single(priv->pdev, le32_to_cpu(entry->TxBuffAddr), ++ skb->len, PCI_DMA_TODEVICE); ++ kfree_skb(skb); ++ ring->idx = (ring->idx + 1) % ring->entries; ++ } ++ ++ pci_free_consistent(priv->pdev, sizeof(*ring->desc)*ring->entries, ++ ring->desc, ring->dma); ++ ring->desc = NULL; ++} ++ ++ ++static void rtl8192_beacon_disable(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ u32 reg; ++ ++ reg = read_nic_dword(priv->ieee80211->dev,INTA_MASK); ++ ++ /* disable Beacon realted interrupt signal */ ++ reg &= ~(IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER); ++ write_nic_dword(priv->ieee80211->dev, INTA_MASK, reg); ++} ++ ++void rtl8192_rtx_disable(struct net_device *dev) ++{ ++ u8 cmd; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int i; ++ ++ cmd=read_nic_byte(dev,CMDR); ++// if(!priv->ieee80211->bSupportRemoteWakeUp) { ++ write_nic_byte(dev, CMDR, cmd &~ \ ++ (CR_TE|CR_RE)); ++// } ++ force_pci_posting(dev); ++ mdelay(30); ++ ++ for(i = 0; i < MAX_QUEUE_SIZE; i++) { ++ skb_queue_purge(&priv->ieee80211->skb_waitQ [i]); ++ } ++ for(i = 0; i < MAX_QUEUE_SIZE; i++) { ++ skb_queue_purge(&priv->ieee80211->skb_aggQ [i]); ++ } ++ ++ ++ skb_queue_purge(&priv->skb_queue); ++ return; ++} ++ ++static void rtl8192_reset(struct net_device *dev) ++{ ++ rtl8192_irq_disable(dev); ++ printk("This is RTL819xP Reset procedure\n"); ++} ++ ++static u16 rtl_rate[] = {10,20,55,110,60,90,120,180,240,360,480,540}; ++inline u16 rtl8192_rate2rate(short rate) ++{ ++ if (rate >11) return 0; ++ return rtl_rate[rate]; ++} ++ ++ ++ ++#if 0 ++void rtl8192_tx_queues_stop(struct net_device *dev) ++{ ++ //struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ u8 dma_poll_mask = (1<dma_poll_mask |= (1<dma_poll_mask); ++ rtl8192_set_mode(dev,EPROM_CMD_NORMAL); ++ #endif ++} ++ ++ ++static void rtl8192_data_hard_resume(struct net_device *dev) ++{ ++ // FIXME !! ++ #if 0 ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ priv->dma_poll_mask &= ~(1<dma_poll_mask); ++ rtl8192_set_mode(dev,EPROM_CMD_NORMAL); ++ #endif ++} ++ ++/* this function TX data frames when the ieee80211 stack requires this. ++ * It checks also if we need to stop the ieee tx queue, eventually do it ++ */ ++static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rate) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ int ret; ++ //unsigned long flags; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ u8 queue_index = tcb_desc->queue_index; ++ /* shall not be referred by command packet */ ++ assert(queue_index != TXCMD_QUEUE); ++ ++ //spin_lock_irqsave(&priv->tx_lock,flags); ++ ++ memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); ++#if 0 ++ tcb_desc->RATRIndex = 7; ++ tcb_desc->bTxDisableRateFallBack = 1; ++ tcb_desc->bTxUseDriverAssingedRate = 1; ++ tcb_desc->bTxEnableFwCalcDur = 1; ++#endif ++ skb_push(skb, priv->ieee80211->tx_headroom); ++ ret = rtl8192_tx(dev, skb); ++ if(ret != 0) { ++ kfree_skb(skb); ++ }; ++ ++// ++ if(queue_index!=MGNT_QUEUE) { ++ priv->ieee80211->stats.tx_bytes+=(skb->len - priv->ieee80211->tx_headroom); ++ priv->ieee80211->stats.tx_packets++; ++ } ++ ++ //spin_unlock_irqrestore(&priv->tx_lock,flags); ++ ++// return ret; ++ return; ++} ++ ++/* This is a rough attempt to TX a frame ++ * This is called by the ieee 80211 stack to TX management frames. ++ * If the ring is full packet are dropped (for data frame the queue ++ * is stopped before this can happen). ++ */ ++static int rtl8192_hard_start_xmit(struct sk_buff *skb,struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ ++ int ret; ++ //unsigned long flags; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ u8 queue_index = tcb_desc->queue_index; ++ ++ ++ //spin_lock_irqsave(&priv->tx_lock,flags); ++ ++ memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); ++ if(queue_index == TXCMD_QUEUE) { ++ // skb_push(skb, USB_HWDESC_HEADER_LEN); ++ rtl819xE_tx_cmd(dev, skb); ++ ret = 0; ++ //spin_unlock_irqrestore(&priv->tx_lock,flags); ++ return ret; ++ } else { ++ // RT_TRACE(COMP_SEND, "To send management packet\n"); ++ tcb_desc->RATRIndex = 7; ++ tcb_desc->bTxDisableRateFallBack = 1; ++ tcb_desc->bTxUseDriverAssingedRate = 1; ++ tcb_desc->bTxEnableFwCalcDur = 1; ++ skb_push(skb, priv->ieee80211->tx_headroom); ++ ret = rtl8192_tx(dev, skb); ++ if(ret != 0) { ++ kfree_skb(skb); ++ }; ++ } ++ ++// priv->ieee80211->stats.tx_bytes+=skb->len; ++// priv->ieee80211->stats.tx_packets++; ++ ++ //spin_unlock_irqrestore(&priv->tx_lock,flags); ++ ++ return ret; ++ ++} ++ ++ ++void rtl8192_try_wake_queue(struct net_device *dev, int pri); ++ ++static void rtl8192_tx_isr(struct net_device *dev, int prio) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ struct rtl8192_tx_ring *ring = &priv->tx_ring[prio]; ++ ++ while (skb_queue_len(&ring->queue)) { ++ tx_desc_819x_pci *entry = &ring->desc[ring->idx]; ++ struct sk_buff *skb; ++ ++ /* beacon packet will only use the first descriptor defautly, ++ * and the OWN may not be cleared by the hardware ++ * */ ++ if(prio != BEACON_QUEUE) { ++ if(entry->OWN) ++ return; ++ ring->idx = (ring->idx + 1) % ring->entries; ++ } ++ ++ skb = __skb_dequeue(&ring->queue); ++ pci_unmap_single(priv->pdev, le32_to_cpu(entry->TxBuffAddr), ++ skb->len, PCI_DMA_TODEVICE); ++ ++ kfree_skb(skb); ++ } ++ if (prio == MGNT_QUEUE){ ++ if (priv->ieee80211->ack_tx_to_ieee){ ++ if (rtl8192_is_tx_queue_empty(dev)){ ++ priv->ieee80211->ack_tx_to_ieee = 0; ++ ieee80211_ps_tx_ack(priv->ieee80211, 1); ++ } ++ } ++ } ++ ++ if(prio != BEACON_QUEUE) { ++ /* try to deal with the pending packets */ ++ tasklet_schedule(&priv->irq_tx_tasklet); ++ } ++ ++} ++ ++static void rtl8192_stop_beacon(struct net_device *dev) ++{ ++ //rtl8192_beacon_disable(dev); ++} ++ ++static void rtl8192_config_rate(struct net_device* dev, u16* rate_config) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_network *net; ++ u8 i=0, basic_rate = 0; ++ net = & priv->ieee80211->current_network; ++ ++ for (i=0; irates_len; i++) ++ { ++ basic_rate = net->rates[i]&0x7f; ++ switch(basic_rate) ++ { ++ case MGN_1M: *rate_config |= RRSR_1M; break; ++ case MGN_2M: *rate_config |= RRSR_2M; break; ++ case MGN_5_5M: *rate_config |= RRSR_5_5M; break; ++ case MGN_11M: *rate_config |= RRSR_11M; break; ++ case MGN_6M: *rate_config |= RRSR_6M; break; ++ case MGN_9M: *rate_config |= RRSR_9M; break; ++ case MGN_12M: *rate_config |= RRSR_12M; break; ++ case MGN_18M: *rate_config |= RRSR_18M; break; ++ case MGN_24M: *rate_config |= RRSR_24M; break; ++ case MGN_36M: *rate_config |= RRSR_36M; break; ++ case MGN_48M: *rate_config |= RRSR_48M; break; ++ case MGN_54M: *rate_config |= RRSR_54M; break; ++ } ++ } ++ for (i=0; irates_ex_len; i++) ++ { ++ basic_rate = net->rates_ex[i]&0x7f; ++ switch(basic_rate) ++ { ++ case MGN_1M: *rate_config |= RRSR_1M; break; ++ case MGN_2M: *rate_config |= RRSR_2M; break; ++ case MGN_5_5M: *rate_config |= RRSR_5_5M; break; ++ case MGN_11M: *rate_config |= RRSR_11M; break; ++ case MGN_6M: *rate_config |= RRSR_6M; break; ++ case MGN_9M: *rate_config |= RRSR_9M; break; ++ case MGN_12M: *rate_config |= RRSR_12M; break; ++ case MGN_18M: *rate_config |= RRSR_18M; break; ++ case MGN_24M: *rate_config |= RRSR_24M; break; ++ case MGN_36M: *rate_config |= RRSR_36M; break; ++ case MGN_48M: *rate_config |= RRSR_48M; break; ++ case MGN_54M: *rate_config |= RRSR_54M; break; ++ } ++ } ++} ++ ++ ++#define SHORT_SLOT_TIME 9 ++#define NON_SHORT_SLOT_TIME 20 ++ ++static void rtl8192_update_cap(struct net_device* dev, u16 cap) ++{ ++ u32 tmp = 0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_network *net = &priv->ieee80211->current_network; ++ priv->short_preamble = cap & WLAN_CAPABILITY_SHORT_PREAMBLE; ++ tmp = priv->basic_rate; ++ if (priv->short_preamble) ++ tmp |= BRSR_AckShortPmb; ++ write_nic_dword(dev, RRSR, tmp); ++ ++ if (net->mode & (IEEE_G|IEEE_N_24G)) ++ { ++ u8 slot_time = 0; ++ if ((cap & WLAN_CAPABILITY_SHORT_SLOT)&&(!priv->ieee80211->pHTInfo->bCurrentRT2RTLongSlotTime)) ++ {//short slot time ++ slot_time = SHORT_SLOT_TIME; ++ } ++ else //long slot time ++ slot_time = NON_SHORT_SLOT_TIME; ++ priv->slot_time = slot_time; ++ write_nic_byte(dev, SLOT_TIME, slot_time); ++ } ++ ++} ++ ++static void rtl8192_net_update(struct net_device *dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_network *net; ++ u16 BcnTimeCfg = 0, BcnCW = 6, BcnIFS = 0xf; ++ u16 rate_config = 0; ++ net = &priv->ieee80211->current_network; ++ //update Basic rate: RR, BRSR ++ rtl8192_config_rate(dev, &rate_config); ++ // 2007.01.16, by Emily ++ // Select RRSR (in Legacy-OFDM and CCK) ++ // For 8190, we select only 24M, 12M, 6M, 11M, 5.5M, 2M, and 1M from the Basic rate. ++ // We do not use other rates. ++ priv->basic_rate = rate_config &= 0x15f; ++ //BSSID ++ write_nic_dword(dev,BSSIDR,((u32*)net->bssid)[0]); ++ write_nic_word(dev,BSSIDR+4,((u16*)net->bssid)[2]); ++#if 0 ++ //MSR ++ rtl8192_update_msr(dev); ++#endif ++ ++ ++// rtl8192_update_cap(dev, net->capability); ++ if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ { ++ write_nic_word(dev, ATIMWND, 2); ++ write_nic_word(dev, BCN_DMATIME, 256); ++ write_nic_word(dev, BCN_INTERVAL, net->beacon_interval); ++ // write_nic_word(dev, BcnIntTime, 100); ++ //BIT15 of BCN_DRV_EARLY_INT will indicate whether software beacon or hw beacon is applied. ++ write_nic_word(dev, BCN_DRV_EARLY_INT, 10); ++ write_nic_byte(dev, BCN_ERR_THRESH, 100); ++ ++ BcnTimeCfg |= (BcnCW<tx_ring[TXCMD_QUEUE]; ++ mapping = pci_map_single(priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); ++ ++ spin_lock_irqsave(&priv->irq_th_lock,flags); ++ idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries; ++ entry = &ring->desc[idx]; ++ ++ tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ memset(entry,0,12); ++ entry->LINIP = tcb_desc->bLastIniPkt; ++ entry->FirstSeg = 1;//first segment ++ entry->LastSeg = 1; //last segment ++ if(tcb_desc->bCmdOrInit == DESC_PACKET_TYPE_INIT) { ++ entry->CmdInit = DESC_PACKET_TYPE_INIT; ++ } else { ++ entry->CmdInit = DESC_PACKET_TYPE_NORMAL; ++ entry->Offset = sizeof(TX_FWINFO_8190PCI) + 8; ++ entry->PktSize = (u16)(tcb_desc->pkt_size + entry->Offset); ++ entry->QueueSelect = QSLT_CMD; ++ entry->TxFWInfoSize = 0x08; ++ entry->RATid = (u8)DESC_PACKET_TYPE_INIT; ++ } ++ entry->TxBufferSize = skb->len; ++ entry->TxBuffAddr = cpu_to_le32(mapping); ++ entry->OWN = 1; ++ ++#ifdef JOHN_DUMP_TXDESC ++ { int i; ++ tx_desc_819x_pci *entry1 = &ring->desc[0]; ++ unsigned int *ptr= (unsigned int *)entry1; ++ printk(":\n"); ++ for (i = 0; i < 8; i++) ++ printk("%8x ", ptr[i]); ++ printk("\n"); ++ } ++#endif ++ __skb_queue_tail(&ring->queue, skb); ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++ ++ write_nic_byte(dev, TPPoll, TPPoll_CQ); ++ ++ return; ++} ++ ++/* ++ * Mapping Software/Hardware descriptor queue id to "Queue Select Field" ++ * in TxFwInfo data structure ++ * 2006.10.30 by Emily ++ * ++ * \param QUEUEID Software Queue ++*/ ++static u8 MapHwQueueToFirmwareQueue(u8 QueueID) ++{ ++ u8 QueueSelect = 0x0; //defualt set to ++ ++ switch(QueueID) { ++ case BE_QUEUE: ++ QueueSelect = QSLT_BE; //or QSelect = pTcb->priority; ++ break; ++ ++ case BK_QUEUE: ++ QueueSelect = QSLT_BK; //or QSelect = pTcb->priority; ++ break; ++ ++ case VO_QUEUE: ++ QueueSelect = QSLT_VO; //or QSelect = pTcb->priority; ++ break; ++ ++ case VI_QUEUE: ++ QueueSelect = QSLT_VI; //or QSelect = pTcb->priority; ++ break; ++ case MGNT_QUEUE: ++ QueueSelect = QSLT_MGNT; ++ break; ++ ++ case BEACON_QUEUE: ++ QueueSelect = QSLT_BEACON; ++ break; ++ ++ // TODO: 2006.10.30 mark other queue selection until we verify it is OK ++ // TODO: Remove Assertions ++//#if (RTL819X_FPGA_VER & RTL819X_FPGA_GUANGAN_070502) ++ case TXCMD_QUEUE: ++ QueueSelect = QSLT_CMD; ++ break; ++//#endif ++ case HIGH_QUEUE: ++ //QueueSelect = QSLT_HIGH; ++ //break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "TransmitTCB(): Impossible Queue Selection: %d \n", QueueID); ++ break; ++ } ++ return QueueSelect; ++} ++ ++static u8 MRateToHwRate8190Pci(u8 rate) ++{ ++ u8 ret = DESC90_RATE1M; ++ ++ switch(rate) { ++ case MGN_1M: ret = DESC90_RATE1M; break; ++ case MGN_2M: ret = DESC90_RATE2M; break; ++ case MGN_5_5M: ret = DESC90_RATE5_5M; break; ++ case MGN_11M: ret = DESC90_RATE11M; break; ++ case MGN_6M: ret = DESC90_RATE6M; break; ++ case MGN_9M: ret = DESC90_RATE9M; break; ++ case MGN_12M: ret = DESC90_RATE12M; break; ++ case MGN_18M: ret = DESC90_RATE18M; break; ++ case MGN_24M: ret = DESC90_RATE24M; break; ++ case MGN_36M: ret = DESC90_RATE36M; break; ++ case MGN_48M: ret = DESC90_RATE48M; break; ++ case MGN_54M: ret = DESC90_RATE54M; break; ++ ++ // HT rate since here ++ case MGN_MCS0: ret = DESC90_RATEMCS0; break; ++ case MGN_MCS1: ret = DESC90_RATEMCS1; break; ++ case MGN_MCS2: ret = DESC90_RATEMCS2; break; ++ case MGN_MCS3: ret = DESC90_RATEMCS3; break; ++ case MGN_MCS4: ret = DESC90_RATEMCS4; break; ++ case MGN_MCS5: ret = DESC90_RATEMCS5; break; ++ case MGN_MCS6: ret = DESC90_RATEMCS6; break; ++ case MGN_MCS7: ret = DESC90_RATEMCS7; break; ++ case MGN_MCS8: ret = DESC90_RATEMCS8; break; ++ case MGN_MCS9: ret = DESC90_RATEMCS9; break; ++ case MGN_MCS10: ret = DESC90_RATEMCS10; break; ++ case MGN_MCS11: ret = DESC90_RATEMCS11; break; ++ case MGN_MCS12: ret = DESC90_RATEMCS12; break; ++ case MGN_MCS13: ret = DESC90_RATEMCS13; break; ++ case MGN_MCS14: ret = DESC90_RATEMCS14; break; ++ case MGN_MCS15: ret = DESC90_RATEMCS15; break; ++ case (0x80|0x20): ret = DESC90_RATEMCS32; break; ++ ++ default: break; ++ } ++ return ret; ++} ++ ++ ++static u8 QueryIsShort(u8 TxHT, u8 TxRate, cb_desc *tcb_desc) ++{ ++ u8 tmp_Short; ++ ++ tmp_Short = (TxHT==1)?((tcb_desc->bUseShortGI)?1:0):((tcb_desc->bUseShortPreamble)?1:0); ++ ++ if(TxHT==1 && TxRate != DESC90_RATEMCS15) ++ tmp_Short = 0; ++ ++ return tmp_Short; ++} ++ ++/* ++ * The tx procedure is just as following, ++ * skb->cb will contain all the following information, ++ * priority, morefrag, rate, &dev. ++ * */ ++short rtl8192_tx(struct net_device *dev, struct sk_buff* skb) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct rtl8192_tx_ring *ring; ++ unsigned long flags; ++ cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ++ tx_desc_819x_pci *pdesc = NULL; ++ TX_FWINFO_8190PCI *pTxFwInfo = NULL; ++ dma_addr_t mapping; ++ bool multi_addr=false,broad_addr=false,uni_addr=false; ++ u8* pda_addr = NULL; ++ int idx; ++ ++ mapping = pci_map_single(priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); ++ /* collect the tx packets statitcs */ ++ pda_addr = ((u8*)skb->data) + sizeof(TX_FWINFO_8190PCI); ++ if(is_multicast_ether_addr(pda_addr)) ++ multi_addr = true; ++ else if(is_broadcast_ether_addr(pda_addr)) ++ broad_addr = true; ++ else ++ uni_addr = true; ++ ++ if(uni_addr) ++ priv->stats.txbytesunicast += (u8)(skb->len) - sizeof(TX_FWINFO_8190PCI); ++ else if(multi_addr) ++ priv->stats.txbytesmulticast +=(u8)(skb->len) - sizeof(TX_FWINFO_8190PCI); ++ else ++ priv->stats.txbytesbroadcast += (u8)(skb->len) - sizeof(TX_FWINFO_8190PCI); ++ ++ /* fill tx firmware */ ++ pTxFwInfo = (PTX_FWINFO_8190PCI)skb->data; ++ memset(pTxFwInfo,0,sizeof(TX_FWINFO_8190PCI)); ++ pTxFwInfo->TxHT = (tcb_desc->data_rate&0x80)?1:0; ++ pTxFwInfo->TxRate = MRateToHwRate8190Pci((u8)tcb_desc->data_rate); ++ pTxFwInfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur; ++ pTxFwInfo->Short = QueryIsShort(pTxFwInfo->TxHT, pTxFwInfo->TxRate, tcb_desc); ++ ++ /* Aggregation related */ ++ if(tcb_desc->bAMPDUEnable) { ++ pTxFwInfo->AllowAggregation = 1; ++ pTxFwInfo->RxMF = tcb_desc->ampdu_factor; ++ pTxFwInfo->RxAMD = tcb_desc->ampdu_density; ++ } else { ++ pTxFwInfo->AllowAggregation = 0; ++ pTxFwInfo->RxMF = 0; ++ pTxFwInfo->RxAMD = 0; ++ } ++ ++ // ++ // Protection mode related ++ // ++ pTxFwInfo->RtsEnable = (tcb_desc->bRTSEnable)?1:0; ++ pTxFwInfo->CtsEnable = (tcb_desc->bCTSEnable)?1:0; ++ pTxFwInfo->RtsSTBC = (tcb_desc->bRTSSTBC)?1:0; ++ pTxFwInfo->RtsHT= (tcb_desc->rts_rate&0x80)?1:0; ++ pTxFwInfo->RtsRate = MRateToHwRate8190Pci((u8)tcb_desc->rts_rate); ++ pTxFwInfo->RtsBandwidth = 0; ++ pTxFwInfo->RtsSubcarrier = tcb_desc->RTSSC; ++ pTxFwInfo->RtsShort = (pTxFwInfo->RtsHT==0)?(tcb_desc->bRTSUseShortPreamble?1:0):(tcb_desc->bRTSUseShortGI?1:0); ++ // ++ // Set Bandwidth and sub-channel settings. ++ // ++ if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20_40) ++ { ++ if(tcb_desc->bPacketBW) ++ { ++ pTxFwInfo->TxBandwidth = 1; ++#ifdef RTL8190P ++ pTxFwInfo->TxSubCarrier = 3; ++#else ++ pTxFwInfo->TxSubCarrier = 0; //By SD3's Jerry suggestion, use duplicated mode, cosa 04012008 ++#endif ++ } ++ else ++ { ++ pTxFwInfo->TxBandwidth = 0; ++ pTxFwInfo->TxSubCarrier = priv->nCur40MhzPrimeSC; ++ } ++ } else { ++ pTxFwInfo->TxBandwidth = 0; ++ pTxFwInfo->TxSubCarrier = 0; ++ } ++ ++ if (0) ++ { ++ /* 2007/07/25 MH Copy current TX FW info.*/ ++ memcpy((void*)(&Tmp_TxFwInfo), (void*)(pTxFwInfo), sizeof(TX_FWINFO_8190PCI)); ++ printk("&&&&&&&&&&&&&&&&&&&&&&====>print out fwinf\n"); ++ printk("===>enable fwcacl:%d\n", Tmp_TxFwInfo.EnableCPUDur); ++ printk("===>RTS STBC:%d\n", Tmp_TxFwInfo.RtsSTBC); ++ printk("===>RTS Subcarrier:%d\n", Tmp_TxFwInfo.RtsSubcarrier); ++ printk("===>Allow Aggregation:%d\n", Tmp_TxFwInfo.AllowAggregation); ++ printk("===>TX HT bit:%d\n", Tmp_TxFwInfo.TxHT); ++ printk("===>Tx rate:%d\n", Tmp_TxFwInfo.TxRate); ++ printk("===>Received AMPDU Density:%d\n", Tmp_TxFwInfo.RxAMD); ++ printk("===>Received MPDU Factor:%d\n", Tmp_TxFwInfo.RxMF); ++ printk("===>TxBandwidth:%d\n", Tmp_TxFwInfo.TxBandwidth); ++ printk("===>TxSubCarrier:%d\n", Tmp_TxFwInfo.TxSubCarrier); ++ ++ printk("<=====**********************out of print\n"); ++ ++ } ++ spin_lock_irqsave(&priv->irq_th_lock,flags); ++ ring = &priv->tx_ring[tcb_desc->queue_index]; ++ if (tcb_desc->queue_index != BEACON_QUEUE) { ++ idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries; ++ } else { ++ idx = 0; ++ } ++ ++ pdesc = &ring->desc[idx]; ++ if((pdesc->OWN == 1) && (tcb_desc->queue_index != BEACON_QUEUE)) { ++ RT_TRACE(COMP_ERR,"No more TX desc@%d, ring->idx = %d,idx = %d,%x", \ ++ tcb_desc->queue_index,ring->idx, idx,skb->len); ++ return skb->len; ++ } ++ ++ /* fill tx descriptor */ ++ memset((u8*)pdesc,0,12); ++ /*DWORD 0*/ ++ pdesc->LINIP = 0; ++ pdesc->CmdInit = 1; ++ pdesc->Offset = sizeof(TX_FWINFO_8190PCI) + 8; //We must add 8!! Emily ++ pdesc->PktSize = (u16)skb->len-sizeof(TX_FWINFO_8190PCI); ++ ++ /*DWORD 1*/ ++ pdesc->SecCAMID= 0; ++ pdesc->RATid = tcb_desc->RATRIndex; ++ ++ ++ pdesc->NoEnc = 1; ++ pdesc->SecType = 0x0; ++ if (tcb_desc->bHwSec) { ++ static u8 tmp =0; ++ if (!tmp) { ++ printk("==>================hw sec\n"); ++ tmp = 1; ++ } ++ switch (priv->ieee80211->pairwise_key_type) { ++ case KEY_TYPE_WEP40: ++ case KEY_TYPE_WEP104: ++ pdesc->SecType = 0x1; ++ pdesc->NoEnc = 0; ++ break; ++ case KEY_TYPE_TKIP: ++ pdesc->SecType = 0x2; ++ pdesc->NoEnc = 0; ++ break; ++ case KEY_TYPE_CCMP: ++ pdesc->SecType = 0x3; ++ pdesc->NoEnc = 0; ++ break; ++ case KEY_TYPE_NA: ++ pdesc->SecType = 0x0; ++ pdesc->NoEnc = 1; ++ break; ++ } ++ } ++ ++ // ++ // Set Packet ID ++ // ++ pdesc->PktId = 0x0; ++ ++ pdesc->QueueSelect = MapHwQueueToFirmwareQueue(tcb_desc->queue_index); ++ pdesc->TxFWInfoSize = sizeof(TX_FWINFO_8190PCI); ++ ++ pdesc->DISFB = tcb_desc->bTxDisableRateFallBack; ++ pdesc->USERATE = tcb_desc->bTxUseDriverAssingedRate; ++ ++ pdesc->FirstSeg =1; ++ pdesc->LastSeg = 1; ++ pdesc->TxBufferSize = skb->len; ++ ++ pdesc->TxBuffAddr = cpu_to_le32(mapping); ++ __skb_queue_tail(&ring->queue, skb); ++ pdesc->OWN = 1; ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++ dev->trans_start = jiffies; ++ write_nic_word(dev,TPPoll,0x01<queue_index); ++ return 0; ++} ++ ++static short rtl8192_alloc_rx_desc_ring(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ rx_desc_819x_pci *entry = NULL; ++ int i; ++ ++ priv->rx_ring = pci_alloc_consistent(priv->pdev, ++ sizeof(*priv->rx_ring) * priv->rxringcount, &priv->rx_ring_dma); ++ ++ if (!priv->rx_ring || (unsigned long)priv->rx_ring & 0xFF) { ++ RT_TRACE(COMP_ERR,"Cannot allocate RX ring\n"); ++ return -ENOMEM; ++ } ++ ++ memset(priv->rx_ring, 0, sizeof(*priv->rx_ring) * priv->rxringcount); ++ priv->rx_idx = 0; ++ ++ for (i = 0; i < priv->rxringcount; i++) { ++ struct sk_buff *skb = dev_alloc_skb(priv->rxbuffersize); ++ dma_addr_t *mapping; ++ entry = &priv->rx_ring[i]; ++ if (!skb) ++ return 0; ++ priv->rx_buf[i] = skb; ++ mapping = (dma_addr_t *)skb->cb; ++ *mapping = pci_map_single(priv->pdev, skb->tail,//skb_tail_pointer(skb), ++ priv->rxbuffersize, PCI_DMA_FROMDEVICE); ++ ++ entry->BufferAddress = cpu_to_le32(*mapping); ++ ++ entry->Length = priv->rxbuffersize; ++ entry->OWN = 1; ++ } ++ ++ entry->EOR = 1; ++ return 0; ++} ++ ++static int rtl8192_alloc_tx_desc_ring(struct net_device *dev, ++ unsigned int prio, unsigned int entries) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ tx_desc_819x_pci *ring; ++ dma_addr_t dma; ++ int i; ++ ++ ring = pci_alloc_consistent(priv->pdev, sizeof(*ring) * entries, &dma); ++ if (!ring || (unsigned long)ring & 0xFF) { ++ RT_TRACE(COMP_ERR, "Cannot allocate TX ring (prio = %d)\n", prio); ++ return -ENOMEM; ++ } ++ ++ memset(ring, 0, sizeof(*ring)*entries); ++ priv->tx_ring[prio].desc = ring; ++ priv->tx_ring[prio].dma = dma; ++ priv->tx_ring[prio].idx = 0; ++ priv->tx_ring[prio].entries = entries; ++ skb_queue_head_init(&priv->tx_ring[prio].queue); ++ ++ for (i = 0; i < entries; i++) ++ ring[i].NextDescAddress = ++ cpu_to_le32((u32)dma + ((i + 1) % entries) * sizeof(*ring)); ++ ++ return 0; ++} ++ ++ ++static short rtl8192_pci_initdescring(struct net_device *dev) ++{ ++ u32 ret; ++ int i; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ ret = rtl8192_alloc_rx_desc_ring(dev); ++ if (ret) { ++ return ret; ++ } ++ ++ ++ /* general process for other queue */ ++ for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) { ++ if ((ret = rtl8192_alloc_tx_desc_ring(dev, i, priv->txringcount))) ++ goto err_free_rings; ++ } ++ ++#if 0 ++ /* specific process for hardware beacon process */ ++ if ((ret = rtl8192_alloc_tx_desc_ring(dev, MAX_TX_QUEUE_COUNT - 1, 2))) ++ goto err_free_rings; ++#endif ++ ++ return 0; ++ ++err_free_rings: ++ rtl8192_free_rx_ring(dev); ++ for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) ++ if (priv->tx_ring[i].desc) ++ rtl8192_free_tx_ring(dev, i); ++ return 1; ++} ++ ++static void rtl8192_pci_resetdescring(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int i; ++ ++ /* force the rx_idx to the first one */ ++ if(priv->rx_ring) { ++ rx_desc_819x_pci *entry = NULL; ++ for (i = 0; i < priv->rxringcount; i++) { ++ entry = &priv->rx_ring[i]; ++ entry->OWN = 1; ++ } ++ priv->rx_idx = 0; ++ } ++ ++ /* after reset, release previous pending packet, and force the ++ * tx idx to the first one */ ++ for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) { ++ if (priv->tx_ring[i].desc) { ++ struct rtl8192_tx_ring *ring = &priv->tx_ring[i]; ++ ++ while (skb_queue_len(&ring->queue)) { ++ tx_desc_819x_pci *entry = &ring->desc[ring->idx]; ++ struct sk_buff *skb = __skb_dequeue(&ring->queue); ++ ++ pci_unmap_single(priv->pdev, le32_to_cpu(entry->TxBuffAddr), ++ skb->len, PCI_DMA_TODEVICE); ++ kfree_skb(skb); ++ ring->idx = (ring->idx + 1) % ring->entries; ++ } ++ ring->idx = 0; ++ } ++ } ++} ++ ++#if 1 ++extern void rtl8192_update_ratr_table(struct net_device* dev); ++static void rtl8192_link_change(struct net_device *dev) ++{ ++// int i; ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ //write_nic_word(dev, BCN_INTR_ITV, net->beacon_interval); ++ if (ieee->state == IEEE80211_LINKED) ++ { ++ rtl8192_net_update(dev); ++ rtl8192_update_ratr_table(dev); ++#if 1 ++ //add this as in pure N mode, wep encryption will use software way, but there is no chance to set this as wep will not set group key in wext. WB.2008.07.08 ++ if ((KEY_TYPE_WEP40 == ieee->pairwise_key_type) || (KEY_TYPE_WEP104 == ieee->pairwise_key_type)) ++ EnableHWSecurityConfig8192(dev); ++#endif ++ } ++ else ++ { ++ write_nic_byte(dev, 0x173, 0); ++ } ++ /*update timing params*/ ++ //rtl8192_set_chan(dev, priv->chan); ++ //MSR ++ rtl8192_update_msr(dev); ++ ++ // 2007/10/16 MH MAC Will update TSF according to all received beacon, so we have ++ // // To set CBSSID bit when link with any AP or STA. ++ if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) ++ { ++ u32 reg = 0; ++ reg = read_nic_dword(dev, RCR); ++ if (priv->ieee80211->state == IEEE80211_LINKED) ++ priv->ReceiveConfig = reg |= RCR_CBSSID; ++ else ++ priv->ReceiveConfig = reg &= ~RCR_CBSSID; ++ write_nic_dword(dev, RCR, reg); ++ } ++} ++#endif ++ ++ ++static struct ieee80211_qos_parameters def_qos_parameters = { ++ {3,3,3,3},/* cw_min */ ++ {7,7,7,7},/* cw_max */ ++ {2,2,2,2},/* aifs */ ++ {0,0,0,0},/* flags */ ++ {0,0,0,0} /* tx_op_limit */ ++}; ++ ++#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) ++static void rtl8192_update_beacon(struct work_struct * work) ++{ ++ struct r8192_priv *priv = container_of(work, struct r8192_priv, update_beacon_wq.work); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++void rtl8192_update_beacon(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ struct ieee80211_device* ieee = priv->ieee80211; ++ struct ieee80211_network* net = &ieee->current_network; ++ ++ if (ieee->pHTInfo->bCurrentHTSupport) ++ HTUpdateSelfAndPeerSetting(ieee, net); ++ ieee->pHTInfo->bCurrentRT2RTLongSlotTime = net->bssht.bdRT2RTLongSlotTime; ++ rtl8192_update_cap(dev, net->capability); ++} ++/* ++* background support to run QoS activate functionality ++*/ ++static int WDCAPARA_ADD[] = {EDCAPARA_BE,EDCAPARA_BK,EDCAPARA_VI,EDCAPARA_VO}; ++#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) ++static void rtl8192_qos_activate(struct work_struct * work) ++{ ++ struct r8192_priv *priv = container_of(work, struct r8192_priv, qos_activate); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++void rtl8192_qos_activate(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters; ++ u8 mode = priv->ieee80211->current_network.mode; ++// u32 size = sizeof(struct ieee80211_qos_parameters); ++ u8 u1bAIFS; ++ u32 u4bAcParam; ++ int i; ++ if (priv == NULL) ++ return; ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) ++ down(&priv->mutex); ++#else ++ mutex_lock(&priv->mutex); ++#endif ++ if(priv->ieee80211->state != IEEE80211_LINKED) ++ goto success; ++ RT_TRACE(COMP_QOS,"qos active process with associate response received\n"); ++ /* It better set slot time at first */ ++ /* For we just support b/g mode at present, let the slot time at 9/20 selection */ ++ /* update the ac parameter to related registers */ ++ for(i = 0; i < QOS_QUEUE_NUM; i++) { ++ //Mode G/A: slotTimeTimer = 9; Mode B: 20 ++ u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime; ++ u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[i]))<< AC_PARAM_TXOP_LIMIT_OFFSET)| ++ (((u32)(qos_parameters->cw_max[i]))<< AC_PARAM_ECW_MAX_OFFSET)| ++ (((u32)(qos_parameters->cw_min[i]))<< AC_PARAM_ECW_MIN_OFFSET)| ++ ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET)); ++ printk("===>u4bAcParam:%x, ", u4bAcParam); ++ write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam); ++ //write_nic_dword(dev, WDCAPARA_ADD[i], 0x005e4332); ++ } ++ ++success: ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) ++ up(&priv->mutex); ++#else ++ mutex_unlock(&priv->mutex); ++#endif ++} ++ ++static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv, ++ int active_network, ++ struct ieee80211_network *network) ++{ ++ int ret = 0; ++ u32 size = sizeof(struct ieee80211_qos_parameters); ++ ++ if(priv->ieee80211->state !=IEEE80211_LINKED) ++ return ret; ++ ++ if ((priv->ieee80211->iw_mode != IW_MODE_INFRA)) ++ return ret; ++ ++ 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 == 1) && ++ (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; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(priv->priv_wq, &priv->qos_activate); ++#else ++ schedule_task(&priv->qos_activate); ++#endif ++ RT_TRACE (COMP_QOS, "QoS parameters change call " ++ "qos_activate\n"); ++ } ++ } else { ++ memcpy(&priv->ieee80211->current_network.qos_data.parameters,\ ++ &def_qos_parameters, size); ++ ++ if ((network->qos_data.active == 1) && (active_network == 1)) { ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(priv->priv_wq, &priv->qos_activate); ++#else ++ schedule_task(&priv->qos_activate); ++#endif ++ RT_TRACE(COMP_QOS, "QoS was disabled call qos_activate \n"); ++ } ++ network->qos_data.active = 0; ++ network->qos_data.supported = 0; ++ } ++ ++ return 0; ++} ++ ++/* handle manage frame frame beacon and probe response */ ++static int rtl8192_handle_beacon(struct net_device * dev, ++ struct ieee80211_beacon * beacon, ++ struct ieee80211_network * network) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ rtl8192_qos_handle_probe_response(priv,1,network); ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq, &priv->update_beacon_wq, 0); ++#else ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->update_beacon_wq); ++#else ++ queue_work(priv->priv_wq, &priv->update_beacon_wq); ++#endif ++#endif ++ return 0; ++ ++} ++ ++/* ++* handling the beaconing responses. if we get different QoS setting ++* off the network from the associated setting, adjust the QoS ++* setting ++*/ ++static int rtl8192_qos_association_resp(struct r8192_priv *priv, ++ struct ieee80211_network *network) ++{ ++ int ret = 0; ++ unsigned long flags; ++ u32 size = sizeof(struct ieee80211_qos_parameters); ++ int set_qos_param = 0; ++ ++ if ((priv == NULL) || (network == NULL)) ++ return ret; ++ ++ if(priv->ieee80211->state !=IEEE80211_LINKED) ++ return ret; ++ ++ if ((priv->ieee80211->iw_mode != IW_MODE_INFRA)) ++ return ret; ++ ++ spin_lock_irqsave(&priv->ieee80211->lock, flags); ++ if(network->flags & NETWORK_HAS_QOS_PARAMETERS) { ++ memcpy(&priv->ieee80211->current_network.qos_data.parameters,\ ++ &network->qos_data.parameters,\ ++ sizeof(struct ieee80211_qos_parameters)); ++ priv->ieee80211->current_network.qos_data.active = 1; ++#if 0 ++ if((priv->ieee80211->current_network.qos_data.param_count != \ ++ network->qos_data.param_count)) ++#endif ++ { ++ set_qos_param = 1; ++ /* update qos parameter for current network */ ++ priv->ieee80211->current_network.qos_data.old_param_count = \ ++ priv->ieee80211->current_network.qos_data.param_count; ++ priv->ieee80211->current_network.qos_data.param_count = \ ++ network->qos_data.param_count; ++ } ++ } else { ++ memcpy(&priv->ieee80211->current_network.qos_data.parameters,\ ++ &def_qos_parameters, size); ++ priv->ieee80211->current_network.qos_data.active = 0; ++ priv->ieee80211->current_network.qos_data.supported = 0; ++ set_qos_param = 1; ++ } ++ ++ spin_unlock_irqrestore(&priv->ieee80211->lock, flags); ++ ++ RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n",__FUNCTION__,network->flags ,priv->ieee80211->current_network.qos_data.active); ++ if (set_qos_param == 1) ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(priv->priv_wq, &priv->qos_activate); ++#else ++ schedule_task(&priv->qos_activate); ++#endif ++ ++ ++ return ret; ++} ++ ++ ++static int rtl8192_handle_assoc_response(struct net_device *dev, ++ struct ieee80211_assoc_response_frame *resp, ++ struct ieee80211_network *network) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ rtl8192_qos_association_resp(priv, network); ++ return 0; ++} ++ ++ ++//updateRATRTabel for MCS only. Basic rate is not implement. ++void rtl8192_update_ratr_table(struct net_device* dev) ++ // POCTET_STRING posLegacyRate, ++ // u8* pMcsRate) ++ // PRT_WLAN_STA pEntry) ++{ ++ struct r8192_priv* priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ u8* pMcsRate = ieee->dot11HTOperationalRateSet; ++ //struct ieee80211_network *net = &ieee->current_network; ++ u32 ratr_value = 0; ++ u8 rate_index = 0; ++ ++ rtl8192_config_rate(dev, (u16*)(&ratr_value)); ++ ratr_value |= (*(u16*)(pMcsRate)) << 12; ++// switch (net->mode) ++ switch (ieee->mode) ++ { ++ case IEEE_A: ++ ratr_value &= 0x00000FF0; ++ break; ++ case IEEE_B: ++ ratr_value &= 0x0000000F; ++ break; ++ case IEEE_G: ++ ratr_value &= 0x00000FF7; ++ break; ++ case IEEE_N_24G: ++ case IEEE_N_5G: ++ if (ieee->pHTInfo->PeerMimoPs == 0) //MIMO_PS_STATIC ++ ratr_value &= 0x0007F007; ++ else{ ++ if (priv->rf_type == RF_1T2R) ++ ratr_value &= 0x000FF007; ++ else ++ ratr_value &= 0x0F81F007; ++ } ++ break; ++ default: ++ break; ++ } ++ ratr_value &= 0x0FFFFFFF; ++ if(ieee->pHTInfo->bCurTxBW40MHz && ieee->pHTInfo->bCurShortGI40MHz){ ++ ratr_value |= 0x80000000; ++ }else if(!ieee->pHTInfo->bCurTxBW40MHz && ieee->pHTInfo->bCurShortGI20MHz){ ++ ratr_value |= 0x80000000; ++ } ++ write_nic_dword(dev, RATR0+rate_index*4, ratr_value); ++ write_nic_byte(dev, UFWP, 1); ++} ++ ++static u8 ccmp_ie[4] = {0x00,0x50,0xf2,0x04}; ++static u8 ccmp_rsn_ie[4] = {0x00, 0x0f, 0xac, 0x04}; ++static bool GetNmodeSupportBySecCfg8190Pci(struct net_device*dev) ++{ ++#if 1 ++ struct r8192_priv* priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ int wpa_ie_len= ieee->wpa_ie_len; ++ struct ieee80211_crypt_data* crypt; ++ int encrypt; ++ ++ crypt = ieee->crypt[ieee->tx_keyidx]; ++ encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY) || (ieee->host_encrypt && crypt && crypt->ops && (0 == strcmp(crypt->ops->name,"WEP"))); ++ ++ /* simply judge */ ++ if(encrypt && (wpa_ie_len == 0)) { ++ /* wep encryption, no N mode setting */ ++ return false; ++// } else if((wpa_ie_len != 0)&&(memcmp(&(ieee->wpa_ie[14]),ccmp_ie,4))) { ++ } else if((wpa_ie_len != 0)) { ++ /* parse pairwise key type */ ++ //if((pairwisekey = WEP40)||(pairwisekey = WEP104)||(pairwisekey = TKIP)) ++ if (((ieee->wpa_ie[0] == 0xdd) && (!memcmp(&(ieee->wpa_ie[14]),ccmp_ie,4))) || ((ieee->wpa_ie[0] == 0x30) && (!memcmp(&ieee->wpa_ie[10],ccmp_rsn_ie, 4)))) ++ return true; ++ else ++ return false; ++ } else { ++ //RT_TRACE(COMP_ERR,"In %s The GroupEncAlgorithm is [4]\n",__FUNCTION__ ); ++ return true; ++ } ++ ++#if 0 ++ //In here we discuss with SD4 David. He think we still can send TKIP in broadcast group key in MCS rate. ++ //We can't force in G mode if Pairwie key is AES and group key is TKIP ++ if((pSecInfo->GroupEncAlgorithm == WEP104_Encryption) || (pSecInfo->GroupEncAlgorithm == WEP40_Encryption) || ++ (pSecInfo->PairwiseEncAlgorithm == WEP104_Encryption) || ++ (pSecInfo->PairwiseEncAlgorithm == WEP40_Encryption) || (pSecInfo->PairwiseEncAlgorithm == TKIP_Encryption)) ++ { ++ return false; ++ } ++ else ++ return true; ++#endif ++ return true; ++#endif ++} ++ ++static void rtl8192_refresh_supportrate(struct r8192_priv* priv) ++{ ++ struct ieee80211_device* ieee = priv->ieee80211; ++ //we donot consider set support rate for ABG mode, only HT MCS rate is set here. ++ if (ieee->mode == WIRELESS_MODE_N_24G || ieee->mode == WIRELESS_MODE_N_5G) ++ { ++ memcpy(ieee->Regdot11HTOperationalRateSet, ieee->RegHTSuppRateSet, 16); ++ //RT_DEBUG_DATA(COMP_INIT, ieee->RegHTSuppRateSet, 16); ++ //RT_DEBUG_DATA(COMP_INIT, ieee->Regdot11HTOperationalRateSet, 16); ++ } ++ else ++ memset(ieee->Regdot11HTOperationalRateSet, 0, 16); ++ return; ++} ++ ++static u8 rtl8192_getSupportedWireleeMode(struct net_device*dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 ret = 0; ++ switch(priv->rf_chip) ++ { ++ case RF_8225: ++ case RF_8256: ++ case RF_PSEUDO_11N: ++ ret = (WIRELESS_MODE_N_24G|WIRELESS_MODE_G|WIRELESS_MODE_B); ++ break; ++ case RF_8258: ++ ret = (WIRELESS_MODE_A|WIRELESS_MODE_N_5G); ++ break; ++ default: ++ ret = WIRELESS_MODE_B; ++ break; ++ } ++ return ret; ++} ++ ++static void rtl8192_SetWirelessMode(struct net_device* dev, u8 wireless_mode) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 bSupportMode = rtl8192_getSupportedWireleeMode(dev); ++ ++#if 1 ++ if ((wireless_mode == WIRELESS_MODE_AUTO) || ((wireless_mode&bSupportMode)==0)) ++ { ++ if(bSupportMode & WIRELESS_MODE_N_24G) ++ { ++ wireless_mode = WIRELESS_MODE_N_24G; ++ } ++ else if(bSupportMode & WIRELESS_MODE_N_5G) ++ { ++ wireless_mode = WIRELESS_MODE_N_5G; ++ } ++ else if((bSupportMode & WIRELESS_MODE_A)) ++ { ++ wireless_mode = WIRELESS_MODE_A; ++ } ++ else if((bSupportMode & WIRELESS_MODE_G)) ++ { ++ wireless_mode = WIRELESS_MODE_G; ++ } ++ else if((bSupportMode & WIRELESS_MODE_B)) ++ { ++ wireless_mode = WIRELESS_MODE_B; ++ } ++ else{ ++ RT_TRACE(COMP_ERR, "%s(), No valid wireless mode supported, SupportedWirelessMode(%x)!!!\n", __FUNCTION__,bSupportMode); ++ wireless_mode = WIRELESS_MODE_B; ++ } ++ } ++#ifdef TO_DO_LIST //// TODO: this function doesn't work well at this time, we shoud wait for FPGA ++ ActUpdateChannelAccessSetting( pAdapter, pHalData->CurrentWirelessMode, &pAdapter->MgntInfo.Info8185.ChannelAccessSetting ); ++#endif ++ priv->ieee80211->mode = wireless_mode; ++ ++ if ((wireless_mode == WIRELESS_MODE_N_24G) || (wireless_mode == WIRELESS_MODE_N_5G)) ++ priv->ieee80211->pHTInfo->bEnableHT = 1; ++ else ++ priv->ieee80211->pHTInfo->bEnableHT = 0; ++ RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode); ++ rtl8192_refresh_supportrate(priv); ++#endif ++ ++} ++//init priv variables here ++ ++static bool GetHalfNmodeSupportByAPs819xPci(struct net_device* dev) ++{ ++ bool Reval; ++ struct r8192_priv* priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ ++ if(ieee->bHalfWirelessN24GMode == true) ++ Reval = true; ++ else ++ Reval = false; ++ ++ return Reval; ++} ++ ++short rtl8192_is_tx_queue_empty(struct net_device *dev) ++{ ++ int i=0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ for (i=0; i<=MGNT_QUEUE; i++) ++ { ++ if ((i== TXCMD_QUEUE) || (i == HCCA_QUEUE) ) ++ continue; ++ if (skb_queue_len(&(&priv->tx_ring[i])->queue) > 0){ ++ printk("===>tx queue is not empty:%d, %d\n", i, skb_queue_len(&(&priv->tx_ring[i])->queue)); ++ return 0; ++ } ++ } ++ return 1; ++} ++#if 0 ++void rtl8192_rq_tx_ack(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ priv->ieee80211->ack_tx_to_ieee = 1; ++} ++#endif ++static void rtl8192_hw_sleep_down(struct net_device *dev) ++{ ++ RT_TRACE(COMP_POWER, "%s()============>come to sleep down\n", __FUNCTION__); ++ MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS); ++} ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++static void rtl8192_hw_sleep_wq (struct work_struct *work) ++{ ++// struct r8180_priv *priv = container_of(work, struct r8180_priv, watch_dog_wq); ++// struct ieee80211_device * ieee = (struct ieee80211_device*) ++// container_of(work, struct ieee80211_device, watch_dog_wq); ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct ieee80211_device *ieee = container_of(dwork,struct ieee80211_device,hw_sleep_wq); ++ struct net_device *dev = ieee->dev; ++#else ++void rtl8192_hw_sleep_wq(struct net_device* dev) ++{ ++#endif ++ //printk("=========>%s()\n", __FUNCTION__); ++ rtl8192_hw_sleep_down(dev); ++} ++// printk("dev is %d\n",dev); ++// printk("&*&(^*(&(&=========>%s()\n", __FUNCTION__); ++static void rtl8192_hw_wakeup(struct net_device* dev) ++{ ++// u32 flags = 0; ++ ++// spin_lock_irqsave(&priv->ps_lock,flags); ++ RT_TRACE(COMP_POWER, "%s()============>come to wake up\n", __FUNCTION__); ++ MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS); ++ //FIXME: will we send package stored while nic is sleep? ++// spin_unlock_irqrestore(&priv->ps_lock,flags); ++} ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void rtl8192_hw_wakeup_wq (struct work_struct *work) ++{ ++// struct r8180_priv *priv = container_of(work, struct r8180_priv, watch_dog_wq); ++// struct ieee80211_device * ieee = (struct ieee80211_device*) ++// container_of(work, struct ieee80211_device, watch_dog_wq); ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct ieee80211_device *ieee = container_of(dwork,struct ieee80211_device,hw_wakeup_wq); ++ struct net_device *dev = ieee->dev; ++#else ++void rtl8192_hw_wakeup_wq(struct net_device* dev) ++{ ++#endif ++ rtl8192_hw_wakeup(dev); ++ ++} ++ ++#define MIN_SLEEP_TIME 50 ++#define MAX_SLEEP_TIME 10000 ++static void rtl8192_hw_to_sleep(struct net_device *dev, u32 th, u32 tl) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ u32 rb = jiffies; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&priv->ps_lock,flags); ++ ++ /* Writing HW register with 0 equals to disable ++ * the timer, that is not really what we want ++ */ ++ tl -= MSECS(4+16+7); ++ ++ //if(tl == 0) tl = 1; ++ ++ /* FIXME HACK FIXME HACK */ ++// force_pci_posting(dev); ++ //mdelay(1); ++ ++// rb = read_nic_dword(dev, TSFTR); ++ ++ /* If the interval in witch we are requested to sleep is too ++ * short then give up and remain awake ++ */ ++ if(((tl>=rb)&& (tl-rb) <= MSECS(MIN_SLEEP_TIME)) ++ ||((rb>tl)&& (rb-tl) < MSECS(MIN_SLEEP_TIME))) { ++ spin_unlock_irqrestore(&priv->ps_lock,flags); ++ printk("too short to sleep\n"); ++ return; ++ } ++ ++// write_nic_dword(dev, TimerInt, tl); ++// rb = read_nic_dword(dev, TSFTR); ++ { ++ u32 tmp = (tl>rb)?(tl-rb):(rb-tl); ++ // if (tlieee80211->wq, &priv->ieee80211->hw_wakeup_wq, tmp); //as tl may be less than rb ++ } ++ /* if we suspect the TimerInt is gone beyond tl ++ * while setting it, then give up ++ */ ++#if 1 ++ if(((tl > rb) && ((tl-rb) > MSECS(MAX_SLEEP_TIME)))|| ++ ((tl < rb) && ((rb-tl) > MSECS(MAX_SLEEP_TIME)))) { ++ printk("========>too long to sleep:%x, %x, %lx\n", tl, rb, MSECS(MAX_SLEEP_TIME)); ++ spin_unlock_irqrestore(&priv->ps_lock,flags); ++ return; ++ } ++#endif ++// if(priv->rf_sleep) ++// priv->rf_sleep(dev); ++ ++ //printk("<=========%s()\n", __FUNCTION__); ++ queue_delayed_work(priv->ieee80211->wq, (void *)&priv->ieee80211->hw_sleep_wq,0); ++ spin_unlock_irqrestore(&priv->ps_lock,flags); ++} ++static void rtl8192_init_priv_variable(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 i; ++ priv->being_init_adapter = false; ++ priv->txbuffsize = 1600;//1024; ++ priv->txfwbuffersize = 4096; ++ priv->txringcount = 64;//32; ++ //priv->txbeaconcount = priv->txringcount; ++ priv->txbeaconcount = 2; ++ priv->rxbuffersize = 9100;//2048;//1024; ++ priv->rxringcount = MAX_RX_COUNT;//64; ++ priv->irq_enabled=0; ++ priv->card_8192 = NIC_8192E; ++ priv->rx_skb_complete = 1; ++ priv->chan = 1; //set to channel 1 ++ priv->RegWirelessMode = WIRELESS_MODE_AUTO; ++ priv->RegChannelPlan = 0xf; ++ priv->nrxAMPDU_size = 0; ++ priv->nrxAMPDU_aggr_num = 0; ++ priv->last_rxdesc_tsf_high = 0; ++ priv->last_rxdesc_tsf_low = 0; ++ priv->ieee80211->mode = WIRELESS_MODE_AUTO; //SET AUTO ++ priv->ieee80211->iw_mode = IW_MODE_INFRA; ++ priv->ieee80211->ieee_up=0; ++ priv->retry_rts = DEFAULT_RETRY_RTS; ++ priv->retry_data = DEFAULT_RETRY_DATA; ++ priv->ieee80211->rts = DEFAULT_RTS_THRESHOLD; ++ priv->ieee80211->rate = 110; //11 mbps ++ priv->ieee80211->short_slot = 1; ++ priv->promisc = (dev->flags & IFF_PROMISC) ? 1:0; ++ priv->bcck_in_ch14 = false; ++ priv->bfsync_processing = false; ++ priv->CCKPresentAttentuation = 0; ++ priv->rfa_txpowertrackingindex = 0; ++ priv->rfc_txpowertrackingindex = 0; ++ priv->CckPwEnl = 6; ++ priv->ScanDelay = 50;//for Scan TODO ++ //added by amy for silent reset ++ priv->ResetProgress = RESET_TYPE_NORESET; ++ priv->bForcedSilentReset = 0; ++ priv->bDisableNormalResetCheck = false; ++ priv->force_reset = false; ++ //added by amy for power save ++ priv->RegRfOff = 0; ++ priv->ieee80211->RfOffReason = 0; ++ priv->RFChangeInProgress = false; ++ priv->bHwRfOffAction = 0; ++ priv->SetRFPowerStateInProgress = false; ++ priv->ieee80211->PowerSaveControl.bInactivePs = true; ++ priv->ieee80211->PowerSaveControl.bIPSModeBackup = false; ++ //just for debug ++ priv->txpower_checkcnt = 0; ++ priv->thermal_readback_index =0; ++ priv->txpower_tracking_callback_cnt = 0; ++ priv->ccktxpower_adjustcnt_ch14 = 0; ++ priv->ccktxpower_adjustcnt_not_ch14 = 0; ++ ++ priv->ieee80211->current_network.beacon_interval = DEFAULT_BEACONINTERVAL; ++ priv->ieee80211->iw_mode = IW_MODE_INFRA; ++ priv->ieee80211->softmac_features = IEEE_SOFTMAC_SCAN | ++ IEEE_SOFTMAC_ASSOCIATE | IEEE_SOFTMAC_PROBERQ | ++ IEEE_SOFTMAC_PROBERS | IEEE_SOFTMAC_TX_QUEUE;/* | ++ IEEE_SOFTMAC_BEACONS;*///added by amy 080604 //| //IEEE_SOFTMAC_SINGLE_QUEUE; ++ ++ priv->ieee80211->active_scan = 1; ++ priv->ieee80211->modulation = IEEE80211_CCK_MODULATION | IEEE80211_OFDM_MODULATION; ++ priv->ieee80211->host_encrypt = 1; ++ priv->ieee80211->host_decrypt = 1; ++ //priv->ieee80211->start_send_beacons = NULL;//rtl819xusb_beacon_tx;//-by amy 080604 ++ //priv->ieee80211->stop_send_beacons = NULL;//rtl8192_beacon_stop;//-by amy 080604 ++ priv->ieee80211->start_send_beacons = rtl8192_start_beacon;//+by david 081107 ++ priv->ieee80211->stop_send_beacons = rtl8192_stop_beacon;//+by david 081107 ++ priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit; ++ priv->ieee80211->set_chan = rtl8192_set_chan; ++ priv->ieee80211->link_change = rtl8192_link_change; ++ priv->ieee80211->softmac_data_hard_start_xmit = rtl8192_hard_data_xmit; ++ priv->ieee80211->data_hard_stop = rtl8192_data_hard_stop; ++ priv->ieee80211->data_hard_resume = rtl8192_data_hard_resume; ++ priv->ieee80211->init_wmmparam_flag = 0; ++ priv->ieee80211->fts = DEFAULT_FRAG_THRESHOLD; ++ priv->ieee80211->check_nic_enough_desc = check_nic_enough_desc; ++ priv->ieee80211->tx_headroom = sizeof(TX_FWINFO_8190PCI); ++ priv->ieee80211->qos_support = 1; ++ priv->ieee80211->dot11PowerSaveMode = 0; ++ //added by WB ++// priv->ieee80211->SwChnlByTimerHandler = rtl8192_phy_SwChnl; ++ priv->ieee80211->SetBWModeHandler = rtl8192_SetBWMode; ++ priv->ieee80211->handle_assoc_response = rtl8192_handle_assoc_response; ++ priv->ieee80211->handle_beacon = rtl8192_handle_beacon; ++ ++ priv->ieee80211->sta_wake_up = rtl8192_hw_wakeup; ++// priv->ieee80211->ps_request_tx_ack = rtl8192_rq_tx_ack; ++ priv->ieee80211->enter_sleep_state = rtl8192_hw_to_sleep; ++ priv->ieee80211->ps_is_queue_empty = rtl8192_is_tx_queue_empty; ++ //added by david ++ priv->ieee80211->GetNmodeSupportBySecCfg = GetNmodeSupportBySecCfg8190Pci; ++ priv->ieee80211->SetWirelessMode = rtl8192_SetWirelessMode; ++ priv->ieee80211->GetHalfNmodeSupportByAPsHandler = GetHalfNmodeSupportByAPs819xPci; ++ ++ //added by amy ++ priv->ieee80211->InitialGainHandler = InitialGain819xPci; ++ ++ priv->card_type = USB; ++ { ++ priv->ShortRetryLimit = 0x30; ++ priv->LongRetryLimit = 0x30; ++ } ++ priv->EarlyRxThreshold = 7; ++ priv->enable_gpio0 = 0; ++ ++ priv->TransmitConfig = 0; ++ ++ priv->ReceiveConfig = RCR_ADD3 | ++ RCR_AMF | RCR_ADF | //accept management/data ++ RCR_AICV | //accept control frame for SW AP needs PS-poll, 2005.07.07, by rcnjko. ++ RCR_AB | RCR_AM | RCR_APM | //accept BC/MC/UC ++ RCR_AAP | ((u32)7<irq_mask = (u32)(IMR_ROK | IMR_VODOK | IMR_VIDOK | IMR_BEDOK | IMR_BKDOK |\ ++ IMR_HCCADOK | IMR_MGNTDOK | IMR_COMDOK | IMR_HIGHDOK |\ ++ IMR_BDOK | IMR_RXCMDOK | IMR_TIMEOUT0 | IMR_RDU | IMR_RXFOVW |\ ++ IMR_TXFOVW | IMR_BcnInt | IMR_TBDOK | IMR_TBDER); ++ ++ priv->AcmControl = 0; ++ priv->pFirmware = (rt_firmware*)vmalloc(sizeof(rt_firmware)); ++ if (priv->pFirmware) ++ memset(priv->pFirmware, 0, sizeof(rt_firmware)); ++ ++ /* rx related queue */ ++ skb_queue_head_init(&priv->rx_queue); ++ skb_queue_head_init(&priv->skb_queue); ++ ++ /* Tx related queue */ ++ for(i = 0; i < MAX_QUEUE_SIZE; i++) { ++ skb_queue_head_init(&priv->ieee80211->skb_waitQ [i]); ++ } ++ for(i = 0; i < MAX_QUEUE_SIZE; i++) { ++ skb_queue_head_init(&priv->ieee80211->skb_aggQ [i]); ++ } ++ priv->rf_set_chan = rtl8192_phy_SwChnl; ++} ++ ++//init lock here ++static void rtl8192_init_priv_lock(struct r8192_priv* priv) ++{ ++ spin_lock_init(&priv->tx_lock); ++ spin_lock_init(&priv->irq_lock);//added by thomas ++ spin_lock_init(&priv->irq_th_lock); ++ spin_lock_init(&priv->rf_ps_lock); ++ spin_lock_init(&priv->ps_lock); ++ //spin_lock_init(&priv->rf_lock); ++ sema_init(&priv->wx_sem,1); ++ sema_init(&priv->rf_sem,1); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) ++ sema_init(&priv->mutex, 1); ++#else ++ mutex_init(&priv->mutex); ++#endif ++} ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void rtl819x_watchdog_wqcallback(struct work_struct *work); ++#else ++extern void rtl819x_watchdog_wqcallback(struct net_device *dev); ++#endif ++ ++void rtl8192_irq_rx_tasklet(struct r8192_priv *priv); ++void rtl8192_irq_tx_tasklet(struct r8192_priv *priv); ++void rtl8192_prepare_beacon(struct r8192_priv *priv); ++//init tasklet and wait_queue here. only 2.6 above kernel is considered ++#define DRV_NAME "wlan0" ++static void rtl8192_init_priv_task(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#ifdef PF_SYNCTHREAD ++ priv->priv_wq = create_workqueue(DRV_NAME,0); ++#else ++ priv->priv_wq = create_workqueue(DRV_NAME); ++#endif ++#endif ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++// INIT_WORK(&priv->reset_wq, (void(*)(void*)) rtl8192_restart); ++ INIT_WORK(&priv->reset_wq, rtl8192_restart); ++// INIT_DELAYED_WORK(&priv->watch_dog_wq, hal_dm_watchdog); ++ INIT_DELAYED_WORK(&priv->watch_dog_wq, rtl819x_watchdog_wqcallback); ++ INIT_DELAYED_WORK(&priv->txpower_tracking_wq, dm_txpower_trackingcallback); ++ INIT_DELAYED_WORK(&priv->rfpath_check_wq, dm_rf_pathcheck_workitemcallback); ++ INIT_DELAYED_WORK(&priv->update_beacon_wq, rtl8192_update_beacon); ++ //INIT_WORK(&priv->SwChnlWorkItem, rtl8192_SwChnl_WorkItem); ++ //INIT_WORK(&priv->SetBWModeWorkItem, rtl8192_SetBWModeWorkItem); ++ INIT_WORK(&priv->qos_activate, rtl8192_qos_activate); ++ INIT_DELAYED_WORK(&priv->ieee80211->hw_wakeup_wq,(void*) rtl8192_hw_wakeup_wq); ++ INIT_DELAYED_WORK(&priv->ieee80211->hw_sleep_wq,(void*) rtl8192_hw_sleep_wq); ++ ++#else ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) ++ tq_init(&priv->reset_wq, (void*)rtl8192_restart, dev); ++ tq_init(&priv->watch_dog_wq, (void*)rtl819x_watchdog_wqcallback, dev); ++ tq_init(&priv->txpower_tracking_wq, (void*)dm_txpower_trackingcallback, dev); ++ tq_init(&priv->rfpath_check_wq, (void*)dm_rf_pathcheck_workitemcallback, dev); ++ tq_init(&priv->update_beacon_wq, (void*)rtl8192_update_beacon, dev); ++ //tq_init(&priv->SwChnlWorkItem, (void*) rtl8192_SwChnl_WorkItem, dev); ++ //tq_init(&priv->SetBWModeWorkItem, (void*)rtl8192_SetBWModeWorkItem, dev); ++ tq_init(&priv->qos_activate, (void *)rtl8192_qos_activate, dev); ++ tq_init(&priv->ieee80211->hw_wakeup_wq,(void*) rtl8192_hw_wakeup_wq, dev); ++ tq_init(&priv->ieee80211->hw_sleep_wq,(void*) rtl8192_hw_sleep_wq, dev); ++ ++#else ++ INIT_WORK(&priv->reset_wq,(void(*)(void*)) rtl8192_restart,dev); ++// INIT_WORK(&priv->watch_dog_wq, (void(*)(void*)) hal_dm_watchdog,dev); ++ INIT_WORK(&priv->watch_dog_wq, (void(*)(void*)) rtl819x_watchdog_wqcallback,dev); ++ INIT_WORK(&priv->txpower_tracking_wq, (void(*)(void*)) dm_txpower_trackingcallback,dev); ++ INIT_WORK(&priv->rfpath_check_wq, (void(*)(void*)) dm_rf_pathcheck_workitemcallback,dev); ++ INIT_WORK(&priv->update_beacon_wq, (void(*)(void*))rtl8192_update_beacon,dev); ++ //INIT_WORK(&priv->SwChnlWorkItem, (void(*)(void*)) rtl8192_SwChnl_WorkItem, dev); ++ //INIT_WORK(&priv->SetBWModeWorkItem, (void(*)(void*)) rtl8192_SetBWModeWorkItem, dev); ++ INIT_WORK(&priv->qos_activate, (void(*)(void *))rtl8192_qos_activate, dev); ++ INIT_WORK(&priv->ieee80211->hw_wakeup_wq,(void*) rtl8192_hw_wakeup_wq, dev); ++ INIT_WORK(&priv->ieee80211->hw_sleep_wq,(void*) rtl8192_hw_sleep_wq, dev); ++#endif ++#endif ++ ++ tasklet_init(&priv->irq_rx_tasklet, ++ (void(*)(unsigned long))rtl8192_irq_rx_tasklet, ++ (unsigned long)priv); ++ tasklet_init(&priv->irq_tx_tasklet, ++ (void(*)(unsigned long))rtl8192_irq_tx_tasklet, ++ (unsigned long)priv); ++ tasklet_init(&priv->irq_prepare_beacon_tasklet, ++ (void(*)(unsigned long))rtl8192_prepare_beacon, ++ (unsigned long)priv); ++} ++ ++static void rtl8192_get_eeprom_size(struct net_device* dev) ++{ ++ u16 curCR = 0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_TRACE(COMP_INIT, "===========>%s()\n", __FUNCTION__); ++ curCR = read_nic_dword(dev, EPROM_CMD); ++ RT_TRACE(COMP_INIT, "read from Reg Cmd9346CR(%x):%x\n", EPROM_CMD, curCR); ++ //whether need I consider BIT5? ++ priv->epromtype = (curCR & EPROM_CMD_9356SEL) ? EPROM_93c56 : EPROM_93c46; ++ RT_TRACE(COMP_INIT, "<===========%s(), epromtype:%d\n", __FUNCTION__, priv->epromtype); ++} ++ ++//used to swap endian. as ntohl & htonl are not neccessary to swap endian, so use this instead. ++static inline u16 endian_swap(u16* data) ++{ ++ u16 tmp = *data; ++ *data = (tmp >> 8) | (tmp << 8); ++ return *data; ++} ++ ++/* ++ * Note: Adapter->EEPROMAddressSize should be set before this function call. ++ * EEPROM address size can be got through GetEEPROMSize8185() ++*/ ++static void rtl8192_read_eeprom_info(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ u8 tempval; ++#ifdef RTL8192E ++ u8 ICVer8192, ICVer8256; ++#endif ++ u16 i,usValue, IC_Version; ++ u16 EEPROMId; ++#ifdef RTL8190P ++ u8 offset;//, tmpAFR; ++ u8 EepromTxPower[100]; ++#endif ++ u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01}; ++ RT_TRACE(COMP_INIT, "====> rtl8192_read_eeprom_info\n"); ++ ++ ++ // TODO: I don't know if we need to apply EF function to EEPROM read function ++ ++ //2 Read EEPROM ID to make sure autoload is success ++ EEPROMId = eprom_read(dev, 0); ++ if( EEPROMId != RTL8190_EEPROM_ID ) ++ { ++ RT_TRACE(COMP_ERR, "EEPROM ID is invalid:%x, %x\n", EEPROMId, RTL8190_EEPROM_ID); ++ priv->AutoloadFailFlag=true; ++ } ++ else ++ { ++ priv->AutoloadFailFlag=false; ++ } ++ ++ // ++ // Assign Chip Version ID ++ // ++ // Read IC Version && Channel Plan ++ if(!priv->AutoloadFailFlag) ++ { ++ // VID, PID ++ priv->eeprom_vid = eprom_read(dev, (EEPROM_VID >> 1)); ++ priv->eeprom_did = eprom_read(dev, (EEPROM_DID >> 1)); ++ ++ usValue = eprom_read(dev, (u16)(EEPROM_Customer_ID>>1)) >> 8 ; ++ priv->eeprom_CustomerID = (u8)( usValue & 0xff); ++ usValue = eprom_read(dev, (EEPROM_ICVersion_ChannelPlan>>1)); ++ priv->eeprom_ChannelPlan = usValue&0xff; ++ IC_Version = ((usValue&0xff00)>>8); ++ ++#ifdef RTL8190P ++ priv->card_8192_version = (VERSION_8190)(IC_Version); ++#else ++ #ifdef RTL8192E ++ ICVer8192 = (IC_Version&0xf); //bit0~3; 1:A cut, 2:B cut, 3:C cut... ++ ICVer8256 = ((IC_Version&0xf0)>>4);//bit4~6, bit7 reserved for other RF chip; 1:A cut, 2:B cut, 3:C cut... ++ RT_TRACE(COMP_INIT, "\nICVer8192 = 0x%x\n", ICVer8192); ++ RT_TRACE(COMP_INIT, "\nICVer8256 = 0x%x\n", ICVer8256); ++ if(ICVer8192 == 0x2) //B-cut ++ { ++ if(ICVer8256 == 0x5) //E-cut ++ priv->card_8192_version= VERSION_8190_BE; ++ } ++ #endif ++#endif ++ switch(priv->card_8192_version) ++ { ++ case VERSION_8190_BD: ++ case VERSION_8190_BE: ++ break; ++ default: ++ priv->card_8192_version = VERSION_8190_BD; ++ break; ++ } ++ RT_TRACE(COMP_INIT, "\nIC Version = 0x%x\n", priv->card_8192_version); ++ } ++ else ++ { ++ priv->card_8192_version = VERSION_8190_BD; ++ priv->eeprom_vid = 0; ++ priv->eeprom_did = 0; ++ priv->eeprom_CustomerID = 0; ++ priv->eeprom_ChannelPlan = 0; ++ RT_TRACE(COMP_INIT, "\nIC Version = 0x%x\n", 0xff); ++ } ++ ++ RT_TRACE(COMP_INIT, "EEPROM VID = 0x%4x\n", priv->eeprom_vid); ++ RT_TRACE(COMP_INIT, "EEPROM DID = 0x%4x\n", priv->eeprom_did); ++ RT_TRACE(COMP_INIT,"EEPROM Customer ID: 0x%2x\n", priv->eeprom_CustomerID); ++ ++ //2 Read Permanent MAC address ++ if(!priv->AutoloadFailFlag) ++ { ++ for(i = 0; i < 6; i += 2) ++ { ++ usValue = eprom_read(dev, (u16) ((EEPROM_NODE_ADDRESS_BYTE_0+i)>>1)); ++ *(u16*)(&dev->dev_addr[i]) = usValue; ++ } ++ } else { ++ // when auto load failed, the last address byte set to be a random one. ++ // added by david woo.2007/11/7 ++ memcpy(dev->dev_addr, bMac_Tmp_Addr, 6); ++ #if 0 ++ for(i = 0; i < 6; i++) ++ { ++ Adapter->PermanentAddress[i] = sMacAddr[i]; ++ PlatformEFIOWrite1Byte(Adapter, IDR0+i, sMacAddr[i]); ++ } ++ #endif ++ } ++ ++ RT_TRACE(COMP_INIT, "Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", ++ dev->dev_addr[0], dev->dev_addr[1], ++ dev->dev_addr[2], dev->dev_addr[3], ++ dev->dev_addr[4], dev->dev_addr[5]); ++ ++ //2 TX Power Check EEPROM Fail or not ++ if(priv->card_8192_version > VERSION_8190_BD) { ++ priv->bTXPowerDataReadFromEEPORM = true; ++ } else { ++ priv->bTXPowerDataReadFromEEPORM = false; ++ } ++ ++ // 2007/11/15 MH 8190PCI Default=2T4R, 8192PCIE dafault=1T2R ++ priv->rf_type = RTL819X_DEFAULT_RF_TYPE; ++ ++ if(priv->card_8192_version > VERSION_8190_BD) ++ { ++ // Read RF-indication and Tx Power gain index diff of legacy to HT OFDM rate. ++ if(!priv->AutoloadFailFlag) ++ { ++ tempval = (eprom_read(dev, (EEPROM_RFInd_PowerDiff>>1))) & 0xff; ++ priv->EEPROMLegacyHTTxPowerDiff = tempval & 0xf; // bit[3:0] ++ ++ if (tempval&0x80) //RF-indication, bit[7] ++ priv->rf_type = RF_1T2R; ++ else ++ priv->rf_type = RF_2T4R; ++ } ++ else ++ { ++ priv->EEPROMLegacyHTTxPowerDiff = EEPROM_Default_LegacyHTTxPowerDiff; ++ } ++ RT_TRACE(COMP_INIT, "EEPROMLegacyHTTxPowerDiff = %d\n", ++ priv->EEPROMLegacyHTTxPowerDiff); ++ ++ // Read ThermalMeter from EEPROM ++ if(!priv->AutoloadFailFlag) ++ { ++ priv->EEPROMThermalMeter = (u8)(((eprom_read(dev, (EEPROM_ThermalMeter>>1))) & 0xff00)>>8); ++ } ++ else ++ { ++ priv->EEPROMThermalMeter = EEPROM_Default_ThermalMeter; ++ } ++ RT_TRACE(COMP_INIT, "ThermalMeter = %d\n", priv->EEPROMThermalMeter); ++ //vivi, for tx power track ++ priv->TSSI_13dBm = priv->EEPROMThermalMeter *100; ++ ++ if(priv->epromtype == EPROM_93c46) ++ { ++ // Read antenna tx power offset of B/C/D to A and CrystalCap from EEPROM ++ if(!priv->AutoloadFailFlag) ++ { ++ usValue = eprom_read(dev, (EEPROM_TxPwDiff_CrystalCap>>1)); ++ priv->EEPROMAntPwDiff = (usValue&0x0fff); ++ priv->EEPROMCrystalCap = (u8)((usValue&0xf000)>>12); ++ } ++ else ++ { ++ priv->EEPROMAntPwDiff = EEPROM_Default_AntTxPowerDiff; ++ priv->EEPROMCrystalCap = EEPROM_Default_TxPwDiff_CrystalCap; ++ } ++ RT_TRACE(COMP_INIT, "EEPROMAntPwDiff = %d\n", priv->EEPROMAntPwDiff); ++ RT_TRACE(COMP_INIT, "EEPROMCrystalCap = %d\n", priv->EEPROMCrystalCap); ++ ++ // ++ // Get per-channel Tx Power Level ++ // ++ for(i=0; i<14; i+=2) ++ { ++ if(!priv->AutoloadFailFlag) ++ { ++ usValue = eprom_read(dev, (u16) ((EEPROM_TxPwIndex_CCK+i)>>1) ); ++ } ++ else ++ { ++ usValue = EEPROM_Default_TxPower; ++ } ++ *((u16*)(&priv->EEPROMTxPowerLevelCCK[i])) = usValue; ++ RT_TRACE(COMP_INIT,"CCK Tx Power Level, Index %d = 0x%02x\n", i, priv->EEPROMTxPowerLevelCCK[i]); ++ RT_TRACE(COMP_INIT, "CCK Tx Power Level, Index %d = 0x%02x\n", i+1, priv->EEPROMTxPowerLevelCCK[i+1]); ++ } ++ for(i=0; i<14; i+=2) ++ { ++ if(!priv->AutoloadFailFlag) ++ { ++ usValue = eprom_read(dev, (u16) ((EEPROM_TxPwIndex_OFDM_24G+i)>>1) ); ++ } ++ else ++ { ++ usValue = EEPROM_Default_TxPower; ++ } ++ *((u16*)(&priv->EEPROMTxPowerLevelOFDM24G[i])) = usValue; ++ RT_TRACE(COMP_INIT, "OFDM 2.4G Tx Power Level, Index %d = 0x%02x\n", i, priv->EEPROMTxPowerLevelOFDM24G[i]); ++ RT_TRACE(COMP_INIT, "OFDM 2.4G Tx Power Level, Index %d = 0x%02x\n", i+1, priv->EEPROMTxPowerLevelOFDM24G[i+1]); ++ } ++ } ++ else if(priv->epromtype== EPROM_93c56) ++ { ++ #ifdef RTL8190P ++ // Read CrystalCap from EEPROM ++ if(!priv->AutoloadFailFlag) ++ { ++ priv->EEPROMAntPwDiff = EEPROM_Default_AntTxPowerDiff; ++ priv->EEPROMCrystalCap = (u8)(((eprom_read(dev, (EEPROM_C56_CrystalCap>>1))) & 0xf000)>>12); ++ } ++ else ++ { ++ priv->EEPROMAntPwDiff = EEPROM_Default_AntTxPowerDiff; ++ priv->EEPROMCrystalCap = EEPROM_Default_TxPwDiff_CrystalCap; ++ } ++ RT_TRACE(COMP_INIT,"EEPROMAntPwDiff = %d\n", priv->EEPROMAntPwDiff); ++ RT_TRACE(COMP_INIT, "EEPROMCrystalCap = %d\n", priv->EEPROMCrystalCap); ++ ++ // Get Tx Power Level by Channel ++ if(!priv->AutoloadFailFlag) ++ { ++ // Read Tx power of Channel 1 ~ 14 from EEPROM. ++ for(i = 0; i < 12; i+=2) ++ { ++ if (i <6) ++ offset = EEPROM_C56_RfA_CCK_Chnl1_TxPwIndex + i; ++ else ++ offset = EEPROM_C56_RfC_CCK_Chnl1_TxPwIndex + i - 6; ++ usValue = eprom_read(dev, (offset>>1)); ++ *((u16*)(&EepromTxPower[i])) = usValue; ++ } ++ ++ for(i = 0; i < 12; i++) ++ { ++ if (i <= 2) ++ priv->EEPROMRfACCKChnl1TxPwLevel[i] = EepromTxPower[i]; ++ else if ((i >=3 )&&(i <= 5)) ++ priv->EEPROMRfAOfdmChnlTxPwLevel[i-3] = EepromTxPower[i]; ++ else if ((i >=6 )&&(i <= 8)) ++ priv->EEPROMRfCCCKChnl1TxPwLevel[i-6] = EepromTxPower[i]; ++ else ++ priv->EEPROMRfCOfdmChnlTxPwLevel[i-9] = EepromTxPower[i]; ++ } ++ } ++ else ++ { ++ priv->EEPROMRfACCKChnl1TxPwLevel[0] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfACCKChnl1TxPwLevel[1] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfACCKChnl1TxPwLevel[2] = EEPROM_Default_TxPowerLevel; ++ ++ priv->EEPROMRfAOfdmChnlTxPwLevel[0] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfAOfdmChnlTxPwLevel[1] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfAOfdmChnlTxPwLevel[2] = EEPROM_Default_TxPowerLevel; ++ ++ priv->EEPROMRfCCCKChnl1TxPwLevel[0] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfCCCKChnl1TxPwLevel[1] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfCCCKChnl1TxPwLevel[2] = EEPROM_Default_TxPowerLevel; ++ ++ priv->EEPROMRfCOfdmChnlTxPwLevel[0] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfCOfdmChnlTxPwLevel[1] = EEPROM_Default_TxPowerLevel; ++ priv->EEPROMRfCOfdmChnlTxPwLevel[2] = EEPROM_Default_TxPowerLevel; ++ } ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfACCKChnl1TxPwLevel[0] = 0x%x\n", priv->EEPROMRfACCKChnl1TxPwLevel[0]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfACCKChnl1TxPwLevel[1] = 0x%x\n", priv->EEPROMRfACCKChnl1TxPwLevel[1]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfACCKChnl1TxPwLevel[2] = 0x%x\n", priv->EEPROMRfACCKChnl1TxPwLevel[2]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfAOfdmChnlTxPwLevel[0] = 0x%x\n", priv->EEPROMRfAOfdmChnlTxPwLevel[0]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfAOfdmChnlTxPwLevel[1] = 0x%x\n", priv->EEPROMRfAOfdmChnlTxPwLevel[1]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfAOfdmChnlTxPwLevel[2] = 0x%x\n", priv->EEPROMRfAOfdmChnlTxPwLevel[2]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCCCKChnl1TxPwLevel[0] = 0x%x\n", priv->EEPROMRfCCCKChnl1TxPwLevel[0]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCCCKChnl1TxPwLevel[1] = 0x%x\n", priv->EEPROMRfCCCKChnl1TxPwLevel[1]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCCCKChnl1TxPwLevel[2] = 0x%x\n", priv->EEPROMRfCCCKChnl1TxPwLevel[2]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCOfdmChnlTxPwLevel[0] = 0x%x\n", priv->EEPROMRfCOfdmChnlTxPwLevel[0]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCOfdmChnlTxPwLevel[1] = 0x%x\n", priv->EEPROMRfCOfdmChnlTxPwLevel[1]); ++ RT_TRACE(COMP_INIT, "priv->EEPROMRfCOfdmChnlTxPwLevel[2] = 0x%x\n", priv->EEPROMRfCOfdmChnlTxPwLevel[2]); ++#endif ++ ++ } ++ // ++ // Update HAL variables. ++ // ++ if(priv->epromtype == EPROM_93c46) ++ { ++ for(i=0; i<14; i++) ++ { ++ priv->TxPowerLevelCCK[i] = priv->EEPROMTxPowerLevelCCK[i]; ++ priv->TxPowerLevelOFDM24G[i] = priv->EEPROMTxPowerLevelOFDM24G[i]; ++ } ++ priv->LegacyHTTxPowerDiff = priv->EEPROMLegacyHTTxPowerDiff; ++ // Antenna B gain offset to antenna A, bit0~3 ++ priv->AntennaTxPwDiff[0] = (priv->EEPROMAntPwDiff & 0xf); ++ // Antenna C gain offset to antenna A, bit4~7 ++ priv->AntennaTxPwDiff[1] = ((priv->EEPROMAntPwDiff & 0xf0)>>4); ++ // Antenna D gain offset to antenna A, bit8~11 ++ priv->AntennaTxPwDiff[2] = ((priv->EEPROMAntPwDiff & 0xf00)>>8); ++ // CrystalCap, bit12~15 ++ priv->CrystalCap = priv->EEPROMCrystalCap; ++ // ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2 ++ priv->ThermalMeter[0] = (priv->EEPROMThermalMeter & 0xf); ++ priv->ThermalMeter[1] = ((priv->EEPROMThermalMeter & 0xf0)>>4); ++ } ++ else if(priv->epromtype == EPROM_93c56) ++ { ++ //char cck_pwr_diff_a=0, cck_pwr_diff_c=0; ++ ++ //cck_pwr_diff_a = pHalData->EEPROMRfACCKChnl7TxPwLevel - pHalData->EEPROMRfAOfdmChnlTxPwLevel[1]; ++ //cck_pwr_diff_c = pHalData->EEPROMRfCCCKChnl7TxPwLevel - pHalData->EEPROMRfCOfdmChnlTxPwLevel[1]; ++ for(i=0; i<3; i++) // channel 1~3 use the same Tx Power Level. ++ { ++ priv->TxPowerLevelCCK_A[i] = priv->EEPROMRfACCKChnl1TxPwLevel[0]; ++ priv->TxPowerLevelOFDM24G_A[i] = priv->EEPROMRfAOfdmChnlTxPwLevel[0]; ++ priv->TxPowerLevelCCK_C[i] = priv->EEPROMRfCCCKChnl1TxPwLevel[0]; ++ priv->TxPowerLevelOFDM24G_C[i] = priv->EEPROMRfCOfdmChnlTxPwLevel[0]; ++ } ++ for(i=3; i<9; i++) // channel 4~9 use the same Tx Power Level ++ { ++ priv->TxPowerLevelCCK_A[i] = priv->EEPROMRfACCKChnl1TxPwLevel[1]; ++ priv->TxPowerLevelOFDM24G_A[i] = priv->EEPROMRfAOfdmChnlTxPwLevel[1]; ++ priv->TxPowerLevelCCK_C[i] = priv->EEPROMRfCCCKChnl1TxPwLevel[1]; ++ priv->TxPowerLevelOFDM24G_C[i] = priv->EEPROMRfCOfdmChnlTxPwLevel[1]; ++ } ++ for(i=9; i<14; i++) // channel 10~14 use the same Tx Power Level ++ { ++ priv->TxPowerLevelCCK_A[i] = priv->EEPROMRfACCKChnl1TxPwLevel[2]; ++ priv->TxPowerLevelOFDM24G_A[i] = priv->EEPROMRfAOfdmChnlTxPwLevel[2]; ++ priv->TxPowerLevelCCK_C[i] = priv->EEPROMRfCCCKChnl1TxPwLevel[2]; ++ priv->TxPowerLevelOFDM24G_C[i] = priv->EEPROMRfCOfdmChnlTxPwLevel[2]; ++ } ++ for(i=0; i<14; i++) ++ RT_TRACE(COMP_INIT, "priv->TxPowerLevelCCK_A[%d] = 0x%x\n", i, priv->TxPowerLevelCCK_A[i]); ++ for(i=0; i<14; i++) ++ RT_TRACE(COMP_INIT,"priv->TxPowerLevelOFDM24G_A[%d] = 0x%x\n", i, priv->TxPowerLevelOFDM24G_A[i]); ++ for(i=0; i<14; i++) ++ RT_TRACE(COMP_INIT, "priv->TxPowerLevelCCK_C[%d] = 0x%x\n", i, priv->TxPowerLevelCCK_C[i]); ++ for(i=0; i<14; i++) ++ RT_TRACE(COMP_INIT, "priv->TxPowerLevelOFDM24G_C[%d] = 0x%x\n", i, priv->TxPowerLevelOFDM24G_C[i]); ++ priv->LegacyHTTxPowerDiff = priv->EEPROMLegacyHTTxPowerDiff; ++ priv->AntennaTxPwDiff[0] = 0; ++ priv->AntennaTxPwDiff[1] = 0; ++ priv->AntennaTxPwDiff[2] = 0; ++ priv->CrystalCap = priv->EEPROMCrystalCap; ++ // ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2 ++ priv->ThermalMeter[0] = (priv->EEPROMThermalMeter & 0xf); ++ priv->ThermalMeter[1] = ((priv->EEPROMThermalMeter & 0xf0)>>4); ++ } ++ } ++ ++ if(priv->rf_type == RF_1T2R) ++ { ++ RT_TRACE(COMP_INIT, "\n1T2R config\n"); ++ } ++ else if (priv->rf_type == RF_2T4R) ++ { ++ RT_TRACE(COMP_INIT, "\n2T4R config\n"); ++ } ++ ++ // 2008/01/16 MH We can only know RF type in the function. So we have to init ++ // DIG RATR table again. ++ init_rate_adaptive(dev); ++ ++ //1 Make a copy for following variables and we can change them if we want ++ ++ priv->rf_chip= RF_8256; ++ ++ if(priv->RegChannelPlan == 0xf) ++ { ++ priv->ChannelPlan = priv->eeprom_ChannelPlan; ++ } ++ else ++ { ++ priv->ChannelPlan = priv->RegChannelPlan; ++ } ++ ++ // ++ // Used PID and DID to Set CustomerID ++ // ++ if( priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304 ) ++ { ++ priv->CustomerID = RT_CID_DLINK; ++ } ++ ++ switch(priv->eeprom_CustomerID) ++ { ++ case EEPROM_CID_DEFAULT: ++ priv->CustomerID = RT_CID_DEFAULT; ++ break; ++ case EEPROM_CID_CAMEO: ++ priv->CustomerID = RT_CID_819x_CAMEO; ++ break; ++ case EEPROM_CID_RUNTOP: ++ priv->CustomerID = RT_CID_819x_RUNTOP; ++ break; ++ case EEPROM_CID_NetCore: ++ priv->CustomerID = RT_CID_819x_Netcore; ++ break; ++ case EEPROM_CID_TOSHIBA: // Merge by Jacken, 2008/01/31 ++ priv->CustomerID = RT_CID_TOSHIBA; ++ if(priv->eeprom_ChannelPlan&0x80) ++ priv->ChannelPlan = priv->eeprom_ChannelPlan&0x7f; ++ else ++ priv->ChannelPlan = 0x0; ++ RT_TRACE(COMP_INIT, "Toshiba ChannelPlan = 0x%x\n", ++ priv->ChannelPlan); ++ break; ++ case EEPROM_CID_Nettronix: ++ priv->ScanDelay = 100; //cosa add for scan ++ priv->CustomerID = RT_CID_Nettronix; ++ break; ++ case EEPROM_CID_Pronet: ++ priv->CustomerID = RT_CID_PRONET; ++ break; ++ case EEPROM_CID_DLINK: ++ priv->CustomerID = RT_CID_DLINK; ++ break; ++ ++ case EEPROM_CID_WHQL: ++ //Adapter->bInHctTest = TRUE;//do not supported ++ ++ //priv->bSupportTurboMode = FALSE; ++ //priv->bAutoTurboBy8186 = FALSE; ++ ++ //pMgntInfo->PowerSaveControl.bInactivePs = FALSE; ++ //pMgntInfo->PowerSaveControl.bIPSModeBackup = FALSE; ++ //pMgntInfo->PowerSaveControl.bLeisurePs = FALSE; ++ ++ break; ++ default: ++ // value from RegCustomerID ++ break; ++ } ++ ++ //Avoid the channel plan array overflow, by Bruce, 2007-08-27. ++ if(priv->ChannelPlan > CHANNEL_PLAN_LEN - 1) ++ priv->ChannelPlan = 0; //FCC ++ ++ switch(priv->CustomerID) ++ { ++ case RT_CID_DEFAULT: ++ #ifdef RTL8190P ++ priv->LedStrategy = HW_LED; ++ #else ++ #ifdef RTL8192E ++ priv->LedStrategy = SW_LED_MODE1; ++ #endif ++ #endif ++ break; ++ ++ case RT_CID_819x_CAMEO: ++ priv->LedStrategy = SW_LED_MODE2; ++ break; ++ ++ case RT_CID_819x_RUNTOP: ++ priv->LedStrategy = SW_LED_MODE3; ++ break; ++ ++ case RT_CID_819x_Netcore: ++ priv->LedStrategy = SW_LED_MODE4; ++ break; ++ ++ case RT_CID_Nettronix: ++ priv->LedStrategy = SW_LED_MODE5; ++ break; ++ ++ case RT_CID_PRONET: ++ priv->LedStrategy = SW_LED_MODE6; ++ break; ++ ++ case RT_CID_TOSHIBA: //Modify by Jacken 2008/01/31 ++ // Do nothing. ++ //break; ++ ++ default: ++ #ifdef RTL8190P ++ priv->LedStrategy = HW_LED; ++ #else ++ #ifdef RTL8192E ++ priv->LedStrategy = SW_LED_MODE1; ++ #endif ++ #endif ++ break; ++ } ++/* ++ //2008.06.03, for WOL ++ if( priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304) ++ priv->ieee80211->bSupportRemoteWakeUp = TRUE; ++ else ++ priv->ieee80211->bSupportRemoteWakeUp = FALSE; ++*/ ++ RT_TRACE(COMP_INIT, "RegChannelPlan(%d)\n", priv->RegChannelPlan); ++ RT_TRACE(COMP_INIT, "ChannelPlan = %d \n", priv->ChannelPlan); ++ RT_TRACE(COMP_INIT, "LedStrategy = %d \n", priv->LedStrategy); ++ RT_TRACE(COMP_TRACE, "<==== ReadAdapterInfo\n"); ++ ++ return ; ++} ++ ++ ++static short rtl8192_get_channel_map(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef ENABLE_DOT11D ++ if(priv->ChannelPlan> COUNTRY_CODE_GLOBAL_DOMAIN){ ++ printk("rtl8180_init:Error channel plan! Set to default.\n"); ++ priv->ChannelPlan= 0; ++ } ++ RT_TRACE(COMP_INIT, "Channel plan is %d\n",priv->ChannelPlan); ++ ++ rtl819x_set_channel_map(priv->ChannelPlan, priv); ++#else ++ int ch,i; ++ //Set Default Channel Plan ++ if(!channels){ ++ DMESG("No channels, aborting"); ++ return -1; ++ } ++ ch=channels; ++ priv->ChannelPlan= 0;//hikaru ++ // set channels 1..14 allowed in given locale ++ for (i=1; i<=14; i++) { ++ (priv->ieee80211->channel_map)[i] = (u8)(ch & 0x01); ++ ch >>= 1; ++ } ++#endif ++ return 0; ++} ++ ++static short rtl8192_init(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ memset(&(priv->stats),0,sizeof(struct Stats)); ++ rtl8192_init_priv_variable(dev); ++ rtl8192_init_priv_lock(priv); ++ rtl8192_init_priv_task(dev); ++ rtl8192_get_eeprom_size(dev); ++ rtl8192_read_eeprom_info(dev); ++ rtl8192_get_channel_map(dev); ++ init_hal_dm(dev); ++ init_timer(&priv->watch_dog_timer); ++ priv->watch_dog_timer.data = (unsigned long)dev; ++ priv->watch_dog_timer.function = watch_dog_timer_callback; ++#if defined(IRQF_SHARED) ++ if(request_irq(dev->irq, (void*)rtl8192_interrupt, IRQF_SHARED, dev->name, dev)){ ++#else ++ if(request_irq(dev->irq, (void *)rtl8192_interrupt, SA_SHIRQ, dev->name, dev)){ ++#endif ++ printk("Error allocating IRQ %d",dev->irq); ++ return -1; ++ }else{ ++ priv->irq=dev->irq; ++ printk("IRQ %d",dev->irq); ++ } ++ if(rtl8192_pci_initdescring(dev)!=0){ ++ printk("Endopoints initialization failed"); ++ return -1; ++ } ++ ++ //rtl8192_rx_enable(dev); ++ //rtl8192_adapter_start(dev); ++ return 0; ++} ++ ++/****************************************************************************** ++ *function: This function actually only set RRSR, RATR and BW_OPMODE registers ++ * not to do all the hw config as its name says ++ * input: net_device dev ++ * output: none ++ * return: none ++ * notice: This part need to modified according to the rate set we filtered ++ * ****************************************************************************/ ++static void rtl8192_hwconfig(struct net_device* dev) ++{ ++ u32 regRATR = 0, regRRSR = 0; ++ u8 regBwOpMode = 0, regTmp = 0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++// Set RRSR, RATR, and BW_OPMODE registers ++ // ++ switch(priv->ieee80211->mode) ++ { ++ case WIRELESS_MODE_B: ++ regBwOpMode = BW_OPMODE_20MHZ; ++ regRATR = RATE_ALL_CCK; ++ regRRSR = RATE_ALL_CCK; ++ break; ++ case WIRELESS_MODE_A: ++ regBwOpMode = BW_OPMODE_5G |BW_OPMODE_20MHZ; ++ regRATR = RATE_ALL_OFDM_AG; ++ regRRSR = RATE_ALL_OFDM_AG; ++ break; ++ case WIRELESS_MODE_G: ++ regBwOpMode = BW_OPMODE_20MHZ; ++ regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; ++ regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; ++ break; ++ case WIRELESS_MODE_AUTO: ++ case WIRELESS_MODE_N_24G: ++ // It support CCK rate by default. ++ // CCK rate will be filtered out only when associated AP does not support it. ++ regBwOpMode = BW_OPMODE_20MHZ; ++ regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS; ++ regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; ++ break; ++ case WIRELESS_MODE_N_5G: ++ regBwOpMode = BW_OPMODE_5G; ++ regRATR = RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS; ++ regRRSR = RATE_ALL_OFDM_AG; ++ break; ++ } ++ ++ write_nic_byte(dev, BW_OPMODE, regBwOpMode); ++ { ++ u32 ratr_value = 0; ++ ratr_value = regRATR; ++ if (priv->rf_type == RF_1T2R) ++ { ++ ratr_value &= ~(RATE_ALL_OFDM_2SS); ++ } ++ write_nic_dword(dev, RATR0, ratr_value); ++ write_nic_byte(dev, UFWP, 1); ++ } ++ regTmp = read_nic_byte(dev, 0x313); ++ regRRSR = ((regTmp) << 24) | (regRRSR & 0x00ffffff); ++ write_nic_dword(dev, RRSR, regRRSR); ++ ++ // ++ // Set Retry Limit here ++ // ++ write_nic_word(dev, RETRY_LIMIT, ++ priv->ShortRetryLimit << RETRY_LIMIT_SHORT_SHIFT | \ ++ priv->LongRetryLimit << RETRY_LIMIT_LONG_SHIFT); ++ // Set Contention Window here ++ ++ // Set Tx AGC ++ ++ // Set Tx Antenna including Feedback control ++ ++ // Set Auto Rate fallback control ++ ++ ++} ++ ++ ++static RT_STATUS rtl8192_adapter_start(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++// struct ieee80211_device *ieee = priv->ieee80211; ++ u32 ulRegRead; ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++// static char szMACPHYRegFile[] = RTL819X_PHY_MACPHY_REG; ++// static char szMACPHYRegPGFile[] = RTL819X_PHY_MACPHY_REG_PG; ++ //u8 eRFPath; ++ u8 tmpvalue; ++#ifdef RTL8192E ++ u8 ICVersion,SwitchingRegulatorOutput; ++#endif ++ bool bfirmwareok = true; ++#ifdef RTL8190P ++ u8 ucRegRead; ++#endif ++ u32 tmpRegA, tmpRegC, TempCCk; ++ int i =0; ++// u32 dwRegRead = 0; ++ ++ RT_TRACE(COMP_INIT, "====>%s()\n", __FUNCTION__); ++ priv->being_init_adapter = true; ++ rtl8192_pci_resetdescring(dev); ++ // 2007/11/02 MH Before initalizing RF. We can not use FW to do RF-R/W. ++ priv->Rf_Mode = RF_OP_By_SW_3wire; ++#ifdef RTL8192E ++ //dPLL on ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ { ++ write_nic_byte(dev, ANAPAR, 0x37); ++ // Accordign to designer's explain, LBUS active will never > 10ms. We delay 10ms ++ // Joseph increae the time to prevent firmware download fail ++ mdelay(500); ++ } ++#endif ++ //PlatformSleepUs(10000); ++ // For any kind of InitializeAdapter process, we shall use system now!! ++ priv->pFirmware->firmware_status = FW_STATUS_0_INIT; ++ ++ // Set to eRfoff in order not to count receive count. ++ if(priv->RegRfOff == TRUE) ++ priv->ieee80211->eRFPowerState = eRfOff; ++ ++ // ++ //3 //Config CPUReset Register ++ //3// ++ //3 Firmware Reset Or Not ++ ulRegRead = read_nic_dword(dev, CPU_GEN); ++ if(priv->pFirmware->firmware_status == FW_STATUS_0_INIT) ++ { //called from MPInitialized. do nothing ++ ulRegRead |= CPU_GEN_SYSTEM_RESET; ++ }else if(priv->pFirmware->firmware_status == FW_STATUS_5_READY) ++ ulRegRead |= CPU_GEN_FIRMWARE_RESET; // Called from MPReset ++ else ++ RT_TRACE(COMP_ERR, "ERROR in %s(): undefined firmware state(%d)\n", __FUNCTION__, priv->pFirmware->firmware_status); ++ ++#ifdef RTL8190P ++ //2008.06.03, for WOL 90 hw bug ++ ulRegRead &= (~(CPU_GEN_GPIO_UART)); ++#endif ++ ++ write_nic_dword(dev, CPU_GEN, ulRegRead); ++ //mdelay(100); ++ ++#ifdef RTL8192E ++ ++ //3// ++ //3 //Fix the issue of E-cut high temperature issue ++ //3// ++ // TODO: E cut only ++ ICVersion = read_nic_byte(dev, IC_VERRSION); ++ if(ICVersion >= 0x4) //E-cut only ++ { ++ // HW SD suggest that we should not wirte this register too often, so driver ++ // should readback this register. This register will be modified only when ++ // power on reset ++ SwitchingRegulatorOutput = read_nic_byte(dev, SWREGULATOR); ++ if(SwitchingRegulatorOutput != 0xb8) ++ { ++ write_nic_byte(dev, SWREGULATOR, 0xa8); ++ mdelay(1); ++ write_nic_byte(dev, SWREGULATOR, 0xb8); ++ } ++ } ++#endif ++ ++ ++ //3// ++ //3// Initialize BB before MAC ++ //3// ++ RT_TRACE(COMP_INIT, "BB Config Start!\n"); ++ rtStatus = rtl8192_BBConfig(dev); ++ if(rtStatus != RT_STATUS_SUCCESS) ++ { ++ RT_TRACE(COMP_ERR, "BB Config failed\n"); ++ return rtStatus; ++ } ++ RT_TRACE(COMP_INIT,"BB Config Finished!\n"); ++ ++ //3//Set Loopback mode or Normal mode ++ //3// ++ //2006.12.13 by emily. Note!We should not merge these two CPU_GEN register writings ++ // because setting of System_Reset bit reset MAC to default transmission mode. ++ //Loopback mode or not ++ priv->LoopbackMode = RTL819X_NO_LOOPBACK; ++ //priv->LoopbackMode = RTL819X_MAC_LOOPBACK; ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ { ++ ulRegRead = read_nic_dword(dev, CPU_GEN); ++ if(priv->LoopbackMode == RTL819X_NO_LOOPBACK) ++ { ++ ulRegRead = ((ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | CPU_GEN_NO_LOOPBACK_SET); ++ } ++ else if (priv->LoopbackMode == RTL819X_MAC_LOOPBACK ) ++ { ++ ulRegRead |= CPU_CCK_LOOPBACK; ++ } ++ else ++ { ++ RT_TRACE(COMP_ERR,"Serious error: wrong loopback mode setting\n"); ++ } ++ ++ //2008.06.03, for WOL ++ //ulRegRead &= (~(CPU_GEN_GPIO_UART)); ++ write_nic_dword(dev, CPU_GEN, ulRegRead); ++ ++ // 2006.11.29. After reset cpu, we sholud wait for a second, otherwise, it may fail to write registers. Emily ++ udelay(500); ++ } ++ //3Set Hardware(Do nothing now) ++ rtl8192_hwconfig(dev); ++ //2======================================================= ++ // Common Setting for all of the FPGA platform. (part 1) ++ //2======================================================= ++ // If there is changes, please make sure it applies to all of the FPGA version ++ //3 Turn on Tx/Rx ++ write_nic_byte(dev, CMDR, CR_RE|CR_TE); ++ ++ //2Set Tx dma burst ++#ifdef RTL8190P ++ write_nic_byte(dev, PCIF, ((MXDMA2_NoLimit<dev_addr)[0]); ++ write_nic_word(dev, MAC4, ((u16*)(dev->dev_addr + 4))[0]); ++ //set RCR ++ write_nic_dword(dev, RCR, priv->ReceiveConfig); ++ ++ //3 Initialize Number of Reserved Pages in Firmware Queue ++ #ifdef TO_DO_LIST ++ if(priv->bInHctTest) ++ { ++ PlatformEFIOWrite4Byte(Adapter, RQPN1, NUM_OF_PAGE_IN_FW_QUEUE_BK_DTM << RSVD_FW_QUEUE_PAGE_BK_SHIFT |\ ++ NUM_OF_PAGE_IN_FW_QUEUE_BE_DTM << RSVD_FW_QUEUE_PAGE_BE_SHIFT | \ ++ NUM_OF_PAGE_IN_FW_QUEUE_VI_DTM << RSVD_FW_QUEUE_PAGE_VI_SHIFT | \ ++ NUM_OF_PAGE_IN_FW_QUEUE_VO_DTM <RegWirelessMode); ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ rtl8192_SetWirelessMode(dev, priv->ieee80211->mode); ++ //----------------------------------------------------------------------------- ++ // Set up security related. 070106, by rcnjko: ++ // 1. Clear all H/W keys. ++ // 2. Enable H/W encryption/decryption. ++ //----------------------------------------------------------------------------- ++ CamResetAllEntry(dev); ++ { ++ u8 SECR_value = 0x0; ++ SECR_value |= SCR_TxEncEnable; ++ SECR_value |= SCR_RxDecEnable; ++ SECR_value |= SCR_NoSKMC; ++ write_nic_byte(dev, SECR, SECR_value); ++ } ++ //3Beacon related ++ write_nic_word(dev, ATIMWND, 2); ++ write_nic_word(dev, BCN_INTERVAL, 100); ++ for (i=0; icard_8192_version > (u8) VERSION_8190_BD) { ++ rtl8192_phy_getTxPower(dev); ++ rtl8192_phy_setTxPower(dev, priv->chan); ++ } ++ ++ //if D or C cut ++ tmpvalue = read_nic_byte(dev, IC_VERRSION); ++ priv->IC_Cut = tmpvalue; ++ RT_TRACE(COMP_INIT, "priv->IC_Cut = 0x%x\n", priv->IC_Cut); ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ { ++ //pHalData->bDcut = TRUE; ++ if(priv->IC_Cut == IC_VersionCut_D) ++ RT_TRACE(COMP_INIT, "D-cut\n"); ++ if(priv->IC_Cut == IC_VersionCut_E) ++ { ++ RT_TRACE(COMP_INIT, "E-cut\n"); ++ // HW SD suggest that we should not wirte this register too often, so driver ++ // should readback this register. This register will be modified only when ++ // power on reset ++ } ++ } ++ else ++ { ++ //pHalData->bDcut = FALSE; ++ RT_TRACE(COMP_INIT, "Before C-cut\n"); ++ } ++ ++#if 1 ++ //Firmware download ++ RT_TRACE(COMP_INIT, "Load Firmware!\n"); ++ bfirmwareok = init_firmware(dev); ++ if(bfirmwareok != true) { ++ rtStatus = RT_STATUS_FAILURE; ++ return rtStatus; ++ } ++ RT_TRACE(COMP_INIT, "Load Firmware finished!\n"); ++#endif ++ //RF config ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ { ++ RT_TRACE(COMP_INIT, "RF Config Started!\n"); ++ rtStatus = rtl8192_phy_RFConfig(dev); ++ if(rtStatus != RT_STATUS_SUCCESS) ++ { ++ RT_TRACE(COMP_ERR, "RF Config failed\n"); ++ return rtStatus; ++ } ++ RT_TRACE(COMP_INIT, "RF Config Finished!\n"); ++ } ++ rtl8192_phy_updateInitGain(dev); ++ ++ /*---- Set CCK and OFDM Block "ON"----*/ ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, bCCKEn, 0x1); ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, bOFDMEn, 0x1); ++ ++#ifdef RTL8192E ++ //Enable Led ++ write_nic_byte(dev, 0x87, 0x0); ++#endif ++#ifdef RTL8190P ++ //2008.06.03, for WOL ++ ucRegRead = read_nic_byte(dev, GPE); ++ ucRegRead |= BIT0; ++ write_nic_byte(dev, GPE, ucRegRead); ++ ++ ucRegRead = read_nic_byte(dev, GPO); ++ ucRegRead &= ~BIT0; ++ write_nic_byte(dev, GPO, ucRegRead); ++#endif ++ ++ //2======================================================= ++ // RF Power Save ++ //2======================================================= ++#ifdef ENABLE_IPS ++ ++{ ++ if(priv->RegRfOff == TRUE) ++ { // User disable RF via registry. ++ RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RegRfOff ----------\n",__FUNCTION__); ++ MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_SW); ++#if 0//cosa, ask SD3 willis and he doesn't know what is this for ++ // Those action will be discard in MgntActSet_RF_State because off the same state ++ for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) ++ PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x0); ++#endif ++ } ++ else if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_PS) ++ { // H/W or S/W RF OFF before sleep. ++ RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d) ----------\n", __FUNCTION__,priv->ieee80211->RfOffReason); ++ MgntActSet_RF_State(dev, eRfOff, priv->ieee80211->RfOffReason); ++ } ++ else if(priv->ieee80211->RfOffReason >= RF_CHANGE_BY_IPS) ++ { // H/W or S/W RF OFF before sleep. ++ RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): Turn off RF for RfOffReason(%d) ----------\n", __FUNCTION__,priv->ieee80211->RfOffReason); ++ MgntActSet_RF_State(dev, eRfOff, priv->ieee80211->RfOffReason); ++ } ++ else ++ { ++ RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON \n",__FUNCTION__); ++ priv->ieee80211->eRFPowerState = eRfOn; ++ priv->ieee80211->RfOffReason = 0; ++ //DrvIFIndicateCurrentPhyStatus(Adapter); ++ // LED control ++ //Adapter->HalFunc.LedControlHandler(Adapter, LED_CTL_POWER_ON); ++ ++ // ++ // If inactive power mode is enabled, disable rf while in disconnected state. ++ // But we should still tell upper layer we are in rf on state. ++ // 2007.07.16, by shien chang. ++ // ++ //if(!Adapter->bInHctTest) ++ //IPSEnter(Adapter); ++ ++ } ++} ++#endif ++ if(1){ ++#ifdef RTL8192E ++ // We can force firmware to do RF-R/W ++ if(priv->ieee80211->FwRWRF) ++ priv->Rf_Mode = RF_OP_By_FW; ++ else ++ priv->Rf_Mode = RF_OP_By_SW_3wire; ++#else ++ priv->Rf_Mode = RF_OP_By_SW_3wire; ++#endif ++ } ++#ifdef RTL8190P ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ { ++ dm_initialize_txpower_tracking(dev); ++ ++ tmpRegA= rtl8192_QueryBBReg(dev,rOFDM0_XATxIQImbalance,bMaskDWord); ++ tmpRegC= rtl8192_QueryBBReg(dev,rOFDM0_XCTxIQImbalance,bMaskDWord); ++ ++ if(priv->rf_type == RF_2T4R){ ++ for(i = 0; itxbbgain_table[i].txbbgain_value) ++ { ++ priv->rfa_txpowertrackingindex= (u8)i; ++ priv->rfa_txpowertrackingindex_real= (u8)i; ++ priv->rfa_txpowertracking_default = priv->rfa_txpowertrackingindex; ++ break; ++ } ++ } ++ } ++ for(i = 0; itxbbgain_table[i].txbbgain_value) ++ { ++ priv->rfc_txpowertrackingindex= (u8)i; ++ priv->rfc_txpowertrackingindex_real= (u8)i; ++ priv->rfc_txpowertracking_default = priv->rfc_txpowertrackingindex; ++ break; ++ } ++ } ++ TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2); ++ ++ for(i=0 ; icck_txbbgain_table[i].ccktxbb_valuearray[0]) ++ { ++ priv->CCKPresentAttentuation_20Mdefault =(u8) i; ++ break; ++ } ++ } ++ priv->CCKPresentAttentuation_40Mdefault = 0; ++ priv->CCKPresentAttentuation_difference = 0; ++ priv->CCKPresentAttentuation = priv->CCKPresentAttentuation_20Mdefault; ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_initial = %d\n", priv->rfa_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_real__initial = %d\n", priv->rfa_txpowertrackingindex_real); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex_initial = %d\n", priv->rfc_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex_real_initial = %d\n", priv->rfc_txpowertrackingindex_real); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_difference_initial = %d\n", priv->CCKPresentAttentuation_difference); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_initial = %d\n", priv->CCKPresentAttentuation); ++ } ++#else ++ #ifdef RTL8192E ++ if(priv->ResetProgress == RESET_TYPE_NORESET) ++ { ++ dm_initialize_txpower_tracking(dev); ++ ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ { ++ tmpRegA= rtl8192_QueryBBReg(dev,rOFDM0_XATxIQImbalance,bMaskDWord); ++ tmpRegC= rtl8192_QueryBBReg(dev,rOFDM0_XCTxIQImbalance,bMaskDWord); ++ for(i = 0; itxbbgain_table[i].txbbgain_value) ++ { ++ priv->rfa_txpowertrackingindex= (u8)i; ++ priv->rfa_txpowertrackingindex_real= (u8)i; ++ priv->rfa_txpowertracking_default = priv->rfa_txpowertrackingindex; ++ break; ++ } ++ } ++ ++ TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2); ++ ++ for(i=0 ; icck_txbbgain_table[i].ccktxbb_valuearray[0]) ++ { ++ priv->CCKPresentAttentuation_20Mdefault =(u8) i; ++ break; ++ } ++ } ++ priv->CCKPresentAttentuation_40Mdefault = 0; ++ priv->CCKPresentAttentuation_difference = 0; ++ priv->CCKPresentAttentuation = priv->CCKPresentAttentuation_20Mdefault; ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_initial = %d\n", priv->rfa_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_real__initial = %d\n", priv->rfa_txpowertrackingindex_real); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_difference_initial = %d\n", priv->CCKPresentAttentuation_difference); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_initial = %d\n", priv->CCKPresentAttentuation); ++ priv->btxpower_tracking = FALSE;//TEMPLY DISABLE ++ } ++ } ++ #endif ++#endif ++ rtl8192_irq_enable(dev); ++ priv->being_init_adapter = false; ++ return rtStatus; ++ ++} ++ ++void rtl8192_prepare_beacon(struct r8192_priv *priv) ++{ ++ struct sk_buff *skb; ++ //unsigned long flags; ++ cb_desc *tcb_desc; ++ ++ skb = ieee80211_get_beacon(priv->ieee80211); ++ tcb_desc = (cb_desc *)(skb->cb + 8); ++ //printk("===========> %s\n", __FUNCTION__); ++ //spin_lock_irqsave(&priv->tx_lock,flags); ++ /* prepare misc info for the beacon xmit */ ++ tcb_desc->queue_index = BEACON_QUEUE; ++ /* IBSS does not support HT yet, use 1M defautly */ ++ tcb_desc->data_rate = 2; ++ tcb_desc->RATRIndex = 7; ++ tcb_desc->bTxDisableRateFallBack = 1; ++ tcb_desc->bTxUseDriverAssingedRate = 1; ++ ++ skb_push(skb, priv->ieee80211->tx_headroom); ++ if(skb){ ++ rtl8192_tx(priv->ieee80211->dev,skb); ++ } ++ //spin_unlock_irqrestore (&priv->tx_lock, flags); ++} ++ ++#if 0 ++void rtl8192_beacon_tx_enable(struct net_device *dev) ++{ ++ struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); ++ ++ rtl8180_set_mode(dev,EPROM_CMD_CONFIG); ++#ifdef CONFIG_RTL8185B ++ priv->dma_poll_stop_mask &= ~(TPPOLLSTOP_BQ);MgntQuery_MgntFrameTxRateMgntQuery_MgntFrameTxRate ++ write_nic_byte(dev,TPPollStop, priv->dma_poll_mask); ++#else ++ priv->dma_poll_mask &=~(1<dma_poll_mask); ++#endif ++ rtl8180_set_mode(dev,EPROM_CMD_NORMAL); ++} ++#endif ++ ++ ++/* this configures registers for beacon tx and enables it via ++ * rtl8192_beacon_tx_enable(). rtl8192_beacon_tx_disable() might ++ * be used to stop beacon transmission ++ */ ++void rtl8192_start_beacon(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct ieee80211_network *net = &priv->ieee80211->current_network; ++ u16 BcnTimeCfg = 0; ++ u16 BcnCW = 6; ++ u16 BcnIFS = 0xf; ++ ++ DMESG("Enabling beacon TX"); ++ //rtl8192_prepare_beacon(dev); ++ rtl8192_irq_disable(dev); ++ //rtl8192_beacon_tx_enable(dev); ++ ++ /* ATIM window */ ++ write_nic_word(dev, ATIMWND, 2); ++ ++ /* Beacon interval (in unit of TU) */ ++ write_nic_word(dev, BCN_INTERVAL, net->beacon_interval); ++ ++ /* ++ * DrvErlyInt (in unit of TU). ++ * (Time to send interrupt to notify driver to c ++ * hange beacon content) ++ * */ ++ write_nic_word(dev, BCN_DRV_EARLY_INT, 10); ++ ++ /* ++ * BcnDMATIM(in unit of us). ++ * Indicates the time before TBTT to perform beacon queue DMA ++ * */ ++ write_nic_word(dev, BCN_DMATIME, 256); ++ ++ /* ++ * Force beacon frame transmission even after receiving ++ * beacon frame from other ad hoc STA ++ * */ ++ write_nic_byte(dev, BCN_ERR_THRESH, 100); ++ ++ /* Set CW and IFS */ ++ BcnTimeCfg |= BcnCW<ieee80211->stats; ++} ++#endif ++ ++ ++ ++static bool HalTxCheckStuck8190Pci(struct net_device *dev) ++{ ++ u16 RegTxCounter = read_nic_word(dev, 0x128); ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool bStuck = FALSE; ++ RT_TRACE(COMP_RESET,"%s():RegTxCounter is %d,TxCounter is %d\n",__FUNCTION__,RegTxCounter,priv->TxCounter); ++ if(priv->TxCounter==RegTxCounter) ++ bStuck = TRUE; ++ ++ priv->TxCounter = RegTxCounter; ++ ++ return bStuck; ++} ++ ++/* ++* ++* First added: 2006.11.19 by emily ++*/ ++static RESET_TYPE ++TxCheckStuck(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 QueueID; ++ ptx_ring head=NULL,tail=NULL,txring = NULL; ++ u8 ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE; ++ bool bCheckFwTxCnt = false; ++ //unsigned long flags; ++ ++ // ++ // Decide Stuch threshold according to current power save mode ++ // ++ //printk("++++++++++++>%s()\n",__FUNCTION__); ++ switch (priv->ieee80211->dot11PowerSaveMode) ++ { ++ // The threshold value may required to be adjusted . ++ case eActive: // Active/Continuous access. ++ ResetThreshold = NIC_SEND_HANG_THRESHOLD_NORMAL; ++ break; ++ case eMaxPs: // Max power save mode. ++ ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE; ++ break; ++ case eFastPs: // Fast power save mode. ++ ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE; ++ break; ++ } ++ ++ // ++ // Check whether specific tcb has been queued for a specific time ++ // ++ for(QueueID = 0; QueueID < MAX_TX_QUEUE; QueueID++) ++ { ++ ++ ++ if(QueueID == TXCMD_QUEUE) ++ continue; ++ ++ switch(QueueID) { ++ case MGNT_QUEUE: ++ tail=priv->txmapringtail; ++ head=priv->txmapringhead; ++ break; ++ ++ case BK_QUEUE: ++ tail=priv->txbkpringtail; ++ head=priv->txbkpringhead; ++ break; ++ ++ case BE_QUEUE: ++ tail=priv->txbepringtail; ++ head=priv->txbepringhead; ++ break; ++ ++ case VI_QUEUE: ++ tail=priv->txvipringtail; ++ head=priv->txvipringhead; ++ break; ++ ++ case VO_QUEUE: ++ tail=priv->txvopringtail; ++ head=priv->txvopringhead; ++ break; ++ ++ default: ++ tail=head=NULL; ++ break; ++ } ++ ++ if(tail == head) ++ continue; ++ else ++ { ++ txring = head; ++ if(txring == NULL) ++ { ++ RT_TRACE(COMP_ERR,"%s():txring is NULL , BUG!\n",__FUNCTION__); ++ continue; ++ } ++ txring->nStuckCount++; ++ #if 0 ++ if(txring->nStuckCount > ResetThreshold) ++ { ++ RT_TRACE( COMP_RESET, "<== TxCheckStuck()\n" ); ++ return RESET_TYPE_NORMAL; ++ } ++ #endif ++ bCheckFwTxCnt = TRUE; ++ } ++ } ++#if 1 ++ if(bCheckFwTxCnt) ++ { ++ if(HalTxCheckStuck8190Pci(dev)) ++ { ++ RT_TRACE(COMP_RESET, "TxCheckStuck(): Fw indicates no Tx condition! \n"); ++ return RESET_TYPE_SILENT; ++ } ++ } ++#endif ++ return RESET_TYPE_NORESET; ++} ++ ++ ++static bool HalRxCheckStuck8190Pci(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u16 RegRxCounter = read_nic_word(dev, 0x130); ++ bool bStuck = FALSE; ++ static u8 rx_chk_cnt = 0; ++ RT_TRACE(COMP_RESET,"%s(): RegRxCounter is %d,RxCounter is %d\n",__FUNCTION__,RegRxCounter,priv->RxCounter); ++ // If rssi is small, we should check rx for long time because of bad rx. ++ // or maybe it will continuous silent reset every 2 seconds. ++ rx_chk_cnt++; ++ if(priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5)) ++ { ++ rx_chk_cnt = 0; //high rssi, check rx stuck right now. ++ } ++ else if(priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High+5) && ++ ((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_40M) || ++ (priv->CurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_20M)) ) ++ ++ { ++ if(rx_chk_cnt < 2) ++ { ++ return bStuck; ++ } ++ else ++ { ++ rx_chk_cnt = 0; ++ } ++ } ++ else if(((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdbCurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdbundecorated_smoothed_pwdb >= VeryLowRSSI) ++ { ++ if(rx_chk_cnt < 4) ++ { ++ //DbgPrint("RSSI < %d && RSSI >= %d, no check this time \n", RateAdaptiveTH_Low, VeryLowRSSI); ++ return bStuck; ++ } ++ else ++ { ++ rx_chk_cnt = 0; ++ //DbgPrint("RSSI < %d && RSSI >= %d, check this time \n", RateAdaptiveTH_Low, VeryLowRSSI); ++ } ++ } ++ else ++ { ++ if(rx_chk_cnt < 8) ++ { ++ //DbgPrint("RSSI <= %d, no check this time \n", VeryLowRSSI); ++ return bStuck; ++ } ++ else ++ { ++ rx_chk_cnt = 0; ++ //DbgPrint("RSSI <= %d, check this time \n", VeryLowRSSI); ++ } ++ } ++#if 0 ++ if (rx_chk_cnt < 2) ++ return bStuck; ++ else ++ rx_chk_cnt = 0; ++#endif ++ if(priv->RxCounter==RegRxCounter) ++ bStuck = TRUE; ++ ++ priv->RxCounter = RegRxCounter; ++ ++ return bStuck; ++} ++ ++static RESET_TYPE RxCheckStuck(struct net_device *dev) ++{ ++ ++ if(HalRxCheckStuck8190Pci(dev)) ++ { ++ RT_TRACE(COMP_RESET, "RxStuck Condition\n"); ++ return RESET_TYPE_SILENT; ++ } ++ ++ return RESET_TYPE_NORESET; ++} ++ ++static RESET_TYPE ++rtl819x_ifcheck_resetornot(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RESET_TYPE TxResetType = RESET_TYPE_NORESET; ++ RESET_TYPE RxResetType = RESET_TYPE_NORESET; ++ RT_RF_POWER_STATE rfState; ++ ++ rfState = priv->ieee80211->eRFPowerState; ++ ++ TxResetType = TxCheckStuck(dev); ++#if 1 ++ if( rfState != eRfOff && ++ /*ADAPTER_TEST_STATUS_FLAG(Adapter, ADAPTER_STATUS_FW_DOWNLOAD_FAILURE)) &&*/ ++ (priv->ieee80211->iw_mode != IW_MODE_ADHOC)) ++ { ++ // If driver is in the status of firmware download failure , driver skips RF initialization and RF is ++ // in turned off state. Driver should check whether Rx stuck and do silent reset. And ++ // if driver is in firmware download failure status, driver should initialize RF in the following ++ // silent reset procedure Emily, 2008.01.21 ++ ++ // Driver should not check RX stuck in IBSS mode because it is required to ++ // set Check BSSID in order to send beacon, however, if check BSSID is ++ // set, STA cannot hear any packet a all. Emily, 2008.04.12 ++ RxResetType = RxCheckStuck(dev); ++ } ++#endif ++ ++ RT_TRACE(COMP_RESET,"%s(): TxResetType is %d, RxResetType is %d\n",__FUNCTION__,TxResetType,RxResetType); ++ if(TxResetType==RESET_TYPE_NORMAL || RxResetType==RESET_TYPE_NORMAL) ++ return RESET_TYPE_NORMAL; ++ else if(TxResetType==RESET_TYPE_SILENT || RxResetType==RESET_TYPE_SILENT) ++ return RESET_TYPE_SILENT; ++ else ++ return RESET_TYPE_NORESET; ++ ++} ++ ++ ++static void CamRestoreAllEntry(struct net_device *dev) ++{ ++ u8 EntryId = 0; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8* MacAddr = priv->ieee80211->current_network.bssid; ++ ++ static u8 CAM_CONST_ADDR[4][6] = { ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}; ++ static u8 CAM_CONST_BROAD[] = ++ {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ++ ++ RT_TRACE(COMP_SEC, "CamRestoreAllEntry: \n"); ++ ++ ++ if ((priv->ieee80211->pairwise_key_type == KEY_TYPE_WEP40)|| ++ (priv->ieee80211->pairwise_key_type == KEY_TYPE_WEP104)) ++ { ++ ++ for(EntryId=0; EntryId<4; EntryId++) ++ { ++ { ++ MacAddr = CAM_CONST_ADDR[EntryId]; ++ setKey(dev, ++ EntryId , ++ EntryId, ++ priv->ieee80211->pairwise_key_type, ++ MacAddr, ++ 0, ++ NULL); ++ } ++ } ++ ++ } ++ else if(priv->ieee80211->pairwise_key_type == KEY_TYPE_TKIP) ++ { ++ ++ { ++ if(priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ setKey(dev, ++ 4, ++ 0, ++ priv->ieee80211->pairwise_key_type, ++ (u8*)dev->dev_addr, ++ 0, ++ NULL); ++ else ++ setKey(dev, ++ 4, ++ 0, ++ priv->ieee80211->pairwise_key_type, ++ MacAddr, ++ 0, ++ NULL); ++ } ++ } ++ else if(priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP) ++ { ++ ++ { ++ if(priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ setKey(dev, ++ 4, ++ 0, ++ priv->ieee80211->pairwise_key_type, ++ (u8*)dev->dev_addr, ++ 0, ++ NULL); ++ else ++ setKey(dev, ++ 4, ++ 0, ++ priv->ieee80211->pairwise_key_type, ++ MacAddr, ++ 0, ++ NULL); ++ } ++ } ++ ++ ++ ++ if(priv->ieee80211->group_key_type == KEY_TYPE_TKIP) ++ { ++ MacAddr = CAM_CONST_BROAD; ++ for(EntryId=1 ; EntryId<4 ; EntryId++) ++ { ++ { ++ setKey(dev, ++ EntryId, ++ EntryId, ++ priv->ieee80211->group_key_type, ++ MacAddr, ++ 0, ++ NULL); ++ } ++ } ++ if(priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ setKey(dev, ++ 0, ++ 0, ++ priv->ieee80211->group_key_type, ++ CAM_CONST_ADDR[0], ++ 0, ++ NULL); ++ } ++ else if(priv->ieee80211->group_key_type == KEY_TYPE_CCMP) ++ { ++ MacAddr = CAM_CONST_BROAD; ++ for(EntryId=1; EntryId<4 ; EntryId++) ++ { ++ { ++ setKey(dev, ++ EntryId , ++ EntryId, ++ priv->ieee80211->group_key_type, ++ MacAddr, ++ 0, ++ NULL); ++ } ++ } ++ ++ if(priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ setKey(dev, ++ 0 , ++ 0, ++ priv->ieee80211->group_key_type, ++ CAM_CONST_ADDR[0], ++ 0, ++ NULL); ++ } ++} ++ ++void rtl8192_cancel_deferred_work(struct r8192_priv* priv); ++int _rtl8192_up(struct net_device *dev); ++ ++/* ++ * This function is used to fix Tx/Rx stop bug temporarily. ++ * This function will do "system reset" to NIC when Tx or Rx is stuck. ++ * The method checking Tx/Rx stuck of this function is supported by FW, ++ * which reports Tx and Rx counter to register 0x128 and 0x130. ++ * */ ++static void rtl819x_ifsilentreset(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 reset_times = 0; ++ int reset_status = 0; ++ struct ieee80211_device *ieee = priv->ieee80211; ++ ++ ++ // 2007.07.20. If we need to check CCK stop, please uncomment this line. ++ //bStuck = Adapter->HalFunc.CheckHWStopHandler(Adapter); ++ ++ if(priv->ResetProgress==RESET_TYPE_NORESET) ++ { ++RESET_START: ++ ++ RT_TRACE(COMP_RESET,"=========>Reset progress!! \n"); ++ ++ // Set the variable for reset. ++ priv->ResetProgress = RESET_TYPE_SILENT; ++// rtl8192_close(dev); ++#if 1 ++ down(&priv->wx_sem); ++ if(priv->up == 0) ++ { ++ RT_TRACE(COMP_ERR,"%s():the driver is not up! return\n",__FUNCTION__); ++ up(&priv->wx_sem); ++ return ; ++ } ++ priv->up = 0; ++ RT_TRACE(COMP_RESET,"%s():======>start to down the driver\n",__FUNCTION__); ++ if(!netif_queue_stopped(dev)) ++ netif_stop_queue(dev); ++ ++ dm_backup_dynamic_mechanism_state(dev); ++ ++ rtl8192_irq_disable(dev); ++ rtl8192_cancel_deferred_work(priv); ++ deinit_hal_dm(dev); ++ del_timer_sync(&priv->watch_dog_timer); ++ ieee->sync_scan_hurryup = 1; ++ if(ieee->state == IEEE80211_LINKED) ++ { ++ down(&ieee->wx_sem); ++ printk("ieee->state is IEEE80211_LINKED\n"); ++ ieee80211_stop_send_beacons(priv->ieee80211); ++ del_timer_sync(&ieee->associate_timer); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&ieee->associate_retry_wq); ++#endif ++ ieee80211_stop_scan(ieee); ++ netif_carrier_off(dev); ++ up(&ieee->wx_sem); ++ } ++ else{ ++ printk("ieee->state is NOT LINKED\n"); ++ ieee80211_softmac_stop_protocol(priv->ieee80211); ++ } ++ rtl8192_rtx_disable(dev); ++ up(&priv->wx_sem); ++ RT_TRACE(COMP_RESET,"%s():<==========down process is finished\n",__FUNCTION__); ++ RT_TRACE(COMP_RESET,"%s():===========>start to up the driver\n",__FUNCTION__); ++ reset_status = _rtl8192_up(dev); ++ ++ RT_TRACE(COMP_RESET,"%s():<===========up process is finished\n",__FUNCTION__); ++ if(reset_status == -1) ++ { ++ if(reset_times < 3) ++ { ++ reset_times++; ++ goto RESET_START; ++ } ++ else ++ { ++ RT_TRACE(COMP_ERR," ERR!!! %s(): Reset Failed!!\n",__FUNCTION__); ++ } ++ } ++#endif ++ ieee->is_silent_reset = 1; ++#if 1 ++ EnableHWSecurityConfig8192(dev); ++#if 1 ++ if(ieee->state == IEEE80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) ++ { ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ++#if 1 ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_complete_wq); ++#else ++ schedule_task(&ieee->associate_complete_wq); ++#endif ++#endif ++ ++ } ++ else if(ieee->state == IEEE80211_LINKED && ieee->iw_mode == IW_MODE_ADHOC) ++ { ++ ieee->set_chan(ieee->dev, ieee->current_network.channel); ++ ieee->link_change(ieee->dev); ++ ++ // notify_wx_assoc_event(ieee); ++ ++ ieee80211_start_send_beacons(ieee); ++ ++ if (ieee->data_hard_resume) ++ ieee->data_hard_resume(ieee->dev); ++ netif_carrier_on(ieee->dev); ++ } ++#endif ++ ++ CamRestoreAllEntry(dev); ++ ++ // Restore the previous setting for all dynamic mechanism ++ dm_restore_dynamic_mechanism_state(dev); ++ ++ priv->ResetProgress = RESET_TYPE_NORESET; ++ priv->reset_count++; ++ ++ priv->bForcedSilentReset =false; ++ priv->bResetInProgress = false; ++ ++ // For test --> force write UFWP. ++ write_nic_byte(dev, UFWP, 1); ++ RT_TRACE(COMP_RESET, "Reset finished!! ====>[%d]\n", priv->reset_count); ++#endif ++ } ++} ++ ++#ifdef ENABLE_IPS ++void InactivePsWorkItemCallback(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl)); ++ //u8 index = 0; ++ ++ RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() ---------> \n"); ++ // ++ // This flag "bSwRfProcessing", indicates the status of IPS procedure, should be set if the IPS workitem ++ // is really scheduled. ++ // The old code, sets this flag before scheduling the IPS workitem and however, at the same time the ++ // previous IPS workitem did not end yet, fails to schedule the current workitem. Thus, bSwRfProcessing ++ // blocks the IPS procedure of switching RF. ++ // By Bruce, 2007-12-25. ++ // ++ pPSC->bSwRfProcessing = TRUE; ++ ++ RT_TRACE(COMP_RF, "InactivePsWorkItemCallback(): Set RF to %s.\n", \ ++ pPSC->eInactivePowerState == eRfOff?"OFF":"ON"); ++ ++ ++ MgntActSet_RF_State(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS); ++ ++ // ++ // To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20. ++ // ++#if 0 ++ if(pPSC->eInactivePowerState == eRfOn) ++ CamRestoreAllEntry(dev); ++#endif ++ pPSC->bSwRfProcessing = FALSE; ++ RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() <--------- \n"); ++} ++ ++// ++// Description: ++// Enter the inactive power save mode. RF will be off ++// 2007.08.17, by shien chang. ++// ++void ++IPSEnter(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl)); ++ RT_RF_POWER_STATE rtState; ++ ++ if (pPSC->bInactivePs) ++ { ++ rtState = priv->ieee80211->eRFPowerState; ++ // ++ // Added by Bruce, 2007-12-25. ++ // Do not enter IPS in the following conditions: ++ // (1) RF is already OFF or Sleep ++ // (2) bSwRfProcessing (indicates the IPS is still under going) ++ // (3) Connectted (only disconnected can trigger IPS) ++ // (4) IBSS (send Beacon) ++ // (5) AP mode (send Beacon) ++ // ++ if (rtState == eRfOn && !pPSC->bSwRfProcessing ++ && (priv->ieee80211->state != IEEE80211_LINKED) ) ++ { ++ RT_TRACE(COMP_RF,"IPSEnter(): Turn off RF.\n"); ++ pPSC->eInactivePowerState = eRfOff; ++// queue_work(priv->priv_wq,&(pPSC->InactivePsWorkItem)); ++ InactivePsWorkItemCallback(dev); ++ } ++ } ++} ++ ++// ++// Description: ++// Leave the inactive power save mode, RF will be on. ++// 2007.08.17, by shien chang. ++// ++void ++IPSLeave(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_POWER_SAVE_CONTROL pPSC = (PRT_POWER_SAVE_CONTROL)(&(priv->ieee80211->PowerSaveControl)); ++ RT_RF_POWER_STATE rtState; ++ ++ if (pPSC->bInactivePs) ++ { ++ rtState = priv->ieee80211->eRFPowerState; ++ if (rtState != eRfOn && !pPSC->bSwRfProcessing && priv->ieee80211->RfOffReason <= RF_CHANGE_BY_IPS) ++ { ++ RT_TRACE(COMP_POWER, "IPSLeave(): Turn on RF.\n"); ++ pPSC->eInactivePowerState = eRfOn; ++// queue_work(priv->priv_wq,&(pPSC->InactivePsWorkItem)); ++ InactivePsWorkItemCallback(dev); ++ } ++ } ++} ++#endif ++ ++static void rtl819x_update_rxcounts( ++ struct r8192_priv *priv, ++ u32* TotalRxBcnNum, ++ u32* TotalRxDataNum ++) ++{ ++ u16 SlotIndex; ++ u8 i; ++ ++ *TotalRxBcnNum = 0; ++ *TotalRxDataNum = 0; ++ ++ SlotIndex = (priv->ieee80211->LinkDetectInfo.SlotIndex++)%(priv->ieee80211->LinkDetectInfo.SlotNum); ++ priv->ieee80211->LinkDetectInfo.RxBcnNum[SlotIndex] = priv->ieee80211->LinkDetectInfo.NumRecvBcnInPeriod; ++ priv->ieee80211->LinkDetectInfo.RxDataNum[SlotIndex] = priv->ieee80211->LinkDetectInfo.NumRecvDataInPeriod; ++ for( i=0; iieee80211->LinkDetectInfo.SlotNum; i++ ){ ++ *TotalRxBcnNum += priv->ieee80211->LinkDetectInfo.RxBcnNum[i]; ++ *TotalRxDataNum += priv->ieee80211->LinkDetectInfo.RxDataNum[i]; ++ } ++} ++ ++ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void rtl819x_watchdog_wqcallback(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct r8192_priv *priv = container_of(dwork,struct r8192_priv,watch_dog_wq); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++extern void rtl819x_watchdog_wqcallback(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ struct ieee80211_device* ieee = priv->ieee80211; ++ RESET_TYPE ResetType = RESET_TYPE_NORESET; ++ static u8 check_reset_cnt=0; ++ unsigned long flags; ++ bool bBusyTraffic = false; ++ static u8 last_time = 0; ++ if(!priv->up) ++ return; ++ hal_dm_watchdog(dev); ++#ifdef ENABLE_IPS ++// printk("watch_dog ENABLE_IPS\n"); ++ if(ieee->actscanning == false){ ++ if((ieee->iw_mode != IW_MODE_ADHOC) && (ieee->state == IEEE80211_NOLINK) && (ieee->beinretry == false) && (ieee->eRFPowerState == eRfOn) && !ieee->is_set_key){ ++ if(ieee->PowerSaveControl.ReturnPoint == IPS_CALLBACK_NONE){ ++ printk("====================>haha:IPSEnter()\n"); ++ IPSEnter(dev); ++ //ieee80211_stop_scan(priv->ieee80211); ++ } ++ } ++ } ++#endif ++ {//to get busy traffic condition ++ if(ieee->state == IEEE80211_LINKED) ++ { ++ if( ieee->LinkDetectInfo.NumRxOkInPeriod> 666 || ++ ieee->LinkDetectInfo.NumTxOkInPeriod> 666 ) { ++ bBusyTraffic = true; ++ } ++ ++ } ++ ieee->LinkDetectInfo.NumRxOkInPeriod = 0; ++ ieee->LinkDetectInfo.NumTxOkInPeriod = 0; ++ ieee->LinkDetectInfo.bBusyTraffic = bBusyTraffic; ++ } ++ ++ ++ //added by amy for AP roaming ++ if (1) ++ { ++ if(ieee->state == IEEE80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) ++ { ++ u32 TotalRxBcnNum = 0; ++ u32 TotalRxDataNum = 0; ++ ++ rtl819x_update_rxcounts(priv, &TotalRxBcnNum, &TotalRxDataNum); ++ if((TotalRxBcnNum+TotalRxDataNum) == 0) ++ { ++ if( ieee->eRFPowerState == eRfOff) ++ RT_TRACE(COMP_ERR,"========>%s()\n",__FUNCTION__); ++ printk("===>%s(): AP is power off,connect another one\n",__FUNCTION__); ++ // Dot11d_Reset(dev); ++ ieee->state = IEEE80211_ASSOCIATING; ++ notify_wx_assoc_event(priv->ieee80211); ++ RemovePeerTS(priv->ieee80211,priv->ieee80211->current_network.bssid); ++ ieee->is_roaming = true; ++ ieee->is_set_key = false; ++ ieee->link_change(dev); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ queue_work(ieee->wq, &ieee->associate_procedure_wq); ++#else ++ schedule_task(&ieee->associate_procedure_wq); ++#endif ++ } ++ } ++ ieee->LinkDetectInfo.NumRecvBcnInPeriod=0; ++ ieee->LinkDetectInfo.NumRecvDataInPeriod=0; ++ ++ } ++ //check if reset the driver ++ spin_lock_irqsave(&priv->tx_lock,flags); ++ if(check_reset_cnt++ >= 3 && !ieee->is_roaming && (last_time != 1)) ++ { ++ ResetType = rtl819x_ifcheck_resetornot(dev); ++ check_reset_cnt = 3; ++ //DbgPrint("Start to check silent reset\n"); ++ } ++ spin_unlock_irqrestore(&priv->tx_lock,flags); ++ if(!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) ++ { ++ priv->ResetProgress = RESET_TYPE_NORMAL; ++ RT_TRACE(COMP_RESET,"%s(): NOMAL RESET\n",__FUNCTION__); ++ return; ++ } ++ /* disable silent reset temply 2008.9.11*/ ++#if 1 ++ if( ((priv->force_reset) || (!priv->bDisableNormalResetCheck && ResetType==RESET_TYPE_SILENT))) // This is control by OID set in Pomelo ++ { ++ last_time = 1; ++ rtl819x_ifsilentreset(dev); ++ } ++ else ++ last_time = 0; ++#endif ++ priv->force_reset = false; ++ priv->bForcedSilentReset = false; ++ priv->bResetInProgress = false; ++ RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n"); ++ ++} ++ ++void watch_dog_timer_callback(unsigned long data) ++{ ++ struct r8192_priv *priv = ieee80211_priv((struct net_device *) data); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq,&priv->watch_dog_wq,0); ++#else ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->watch_dog_wq); ++#else ++ queue_work(priv->priv_wq,&priv->watch_dog_wq); ++#endif ++#endif ++ mod_timer(&priv->watch_dog_timer, jiffies + MSECS(IEEE80211_WATCH_DOG_TIME)); ++ ++} ++int _rtl8192_up(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //int i; ++ RT_STATUS init_status = RT_STATUS_SUCCESS; ++ priv->up=1; ++ priv->ieee80211->ieee_up=1; ++ RT_TRACE(COMP_INIT, "Bringing up iface"); ++ ++ init_status = rtl8192_adapter_start(dev); ++ if(init_status != RT_STATUS_SUCCESS) ++ { ++ RT_TRACE(COMP_ERR,"ERR!!! %s(): initialization is failed!\n",__FUNCTION__); ++ return -1; ++ } ++ RT_TRACE(COMP_INIT, "start adapter finished\n"); ++#ifdef RTL8192E ++ if(priv->ieee80211->eRFPowerState!=eRfOn) ++ MgntActSet_RF_State(dev, eRfOn, priv->ieee80211->RfOffReason); ++#endif ++ if(priv->ieee80211->state != IEEE80211_LINKED) ++ ieee80211_softmac_start_protocol(priv->ieee80211); ++ ieee80211_reset_queue(priv->ieee80211); ++ watch_dog_timer_callback((unsigned long) dev); ++ if(!netif_queue_stopped(dev)) ++ netif_start_queue(dev); ++ else ++ netif_wake_queue(dev); ++ ++ return 0; ++} ++ ++ ++static int rtl8192_open(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int ret; ++ ++ down(&priv->wx_sem); ++ ret = rtl8192_up(dev); ++ up(&priv->wx_sem); ++ return ret; ++ ++} ++ ++ ++int rtl8192_up(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if (priv->up == 1) return -1; ++ ++ return _rtl8192_up(dev); ++} ++ ++ ++static int rtl8192_close(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int ret; ++ ++ down(&priv->wx_sem); ++ ++ ret = rtl8192_down(dev); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++ ++} ++ ++int rtl8192_down(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++// int i; ++#if 0 ++ u8 ucRegRead; ++ u32 ulRegRead; ++#endif ++ if (priv->up == 0) return -1; ++ ++ priv->up=0; ++ priv->ieee80211->ieee_up = 0; ++ RT_TRACE(COMP_DOWN, "==========>%s()\n", __FUNCTION__); ++/* FIXME */ ++ if (!netif_queue_stopped(dev)) ++ netif_stop_queue(dev); ++ ++ rtl8192_irq_disable(dev); ++#if 0 ++ if(!priv->ieee80211->bSupportRemoteWakeUp) { ++ MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT); ++ // 2006.11.30. System reset bit ++ ulRegRead = read_nic_dword(dev, CPU_GEN); ++ ulRegRead|=CPU_GEN_SYSTEM_RESET; ++ write_nic_dword(dev, CPU_GEN, ulRegRead); ++ } else { ++ //2008.06.03 for WOL ++ write_nic_dword(dev, WFCRC0, 0xffffffff); ++ write_nic_dword(dev, WFCRC1, 0xffffffff); ++ write_nic_dword(dev, WFCRC2, 0xffffffff); ++#ifdef RTL8190P ++ //GPIO 0 = TRUE ++ ucRegRead = read_nic_byte(dev, GPO); ++ ucRegRead |= BIT0; ++ write_nic_byte(dev, GPO, ucRegRead); ++#endif ++ //Write PMR register ++ write_nic_byte(dev, PMR, 0x5); ++ //Disable tx, enanble rx ++ write_nic_byte(dev, MacBlkCtrl, 0xa); ++ } ++#endif ++// flush_scheduled_work(); ++ rtl8192_cancel_deferred_work(priv); ++ deinit_hal_dm(dev); ++ del_timer_sync(&priv->watch_dog_timer); ++ ++ ieee80211_softmac_stop_protocol(priv->ieee80211); ++#ifdef ENABLE_IPS ++ MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT); ++#endif ++ rtl8192_rtx_disable(dev); ++ memset(&priv->ieee80211->current_network, 0 , offsetof(struct ieee80211_network, list)); ++ ++ RT_TRACE(COMP_DOWN, "<==========%s()\n", __FUNCTION__); ++ ++ return 0; ++} ++ ++ ++void rtl8192_commit(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if (priv->up == 0) return ; ++ ++ ++ ieee80211_softmac_stop_protocol(priv->ieee80211); ++ ++ rtl8192_irq_disable(dev); ++ rtl8192_rtx_disable(dev); ++ _rtl8192_up(dev); ++} ++ ++/* ++void rtl8192_restart(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++*/ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void rtl8192_restart(struct work_struct *work) ++{ ++ struct r8192_priv *priv = container_of(work, struct r8192_priv, reset_wq); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++void rtl8192_restart(struct net_device *dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ ++ down(&priv->wx_sem); ++ ++ rtl8192_commit(dev); ++ ++ up(&priv->wx_sem); ++} ++ ++static void r8192_set_multicast(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ short promisc; ++ ++ //down(&priv->wx_sem); ++ ++ /* FIXME FIXME */ ++ ++ promisc = (dev->flags & IFF_PROMISC) ? 1:0; ++ ++ if (promisc != priv->promisc) { ++ ; ++ // rtl8192_commit(dev); ++ } ++ ++ priv->promisc = promisc; ++ ++ //schedule_work(&priv->reset_wq); ++ //up(&priv->wx_sem); ++} ++ ++ ++static int r8192_set_mac_adr(struct net_device *dev, void *mac) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct sockaddr *addr = mac; ++ ++ down(&priv->wx_sem); ++ ++ memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); ++ ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) ++ schedule_work(&priv->reset_wq); ++#else ++ schedule_task(&priv->reset_wq); ++#endif ++ up(&priv->wx_sem); ++ ++ return 0; ++} ++ ++/* based on ipw2200 driver */ ++static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct iwreq *wrq = (struct iwreq *)rq; ++ int ret=-1; ++ struct ieee80211_device *ieee = priv->ieee80211; ++ u32 key[4]; ++ u8 broadcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff}; ++ struct iw_point *p = &wrq->u.data; ++ struct ieee_param *ipw = NULL;//(struct ieee_param *)wrq->u.data.pointer; ++ ++ down(&priv->wx_sem); ++ ++ ++ if (p->length < sizeof(struct ieee_param) || !p->pointer){ ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); ++ if (ipw == NULL){ ++ ret = -ENOMEM; ++ goto out; ++ } ++ if (copy_from_user(ipw, p->pointer, p->length)) { ++ kfree(ipw); ++ ret = -EFAULT; ++ goto out; ++ } ++ ++ switch (cmd) { ++ case RTL_IOCTL_WPA_SUPPLICANT: ++ //parse here for HW security ++ if (ipw->cmd == IEEE_CMD_SET_ENCRYPTION) ++ { ++ if (ipw->u.crypt.set_tx) ++ { ++ if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) ++ ieee->pairwise_key_type = KEY_TYPE_CCMP; ++ else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) ++ ieee->pairwise_key_type = KEY_TYPE_TKIP; ++ else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) ++ { ++ if (ipw->u.crypt.key_len == 13) ++ ieee->pairwise_key_type = KEY_TYPE_WEP104; ++ else if (ipw->u.crypt.key_len == 5) ++ ieee->pairwise_key_type = KEY_TYPE_WEP40; ++ } ++ else ++ ieee->pairwise_key_type = KEY_TYPE_NA; ++ ++ if (ieee->pairwise_key_type) ++ { ++ memcpy((u8*)key, ipw->u.crypt.key, 16); ++ EnableHWSecurityConfig8192(dev); ++ //we fill both index entry and 4th entry for pairwise key as in IPW interface, adhoc will only get here, so we need index entry for its default key serching! ++ //added by WB. ++ setKey(dev, 4, ipw->u.crypt.idx, ieee->pairwise_key_type, (u8*)ieee->ap_mac_addr, 0, key); ++ if (ieee->auth_mode != 2) //LEAP WEP will never set this. ++ setKey(dev, ipw->u.crypt.idx, ipw->u.crypt.idx, ieee->pairwise_key_type, (u8*)ieee->ap_mac_addr, 0, key); ++ } ++ if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->pHTInfo->bCurrentHTSupport){ ++ write_nic_byte(dev, 0x173, 1); //fix aes bug ++ } ++ ++ } ++ else //if (ipw->u.crypt.idx) //group key use idx > 0 ++ { ++ memcpy((u8*)key, ipw->u.crypt.key, 16); ++ if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) ++ ieee->group_key_type= KEY_TYPE_CCMP; ++ else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) ++ ieee->group_key_type = KEY_TYPE_TKIP; ++ else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) ++ { ++ if (ipw->u.crypt.key_len == 13) ++ ieee->group_key_type = KEY_TYPE_WEP104; ++ else if (ipw->u.crypt.key_len == 5) ++ ieee->group_key_type = KEY_TYPE_WEP40; ++ } ++ else ++ ieee->group_key_type = KEY_TYPE_NA; ++ ++ if (ieee->group_key_type) ++ { ++ setKey( dev, ++ ipw->u.crypt.idx, ++ ipw->u.crypt.idx, //KeyIndex ++ ieee->group_key_type, //KeyType ++ broadcast_addr, //MacAddr ++ 0, //DefaultKey ++ key); //KeyContent ++ } ++ } ++ } ++#ifdef JOHN_DEBUG ++ //john's test 0711 ++ { ++ int i; ++ printk("@@ wrq->u pointer = "); ++ for(i=0;iu.data.length;i++){ ++ if(i%10==0) printk("\n"); ++ printk( "%8x|", ((u32*)wrq->u.data.pointer)[i] ); ++ } ++ printk("\n"); ++ } ++#endif /*JOHN_DEBUG*/ ++ ret = ieee80211_wpa_supplicant_ioctl(priv->ieee80211, &wrq->u.data); ++ break; ++ ++ default: ++ ret = -EOPNOTSUPP; ++ break; ++ } ++ ++ kfree(ipw); ++out: ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++static u8 HwRateToMRate90(bool bIsHT, u8 rate) ++{ ++ u8 ret_rate = 0x02; ++ ++ if(!bIsHT) { ++ switch(rate) { ++ case DESC90_RATE1M: ret_rate = MGN_1M; break; ++ case DESC90_RATE2M: ret_rate = MGN_2M; break; ++ case DESC90_RATE5_5M: ret_rate = MGN_5_5M; break; ++ case DESC90_RATE11M: ret_rate = MGN_11M; break; ++ case DESC90_RATE6M: ret_rate = MGN_6M; break; ++ case DESC90_RATE9M: ret_rate = MGN_9M; break; ++ case DESC90_RATE12M: ret_rate = MGN_12M; break; ++ case DESC90_RATE18M: ret_rate = MGN_18M; break; ++ case DESC90_RATE24M: ret_rate = MGN_24M; break; ++ case DESC90_RATE36M: ret_rate = MGN_36M; break; ++ case DESC90_RATE48M: ret_rate = MGN_48M; break; ++ case DESC90_RATE54M: ret_rate = MGN_54M; break; ++ ++ default: ++ RT_TRACE(COMP_RECV, "HwRateToMRate90(): Non supported Rate [%x], bIsHT = %d!!!\n", rate, bIsHT); ++ break; ++ } ++ ++ } else { ++ switch(rate) { ++ case DESC90_RATEMCS0: ret_rate = MGN_MCS0; break; ++ case DESC90_RATEMCS1: ret_rate = MGN_MCS1; break; ++ case DESC90_RATEMCS2: ret_rate = MGN_MCS2; break; ++ case DESC90_RATEMCS3: ret_rate = MGN_MCS3; break; ++ case DESC90_RATEMCS4: ret_rate = MGN_MCS4; break; ++ case DESC90_RATEMCS5: ret_rate = MGN_MCS5; break; ++ case DESC90_RATEMCS6: ret_rate = MGN_MCS6; break; ++ case DESC90_RATEMCS7: ret_rate = MGN_MCS7; break; ++ case DESC90_RATEMCS8: ret_rate = MGN_MCS8; break; ++ case DESC90_RATEMCS9: ret_rate = MGN_MCS9; break; ++ case DESC90_RATEMCS10: ret_rate = MGN_MCS10; break; ++ case DESC90_RATEMCS11: ret_rate = MGN_MCS11; break; ++ case DESC90_RATEMCS12: ret_rate = MGN_MCS12; break; ++ case DESC90_RATEMCS13: ret_rate = MGN_MCS13; break; ++ case DESC90_RATEMCS14: ret_rate = MGN_MCS14; break; ++ case DESC90_RATEMCS15: ret_rate = MGN_MCS15; break; ++ case DESC90_RATEMCS32: ret_rate = (0x80|0x20); break; ++ ++ default: ++ RT_TRACE(COMP_RECV, "HwRateToMRate90(): Non supported Rate [%x], bIsHT = %d!!!\n",rate, bIsHT); ++ break; ++ } ++ } ++ ++ return ret_rate; ++} ++ ++/** ++ * Function: UpdateRxPktTimeStamp ++ * Overview: Recored down the TSF time stamp when receiving a packet ++ * ++ * Input: ++ * PADAPTER Adapter ++ * PRT_RFD pRfd, ++ * ++ * Output: ++ * PRT_RFD pRfd ++ * (pRfd->Status.TimeStampHigh is updated) ++ * (pRfd->Status.TimeStampLow is updated) ++ * Return: ++ * None ++ */ ++static void UpdateRxPktTimeStamp8190 (struct net_device *dev, struct ieee80211_rx_stats *stats) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ if(stats->bIsAMPDU && !stats->bFirstMPDU) { ++ stats->mac_time[0] = priv->LastRxDescTSFLow; ++ stats->mac_time[1] = priv->LastRxDescTSFHigh; ++ } else { ++ priv->LastRxDescTSFLow = stats->mac_time[0]; ++ priv->LastRxDescTSFHigh = stats->mac_time[1]; ++ } ++} ++ ++static long rtl819x_translate_todbm(u8 signal_strength_index)// 0-100 index. ++{ ++ long signal_power; // in dBm. ++ ++ // Translate to dBm (x=0.5y-95). ++ signal_power = (long)((signal_strength_index + 1) >> 1); ++ signal_power -= 95; ++ ++ return signal_power; ++} ++ ++// ++// Description: ++// Update Rx signal related information in the packet reeived ++// to RxStats. User application can query RxStats to realize ++// current Rx signal status. ++// ++// Assumption: ++// In normal operation, user only care about the information of the BSS ++// and we shall invoke this function if the packet received is from the BSS. ++// ++static void ++rtl819x_update_rxsignalstatistics8190pci( ++ struct r8192_priv * priv, ++ struct ieee80211_rx_stats * pprevious_stats ++ ) ++{ ++ int weighting = 0; ++ ++ //2 Update Rx Statistics (such as signal strength and signal quality). ++ ++ // Initila state ++ if(priv->stats.recv_signal_power == 0) ++ priv->stats.recv_signal_power = pprevious_stats->RecvSignalPower; ++ ++ // To avoid the past result restricting the statistics sensitivity, weight the current power (5/6) to speed up the ++ // reaction of smoothed Signal Power. ++ if(pprevious_stats->RecvSignalPower > priv->stats.recv_signal_power) ++ weighting = 5; ++ else if(pprevious_stats->RecvSignalPower < priv->stats.recv_signal_power) ++ weighting = (-5); ++ // ++ // We need more correct power of received packets and the "SignalStrength" of RxStats have been beautified or translated, ++ // so we record the correct power in Dbm here. By Bruce, 2008-03-07. ++ // ++ priv->stats.recv_signal_power = (priv->stats.recv_signal_power * 5 + pprevious_stats->RecvSignalPower + weighting) / 6; ++} ++ ++static void ++rtl8190_process_cck_rxpathsel( ++ struct r8192_priv * priv, ++ struct ieee80211_rx_stats * pprevious_stats ++ ) ++{ ++#ifdef RTL8190P //Only 90P 2T4R need to check ++ char last_cck_adc_pwdb[4]={0,0,0,0}; ++ u8 i; ++//cosa add for Rx path selection ++ if(priv->rf_type == RF_2T4R && DM_RxPathSelTable.Enable) ++ { ++ if(pprevious_stats->bIsCCK && ++ (pprevious_stats->bPacketToSelf ||pprevious_stats->bPacketBeacon)) ++ { ++ /* record the cck adc_pwdb to the sliding window. */ ++ if(priv->stats.cck_adc_pwdb.TotalNum++ >= PHY_RSSI_SLID_WIN_MAX) ++ { ++ priv->stats.cck_adc_pwdb.TotalNum = PHY_RSSI_SLID_WIN_MAX; ++ for(i=RF90_PATH_A; istats.cck_adc_pwdb.elements[i][priv->stats.cck_adc_pwdb.index]; ++ priv->stats.cck_adc_pwdb.TotalVal[i] -= last_cck_adc_pwdb[i]; ++ } ++ } ++ for(i=RF90_PATH_A; istats.cck_adc_pwdb.TotalVal[i] += pprevious_stats->cck_adc_pwdb[i]; ++ priv->stats.cck_adc_pwdb.elements[i][priv->stats.cck_adc_pwdb.index] = pprevious_stats->cck_adc_pwdb[i]; ++ } ++ priv->stats.cck_adc_pwdb.index++; ++ if(priv->stats.cck_adc_pwdb.index >= PHY_RSSI_SLID_WIN_MAX) ++ priv->stats.cck_adc_pwdb.index = 0; ++ ++ for(i=RF90_PATH_A; istats.cck_adc_pwdb.TotalVal[i]/priv->stats.cck_adc_pwdb.TotalNum; ++ } ++ ++ for(i=RF90_PATH_A; icck_adc_pwdb[i] > (char)priv->undecorated_smoothed_cck_adc_pwdb[i]) ++ { ++ priv->undecorated_smoothed_cck_adc_pwdb[i] = ++ ( (priv->undecorated_smoothed_cck_adc_pwdb[i]*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->cck_adc_pwdb[i])) /(Rx_Smooth_Factor); ++ priv->undecorated_smoothed_cck_adc_pwdb[i] = priv->undecorated_smoothed_cck_adc_pwdb[i] + 1; ++ } ++ else ++ { ++ priv->undecorated_smoothed_cck_adc_pwdb[i] = ++ ( (priv->undecorated_smoothed_cck_adc_pwdb[i]*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->cck_adc_pwdb[i])) /(Rx_Smooth_Factor); ++ } ++ } ++ } ++ } ++#endif ++} ++ ++ ++/* 2008/01/22 MH We can not delcare RSSI/EVM total value of sliding window to ++ be a local static. Otherwise, it may increase when we return from S3/S4. The ++ value will be kept in memory or disk. We must delcare the value in adapter ++ and it will be reinitialized when return from S3/S4. */ ++static void rtl8192_process_phyinfo(struct r8192_priv * priv, u8* buffer,struct ieee80211_rx_stats * pprevious_stats, struct ieee80211_rx_stats * pcurrent_stats) ++{ ++ bool bcheck = false; ++ u8 rfpath; ++ u32 nspatial_stream, tmp_val; ++ //u8 i; ++ static u32 slide_rssi_index=0, slide_rssi_statistics=0; ++ static u32 slide_evm_index=0, slide_evm_statistics=0; ++ static u32 last_rssi=0, last_evm=0; ++ //cosa add for rx path selection ++// static long slide_cck_adc_pwdb_index=0, slide_cck_adc_pwdb_statistics=0; ++// static char last_cck_adc_pwdb[4]={0,0,0,0}; ++ //cosa add for beacon rssi smoothing ++ static u32 slide_beacon_adc_pwdb_index=0, slide_beacon_adc_pwdb_statistics=0; ++ static u32 last_beacon_adc_pwdb=0; ++ ++ struct ieee80211_hdr_3addr *hdr; ++ u16 sc ; ++ unsigned int frag,seq; ++ hdr = (struct ieee80211_hdr_3addr *)buffer; ++ sc = le16_to_cpu(hdr->seq_ctl); ++ frag = WLAN_GET_SEQ_FRAG(sc); ++ seq = WLAN_GET_SEQ_SEQ(sc); ++ //cosa add 04292008 to record the sequence number ++ pcurrent_stats->Seq_Num = seq; ++ // ++ // Check whether we should take the previous packet into accounting ++ // ++ if(!pprevious_stats->bIsAMPDU) ++ { ++ // if previous packet is not aggregated packet ++ bcheck = true; ++ }else ++ { ++//remve for that we don't use AMPDU to calculate PWDB,because the reported PWDB of some AP is fault. ++#if 0 ++ // if previous packet is aggregated packet, and current packet ++ // (1) is not AMPDU ++ // (2) is the first packet of one AMPDU ++ // that means the previous packet is the last one aggregated packet ++ if( !pcurrent_stats->bIsAMPDU || pcurrent_stats->bFirstMPDU) ++ bcheck = true; ++#endif ++ } ++ ++ if(slide_rssi_statistics++ >= PHY_RSSI_SLID_WIN_MAX) ++ { ++ slide_rssi_statistics = PHY_RSSI_SLID_WIN_MAX; ++ last_rssi = priv->stats.slide_signal_strength[slide_rssi_index]; ++ priv->stats.slide_rssi_total -= last_rssi; ++ } ++ priv->stats.slide_rssi_total += pprevious_stats->SignalStrength; ++ ++ priv->stats.slide_signal_strength[slide_rssi_index++] = pprevious_stats->SignalStrength; ++ if(slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX) ++ slide_rssi_index = 0; ++ ++ // <1> Showed on UI for user, in dbm ++ tmp_val = priv->stats.slide_rssi_total/slide_rssi_statistics; ++ priv->stats.signal_strength = rtl819x_translate_todbm((u8)tmp_val); ++ pcurrent_stats->rssi = priv->stats.signal_strength; ++ // ++ // If the previous packet does not match the criteria, neglect it ++ // ++ if(!pprevious_stats->bPacketMatchBSSID) ++ { ++ if(!pprevious_stats->bToSelfBA) ++ return; ++ } ++ ++ if(!bcheck) ++ return; ++ ++ rtl8190_process_cck_rxpathsel(priv,pprevious_stats); ++ ++ // ++ // Check RSSI ++ // ++ priv->stats.num_process_phyinfo++; ++#if 0 ++ /* record the general signal strength to the sliding window. */ ++ if(slide_rssi_statistics++ >= PHY_RSSI_SLID_WIN_MAX) ++ { ++ slide_rssi_statistics = PHY_RSSI_SLID_WIN_MAX; ++ last_rssi = priv->stats.slide_signal_strength[slide_rssi_index]; ++ priv->stats.slide_rssi_total -= last_rssi; ++ } ++ priv->stats.slide_rssi_total += pprevious_stats->SignalStrength; ++ ++ priv->stats.slide_signal_strength[slide_rssi_index++] = pprevious_stats->SignalStrength; ++ if(slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX) ++ slide_rssi_index = 0; ++ ++ // <1> Showed on UI for user, in dbm ++ tmp_val = priv->stats.slide_rssi_total/slide_rssi_statistics; ++ priv->stats.signal_strength = rtl819x_translate_todbm((u8)tmp_val); ++ ++#endif ++ // <2> Showed on UI for engineering ++ // hardware does not provide rssi information for each rf path in CCK ++ if(!pprevious_stats->bIsCCK && pprevious_stats->bPacketToSelf) ++ { ++ for (rfpath = RF90_PATH_A; rfpath < RF90_PATH_C; rfpath++) ++ { ++ if (!rtl8192_phy_CheckIsLegalRFPath(priv->ieee80211->dev, rfpath)) ++ continue; ++ RT_TRACE(COMP_DBG,"Jacken -> pPreviousstats->RxMIMOSignalStrength[rfpath] = %d \n" ,pprevious_stats->RxMIMOSignalStrength[rfpath] ); ++ //Fixed by Jacken 2008-03-20 ++ if(priv->stats.rx_rssi_percentage[rfpath] == 0) ++ { ++ priv->stats.rx_rssi_percentage[rfpath] = pprevious_stats->RxMIMOSignalStrength[rfpath]; ++ //DbgPrint("MIMO RSSI initialize \n"); ++ } ++ if(pprevious_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath]) ++ { ++ priv->stats.rx_rssi_percentage[rfpath] = ++ ( (priv->stats.rx_rssi_percentage[rfpath]*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->RxMIMOSignalStrength[rfpath])) /(Rx_Smooth_Factor); ++ priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath] + 1; ++ } ++ else ++ { ++ priv->stats.rx_rssi_percentage[rfpath] = ++ ( (priv->stats.rx_rssi_percentage[rfpath]*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->RxMIMOSignalStrength[rfpath])) /(Rx_Smooth_Factor); ++ } ++ RT_TRACE(COMP_DBG,"Jacken -> priv->RxStats.RxRSSIPercentage[rfPath] = %d \n" ,priv->stats.rx_rssi_percentage[rfpath] ); ++ } ++ } ++ ++ ++ // ++ // Check PWDB. ++ // ++ //cosa add for beacon rssi smoothing by average. ++ if(pprevious_stats->bPacketBeacon) ++ { ++ /* record the beacon pwdb to the sliding window. */ ++ if(slide_beacon_adc_pwdb_statistics++ >= PHY_Beacon_RSSI_SLID_WIN_MAX) ++ { ++ slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX; ++ last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index]; ++ priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb; ++ //DbgPrint("slide_beacon_adc_pwdb_index = %d, last_beacon_adc_pwdb = %d, Adapter->RxStats.Slide_Beacon_Total = %d\n", ++ // slide_beacon_adc_pwdb_index, last_beacon_adc_pwdb, Adapter->RxStats.Slide_Beacon_Total); ++ } ++ priv->stats.Slide_Beacon_Total += pprevious_stats->RxPWDBAll; ++ priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = pprevious_stats->RxPWDBAll; ++ //DbgPrint("slide_beacon_adc_pwdb_index = %d, pPreviousRfd->Status.RxPWDBAll = %d\n", slide_beacon_adc_pwdb_index, pPreviousRfd->Status.RxPWDBAll); ++ slide_beacon_adc_pwdb_index++; ++ if(slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX) ++ slide_beacon_adc_pwdb_index = 0; ++ pprevious_stats->RxPWDBAll = priv->stats.Slide_Beacon_Total/slide_beacon_adc_pwdb_statistics; ++ if(pprevious_stats->RxPWDBAll >= 3) ++ pprevious_stats->RxPWDBAll -= 3; ++ } ++ ++ RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n", ++ pprevious_stats->bIsCCK? "CCK": "OFDM", ++ pprevious_stats->RxPWDBAll); ++ ++ if(pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA) ++ { ++ if(priv->undecorated_smoothed_pwdb < 0) // initialize ++ { ++ priv->undecorated_smoothed_pwdb = pprevious_stats->RxPWDBAll; ++ //DbgPrint("First pwdb initialize \n"); ++ } ++#if 1 ++ if(pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) ++ { ++ priv->undecorated_smoothed_pwdb = ++ ( ((priv->undecorated_smoothed_pwdb)*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->RxPWDBAll)) /(Rx_Smooth_Factor); ++ priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1; ++ } ++ else ++ { ++ priv->undecorated_smoothed_pwdb = ++ ( ((priv->undecorated_smoothed_pwdb)*(Rx_Smooth_Factor-1)) + ++ (pprevious_stats->RxPWDBAll)) /(Rx_Smooth_Factor); ++ } ++#else ++ //Fixed by Jacken 2008-03-20 ++ if(pPreviousRfd->Status.RxPWDBAll > (u32)pHalData->UndecoratedSmoothedPWDB) ++ { ++ pHalData->UndecoratedSmoothedPWDB = ++ ( ((pHalData->UndecoratedSmoothedPWDB)* 5) + (pPreviousRfd->Status.RxPWDBAll)) / 6; ++ pHalData->UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB + 1; ++ } ++ else ++ { ++ pHalData->UndecoratedSmoothedPWDB = ++ ( ((pHalData->UndecoratedSmoothedPWDB)* 5) + (pPreviousRfd->Status.RxPWDBAll)) / 6; ++ } ++#endif ++ rtl819x_update_rxsignalstatistics8190pci(priv,pprevious_stats); ++ } ++ ++ // ++ // Check EVM ++ // ++ /* record the general EVM to the sliding window. */ ++ if(pprevious_stats->SignalQuality == 0) ++ { ++ } ++ else ++ { ++ if(pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA){ ++ if(slide_evm_statistics++ >= PHY_RSSI_SLID_WIN_MAX){ ++ slide_evm_statistics = PHY_RSSI_SLID_WIN_MAX; ++ last_evm = priv->stats.slide_evm[slide_evm_index]; ++ priv->stats.slide_evm_total -= last_evm; ++ } ++ ++ priv->stats.slide_evm_total += pprevious_stats->SignalQuality; ++ ++ priv->stats.slide_evm[slide_evm_index++] = pprevious_stats->SignalQuality; ++ if(slide_evm_index >= PHY_RSSI_SLID_WIN_MAX) ++ slide_evm_index = 0; ++ ++ // <1> Showed on UI for user, in percentage. ++ tmp_val = priv->stats.slide_evm_total/slide_evm_statistics; ++ priv->stats.signal_quality = tmp_val; ++ //cosa add 10/11/2007, Showed on UI for user in Windows Vista, for Link quality. ++ priv->stats.last_signal_strength_inpercent = tmp_val; ++ } ++ ++ // <2> Showed on UI for engineering ++ if(pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA) ++ { ++ for(nspatial_stream = 0; nspatial_stream<2 ; nspatial_stream++) // 2 spatial stream ++ { ++ if(pprevious_stats->RxMIMOSignalQuality[nspatial_stream] != -1) ++ { ++ if(priv->stats.rx_evm_percentage[nspatial_stream] == 0) // initialize ++ { ++ priv->stats.rx_evm_percentage[nspatial_stream] = pprevious_stats->RxMIMOSignalQuality[nspatial_stream]; ++ } ++ priv->stats.rx_evm_percentage[nspatial_stream] = ++ ( (priv->stats.rx_evm_percentage[nspatial_stream]* (Rx_Smooth_Factor-1)) + ++ (pprevious_stats->RxMIMOSignalQuality[nspatial_stream]* 1)) / (Rx_Smooth_Factor); ++ } ++ } ++ } ++ } ++ ++} ++ ++/*----------------------------------------------------------------------------- ++ * Function: rtl819x_query_rxpwrpercentage() ++ * ++ * Overview: ++ * ++ * Input: char antpower ++ * ++ * Output: NONE ++ * ++ * Return: 0-100 percentage ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/26/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static u8 rtl819x_query_rxpwrpercentage( ++ char antpower ++ ) ++{ ++ if ((antpower <= -100) || (antpower >= 20)) ++ { ++ return 0; ++ } ++ else if (antpower >= 0) ++ { ++ return 100; ++ } ++ else ++ { ++ return (100+antpower); ++ } ++ ++} /* QueryRxPwrPercentage */ ++ ++static u8 ++rtl819x_evm_dbtopercentage( ++ char value ++ ) ++{ ++ char ret_val; ++ ++ ret_val = value; ++ ++ if(ret_val >= 0) ++ ret_val = 0; ++ if(ret_val <= -33) ++ ret_val = -33; ++ ret_val = 0 - ret_val; ++ ret_val*=3; ++ if(ret_val == 99) ++ ret_val = 100; ++ return(ret_val); ++} ++ ++// ++// Description: ++// We want good-looking for signal strength/quality ++// 2007/7/19 01:09, by cosa. ++// ++static long rtl819x_signal_scale_mapping(long currsig) ++{ ++ long retsig; ++ ++ // Step 1. Scale mapping. ++ if(currsig >= 61 && currsig <= 100) ++ { ++ retsig = 90 + ((currsig - 60) / 4); ++ } ++ else if(currsig >= 41 && currsig <= 60) ++ { ++ retsig = 78 + ((currsig - 40) / 2); ++ } ++ else if(currsig >= 31 && currsig <= 40) ++ { ++ retsig = 66 + (currsig - 30); ++ } ++ else if(currsig >= 21 && currsig <= 30) ++ { ++ retsig = 54 + (currsig - 20); ++ } ++ else if(currsig >= 5 && currsig <= 20) ++ { ++ retsig = 42 + (((currsig - 5) * 2) / 3); ++ } ++ else if(currsig == 4) ++ { ++ retsig = 36; ++ } ++ else if(currsig == 3) ++ { ++ retsig = 27; ++ } ++ else if(currsig == 2) ++ { ++ retsig = 18; ++ } ++ else if(currsig == 1) ++ { ++ retsig = 9; ++ } ++ else ++ { ++ retsig = currsig; ++ } ++ ++ return retsig; ++} ++ ++static void rtl8192_query_rxphystatus( ++ struct r8192_priv * priv, ++ struct ieee80211_rx_stats * pstats, ++ prx_desc_819x_pci pdesc, ++ prx_fwinfo_819x_pci pdrvinfo, ++ struct ieee80211_rx_stats * precord_stats, ++ bool bpacket_match_bssid, ++ bool bpacket_toself, ++ bool bPacketBeacon, ++ bool bToSelfBA ++ ) ++{ ++ //PRT_RFD_STATUS pRtRfdStatus = &(pRfd->Status); ++ phy_sts_ofdm_819xpci_t* pofdm_buf; ++ phy_sts_cck_819xpci_t * pcck_buf; ++ phy_ofdm_rx_status_rxsc_sgien_exintfflag* prxsc; ++ u8 *prxpkt; ++ u8 i,max_spatial_stream, tmp_rxsnr, tmp_rxevm, rxsc_sgien_exflg; ++ char rx_pwr[4], rx_pwr_all=0; ++ //long rx_avg_pwr = 0; ++ char rx_snrX, rx_evmX; ++ u8 evm, pwdb_all; ++ u32 RSSI, total_rssi=0;//, total_evm=0; ++// long signal_strength_index = 0; ++ u8 is_cck_rate=0; ++ u8 rf_rx_num = 0; ++ ++ /* 2007/07/04 MH For OFDM RSSI. For high power or not. */ ++ static u8 check_reg824 = 0; ++ static u32 reg824_bit9 = 0; ++ ++ priv->stats.numqry_phystatus++; ++ ++ is_cck_rate = rx_hal_is_cck_rate(pdrvinfo); ++ ++ // Record it for next packet processing ++ memset(precord_stats, 0, sizeof(struct ieee80211_rx_stats)); ++ pstats->bPacketMatchBSSID = precord_stats->bPacketMatchBSSID = bpacket_match_bssid; ++ pstats->bPacketToSelf = precord_stats->bPacketToSelf = bpacket_toself; ++ pstats->bIsCCK = precord_stats->bIsCCK = is_cck_rate;//RX_HAL_IS_CCK_RATE(pDrvInfo); ++ pstats->bPacketBeacon = precord_stats->bPacketBeacon = bPacketBeacon; ++ pstats->bToSelfBA = precord_stats->bToSelfBA = bToSelfBA; ++ /*2007.08.30 requested by SD3 Jerry */ ++ if(check_reg824 == 0) ++ { ++ reg824_bit9 = rtl8192_QueryBBReg(priv->ieee80211->dev, rFPGA0_XA_HSSIParameter2, 0x200); ++ check_reg824 = 1; ++ } ++ ++ ++ prxpkt = (u8*)pdrvinfo; ++ ++ /* Move pointer to the 16th bytes. Phy status start address. */ ++ prxpkt += sizeof(rx_fwinfo_819x_pci); ++ ++ /* Initial the cck and ofdm buffer pointer */ ++ pcck_buf = (phy_sts_cck_819xpci_t *)prxpkt; ++ pofdm_buf = (phy_sts_ofdm_819xpci_t *)prxpkt; ++ ++ pstats->RxMIMOSignalQuality[0] = -1; ++ pstats->RxMIMOSignalQuality[1] = -1; ++ precord_stats->RxMIMOSignalQuality[0] = -1; ++ precord_stats->RxMIMOSignalQuality[1] = -1; ++ ++ if(is_cck_rate) ++ { ++ // ++ // (1)Hardware does not provide RSSI for CCK ++ // ++ ++ // ++ // (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) ++ // ++ u8 report;//, cck_agc_rpt; ++#ifdef RTL8190P ++ u8 tmp_pwdb; ++ char cck_adc_pwdb[4]; ++#endif ++ priv->stats.numqry_phystatusCCK++; ++ ++#ifdef RTL8190P //Only 90P 2T4R need to check ++ if(priv->rf_type == RF_2T4R && DM_RxPathSelTable.Enable && bpacket_match_bssid) ++ { ++ for(i=RF90_PATH_A; iadc_pwdb_X[i]; ++ cck_adc_pwdb[i] = (char)tmp_pwdb; ++ cck_adc_pwdb[i] /= 2; ++ pstats->cck_adc_pwdb[i] = precord_stats->cck_adc_pwdb[i] = cck_adc_pwdb[i]; ++ //DbgPrint("RF-%d tmp_pwdb = 0x%x, cck_adc_pwdb = %d", i, tmp_pwdb, cck_adc_pwdb[i]); ++ } ++ } ++#endif ++ ++ if(!reg824_bit9) ++ { ++ report = pcck_buf->cck_agc_rpt & 0xc0; ++ report = report>>6; ++ switch(report) ++ { ++ //Fixed by Jacken from Bryant 2008-03-20 ++ //Original value is -38 , -26 , -14 , -2 ++ //Fixed value is -35 , -23 , -11 , 6 ++ case 0x3: ++ rx_pwr_all = -35 - (pcck_buf->cck_agc_rpt & 0x3e); ++ break; ++ case 0x2: ++ rx_pwr_all = -23 - (pcck_buf->cck_agc_rpt & 0x3e); ++ break; ++ case 0x1: ++ rx_pwr_all = -11 - (pcck_buf->cck_agc_rpt & 0x3e); ++ break; ++ case 0x0: ++ rx_pwr_all = 8 - (pcck_buf->cck_agc_rpt & 0x3e); ++ break; ++ } ++ } ++ else ++ { ++ report = pcck_buf->cck_agc_rpt & 0x60; ++ report = report>>5; ++ switch(report) ++ { ++ case 0x3: ++ rx_pwr_all = -35 - ((pcck_buf->cck_agc_rpt & 0x1f)<<1) ; ++ break; ++ case 0x2: ++ rx_pwr_all = -23 - ((pcck_buf->cck_agc_rpt & 0x1f)<<1); ++ break; ++ case 0x1: ++ rx_pwr_all = -11 - ((pcck_buf->cck_agc_rpt & 0x1f)<<1) ; ++ break; ++ case 0x0: ++ rx_pwr_all = -8 - ((pcck_buf->cck_agc_rpt & 0x1f)<<1) ; ++ break; ++ } ++ } ++ ++ pwdb_all = rtl819x_query_rxpwrpercentage(rx_pwr_all); ++ pstats->RxPWDBAll = precord_stats->RxPWDBAll = pwdb_all; ++ pstats->RecvSignalPower = rx_pwr_all; ++ ++ // ++ // (3) Get Signal Quality (EVM) ++ // ++ if(bpacket_match_bssid) ++ { ++ u8 sq; ++ ++ if(pstats->RxPWDBAll > 40) ++ { ++ sq = 100; ++ }else ++ { ++ sq = pcck_buf->sq_rpt; ++ ++ if(pcck_buf->sq_rpt > 64) ++ sq = 0; ++ else if (pcck_buf->sq_rpt < 20) ++ sq = 100; ++ else ++ sq = ((64-sq) * 100) / 44; ++ } ++ pstats->SignalQuality = precord_stats->SignalQuality = sq; ++ pstats->RxMIMOSignalQuality[0] = precord_stats->RxMIMOSignalQuality[0] = sq; ++ pstats->RxMIMOSignalQuality[1] = precord_stats->RxMIMOSignalQuality[1] = -1; ++ } ++ } ++ else ++ { ++ priv->stats.numqry_phystatusHT++; ++ // ++ // (1)Get RSSI for HT rate ++ // ++ for(i=RF90_PATH_A; ibrfpath_rxenable[i]) ++ rf_rx_num++; ++ //else ++ //continue; ++ ++ //Fixed by Jacken from Bryant 2008-03-20 ++ //Original value is 106 ++#ifdef RTL8190P //Modify by Jacken 2008/03/31 ++ rx_pwr[i] = ((pofdm_buf->trsw_gain_X[i]&0x3F)*2) - 106; ++#else ++ rx_pwr[i] = ((pofdm_buf->trsw_gain_X[i]&0x3F)*2) - 110; ++#endif ++ ++ //Get Rx snr value in DB ++ tmp_rxsnr = pofdm_buf->rxsnr_X[i]; ++ rx_snrX = (char)(tmp_rxsnr); ++ rx_snrX /= 2; ++ priv->stats.rxSNRdB[i] = (long)rx_snrX; ++ ++ /* Translate DBM to percentage. */ ++ RSSI = rtl819x_query_rxpwrpercentage(rx_pwr[i]); ++ if (priv->brfpath_rxenable[i]) ++ total_rssi += RSSI; ++ ++ /* Record Signal Strength for next packet */ ++ if(bpacket_match_bssid) ++ { ++ pstats->RxMIMOSignalStrength[i] =(u8) RSSI; ++ precord_stats->RxMIMOSignalStrength[i] =(u8) RSSI; ++ } ++ } ++ ++ ++ // ++ // (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) ++ // ++ //Fixed by Jacken from Bryant 2008-03-20 ++ //Original value is 106 ++ rx_pwr_all = (((pofdm_buf->pwdb_all ) >> 1 )& 0x7f) -106; ++ pwdb_all = rtl819x_query_rxpwrpercentage(rx_pwr_all); ++ ++ pstats->RxPWDBAll = precord_stats->RxPWDBAll = pwdb_all; ++ pstats->RxPower = precord_stats->RxPower = rx_pwr_all; ++ pstats->RecvSignalPower = rx_pwr_all; ++ // ++ // (3)EVM of HT rate ++ // ++ if(pdrvinfo->RxHT && pdrvinfo->RxRate>=DESC90_RATEMCS8 && ++ pdrvinfo->RxRate<=DESC90_RATEMCS15) ++ max_spatial_stream = 2; //both spatial stream make sense ++ else ++ max_spatial_stream = 1; //only spatial stream 1 makes sense ++ ++ for(i=0; irxevm_X[i]; ++ rx_evmX = (char)(tmp_rxevm); ++ ++ // Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment ++ // fill most significant bit to "zero" when doing shifting operation which may change a negative ++ // value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. ++ rx_evmX /= 2; //dbm ++ ++ evm = rtl819x_evm_dbtopercentage(rx_evmX); ++#if 0 ++ EVM = SignalScaleMapping(EVM);//make it good looking, from 0~100 ++#endif ++ if(bpacket_match_bssid) ++ { ++ if(i==0) // Fill value in RFD, Get the first spatial stream only ++ pstats->SignalQuality = precord_stats->SignalQuality = (u8)(evm & 0xff); ++ pstats->RxMIMOSignalQuality[i] = precord_stats->RxMIMOSignalQuality[i] = (u8)(evm & 0xff); ++ } ++ } ++ ++ ++ /* record rx statistics for debug */ ++ rxsc_sgien_exflg = pofdm_buf->rxsc_sgien_exflg; ++ prxsc = (phy_ofdm_rx_status_rxsc_sgien_exintfflag *)&rxsc_sgien_exflg; ++ if(pdrvinfo->BW) //40M channel ++ priv->stats.received_bwtype[1+prxsc->rxsc]++; ++ else //20M channel ++ priv->stats.received_bwtype[0]++; ++ } ++ ++ //UI BSS List signal strength(in percentage), make it good looking, from 0~100. ++ //It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). ++ if(is_cck_rate) ++ { ++ pstats->SignalStrength = precord_stats->SignalStrength = (u8)(rtl819x_signal_scale_mapping((long)pwdb_all));//PWDB_ALL; ++ ++ } ++ else ++ { ++ //pRfd->Status.SignalStrength = pRecordRfd->Status.SignalStrength = (u1Byte)(SignalScaleMapping(total_rssi/=RF90_PATH_MAX));//(u1Byte)(total_rssi/=RF90_PATH_MAX); ++ // We can judge RX path number now. ++ if (rf_rx_num != 0) ++ pstats->SignalStrength = precord_stats->SignalStrength = (u8)(rtl819x_signal_scale_mapping((long)(total_rssi/=rf_rx_num))); ++ } ++} /* QueryRxPhyStatus8190Pci */ ++ ++static void ++rtl8192_record_rxdesc_forlateruse( ++ struct ieee80211_rx_stats * psrc_stats, ++ struct ieee80211_rx_stats * ptarget_stats ++) ++{ ++ ptarget_stats->bIsAMPDU = psrc_stats->bIsAMPDU; ++ ptarget_stats->bFirstMPDU = psrc_stats->bFirstMPDU; ++ //ptarget_stats->Seq_Num = psrc_stats->Seq_Num; ++} ++ ++ ++ ++static void TranslateRxSignalStuff819xpci(struct net_device *dev, ++ struct sk_buff *skb, ++ struct ieee80211_rx_stats * pstats, ++ prx_desc_819x_pci pdesc, ++ prx_fwinfo_819x_pci pdrvinfo) ++{ ++ // TODO: We must only check packet for current MAC address. Not finish ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ bool bpacket_match_bssid, bpacket_toself; ++ bool bPacketBeacon=false, bToSelfBA=false; ++ static struct ieee80211_rx_stats previous_stats; ++ struct ieee80211_hdr_3addr *hdr; ++ u16 fc,type; ++ ++ // Get Signal Quality for only RX data queue (but not command queue) ++ ++ u8* tmp_buf; ++ u8 *praddr; ++ ++ /* Get MAC frame start address. */ ++ tmp_buf = skb->data; ++ ++ hdr = (struct ieee80211_hdr_3addr *)tmp_buf; ++ fc = le16_to_cpu(hdr->frame_ctl); ++ type = WLAN_FC_GET_TYPE(fc); ++ praddr = hdr->addr1; ++ ++ /* Check if the received packet is acceptabe. */ ++ bpacket_match_bssid = ((IEEE80211_FTYPE_CTL != type) && ++ (eqMacAddr(priv->ieee80211->current_network.bssid, (fc & IEEE80211_FCTL_TODS)? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS )? hdr->addr2 : hdr->addr3)) ++ && (!pstats->bHwError) && (!pstats->bCRC)&& (!pstats->bICV)); ++ bpacket_toself = bpacket_match_bssid & (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr)); ++#if 1//cosa ++ if(WLAN_FC_GET_FRAMETYPE(fc)== IEEE80211_STYPE_BEACON) ++ { ++ bPacketBeacon = true; ++ //DbgPrint("Beacon 2, MatchBSSID = %d, ToSelf = %d \n", bPacketMatchBSSID, bPacketToSelf); ++ } ++ if(WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BLOCKACK) ++ { ++ if((eqMacAddr(praddr,dev->dev_addr))) ++ bToSelfBA = true; ++ //DbgPrint("BlockAck, MatchBSSID = %d, ToSelf = %d \n", bPacketMatchBSSID, bPacketToSelf); ++ } ++ ++#endif ++ if(bpacket_match_bssid) ++ { ++ priv->stats.numpacket_matchbssid++; ++ } ++ if(bpacket_toself){ ++ priv->stats.numpacket_toself++; ++ } ++ // ++ // Process PHY information for previous packet (RSSI/PWDB/EVM) ++ // ++ // Because phy information is contained in the last packet of AMPDU only, so driver ++ // should process phy information of previous packet ++ rtl8192_process_phyinfo(priv, tmp_buf,&previous_stats, pstats); ++ rtl8192_query_rxphystatus(priv, pstats, pdesc, pdrvinfo, &previous_stats, bpacket_match_bssid, ++ bpacket_toself ,bPacketBeacon, bToSelfBA); ++ rtl8192_record_rxdesc_forlateruse(pstats, &previous_stats); ++ ++} ++ ++ ++static void rtl8192_tx_resume(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct ieee80211_device *ieee = priv->ieee80211; ++ struct sk_buff *skb; ++ int queue_index; ++ ++ for(queue_index = BK_QUEUE; queue_index < TXCMD_QUEUE;queue_index++) { ++ while((!skb_queue_empty(&ieee->skb_waitQ[queue_index]))&& ++ (priv->ieee80211->check_nic_enough_desc(dev,queue_index) > 0)) { ++ /* 1. dequeue the packet from the wait queue */ ++ skb = skb_dequeue(&ieee->skb_waitQ[queue_index]); ++ /* 2. tx the packet directly */ ++ ieee->softmac_data_hard_start_xmit(skb,dev,0/* rate useless now*/); ++ #if 0 ++ if(queue_index!=MGNT_QUEUE) { ++ ieee->stats.tx_packets++; ++ ieee->stats.tx_bytes += skb->len; ++ } ++ #endif ++ } ++ } ++} ++ ++void rtl8192_irq_tx_tasklet(struct r8192_priv *priv) ++{ ++ rtl8192_tx_resume(priv->ieee80211->dev); ++} ++ ++/** ++* Function: UpdateReceivedRateHistogramStatistics ++* Overview: Recored down the received data rate ++* ++* Input: ++* PADAPTER Adapter ++* PRT_RFD pRfd, ++* ++* Output: ++* PRT_TCB Adapter ++* (Adapter->RxStats.ReceivedRateHistogram[] is updated) ++* Return: ++* None ++*/ ++static void UpdateReceivedRateHistogramStatistics8190( ++ struct net_device *dev, ++ struct ieee80211_rx_stats* pstats ++ ) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ u32 rcvType=1; //0: Total, 1:OK, 2:CRC, 3:ICV ++ u32 rateIndex; ++ u32 preamble_guardinterval; //1: short preamble/GI, 0: long preamble/GI ++ ++ /* 2007/03/09 MH We will not update rate of packet from rx cmd queue. */ ++ #if 0 ++ if (pRfd->queue_id == CMPK_RX_QUEUE_ID) ++ return; ++ #endif ++ if(pstats->bCRC) ++ rcvType = 2; ++ else if(pstats->bICV) ++ rcvType = 3; ++ ++ if(pstats->bShortPreamble) ++ preamble_guardinterval = 1;// short ++ else ++ preamble_guardinterval = 0;// long ++ ++ switch(pstats->rate) ++ { ++ // ++ // CCK rate ++ // ++ case MGN_1M: rateIndex = 0; break; ++ case MGN_2M: rateIndex = 1; break; ++ case MGN_5_5M: rateIndex = 2; break; ++ case MGN_11M: rateIndex = 3; break; ++ // ++ // Legacy OFDM rate ++ // ++ case MGN_6M: rateIndex = 4; break; ++ case MGN_9M: rateIndex = 5; break; ++ case MGN_12M: rateIndex = 6; break; ++ case MGN_18M: rateIndex = 7; break; ++ case MGN_24M: rateIndex = 8; break; ++ case MGN_36M: rateIndex = 9; break; ++ case MGN_48M: rateIndex = 10; break; ++ case MGN_54M: rateIndex = 11; break; ++ // ++ // 11n High throughput rate ++ // ++ case MGN_MCS0: rateIndex = 12; break; ++ case MGN_MCS1: rateIndex = 13; break; ++ case MGN_MCS2: rateIndex = 14; break; ++ case MGN_MCS3: rateIndex = 15; break; ++ case MGN_MCS4: rateIndex = 16; break; ++ case MGN_MCS5: rateIndex = 17; break; ++ case MGN_MCS6: rateIndex = 18; break; ++ case MGN_MCS7: rateIndex = 19; break; ++ case MGN_MCS8: rateIndex = 20; break; ++ case MGN_MCS9: rateIndex = 21; break; ++ case MGN_MCS10: rateIndex = 22; break; ++ case MGN_MCS11: rateIndex = 23; break; ++ case MGN_MCS12: rateIndex = 24; break; ++ case MGN_MCS13: rateIndex = 25; break; ++ case MGN_MCS14: rateIndex = 26; break; ++ case MGN_MCS15: rateIndex = 27; break; ++ default: rateIndex = 28; break; ++ } ++ priv->stats.received_preamble_GI[preamble_guardinterval][rateIndex]++; ++ priv->stats.received_rate_histogram[0][rateIndex]++; //total ++ priv->stats.received_rate_histogram[rcvType][rateIndex]++; ++} ++ ++static void rtl8192_rx(struct net_device *dev) ++{ ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct ieee80211_hdr_1addr *ieee80211_hdr = NULL; ++ bool unicast_packet = false; ++ struct ieee80211_rx_stats stats = { ++ .signal = 0, ++ .noise = -98, ++ .rate = 0, ++ .freq = IEEE80211_24GHZ_BAND, ++ }; ++ unsigned int count = priv->rxringcount; ++ ++ stats.nic_type = NIC_8192E; ++ ++ while (count--) { ++ rx_desc_819x_pci *pdesc = &priv->rx_ring[priv->rx_idx];//rx descriptor ++ struct sk_buff *skb = priv->rx_buf[priv->rx_idx];//rx pkt ++ ++ if (pdesc->OWN){ ++ /* wait data to be filled by hardware */ ++ return; ++ } else { ++ stats.bICV = pdesc->ICV; ++ stats.bCRC = pdesc->CRC32; ++ stats.bHwError = pdesc->CRC32 | pdesc->ICV; ++ ++ stats.Length = pdesc->Length; ++ if(stats.Length < 24) ++ stats.bHwError |= 1; ++ ++ if(stats.bHwError) { ++ stats.bShift = false; ++ ++ if(pdesc->CRC32) { ++ if (pdesc->Length <500) ++ priv->stats.rxcrcerrmin++; ++ else if (pdesc->Length >1000) ++ priv->stats.rxcrcerrmax++; ++ else ++ priv->stats.rxcrcerrmid++; ++ } ++ goto done; ++ } else { ++ prx_fwinfo_819x_pci pDrvInfo = NULL; ++ struct sk_buff *new_skb = dev_alloc_skb(priv->rxbuffersize); ++ ++ if (unlikely(!new_skb)) { ++ goto done; ++ } ++ ++ stats.RxDrvInfoSize = pdesc->RxDrvInfoSize; ++ stats.RxBufShift = ((pdesc->Shift)&0x03); ++ stats.Decrypted = !pdesc->SWDec; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ pci_dma_sync_single_for_cpu(priv->pdev, ++#else ++ pci_unmap_single(priv->pdev, ++#endif ++ *((dma_addr_t *)skb->cb), ++ priv->rxbuffersize, ++ PCI_DMA_FROMDEVICE); ++ skb_put(skb, pdesc->Length); ++ pDrvInfo = (rx_fwinfo_819x_pci *)(skb->data + stats.RxBufShift); ++ skb_reserve(skb, stats.RxDrvInfoSize + stats.RxBufShift); ++ ++ stats.rate = HwRateToMRate90((bool)pDrvInfo->RxHT, (u8)pDrvInfo->RxRate); ++ stats.bShortPreamble = pDrvInfo->SPLCP; ++ ++ /* it is debug only. It should be disabled in released driver. ++ * 2007.1.11 by Emily ++ * */ ++ UpdateReceivedRateHistogramStatistics8190(dev, &stats); ++ ++ stats.bIsAMPDU = (pDrvInfo->PartAggr==1); ++ stats.bFirstMPDU = (pDrvInfo->PartAggr==1) && (pDrvInfo->FirstAGGR==1); ++ ++ stats.TimeStampLow = pDrvInfo->TSFL; ++ stats.TimeStampHigh = read_nic_dword(dev, TSFR+4); ++ ++ UpdateRxPktTimeStamp8190(dev, &stats); ++ ++ // ++ // Get Total offset of MPDU Frame Body ++ // ++ if((stats.RxBufShift + stats.RxDrvInfoSize) > 0) ++ stats.bShift = 1; ++ ++ stats.RxIs40MHzPacket = pDrvInfo->BW; ++ ++ /* ???? */ ++ TranslateRxSignalStuff819xpci(dev,skb, &stats, pdesc, pDrvInfo); ++ ++ /* Rx A-MPDU */ ++ if(pDrvInfo->FirstAGGR==1 || pDrvInfo->PartAggr == 1) ++ RT_TRACE(COMP_RXDESC, "pDrvInfo->FirstAGGR = %d, pDrvInfo->PartAggr = %d\n", ++ pDrvInfo->FirstAGGR, pDrvInfo->PartAggr); ++ skb_trim(skb, skb->len - 4/*sCrcLng*/); ++ /* rx packets statistics */ ++ ieee80211_hdr = (struct ieee80211_hdr_1addr *)skb->data; ++ unicast_packet = false; ++ ++ if(is_broadcast_ether_addr(ieee80211_hdr->addr1)) { ++ //TODO ++ }else if(is_multicast_ether_addr(ieee80211_hdr->addr1)){ ++ //TODO ++ }else { ++ /* unicast packet */ ++ unicast_packet = true; ++ } ++ ++ stats.packetlength = stats.Length-4; ++ stats.fraglength = stats.packetlength; ++ stats.fragoffset = 0; ++ stats.ntotalfrag = 1; ++ ++ if(!ieee80211_rx(priv->ieee80211, skb, &stats)){ ++ dev_kfree_skb_any(skb); ++ } else { ++ priv->stats.rxok++; ++ if(unicast_packet) { ++ priv->stats.rxbytesunicast += skb->len; ++ } ++ } ++ ++ skb = new_skb; ++ priv->rx_buf[priv->rx_idx] = skb; ++ *((dma_addr_t *) skb->cb) = pci_map_single(priv->pdev, skb->tail, priv->rxbuffersize, PCI_DMA_FROMDEVICE); ++// *((dma_addr_t *) skb->cb) = pci_map_single(priv->pdev, skb_tail_pointer(skb), priv->rxbuffersize, PCI_DMA_FROMDEVICE); ++ } ++ ++ } ++done: ++ pdesc->BufferAddress = cpu_to_le32(*((dma_addr_t *)skb->cb)); ++ pdesc->OWN = 1; ++ pdesc->Length = priv->rxbuffersize; ++ if (priv->rx_idx == priv->rxringcount-1) ++ pdesc->EOR = 1; ++ priv->rx_idx = (priv->rx_idx + 1) % priv->rxringcount; ++ } ++ ++} ++ ++void rtl8192_irq_rx_tasklet(struct r8192_priv *priv) ++{ ++ rtl8192_rx(priv->ieee80211->dev); ++ /* unmask RDU */ ++ write_nic_dword(priv->ieee80211->dev, INTA_MASK,read_nic_dword(priv->ieee80211->dev, INTA_MASK) | IMR_RDU); ++} ++ ++static const struct net_device_ops rtl8192_netdev_ops = { ++ .ndo_open = rtl8192_open, ++ .ndo_stop = rtl8192_close, ++/* .ndo_get_stats = rtl8192_stats, */ ++ .ndo_tx_timeout = tx_timeout, ++ .ndo_do_ioctl = rtl8192_ioctl, ++ .ndo_set_multicast_list = r8192_set_multicast, ++ .ndo_set_mac_address = r8192_set_mac_adr, ++ .ndo_start_xmit = ieee80211_xmit, ++}; ++ ++/**************************************************************************** ++ ---------------------------- PCI_STUFF--------------------------- ++*****************************************************************************/ ++ ++static int __devinit rtl8192_pci_probe(struct pci_dev *pdev, ++ const struct pci_device_id *id) ++{ ++ unsigned long ioaddr = 0; ++ struct net_device *dev = NULL; ++ struct r8192_priv *priv= NULL; ++ u8 unit = 0; ++ ++#ifdef CONFIG_RTL8192_IO_MAP ++ unsigned long pio_start, pio_len, pio_flags; ++#else ++ unsigned long pmem_start, pmem_len, pmem_flags; ++#endif //end #ifdef RTL_IO_MAP ++ ++ RT_TRACE(COMP_INIT,"Configuring chip resources"); ++ ++ if( pci_enable_device (pdev) ){ ++ RT_TRACE(COMP_ERR,"Failed to enable PCI device"); ++ return -EIO; ++ } ++ ++ pci_set_master(pdev); ++ //pci_set_wmi(pdev); ++ pci_set_dma_mask(pdev, 0xffffff00ULL); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ pci_set_consistent_dma_mask(pdev,0xffffff00ULL); ++#endif ++ dev = alloc_ieee80211(sizeof(struct r8192_priv)); ++ if (!dev) ++ return -ENOMEM; ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ++ SET_MODULE_OWNER(dev); ++#endif ++ ++ pci_set_drvdata(pdev, dev); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ SET_NETDEV_DEV(dev, &pdev->dev); ++#endif ++ priv = ieee80211_priv(dev); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ priv->ieee80211 = netdev_priv(dev); ++#else ++ priv->ieee80211 = (struct ieee80211_device *)dev->priv; ++#endif ++ priv->pdev=pdev; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ if((pdev->subsystem_vendor == PCI_VENDOR_ID_DLINK)&&(pdev->subsystem_device == 0x3304)){ ++ priv->ieee80211->bSupportRemoteWakeUp = 1; ++ } else ++#endif ++ { ++ priv->ieee80211->bSupportRemoteWakeUp = 0; ++ } ++ ++#ifdef CONFIG_RTL8192_IO_MAP ++ ++ pio_start = (unsigned long)pci_resource_start (pdev, 0); ++ pio_len = (unsigned long)pci_resource_len (pdev, 0); ++ pio_flags = (unsigned long)pci_resource_flags (pdev, 0); ++ ++ if (!(pio_flags & IORESOURCE_IO)) { ++ RT_TRACE(COMP_ERR,"region #0 not a PIO resource, aborting"); ++ goto fail; ++ } ++ ++ //DMESG("IO space @ 0x%08lx", pio_start ); ++ if( ! request_region( pio_start, pio_len, RTL819xE_MODULE_NAME ) ){ ++ RT_TRACE(COMP_ERR,"request_region failed!"); ++ goto fail; ++ } ++ ++ ioaddr = pio_start; ++ dev->base_addr = ioaddr; // device I/O address ++ ++#else ++ ++ pmem_start = pci_resource_start(pdev, 1); ++ pmem_len = pci_resource_len(pdev, 1); ++ pmem_flags = pci_resource_flags (pdev, 1); ++ ++ if (!(pmem_flags & IORESOURCE_MEM)) { ++ RT_TRACE(COMP_ERR,"region #1 not a MMIO resource, aborting"); ++ goto fail; ++ } ++ ++ //DMESG("Memory mapped space @ 0x%08lx ", pmem_start); ++ if( ! request_mem_region(pmem_start, pmem_len, RTL819xE_MODULE_NAME)) { ++ RT_TRACE(COMP_ERR,"request_mem_region failed!"); ++ goto fail; ++ } ++ ++ ++ ioaddr = (unsigned long)ioremap_nocache( pmem_start, pmem_len); ++ if( ioaddr == (unsigned long)NULL ){ ++ RT_TRACE(COMP_ERR,"ioremap failed!"); ++ // release_mem_region( pmem_start, pmem_len ); ++ goto fail1; ++ } ++ ++ dev->mem_start = ioaddr; // shared mem start ++ dev->mem_end = ioaddr + pci_resource_len(pdev, 0); // shared mem end ++ ++#endif //end #ifdef RTL_IO_MAP ++ ++ /* 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); ++ ++ ++ pci_read_config_byte(pdev, 0x05, &unit); ++ pci_write_config_byte(pdev, 0x05, unit & (~0x04)); ++ ++ dev->irq = pdev->irq; ++ priv->irq = 0; ++ ++ dev->netdev_ops = &rtl8192_netdev_ops; ++#if 0 ++ dev->open = rtl8192_open; ++ dev->stop = rtl8192_close; ++ //dev->hard_start_xmit = rtl8192_8023_hard_start_xmit; ++ dev->tx_timeout = tx_timeout; ++ //dev->wireless_handlers = &r8192_wx_handlers_def; ++ dev->do_ioctl = rtl8192_ioctl; ++ dev->set_multicast_list = r8192_set_multicast; ++ dev->set_mac_address = r8192_set_mac_adr; ++#endif ++ ++ //DMESG("Oops: i'm coming\n"); ++#if WIRELESS_EXT >= 12 ++#if WIRELESS_EXT < 17 ++ dev->get_wireless_stats = r8192_get_wireless_stats; ++#endif ++ dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def; ++#endif ++ //dev->get_wireless_stats = r8192_get_wireless_stats; ++ dev->type=ARPHRD_ETHER; ++ ++ dev->watchdog_timeo = HZ*3; //modified by john, 0805 ++ ++ if (dev_alloc_name(dev, ifname) < 0){ ++ RT_TRACE(COMP_INIT, "Oops: devname already taken! Trying wlan%%d...\n"); ++ ifname = "wlan%d"; ++ dev_alloc_name(dev, ifname); ++ } ++ ++ RT_TRACE(COMP_INIT, "Driver probe completed1\n"); ++ if(rtl8192_init(dev)!=0){ ++ RT_TRACE(COMP_ERR, "Initialization failed"); ++ goto fail; ++ } ++ ++ netif_carrier_off(dev); ++ netif_stop_queue(dev); ++ ++ register_netdev(dev); ++ RT_TRACE(COMP_INIT, "dev name=======> %s\n",dev->name); ++ rtl8192_proc_init_one(dev); ++ ++ ++ RT_TRACE(COMP_INIT, "Driver probe completed\n"); ++//#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++// return dev; ++//#else ++ return 0; ++//#endif ++ ++fail1: ++ ++#ifdef CONFIG_RTL8180_IO_MAP ++ ++ if( dev->base_addr != 0 ){ ++ ++ release_region(dev->base_addr, ++ pci_resource_len(pdev, 0) ); ++ } ++#else ++ if( dev->mem_start != (unsigned long)NULL ){ ++ iounmap( (void *)dev->mem_start ); ++ release_mem_region( pci_resource_start(pdev, 1), ++ pci_resource_len(pdev, 1) ); ++ } ++#endif //end #ifdef RTL_IO_MAP ++ ++fail: ++ if(dev){ ++ ++ if (priv->irq) { ++ free_irq(dev->irq, dev); ++ dev->irq=0; ++ } ++ free_ieee80211(dev); ++ } ++ ++ pci_disable_device(pdev); ++ ++ DMESG("wlan driver load failed\n"); ++ pci_set_drvdata(pdev, NULL); ++ return -ENODEV; ++ ++} ++ ++/* detach all the work and timer structure declared or inititialized ++ * in r8192_init function. ++ * */ ++void rtl8192_cancel_deferred_work(struct r8192_priv* priv) ++{ ++ /* call cancel_work_sync instead of cancel_delayed_work if and only if Linux_version_code ++ * is or is newer than 2.6.20 and work structure is defined to be struct work_struct. ++ * Otherwise call cancel_delayed_work is enough. ++ * FIXME (2.6.20 shoud 2.6.22, work_struct shoud not cancel) ++ * */ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&priv->watch_dog_wq); ++ cancel_delayed_work(&priv->update_beacon_wq); ++ cancel_delayed_work(&priv->ieee80211->hw_wakeup_wq); ++ cancel_delayed_work(&priv->ieee80211->hw_sleep_wq); ++#ifdef RTL8192E ++ cancel_delayed_work(&priv->gpio_change_rf_wq); ++#endif ++#endif ++#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,22) ++ cancel_work_sync(&priv->reset_wq); ++ cancel_work_sync(&priv->qos_activate); ++ //cancel_work_sync(&priv->SetBWModeWorkItem); ++ //cancel_work_sync(&priv->SwChnlWorkItem); ++#else ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&priv->reset_wq); ++ cancel_delayed_work(&priv->qos_activate); ++ //cancel_delayed_work(&priv->SetBWModeWorkItem); ++ //cancel_delayed_work(&priv->SwChnlWorkItem); ++#endif ++#endif ++ ++} ++ ++ ++static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev) ++{ ++ struct net_device *dev = pci_get_drvdata(pdev); ++ struct r8192_priv *priv ; ++ ++ if(dev){ ++ ++ unregister_netdev(dev); ++ ++ priv=ieee80211_priv(dev); ++ ++ rtl8192_proc_remove_one(dev); ++ ++ rtl8192_down(dev); ++ if (priv->pFirmware) ++ { ++ vfree(priv->pFirmware); ++ priv->pFirmware = NULL; ++ } ++ // priv->rf_close(dev); ++ // rtl8192_usb_deleteendpoints(dev); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ destroy_workqueue(priv->priv_wq); ++#endif ++ /* redundant with rtl8192_down */ ++ // rtl8192_irq_disable(dev); ++ // rtl8192_reset(dev); ++ // mdelay(10); ++ { ++ u32 i; ++ /* free tx/rx rings */ ++ rtl8192_free_rx_ring(dev); ++ for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) { ++ rtl8192_free_tx_ring(dev, i); ++ } ++ } ++ if(priv->irq){ ++ ++ printk("Freeing irq %d\n",dev->irq); ++ free_irq(dev->irq, dev); ++ priv->irq=0; ++ ++ } ++ ++ ++ ++ // free_beacon_desc_ring(dev,priv->txbeaconcount); ++ ++#ifdef CONFIG_RTL8180_IO_MAP ++ ++ if( dev->base_addr != 0 ){ ++ ++ release_region(dev->base_addr, ++ pci_resource_len(pdev, 0) ); ++ } ++#else ++ if( dev->mem_start != (unsigned long)NULL ){ ++ iounmap( (void *)dev->mem_start ); ++ release_mem_region( pci_resource_start(pdev, 1), ++ pci_resource_len(pdev, 1) ); ++ } ++#endif /*end #ifdef RTL_IO_MAP*/ ++ free_ieee80211(dev); ++ ++ } ++ ++ pci_disable_device(pdev); ++ RT_TRACE(COMP_DOWN, "wlan driver removed\n"); ++} ++ ++extern int ieee80211_init(void); ++extern void ieee80211_exit(void); ++ ++static int __init rtl8192_pci_module_init(void) ++{ ++ int retval; ++ ++ retval = ieee80211_init(); ++ if (retval) ++ return retval; ++ ++ printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN cards\n"); ++ printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n"); ++ RT_TRACE(COMP_INIT, "Initializing module"); ++ RT_TRACE(COMP_INIT, "Wireless extensions version %d", WIRELESS_EXT); ++ rtl8192_proc_module_init(); ++#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) ++ if(0!=pci_module_init(&rtl8192_pci_driver)) ++#else ++ if(0!=pci_register_driver(&rtl8192_pci_driver)) ++#endif ++ { ++ DMESG("No device found"); ++ /*pci_unregister_driver (&rtl8192_pci_driver);*/ ++ return -ENODEV; ++ } ++ return 0; ++} ++ ++ ++static void __exit rtl8192_pci_module_exit(void) ++{ ++ pci_unregister_driver(&rtl8192_pci_driver); ++ ++ RT_TRACE(COMP_DOWN, "Exiting"); ++ rtl8192_proc_module_remove(); ++ ieee80211_exit(); ++} ++ ++//warning message WB ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++void rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs) ++#else ++irqreturn_t rtl8192_interrupt(int irq, void *netdev, struct pt_regs *regs) ++#endif ++#else ++irqreturn_t rtl8192_interrupt(int irq, void *netdev) ++#endif ++{ ++ struct net_device *dev = (struct net_device *) netdev; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ unsigned long flags; ++ u32 inta; ++ /* We should return IRQ_NONE, but for now let me keep this */ ++ if(priv->irq_enabled == 0){ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ return; ++#else ++ return IRQ_HANDLED; ++#endif ++ } ++ ++ spin_lock_irqsave(&priv->irq_th_lock,flags); ++ ++ //ISR: 4bytes ++ ++ inta = read_nic_dword(dev, ISR);// & priv->IntrMask; ++ write_nic_dword(dev,ISR,inta); // reset int situation ++ ++ priv->stats.shints++; ++ //DMESG("Enter interrupt, ISR value = 0x%08x", inta); ++ if(!inta){ ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ return; ++#else ++ return IRQ_HANDLED; ++#endif ++ /* ++ most probably we can safely return IRQ_NONE, ++ but for now is better to avoid problems ++ */ ++ } ++ ++ if(inta == 0xffff){ ++ /* HW disappared */ ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ return; ++#else ++ return IRQ_HANDLED; ++#endif ++ } ++ ++ priv->stats.ints++; ++#ifdef DEBUG_IRQ ++ DMESG("NIC irq %x",inta); ++#endif ++ //priv->irqpending = inta; ++ ++ ++ if(!netif_running(dev)) { ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ return; ++#else ++ return IRQ_HANDLED; ++#endif ++ } ++ ++ if(inta & IMR_TIMEOUT0){ ++ // write_nic_dword(dev, TimerInt, 0); ++ //DMESG("=================>waking up"); ++ // rtl8180_hw_wakeup(dev); ++ } ++ ++ if(inta & IMR_TBDOK){ ++ RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); ++ rtl8192_tx_isr(dev, BEACON_QUEUE); ++ priv->stats.txbeaconokint++; ++ } ++ ++ if(inta & IMR_TBDER){ ++ RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); ++ rtl8192_tx_isr(dev, BEACON_QUEUE); ++ priv->stats.txbeaconerr++; ++ } ++ ++ if(inta & IMR_MGNTDOK ) { ++ RT_TRACE(COMP_INTR, "Manage ok interrupt!\n"); ++ priv->stats.txmanageokint++; ++ rtl8192_tx_isr(dev,MGNT_QUEUE); ++ ++ } ++ ++ if(inta & IMR_COMDOK) ++ { ++ priv->stats.txcmdpktokint++; ++ rtl8192_tx_isr(dev,TXCMD_QUEUE); ++ } ++ ++ if(inta & IMR_ROK){ ++#ifdef DEBUG_RX ++ DMESG("Frame arrived !"); ++#endif ++ priv->stats.rxint++; ++ tasklet_schedule(&priv->irq_rx_tasklet); ++ } ++ ++ if(inta & IMR_BcnInt) { ++ RT_TRACE(COMP_INTR, "prepare beacon for interrupt!\n"); ++ tasklet_schedule(&priv->irq_prepare_beacon_tasklet); ++ } ++ ++ if(inta & IMR_RDU){ ++ RT_TRACE(COMP_INTR, "rx descriptor unavailable!\n"); ++ priv->stats.rxrdu++; ++ /* reset int situation */ ++ write_nic_dword(dev,INTA_MASK,read_nic_dword(dev, INTA_MASK) & ~IMR_RDU); ++ tasklet_schedule(&priv->irq_rx_tasklet); ++ } ++ ++ if(inta & IMR_RXFOVW){ ++ RT_TRACE(COMP_INTR, "rx overflow !\n"); ++ priv->stats.rxoverflow++; ++ tasklet_schedule(&priv->irq_rx_tasklet); ++ } ++ ++ if(inta & IMR_TXFOVW) priv->stats.txoverflow++; ++ ++ if(inta & IMR_BKDOK){ ++ RT_TRACE(COMP_INTR, "BK Tx OK interrupt!\n"); ++ priv->stats.txbkokint++; ++ priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; ++ rtl8192_tx_isr(dev,BK_QUEUE); ++ rtl8192_try_wake_queue(dev, BK_QUEUE); ++ } ++ ++ if(inta & IMR_BEDOK){ ++ RT_TRACE(COMP_INTR, "BE TX OK interrupt!\n"); ++ priv->stats.txbeokint++; ++ priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; ++ rtl8192_tx_isr(dev,BE_QUEUE); ++ rtl8192_try_wake_queue(dev, BE_QUEUE); ++ } ++ ++ if(inta & IMR_VIDOK){ ++ RT_TRACE(COMP_INTR, "VI TX OK interrupt!\n"); ++ priv->stats.txviokint++; ++ priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; ++ rtl8192_tx_isr(dev,VI_QUEUE); ++ rtl8192_try_wake_queue(dev, VI_QUEUE); ++ } ++ ++ if(inta & IMR_VODOK){ ++ priv->stats.txvookint++; ++ priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; ++ rtl8192_tx_isr(dev,VO_QUEUE); ++ rtl8192_try_wake_queue(dev, VO_QUEUE); ++ } ++ ++ force_pci_posting(dev); ++ spin_unlock_irqrestore(&priv->irq_th_lock,flags); ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ return; ++#else ++ return IRQ_HANDLED; ++#endif ++} ++ ++void rtl8192_try_wake_queue(struct net_device *dev, int pri) ++{ ++#if 0 ++ unsigned long flags; ++ short enough_desc; ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ ++ spin_lock_irqsave(&priv->tx_lock,flags); ++ enough_desc = check_nic_enough_desc(dev,pri); ++ spin_unlock_irqrestore(&priv->tx_lock,flags); ++ ++ if(enough_desc) ++ ieee80211_wake_queue(priv->ieee80211); ++#endif ++} ++ ++ ++void EnableHWSecurityConfig8192(struct net_device *dev) ++{ ++ u8 SECR_value = 0x0; ++ // struct ieee80211_device* ieee1 = container_of(&dev, struct ieee80211_device, dev); ++ //printk("==>ieee1:%p, dev:%p\n", ieee1, dev); ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ //printk("==>ieee:%p, dev:%p\n", ieee, dev); ++ SECR_value = SCR_TxEncEnable | SCR_RxDecEnable; ++#if 1 ++ if (((KEY_TYPE_WEP40 == ieee->pairwise_key_type) || (KEY_TYPE_WEP104 == ieee->pairwise_key_type)) && (priv->ieee80211->auth_mode != 2)) ++ { ++ SECR_value |= SCR_RxUseDK; ++ SECR_value |= SCR_TxUseDK; ++ } ++ else if ((ieee->iw_mode == IW_MODE_ADHOC) && (ieee->pairwise_key_type & (KEY_TYPE_CCMP | KEY_TYPE_TKIP))) ++ { ++ SECR_value |= SCR_RxUseDK; ++ SECR_value |= SCR_TxUseDK; ++ } ++ ++#endif ++ ++ //add HWSec active enable here. ++//default using hwsec. when peer AP is in N mode only and pairwise_key_type is none_aes(which HT_IOT_ACT_PURE_N_MODE indicates it), use software security. when peer AP is in b,g,n mode mixed and pairwise_key_type is none_aes, use g mode hw security. WB on 2008.7.4 ++ ieee->hwsec_active = 1; ++ ++ if ((ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE) || !hwwep)//!ieee->hwsec_support) //add hwsec_support flag to totol control hw_sec on/off ++ { ++ ieee->hwsec_active = 0; ++ SECR_value &= ~SCR_RxDecEnable; ++ } ++ ++ RT_TRACE(COMP_SEC,"%s:, hwsec:%d, pairwise_key:%d, SECR_value:%x\n", __FUNCTION__, \ ++ ieee->hwsec_active, ieee->pairwise_key_type, SECR_value); ++ { ++ write_nic_byte(dev, SECR, SECR_value);//SECR_value | SCR_UseDK ); ++ } ++ ++} ++#define TOTAL_CAM_ENTRY 32 ++//#define CAM_CONTENT_COUNT 8 ++void setKey( struct net_device *dev, ++ u8 EntryNo, ++ u8 KeyIndex, ++ u16 KeyType, ++ u8 *MacAddr, ++ u8 DefaultKey, ++ u32 *KeyContent ) ++{ ++ u32 TargetCommand = 0; ++ u32 TargetContent = 0; ++ u16 usConfig = 0; ++ u8 i; ++#ifdef ENABLE_IPS ++ struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); ++ RT_RF_POWER_STATE rtState; ++ rtState = priv->ieee80211->eRFPowerState; ++ if(priv->ieee80211->PowerSaveControl.bInactivePs){ ++ if(rtState == eRfOff){ ++ if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS) ++ { ++ RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__); ++ up(&priv->wx_sem); ++ return ; ++ } ++ else{ ++ IPSLeave(dev); ++ } ++ } ++ } ++ priv->ieee80211->is_set_key = true; ++#endif ++ if (EntryNo >= TOTAL_CAM_ENTRY) ++ RT_TRACE(COMP_ERR, "cam entry exceeds in setKey()\n"); ++ ++ RT_TRACE(COMP_SEC, "====>to setKey(), dev:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr"MAC_FMT"\n", dev,EntryNo, KeyIndex, KeyType, MAC_ARG(MacAddr)); ++ ++ if (DefaultKey) ++ usConfig |= BIT15 | (KeyType<<2); ++ else ++ usConfig |= BIT15 | (KeyType<<2) | KeyIndex; ++// usConfig |= BIT15 | (KeyType<<2) | (DefaultKey<<5) | KeyIndex; ++ ++ ++ for(i=0 ; iafter set key, usconfig:%x\n", usConfig); ++} ++// This function seems not ready! WB ++void CamPrintDbgReg(struct net_device* dev) ++{ ++ unsigned long rvalue; ++ unsigned char ucValue; ++ write_nic_dword(dev, DCAM, 0x80000000); ++ msleep(40); ++ rvalue = read_nic_dword(dev, DCAM); //delay_ms(40); ++ RT_TRACE(COMP_SEC, " TX CAM=%8lX ",rvalue); ++ if((rvalue & 0x40000000) != 0x4000000) ++ RT_TRACE(COMP_SEC, "-->TX Key Not Found "); ++ msleep(20); ++ write_nic_dword(dev, DCAM, 0x00000000); //delay_ms(40); ++ rvalue = read_nic_dword(dev, DCAM); //delay_ms(40); ++ RT_TRACE(COMP_SEC, "RX CAM=%8lX ",rvalue); ++ if((rvalue & 0x40000000) != 0x4000000) ++ RT_TRACE(COMP_SEC, "-->CAM Key Not Found "); ++ ucValue = read_nic_byte(dev, SECR); ++ RT_TRACE(COMP_SEC, "WPA_Config=%x \n",ucValue); ++} ++ ++ ++/*************************************************************************** ++ ------------------- module init / exit stubs ---------------- ++****************************************************************************/ ++module_init(rtl8192_pci_module_init); ++module_exit(rtl8192_pci_module_exit); +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_dm.c +@@ -0,0 +1,4115 @@ ++/*++ ++Copyright-c Realtek Semiconductor Corp. All rights reserved. ++ ++Module Name: ++ r8192U_dm.c ++ ++Abstract: ++ HW dynamic mechanism. ++ ++Major Change History: ++ When Who What ++ ---------- --------------- ------------------------------- ++ 2008-05-14 amy create version 0 porting from windows code. ++ ++--*/ ++#include "r8192E.h" ++#include "r8192E_dm.h" ++#include "r8192E_hw.h" ++#include "r819xE_phy.h" ++#include "r819xE_phyreg.h" ++#include "r8190_rtl8256.h" ++/*---------------------------Define Local Constant---------------------------*/ ++// ++// Indicate different AP vendor for IOT issue. ++// ++#ifdef RTL8190P ++static u32 edca_setting_DL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0x5e4322, 0x5e4322, 0x604322, 0xa44f, 0x5e4322}; ++static u32 edca_setting_UL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0xa44f, 0x5e4322, 0x604322, 0x5e4322, 0x5e4322}; ++#else ++#ifdef RTL8192E ++static u32 edca_setting_DL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0x5e4322, 0x5e4322, 0x604322, 0xa44f, 0x5e4322}; ++static u32 edca_setting_UL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0xa44f, 0x5e4322, 0x604322, 0x5e4322, 0x5e4322}; ++#else ++static u32 edca_setting_DL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0x5e4322, 0x5e4322, 0x604322, 0xa44f, 0x5ea44f}; ++static u32 edca_setting_UL[HT_IOT_PEER_MAX] = ++{ 0x5e4322, 0xa44f, 0x5e4322, 0x604322, 0x5ea44f, 0x5ea44f}; ++#endif ++#endif ++ ++#define RTK_UL_EDCA 0xa44f ++#define RTK_DL_EDCA 0x5e4322 ++/*---------------------------Define Local Constant---------------------------*/ ++ ++ ++/*------------------------Define global variable-----------------------------*/ ++// Debug variable ? ++dig_t dm_digtable; ++// Store current shoftware write register content for MAC PHY. ++u8 dm_shadow[16][256] = {{0}}; ++// For Dynamic Rx Path Selection by Signal Strength ++DRxPathSel DM_RxPathSelTable; ++/*------------------------Define global variable-----------------------------*/ ++ ++ ++/*------------------------Define local variable------------------------------*/ ++/*------------------------Define local variable------------------------------*/ ++ ++ ++/*--------------------Define export function prototype-----------------------*/ ++extern void init_hal_dm(struct net_device *dev); ++extern void deinit_hal_dm(struct net_device *dev); ++ ++extern void hal_dm_watchdog(struct net_device *dev); ++ ++ ++extern void init_rate_adaptive(struct net_device *dev); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void dm_txpower_trackingcallback(struct work_struct *work); ++#else ++extern void dm_txpower_trackingcallback(struct net_device *dev); ++#endif ++ ++extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); ++extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); ++extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); ++extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, ++ u32 dm_type, ++ u32 dm_value); ++extern void DM_ChangeFsyncSetting(struct net_device *dev, ++ s32 DM_Type, ++ s32 DM_Value); ++extern void dm_force_tx_fw_info(struct net_device *dev, ++ u32 force_type, ++ u32 force_value); ++extern void dm_init_edca_turbo(struct net_device *dev); ++extern void dm_rf_operation_test_callback(unsigned long data); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); ++#else ++extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev); ++#endif ++extern void dm_fsync_timer_callback(unsigned long data); ++#if 0 ++extern bool dm_check_lbus_status(struct net_device *dev); ++#endif ++extern void dm_check_fsync(struct net_device *dev); ++extern void dm_shadow_init(struct net_device *dev); ++extern void dm_initialize_txpower_tracking(struct net_device *dev); ++ ++#ifdef RTL8192E ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void dm_gpio_change_rf_callback(struct work_struct *work); ++#else ++extern void dm_gpio_change_rf_callback(struct net_device *dev); ++#endif ++#endif ++ ++ ++ ++/*--------------------Define export function prototype-----------------------*/ ++ ++ ++/*---------------------Define local function prototype-----------------------*/ ++// DM --> Rate Adaptive ++static void dm_check_rate_adaptive(struct net_device *dev); ++ ++// DM --> Bandwidth switch ++static void dm_init_bandwidth_autoswitch(struct net_device *dev); ++static void dm_bandwidth_autoswitch( struct net_device *dev); ++ ++// DM --> TX power control ++//static void dm_initialize_txpower_tracking(struct net_device *dev); ++ ++static void dm_check_txpower_tracking(struct net_device *dev); ++ ++ ++ ++//static void dm_txpower_reset_recovery(struct net_device *dev); ++ ++ ++// DM --> BB init gain restore ++#ifndef RTL8192U ++static void dm_bb_initialgain_restore(struct net_device *dev); ++ ++ ++// DM --> BB init gain backup ++static void dm_bb_initialgain_backup(struct net_device *dev); ++#endif ++ ++// DM --> Dynamic Init Gain by RSSI ++static void dm_dig_init(struct net_device *dev); ++static void dm_ctrl_initgain_byrssi(struct net_device *dev); ++static void dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev); ++static void dm_ctrl_initgain_byrssi_by_driverrssi( struct net_device *dev); ++static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(struct net_device *dev); ++static void dm_initial_gain(struct net_device *dev); ++static void dm_pd_th(struct net_device *dev); ++static void dm_cs_ratio(struct net_device *dev); ++ ++static void dm_init_ctstoself(struct net_device *dev); ++// DM --> EDCA turboe mode control ++static void dm_check_edca_turbo(struct net_device *dev); ++ ++// DM --> HW RF control ++static void dm_check_rfctrl_gpio(struct net_device *dev); ++ ++#ifndef RTL8190P ++//static void dm_gpio_change_rf(struct net_device *dev); ++#endif ++// DM --> Check PBC ++static void dm_check_pbc_gpio(struct net_device *dev); ++ ++ ++// DM --> Check current RX RF path state ++static void dm_check_rx_path_selection(struct net_device *dev); ++static void dm_init_rxpath_selection(struct net_device *dev); ++static void dm_rxpath_sel_byrssi(struct net_device *dev); ++ ++ ++// DM --> Fsync for broadcom ap ++static void dm_init_fsync(struct net_device *dev); ++static void dm_deInit_fsync(struct net_device *dev); ++ ++//Added by vivi, 20080522 ++static void dm_check_txrateandretrycount(struct net_device *dev); ++ ++/*---------------------Define local function prototype-----------------------*/ ++ ++/*---------------------Define of Tx Power Control For Near/Far Range --------*/ //Add by Jacken 2008/02/18 ++static void dm_init_dynamic_txpower(struct net_device *dev); ++static void dm_dynamic_txpower(struct net_device *dev); ++ ++ ++// DM --> For rate adaptive and DIG, we must send RSSI to firmware ++static void dm_send_rssi_tofw(struct net_device *dev); ++static void dm_ctstoself(struct net_device *dev); ++/*---------------------------Define function prototype------------------------*/ ++//================================================================================ ++// HW Dynamic mechanism interface. ++//================================================================================ ++ ++// ++// Description: ++// Prepare SW resource for HW dynamic mechanism. ++// ++// Assumption: ++// This function is only invoked at driver intialization once. ++// ++// ++void init_hal_dm(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ // Undecorated Smoothed Signal Strength, it can utilized to dynamic mechanism. ++ priv->undecorated_smoothed_pwdb = -1; ++ ++ //Initial TX Power Control for near/far range , add by amy 2008/05/15, porting from windows code. ++ dm_init_dynamic_txpower(dev); ++ init_rate_adaptive(dev); ++ //dm_initialize_txpower_tracking(dev); ++ dm_dig_init(dev); ++ dm_init_edca_turbo(dev); ++ dm_init_bandwidth_autoswitch(dev); ++ dm_init_fsync(dev); ++ dm_init_rxpath_selection(dev); ++ dm_init_ctstoself(dev); ++#ifdef RTL8192E ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++ INIT_DELAYED_WORK(&priv->gpio_change_rf_wq, dm_gpio_change_rf_callback); ++#else ++ INIT_WORK(&priv->gpio_change_rf_wq, (void(*)(void*)) dm_gpio_change_rf_callback,dev); ++#endif ++#endif ++ ++} // InitHalDm ++ ++void deinit_hal_dm(struct net_device *dev) ++{ ++ ++ dm_deInit_fsync(dev); ++ ++} ++ ++ ++#ifdef USB_RX_AGGREGATION_SUPPORT ++void dm_CheckRxAggregation(struct net_device *dev) { ++ struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); ++ PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo; ++ static unsigned long lastTxOkCnt = 0; ++ static unsigned long lastRxOkCnt = 0; ++ unsigned long curTxOkCnt = 0; ++ unsigned long curRxOkCnt = 0; ++ ++/* ++ if (pHalData->bForcedUsbRxAggr) { ++ if (pHalData->ForcedUsbRxAggrInfo == 0) { ++ if (pHalData->bCurrentRxAggrEnable) { ++ Adapter->HalFunc.HalUsbRxAggrHandler(Adapter, FALSE); ++ } ++ } else { ++ if (!pHalData->bCurrentRxAggrEnable || (pHalData->ForcedUsbRxAggrInfo != pHalData->LastUsbRxAggrInfoSetting)) { ++ Adapter->HalFunc.HalUsbRxAggrHandler(Adapter, TRUE); ++ } ++ } ++ return; ++ } ++ ++*/ ++ curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; ++ curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; ++ ++ if((curTxOkCnt + curRxOkCnt) < 15000000) { ++ return; ++ } ++ ++ if(curTxOkCnt > 4*curRxOkCnt) { ++ if (priv->bCurrentRxAggrEnable) { ++ write_nic_dword(dev, 0x1a8, 0); ++ priv->bCurrentRxAggrEnable = false; ++ } ++ }else{ ++ if (!priv->bCurrentRxAggrEnable && !pHTInfo->bCurrentRT2RTAggregation) { ++ u32 ulValue; ++ ulValue = (pHTInfo->UsbRxFwAggrEn<<24) | (pHTInfo->UsbRxFwAggrPageNum<<16) | ++ (pHTInfo->UsbRxFwAggrPacketNum<<8) | (pHTInfo->UsbRxFwAggrTimeout); ++ /* ++ * If usb rx firmware aggregation is enabled, ++ * when anyone of three threshold conditions above is reached, ++ * firmware will send aggregated packet to driver. ++ */ ++ write_nic_dword(dev, 0x1a8, ulValue); ++ priv->bCurrentRxAggrEnable = true; ++ } ++ } ++ ++ lastTxOkCnt = priv->stats.txbytesunicast; ++ lastRxOkCnt = priv->stats.rxbytesunicast; ++} // dm_CheckEdcaTurbo ++#endif ++ ++ ++ ++void hal_dm_watchdog(struct net_device *dev) ++{ ++ //struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ //static u8 previous_bssid[6] ={0}; ++ ++ /*Add by amy 2008/05/15 ,porting from windows code.*/ ++ dm_check_rate_adaptive(dev); ++ dm_dynamic_txpower(dev); ++ dm_check_txrateandretrycount(dev); ++ ++ dm_check_txpower_tracking(dev); ++ ++ dm_ctrl_initgain_byrssi(dev); ++ dm_check_edca_turbo(dev); ++ dm_bandwidth_autoswitch(dev); ++ ++ dm_check_rfctrl_gpio(dev); ++ dm_check_rx_path_selection(dev); ++ dm_check_fsync(dev); ++ ++ // Add by amy 2008-05-15 porting from windows code. ++ dm_check_pbc_gpio(dev); ++ dm_send_rssi_tofw(dev); ++ dm_ctstoself(dev); ++ ++#ifdef USB_RX_AGGREGATION_SUPPORT ++ dm_CheckRxAggregation(dev); ++#endif ++} //HalDmWatchDog ++ ++ ++/* ++ * Decide Rate Adaptive Set according to distance (signal strength) ++ * 01/11/2008 MHC Modify input arguments and RATR table level. ++ * 01/16/2008 MHC RF_Type is assigned in ReadAdapterInfo(). We must call ++ * the function after making sure RF_Type. ++ */ ++void init_rate_adaptive(struct net_device * dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ prate_adaptive pra = (prate_adaptive)&priv->rate_adaptive; ++ ++ pra->ratr_state = DM_RATR_STA_MAX; ++ pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High; ++ pra->low2high_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M+5; ++ pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5; ++ ++ pra->high_rssi_thresh_for_ra = RateAdaptiveTH_High+5; ++ pra->low_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M; ++ pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M; ++ ++ if(priv->CustomerID == RT_CID_819x_Netcore) ++ pra->ping_rssi_enable = 1; ++ else ++ pra->ping_rssi_enable = 0; ++ pra->ping_rssi_thresh_for_ra = 15; ++ ++ ++ if (priv->rf_type == RF_2T4R) ++ { ++ // 07/10/08 MH Modify for RA smooth scheme. ++ /* 2008/01/11 MH Modify 2T RATR table for different RSSI. 080515 porting by amy from windows code.*/ ++ pra->upper_rssi_threshold_ratr = 0x8f0f0000; ++ pra->middle_rssi_threshold_ratr = 0x8f0ff000; ++ pra->low_rssi_threshold_ratr = 0x8f0ff001; ++ pra->low_rssi_threshold_ratr_40M = 0x8f0ff005; ++ pra->low_rssi_threshold_ratr_20M = 0x8f0ff001; ++ pra->ping_rssi_ratr = 0x0000000d;//cosa add for test ++ } ++ else if (priv->rf_type == RF_1T2R) ++ { ++ pra->upper_rssi_threshold_ratr = 0x000f0000; ++ pra->middle_rssi_threshold_ratr = 0x000ff000; ++ pra->low_rssi_threshold_ratr = 0x000ff001; ++ pra->low_rssi_threshold_ratr_40M = 0x000ff005; ++ pra->low_rssi_threshold_ratr_20M = 0x000ff001; ++ pra->ping_rssi_ratr = 0x0000000d;//cosa add for test ++ } ++ ++} // InitRateAdaptive ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_check_rate_adaptive() ++ * ++ * Overview: ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/26/08 amy Create version 0 proting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void dm_check_rate_adaptive(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo; ++ prate_adaptive pra = (prate_adaptive)&priv->rate_adaptive; ++ u32 currentRATR, targetRATR = 0; ++ u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; ++ bool bshort_gi_enabled = false; ++ static u8 ping_rssi_state=0; ++ ++ ++ if(!priv->up) ++ { ++ RT_TRACE(COMP_RATE, "<---- dm_check_rate_adaptive(): driver is going to unload\n"); ++ return; ++ } ++ ++ if(pra->rate_adaptive_disabled)//this variable is set by ioctl. ++ return; ++ ++ // TODO: Only 11n mode is implemented currently, ++ if( !(priv->ieee80211->mode == WIRELESS_MODE_N_24G || ++ priv->ieee80211->mode == WIRELESS_MODE_N_5G)) ++ return; ++ ++ if( priv->ieee80211->state == IEEE80211_LINKED ) ++ { ++ // RT_TRACE(COMP_RATE, "dm_CheckRateAdaptive(): \t"); ++ ++ // ++ // Check whether Short GI is enabled ++ // ++ bshort_gi_enabled = (pHTInfo->bCurTxBW40MHz && pHTInfo->bCurShortGI40MHz) || ++ (!pHTInfo->bCurTxBW40MHz && pHTInfo->bCurShortGI20MHz); ++ ++ ++ pra->upper_rssi_threshold_ratr = ++ (pra->upper_rssi_threshold_ratr & (~BIT31)) | ((bshort_gi_enabled)? BIT31:0) ; ++ ++ pra->middle_rssi_threshold_ratr = ++ (pra->middle_rssi_threshold_ratr & (~BIT31)) | ((bshort_gi_enabled)? BIT31:0) ; ++ ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ pra->low_rssi_threshold_ratr = ++ (pra->low_rssi_threshold_ratr_40M & (~BIT31)) | ((bshort_gi_enabled)? BIT31:0) ; ++ } ++ else ++ { ++ pra->low_rssi_threshold_ratr = ++ (pra->low_rssi_threshold_ratr_20M & (~BIT31)) | ((bshort_gi_enabled)? BIT31:0) ; ++ } ++ //cosa add for test ++ pra->ping_rssi_ratr = ++ (pra->ping_rssi_ratr & (~BIT31)) | ((bshort_gi_enabled)? BIT31:0) ; ++ ++ /* 2007/10/08 MH We support RA smooth scheme now. When it is the first ++ time to link with AP. We will not change upper/lower threshold. If ++ STA stay in high or low level, we must change two different threshold ++ to prevent jumping frequently. */ ++ if (pra->ratr_state == DM_RATR_STA_HIGH) ++ { ++ HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; ++ LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)? ++ (pra->low_rssi_thresh_for_ra40M):(pra->low_rssi_thresh_for_ra20M); ++ } ++ else if (pra->ratr_state == DM_RATR_STA_LOW) ++ { ++ HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; ++ LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)? ++ (pra->low2high_rssi_thresh_for_ra40M):(pra->low2high_rssi_thresh_for_ra20M); ++ } ++ else ++ { ++ HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; ++ LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)? ++ (pra->low_rssi_thresh_for_ra40M):(pra->low_rssi_thresh_for_ra20M); ++ } ++ ++ //DbgPrint("[DM] THresh H/L=%d/%d\n\r", RATR.HighRSSIThreshForRA, RATR.LowRSSIThreshForRA); ++ if(priv->undecorated_smoothed_pwdb >= (long)HighRSSIThreshForRA) ++ { ++ //DbgPrint("[DM] RSSI=%d STA=HIGH\n\r", pHalData->UndecoratedSmoothedPWDB); ++ pra->ratr_state = DM_RATR_STA_HIGH; ++ targetRATR = pra->upper_rssi_threshold_ratr; ++ }else if(priv->undecorated_smoothed_pwdb >= (long)LowRSSIThreshForRA) ++ { ++ //DbgPrint("[DM] RSSI=%d STA=Middle\n\r", pHalData->UndecoratedSmoothedPWDB); ++ pra->ratr_state = DM_RATR_STA_MIDDLE; ++ targetRATR = pra->middle_rssi_threshold_ratr; ++ }else ++ { ++ //DbgPrint("[DM] RSSI=%d STA=LOW\n\r", pHalData->UndecoratedSmoothedPWDB); ++ pra->ratr_state = DM_RATR_STA_LOW; ++ targetRATR = pra->low_rssi_threshold_ratr; ++ } ++ ++ //cosa add for test ++ if(pra->ping_rssi_enable) ++ { ++ //pHalData->UndecoratedSmoothedPWDB = 19; ++ if(priv->undecorated_smoothed_pwdb < (long)(pra->ping_rssi_thresh_for_ra+5)) ++ { ++ if( (priv->undecorated_smoothed_pwdb < (long)pra->ping_rssi_thresh_for_ra) || ++ ping_rssi_state ) ++ { ++ //DbgPrint("TestRSSI = %d, set RATR to 0x%x \n", pHalData->UndecoratedSmoothedPWDB, pRA->TestRSSIRATR); ++ pra->ratr_state = DM_RATR_STA_LOW; ++ targetRATR = pra->ping_rssi_ratr; ++ ping_rssi_state = 1; ++ } ++ //else ++ // DbgPrint("TestRSSI is between the range. \n"); ++ } ++ else ++ { ++ //DbgPrint("TestRSSI Recover to 0x%x \n", targetRATR); ++ ping_rssi_state = 0; ++ } ++ } ++ ++ // 2008.04.01 ++#if 1 ++ // For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7. ++ if(priv->ieee80211->GetHalfNmodeSupportByAPsHandler(dev)) ++ targetRATR &= 0xf00fffff; ++#endif ++ ++ // ++ // Check whether updating of RATR0 is required ++ // ++ currentRATR = read_nic_dword(dev, RATR0); ++ if( targetRATR != currentRATR ) ++ { ++ u32 ratr_value; ++ ratr_value = targetRATR; ++ RT_TRACE(COMP_RATE,"currentRATR = %x, targetRATR = %x\n", currentRATR, targetRATR); ++ if(priv->rf_type == RF_1T2R) ++ { ++ ratr_value &= ~(RATE_ALL_OFDM_2SS); ++ } ++ write_nic_dword(dev, RATR0, ratr_value); ++ write_nic_byte(dev, UFWP, 1); ++ ++ pra->last_ratr = targetRATR; ++ } ++ ++ } ++ else ++ { ++ pra->ratr_state = DM_RATR_STA_MAX; ++ } ++ ++} // dm_CheckRateAdaptive ++ ++ ++static void dm_init_bandwidth_autoswitch(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz = BW_AUTO_SWITCH_LOW_HIGH; ++ priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz = BW_AUTO_SWITCH_HIGH_LOW; ++ priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; ++ priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable = false; ++ ++} // dm_init_bandwidth_autoswitch ++ ++ ++static void dm_bandwidth_autoswitch(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable){ ++ return; ++ }else{ ++ if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 ++ if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) ++ priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; ++ }else{//in force send packets in 20 Mhz in 20/40 ++ if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) ++ priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; ++ ++ } ++ } ++} // dm_BandwidthAutoSwitch ++ ++//OFDM default at 0db, index=6. ++#ifndef RTL8190P ++static u32 OFDMSwingTable[OFDM_Table_Length] = { ++ 0x7f8001fe, // 0, +6db ++ 0x71c001c7, // 1, +5db ++ 0x65400195, // 2, +4db ++ 0x5a400169, // 3, +3db ++ 0x50800142, // 4, +2db ++ 0x47c0011f, // 5, +1db ++ 0x40000100, // 6, +0db ===> default, upper for higher temprature, lower for low temprature ++ 0x390000e4, // 7, -1db ++ 0x32c000cb, // 8, -2db ++ 0x2d4000b5, // 9, -3db ++ 0x288000a2, // 10, -4db ++ 0x24000090, // 11, -5db ++ 0x20000080, // 12, -6db ++ 0x1c800072, // 13, -7db ++ 0x19800066, // 14, -8db ++ 0x26c0005b, // 15, -9db ++ 0x24400051, // 16, -10db ++ 0x12000048, // 17, -11db ++ 0x10000040 // 18, -12db ++}; ++static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { ++ {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, // 0, +0db ===> CCK40M default ++ {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, // 1, -1db ++ {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, // 2, -2db ++ {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, // 3, -3db ++ {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, // 4, -4db ++ {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, // 5, -5db ++ {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, // 6, -6db ===> CCK20M default ++ {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, // 7, -7db ++ {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, // 8, -8db ++ {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, // 9, -9db ++ {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, // 10, -10db ++ {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01} // 11, -11db ++}; ++ ++static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = { ++ {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, // 0, +0db ===> CCK40M default ++ {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, // 1, -1db ++ {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, // 2, -2db ++ {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, // 3, -3db ++ {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, // 4, -4db ++ {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, // 5, -5db ++ {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, // 6, -6db ===> CCK20M default ++ {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, // 7, -7db ++ {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, // 8, -8db ++ {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, // 9, -9db ++ {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, // 10, -10db ++ {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00} // 11, -11db ++}; ++#endif ++#define Pw_Track_Flag 0x11d ++#define Tssi_Mea_Value 0x13c ++#define Tssi_Report_Value1 0x134 ++#define Tssi_Report_Value2 0x13e ++#define FW_Busy_Flag 0x13f ++static void dm_TXPowerTrackingCallback_TSSI(struct net_device * dev) ++ { ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool bHighpowerstate, viviflag = FALSE; ++ DCMD_TXCMD_T tx_cmd; ++ u8 powerlevelOFDM24G; ++ int i =0, j = 0, k = 0; ++ u8 RF_Type, tmp_report[5]={0, 0, 0, 0, 0}; ++ u32 Value; ++ u8 Pwr_Flag; ++ u16 Avg_TSSI_Meas, TSSI_13dBm, Avg_TSSI_Meas_from_driver=0; ++#ifdef RTL8192U ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++#endif ++// bool rtStatus = true; ++ u32 delta=0; ++ RT_TRACE(COMP_POWER_TRACKING,"%s()\n",__FUNCTION__); ++// write_nic_byte(dev, 0x1ba, 0); ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ write_nic_byte(dev, FW_Busy_Flag, 0); ++ priv->ieee80211->bdynamic_txpower_enable = false; ++ bHighpowerstate = priv->bDynamicTxHighPower; ++ ++ powerlevelOFDM24G = (u8)(priv->Pwr_Track>>24); ++ RF_Type = priv->rf_type; ++ Value = (RF_Type<<8) | powerlevelOFDM24G; ++ ++ RT_TRACE(COMP_POWER_TRACKING, "powerlevelOFDM24G = %x\n", powerlevelOFDM24G); ++ ++ for(j = 0; j<=30; j++) ++{ //fill tx_cmd ++ ++ tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING; ++ tx_cmd.Length = 4; ++ tx_cmd.Value = Value; ++#ifdef RTL8192U ++ rtStatus = SendTxCommandPacket(dev, &tx_cmd, 12); ++ if (rtStatus == RT_STATUS_FAILURE) ++ { ++ RT_TRACE(COMP_POWER_TRACKING, "Set configuration with tx cmd queue fail!\n"); ++ } ++#else ++ cmpk_message_handle_tx(dev, (u8*)&tx_cmd, DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T)); ++#endif ++ mdelay(1); ++ //DbgPrint("hi, vivi, strange\n"); ++ for(i = 0;i <= 30; i++) ++ { ++ Pwr_Flag = read_nic_byte(dev, Pw_Track_Flag); ++ ++ if (Pwr_Flag == 0) ++ { ++ mdelay(1); ++ continue; ++ } ++ ++ Avg_TSSI_Meas = read_nic_word(dev, Tssi_Mea_Value); ++ ++ if(Avg_TSSI_Meas == 0) ++ { ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ write_nic_byte(dev, FW_Busy_Flag, 0); ++ return; ++ } ++ ++ for(k = 0;k < 5; k++) ++ { ++ if(k !=4) ++ tmp_report[k] = read_nic_byte(dev, Tssi_Report_Value1+k); ++ else ++ tmp_report[k] = read_nic_byte(dev, Tssi_Report_Value2); ++ ++ RT_TRACE(COMP_POWER_TRACKING, "TSSI_report_value = %d\n", tmp_report[k]); ++ } ++ ++ //check if the report value is right ++ for(k = 0;k < 5; k++) ++ { ++ if(tmp_report[k] <= 20) ++ { ++ viviflag =TRUE; ++ break; ++ } ++ } ++ if(viviflag ==TRUE) ++ { ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ viviflag = FALSE; ++ RT_TRACE(COMP_POWER_TRACKING, "we filted this data\n"); ++ for(k = 0;k < 5; k++) ++ tmp_report[k] = 0; ++ break; ++ } ++ ++ for(k = 0;k < 5; k++) ++ { ++ Avg_TSSI_Meas_from_driver += tmp_report[k]; ++ } ++ ++ Avg_TSSI_Meas_from_driver = Avg_TSSI_Meas_from_driver*100/5; ++ RT_TRACE(COMP_POWER_TRACKING, "Avg_TSSI_Meas_from_driver = %d\n", Avg_TSSI_Meas_from_driver); ++ TSSI_13dBm = priv->TSSI_13dBm; ++ RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n", TSSI_13dBm); ++ ++ //if(abs(Avg_TSSI_Meas_from_driver - TSSI_13dBm) <= E_FOR_TX_POWER_TRACK) ++ // For MacOS-compatible ++ if(Avg_TSSI_Meas_from_driver > TSSI_13dBm) ++ delta = Avg_TSSI_Meas_from_driver - TSSI_13dBm; ++ else ++ delta = TSSI_13dBm - Avg_TSSI_Meas_from_driver; ++ ++ if(delta <= E_FOR_TX_POWER_TRACK) ++ { ++ priv->ieee80211->bdynamic_txpower_enable = TRUE; ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ write_nic_byte(dev, FW_Busy_Flag, 0); ++ RT_TRACE(COMP_POWER_TRACKING, "tx power track is done\n"); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex = %d\n", priv->rfa_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_real = %d\n", priv->rfa_txpowertrackingindex_real); ++#ifdef RTL8190P ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex = %d\n", priv->rfc_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex_real = %d\n", priv->rfc_txpowertrackingindex_real); ++#endif ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_difference = %d\n", priv->CCKPresentAttentuation_difference); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation = %d\n", priv->CCKPresentAttentuation); ++ return; ++ } ++ else ++ { ++ if(Avg_TSSI_Meas_from_driver < TSSI_13dBm - E_FOR_TX_POWER_TRACK) ++ { ++ if (RF_Type == RF_2T4R) ++ { ++ ++ if((priv->rfa_txpowertrackingindex > 0) &&(priv->rfc_txpowertrackingindex > 0)) ++ { ++ priv->rfa_txpowertrackingindex--; ++ if(priv->rfa_txpowertrackingindex_real > 4) ++ { ++ priv->rfa_txpowertrackingindex_real--; ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfa_txpowertrackingindex_real].txbbgain_value); ++ } ++ ++ priv->rfc_txpowertrackingindex--; ++ if(priv->rfc_txpowertrackingindex_real > 4) ++ { ++ priv->rfc_txpowertrackingindex_real--; ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfc_txpowertrackingindex_real].txbbgain_value); ++ } ++ } ++ else ++ { ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, priv->txbbgain_table[4].txbbgain_value); ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[4].txbbgain_value); ++ } ++ } ++ else ++ { ++ if(priv->rfc_txpowertrackingindex > 0) ++ { ++ priv->rfc_txpowertrackingindex--; ++ if(priv->rfc_txpowertrackingindex_real > 4) ++ { ++ priv->rfc_txpowertrackingindex_real--; ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfc_txpowertrackingindex_real].txbbgain_value); ++ } ++ } ++ else ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[4].txbbgain_value); ++ } ++ } ++ else ++ { ++ if (RF_Type == RF_2T4R) ++ { ++ if((priv->rfa_txpowertrackingindex < TxBBGainTableLength - 1) &&(priv->rfc_txpowertrackingindex < TxBBGainTableLength - 1)) ++ { ++ priv->rfa_txpowertrackingindex++; ++ priv->rfa_txpowertrackingindex_real++; ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfa_txpowertrackingindex_real].txbbgain_value); ++ priv->rfc_txpowertrackingindex++; ++ priv->rfc_txpowertrackingindex_real++; ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfc_txpowertrackingindex_real].txbbgain_value); ++ } ++ else ++ { ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, priv->txbbgain_table[TxBBGainTableLength - 1].txbbgain_value); ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[TxBBGainTableLength - 1].txbbgain_value); ++ } ++ } ++ else ++ { ++ if(priv->rfc_txpowertrackingindex < (TxBBGainTableLength - 1)) ++ { ++ priv->rfc_txpowertrackingindex++; ++ priv->rfc_txpowertrackingindex_real++; ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfc_txpowertrackingindex_real].txbbgain_value); ++ } ++ else ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[TxBBGainTableLength - 1].txbbgain_value); ++ } ++ } ++ if (RF_Type == RF_2T4R) ++ priv->CCKPresentAttentuation_difference ++ = priv->rfa_txpowertrackingindex - priv->rfa_txpowertracking_default; ++ else ++ priv->CCKPresentAttentuation_difference ++ = priv->rfc_txpowertrackingindex - priv->rfc_txpowertracking_default; ++ ++ if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) ++ priv->CCKPresentAttentuation ++ = priv->CCKPresentAttentuation_20Mdefault + priv->CCKPresentAttentuation_difference; ++ else ++ priv->CCKPresentAttentuation ++ = priv->CCKPresentAttentuation_40Mdefault + priv->CCKPresentAttentuation_difference; ++ ++ if(priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1)) ++ priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1; ++ if(priv->CCKPresentAttentuation < 0) ++ priv->CCKPresentAttentuation = 0; ++ ++ if(1) ++ { ++ if(priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = TRUE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else if(priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = FALSE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex = %d\n", priv->rfa_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfa_txpowertrackingindex_real = %d\n", priv->rfa_txpowertrackingindex_real); ++#ifdef RTL8190P ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex = %d\n", priv->rfc_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->rfc_txpowertrackingindex_real = %d\n", priv->rfc_txpowertrackingindex_real); ++#endif ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation_difference = %d\n", priv->CCKPresentAttentuation_difference); ++ RT_TRACE(COMP_POWER_TRACKING, "priv->CCKPresentAttentuation = %d\n", priv->CCKPresentAttentuation); ++ ++ if (priv->CCKPresentAttentuation_difference <= -12||priv->CCKPresentAttentuation_difference >= 24) ++ { ++ priv->ieee80211->bdynamic_txpower_enable = TRUE; ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ write_nic_byte(dev, FW_Busy_Flag, 0); ++ RT_TRACE(COMP_POWER_TRACKING, "tx power track--->limited\n"); ++ return; ++ } ++ ++ ++ } ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++ Avg_TSSI_Meas_from_driver = 0; ++ for(k = 0;k < 5; k++) ++ tmp_report[k] = 0; ++ break; ++ } ++ write_nic_byte(dev, FW_Busy_Flag, 0); ++} ++ priv->ieee80211->bdynamic_txpower_enable = TRUE; ++ write_nic_byte(dev, Pw_Track_Flag, 0); ++} ++#ifndef RTL8190P ++static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev) ++{ ++#define ThermalMeterVal 9 ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 tmpRegA, TempCCk; ++ u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; ++ int i =0, CCKSwingNeedUpdate=0; ++ ++ if(!priv->btxpower_trackingInit) ++ { ++ //Query OFDM default setting ++ tmpRegA= rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord); ++ for(i=0; iOFDM_index= (u8)i; ++ RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, OFDM_index=0x%x\n", ++ rOFDM0_XATxIQImbalance, tmpRegA, priv->OFDM_index); ++ } ++ } ++ ++ //Query CCK default setting From 0xa22 ++ TempCCk = rtl8192_QueryBBReg(dev, rCCK0_TxFilter1, bMaskByte2); ++ for(i=0 ; iCCK_index =(u8) i; ++ RT_TRACE(COMP_POWER_TRACKING, "Initial reg0x%x = 0x%x, CCK_index=0x%x\n", ++ rCCK0_TxFilter1, TempCCk, priv->CCK_index); ++ break; ++ } ++} ++ priv->btxpower_trackingInit = TRUE; ++ //pHalData->TXPowercount = 0; ++ return; ++ } ++ ++ //========================== ++ // this is only for test, should be masked ++#if 0 ++{ ++ //UINT32 eRFPath; ++ //UINT32 start_rf, end_rf; ++ UINT32 curr_addr; ++ //UINT32 reg_addr; ++ //UINT32 reg_addr_end; ++ UINT32 reg_value; ++ //start_rf = RF90_PATH_A; ++ //end_rf = RF90_PATH_B;//RF90_PATH_MAX; ++ //reg_addr = 0x0; ++ //reg_addr_end = 0x2F; ++ ++ for (curr_addr = 0; curr_addr < 0x2d; curr_addr++) ++ { ++ reg_value = PHY_QueryRFReg( Adapter, (RF90_RADIO_PATH_E)RF90_PATH_A, ++ curr_addr, bMaskDWord); ++ } ++ ++ pHalData->TXPowercount = 0; ++ return; ++} ++#endif ++ //========================== ++ ++ // read and filter out unreasonable value ++ tmpRegA = rtl8192_phy_QueryRFReg(dev, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7] ++ RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d \n", tmpRegA); ++ if(tmpRegA < 3 || tmpRegA > 13) ++ return; ++ if(tmpRegA >= 12) // if over 12, TP will be bad when high temprature ++ tmpRegA = 12; ++ RT_TRACE(COMP_POWER_TRACKING, "Valid ThermalMeterA = %d \n", tmpRegA); ++ priv->ThermalMeter[0] = ThermalMeterVal; //We use fixed value by Bryant's suggestion ++ priv->ThermalMeter[1] = ThermalMeterVal; //We use fixed value by Bryant's suggestion ++ ++ //Get current RF-A temprature index ++ if(priv->ThermalMeter[0] >= (u8)tmpRegA) //lower temprature ++ { ++ tmpOFDMindex = tmpCCK20Mindex = 6+(priv->ThermalMeter[0]-(u8)tmpRegA); ++ tmpCCK40Mindex = tmpCCK20Mindex - 6; ++ if(tmpOFDMindex >= OFDM_Table_Length) ++ tmpOFDMindex = OFDM_Table_Length-1; ++ if(tmpCCK20Mindex >= CCK_Table_length) ++ tmpCCK20Mindex = CCK_Table_length-1; ++ if(tmpCCK40Mindex >= CCK_Table_length) ++ tmpCCK40Mindex = CCK_Table_length-1; ++ } ++ else ++ { ++ tmpval = ((u8)tmpRegA - priv->ThermalMeter[0]); ++ if(tmpval >= 6) // higher temprature ++ tmpOFDMindex = tmpCCK20Mindex = 0; // max to +6dB ++ else ++ tmpOFDMindex = tmpCCK20Mindex = 6 - tmpval; ++ tmpCCK40Mindex = 0; ++ } ++ //DbgPrint("%ddb, tmpOFDMindex = %d, tmpCCK20Mindex = %d, tmpCCK40Mindex = %d", ++ //((u1Byte)tmpRegA - pHalData->ThermalMeter[0]), ++ //tmpOFDMindex, tmpCCK20Mindex, tmpCCK40Mindex); ++ if(priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) //40M ++ tmpCCKindex = tmpCCK40Mindex; ++ else ++ tmpCCKindex = tmpCCK20Mindex; ++ ++ //record for bandwidth swith ++ priv->Record_CCK_20Mindex = tmpCCK20Mindex; ++ priv->Record_CCK_40Mindex = tmpCCK40Mindex; ++ RT_TRACE(COMP_POWER_TRACKING, "Record_CCK_20Mindex / Record_CCK_40Mindex = %d / %d.\n", ++ priv->Record_CCK_20Mindex, priv->Record_CCK_40Mindex); ++ ++ if(priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = TRUE; ++ CCKSwingNeedUpdate = 1; ++ } ++ else if(priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = FALSE; ++ CCKSwingNeedUpdate = 1; ++ } ++ ++ if(priv->CCK_index != tmpCCKindex) ++{ ++ priv->CCK_index = tmpCCKindex; ++ CCKSwingNeedUpdate = 1; ++ } ++ ++ if(CCKSwingNeedUpdate) ++ { ++ //DbgPrint("Update CCK Swing, CCK_index = %d\n", pHalData->CCK_index); ++ dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); ++ } ++ if(priv->OFDM_index != tmpOFDMindex) ++ { ++ priv->OFDM_index = tmpOFDMindex; ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, OFDMSwingTable[priv->OFDM_index]); ++ RT_TRACE(COMP_POWER_TRACKING, "Update OFDMSwing[%d] = 0x%x\n", ++ priv->OFDM_index, OFDMSwingTable[priv->OFDM_index]); ++ } ++ priv->txpower_count = 0; ++} ++#endif ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void dm_txpower_trackingcallback(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct r8192_priv *priv = container_of(dwork,struct r8192_priv,txpower_tracking_wq); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++extern void dm_txpower_trackingcallback(struct net_device *dev) ++{ ++#ifndef RTL8190P ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++#endif ++ ++#ifdef RTL8190P ++ dm_TXPowerTrackingCallback_TSSI(dev); ++#else ++ //if(priv->bDcut == TRUE) ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ dm_TXPowerTrackingCallback_TSSI(dev); ++ else ++ dm_TXPowerTrackingCallback_ThermalMeter(dev); ++#endif ++} ++ ++ ++static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ //Initial the Tx BB index and mapping value ++ priv->txbbgain_table[0].txbb_iq_amplifygain = 12; ++ priv->txbbgain_table[0].txbbgain_value=0x7f8001fe; ++ priv->txbbgain_table[1].txbb_iq_amplifygain = 11; ++ priv->txbbgain_table[1].txbbgain_value=0x788001e2; ++ priv->txbbgain_table[2].txbb_iq_amplifygain = 10; ++ priv->txbbgain_table[2].txbbgain_value=0x71c001c7; ++ priv->txbbgain_table[3].txbb_iq_amplifygain = 9; ++ priv->txbbgain_table[3].txbbgain_value=0x6b8001ae; ++ priv->txbbgain_table[4].txbb_iq_amplifygain = 8; ++ priv->txbbgain_table[4].txbbgain_value=0x65400195; ++ priv->txbbgain_table[5].txbb_iq_amplifygain = 7; ++ priv->txbbgain_table[5].txbbgain_value=0x5fc0017f; ++ priv->txbbgain_table[6].txbb_iq_amplifygain = 6; ++ priv->txbbgain_table[6].txbbgain_value=0x5a400169; ++ priv->txbbgain_table[7].txbb_iq_amplifygain = 5; ++ priv->txbbgain_table[7].txbbgain_value=0x55400155; ++ priv->txbbgain_table[8].txbb_iq_amplifygain = 4; ++ priv->txbbgain_table[8].txbbgain_value=0x50800142; ++ priv->txbbgain_table[9].txbb_iq_amplifygain = 3; ++ priv->txbbgain_table[9].txbbgain_value=0x4c000130; ++ priv->txbbgain_table[10].txbb_iq_amplifygain = 2; ++ priv->txbbgain_table[10].txbbgain_value=0x47c0011f; ++ priv->txbbgain_table[11].txbb_iq_amplifygain = 1; ++ priv->txbbgain_table[11].txbbgain_value=0x43c0010f; ++ priv->txbbgain_table[12].txbb_iq_amplifygain = 0; ++ priv->txbbgain_table[12].txbbgain_value=0x40000100; ++ priv->txbbgain_table[13].txbb_iq_amplifygain = -1; ++ priv->txbbgain_table[13].txbbgain_value=0x3c8000f2; ++ priv->txbbgain_table[14].txbb_iq_amplifygain = -2; ++ priv->txbbgain_table[14].txbbgain_value=0x390000e4; ++ priv->txbbgain_table[15].txbb_iq_amplifygain = -3; ++ priv->txbbgain_table[15].txbbgain_value=0x35c000d7; ++ priv->txbbgain_table[16].txbb_iq_amplifygain = -4; ++ priv->txbbgain_table[16].txbbgain_value=0x32c000cb; ++ priv->txbbgain_table[17].txbb_iq_amplifygain = -5; ++ priv->txbbgain_table[17].txbbgain_value=0x300000c0; ++ priv->txbbgain_table[18].txbb_iq_amplifygain = -6; ++ priv->txbbgain_table[18].txbbgain_value=0x2d4000b5; ++ priv->txbbgain_table[19].txbb_iq_amplifygain = -7; ++ priv->txbbgain_table[19].txbbgain_value=0x2ac000ab; ++ priv->txbbgain_table[20].txbb_iq_amplifygain = -8; ++ priv->txbbgain_table[20].txbbgain_value=0x288000a2; ++ priv->txbbgain_table[21].txbb_iq_amplifygain = -9; ++ priv->txbbgain_table[21].txbbgain_value=0x26000098; ++ priv->txbbgain_table[22].txbb_iq_amplifygain = -10; ++ priv->txbbgain_table[22].txbbgain_value=0x24000090; ++ priv->txbbgain_table[23].txbb_iq_amplifygain = -11; ++ priv->txbbgain_table[23].txbbgain_value=0x22000088; ++ priv->txbbgain_table[24].txbb_iq_amplifygain = -12; ++ priv->txbbgain_table[24].txbbgain_value=0x20000080; ++ priv->txbbgain_table[25].txbb_iq_amplifygain = -13; ++ priv->txbbgain_table[25].txbbgain_value=0x1a00006c; ++ priv->txbbgain_table[26].txbb_iq_amplifygain = -14; ++ priv->txbbgain_table[26].txbbgain_value=0x1c800072; ++ priv->txbbgain_table[27].txbb_iq_amplifygain = -15; ++ priv->txbbgain_table[27].txbbgain_value=0x18000060; ++ priv->txbbgain_table[28].txbb_iq_amplifygain = -16; ++ priv->txbbgain_table[28].txbbgain_value=0x19800066; ++ priv->txbbgain_table[29].txbb_iq_amplifygain = -17; ++ priv->txbbgain_table[29].txbbgain_value=0x15800056; ++ priv->txbbgain_table[30].txbb_iq_amplifygain = -18; ++ priv->txbbgain_table[30].txbbgain_value=0x26c0005b; ++ priv->txbbgain_table[31].txbb_iq_amplifygain = -19; ++ priv->txbbgain_table[31].txbbgain_value=0x14400051; ++ priv->txbbgain_table[32].txbb_iq_amplifygain = -20; ++ priv->txbbgain_table[32].txbbgain_value=0x24400051; ++ priv->txbbgain_table[33].txbb_iq_amplifygain = -21; ++ priv->txbbgain_table[33].txbbgain_value=0x1300004c; ++ priv->txbbgain_table[34].txbb_iq_amplifygain = -22; ++ priv->txbbgain_table[34].txbbgain_value=0x12000048; ++ priv->txbbgain_table[35].txbb_iq_amplifygain = -23; ++ priv->txbbgain_table[35].txbbgain_value=0x11000044; ++ priv->txbbgain_table[36].txbb_iq_amplifygain = -24; ++ priv->txbbgain_table[36].txbbgain_value=0x10000040; ++ ++ //ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 ++ //This Table is for CH1~CH13 ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[0] = 0x36; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[1] = 0x35; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[2] = 0x2e; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[3] = 0x25; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[4] = 0x1c; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[5] = 0x12; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[6] = 0x09; ++ priv->cck_txbbgain_table[0].ccktxbb_valuearray[7] = 0x04; ++ ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[0] = 0x33; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[1] = 0x32; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[2] = 0x2b; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[3] = 0x23; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[4] = 0x1a; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[5] = 0x11; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[6] = 0x08; ++ priv->cck_txbbgain_table[1].ccktxbb_valuearray[7] = 0x04; ++ ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[0] = 0x30; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[1] = 0x2f; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[2] = 0x29; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[3] = 0x21; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[4] = 0x19; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[5] = 0x10; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[6] = 0x08; ++ priv->cck_txbbgain_table[2].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[0] = 0x2d; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[1] = 0x2d; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[2] = 0x27; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[3] = 0x1f; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[4] = 0x18; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[5] = 0x0f; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[6] = 0x08; ++ priv->cck_txbbgain_table[3].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[0] = 0x2b; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[1] = 0x2a; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[2] = 0x25; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[3] = 0x1e; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[4] = 0x16; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[5] = 0x0e; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[6] = 0x07; ++ priv->cck_txbbgain_table[4].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[0] = 0x28; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[1] = 0x28; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[2] = 0x22; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[3] = 0x1c; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[4] = 0x15; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[5] = 0x0d; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[6] = 0x07; ++ priv->cck_txbbgain_table[5].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[0] = 0x26; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[1] = 0x25; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[2] = 0x21; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[3] = 0x1b; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[4] = 0x14; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[5] = 0x0d; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[6] = 0x06; ++ priv->cck_txbbgain_table[6].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[0] = 0x24; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[1] = 0x23; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[2] = 0x1f; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[3] = 0x19; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[4] = 0x13; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[5] = 0x0c; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[6] = 0x06; ++ priv->cck_txbbgain_table[7].ccktxbb_valuearray[7] = 0x03; ++ ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[0] = 0x22; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[1] = 0x21; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[2] = 0x1d; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[3] = 0x18; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[4] = 0x11; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[5] = 0x0b; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[6] = 0x06; ++ priv->cck_txbbgain_table[8].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[0] = 0x20; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[1] = 0x20; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[2] = 0x1b; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[3] = 0x16; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[4] = 0x11; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[5] = 0x08; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[6] = 0x05; ++ priv->cck_txbbgain_table[9].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[0] = 0x1f; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[1] = 0x1e; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[2] = 0x1a; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[3] = 0x15; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[4] = 0x10; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[5] = 0x0a; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[6] = 0x05; ++ priv->cck_txbbgain_table[10].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[0] = 0x1d; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[1] = 0x1c; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[2] = 0x18; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[3] = 0x14; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[4] = 0x0f; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[5] = 0x0a; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[6] = 0x05; ++ priv->cck_txbbgain_table[11].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[0] = 0x1b; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[1] = 0x1a; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[2] = 0x17; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[3] = 0x13; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[4] = 0x0e; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[5] = 0x09; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[6] = 0x04; ++ priv->cck_txbbgain_table[12].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[0] = 0x1a; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[1] = 0x19; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[2] = 0x16; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[3] = 0x12; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[4] = 0x0d; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[5] = 0x09; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[6] = 0x04; ++ priv->cck_txbbgain_table[13].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[0] = 0x18; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[1] = 0x17; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[2] = 0x15; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[3] = 0x11; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[4] = 0x0c; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[5] = 0x08; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[6] = 0x04; ++ priv->cck_txbbgain_table[14].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[0] = 0x17; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[1] = 0x16; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[2] = 0x13; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[3] = 0x10; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[4] = 0x0c; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[5] = 0x08; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[6] = 0x04; ++ priv->cck_txbbgain_table[15].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[0] = 0x16; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[1] = 0x15; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[2] = 0x12; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[3] = 0x0f; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[4] = 0x0b; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[5] = 0x07; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[6] = 0x04; ++ priv->cck_txbbgain_table[16].ccktxbb_valuearray[7] = 0x01; ++ ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[0] = 0x14; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[1] = 0x14; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[2] = 0x11; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[3] = 0x0e; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[4] = 0x0b; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[5] = 0x07; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[17].ccktxbb_valuearray[7] = 0x02; ++ ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[0] = 0x13; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[1] = 0x13; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[2] = 0x10; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[3] = 0x0d; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[4] = 0x0a; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[5] = 0x06; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[18].ccktxbb_valuearray[7] = 0x01; ++ ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[0] = 0x12; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[1] = 0x12; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[2] = 0x0f; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[3] = 0x0c; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[4] = 0x09; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[5] = 0x06; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[19].ccktxbb_valuearray[7] = 0x01; ++ ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[0] = 0x11; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[1] = 0x11; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[2] = 0x0f; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[3] = 0x0c; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[4] = 0x09; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[5] = 0x06; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[20].ccktxbb_valuearray[7] = 0x01; ++ ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[0] = 0x10; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[1] = 0x10; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[2] = 0x0e; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[3] = 0x0b; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[4] = 0x08; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[5] = 0x05; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[21].ccktxbb_valuearray[7] = 0x01; ++ ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[0] = 0x0f; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[1] = 0x0f; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[2] = 0x0d; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[3] = 0x0b; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[4] = 0x08; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[5] = 0x05; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[6] = 0x03; ++ priv->cck_txbbgain_table[22].ccktxbb_valuearray[7] = 0x01; ++ ++ //ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 ++ //This Table is for CH14 ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[0] = 0x36; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[1] = 0x35; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[2] = 0x2e; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[3] = 0x1b; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[0] = 0x33; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[1] = 0x32; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[2] = 0x2b; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[3] = 0x19; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[1].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[0] = 0x30; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[1] = 0x2f; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[2] = 0x29; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[3] = 0x18; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[2].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[0] = 0x2d; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[1] = 0x2d; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[2] = 0x27; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[3] = 0x17; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[3].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[0] = 0x2b; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[1] = 0x2a; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[2] = 0x25; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[3] = 0x15; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[4].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[0] = 0x28; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[1] = 0x28; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[2] = 0x22; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[3] = 0x14; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[5].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[0] = 0x26; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[1] = 0x25; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[2] = 0x21; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[3] = 0x13; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[6].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[0] = 0x24; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[1] = 0x23; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[2] = 0x1f; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[3] = 0x12; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[7].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[0] = 0x22; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[1] = 0x21; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[2] = 0x1d; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[3] = 0x11; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[8].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[0] = 0x20; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[1] = 0x20; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[2] = 0x1b; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[3] = 0x10; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[9].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[0] = 0x1f; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[1] = 0x1e; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[2] = 0x1a; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[3] = 0x0f; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[10].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[0] = 0x1d; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[1] = 0x1c; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[2] = 0x18; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[3] = 0x0e; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[11].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[0] = 0x1b; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[1] = 0x1a; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[2] = 0x17; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[3] = 0x0e; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[12].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[0] = 0x1a; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[1] = 0x19; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[2] = 0x16; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[3] = 0x0d; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[13].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[0] = 0x18; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[1] = 0x17; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[2] = 0x15; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[3] = 0x0c; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[14].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[0] = 0x17; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[1] = 0x16; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[2] = 0x13; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[3] = 0x0b; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[15].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[0] = 0x16; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[1] = 0x15; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[2] = 0x12; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[3] = 0x0b; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[16].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[0] = 0x14; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[1] = 0x14; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[2] = 0x11; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[3] = 0x0a; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[17].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[0] = 0x13; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[1] = 0x13; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[2] = 0x10; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[3] = 0x0a; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[18].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[0] = 0x12; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[1] = 0x12; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[2] = 0x0f; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[3] = 0x09; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[19].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[0] = 0x11; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[1] = 0x11; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[2] = 0x0f; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[3] = 0x09; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[20].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[0] = 0x10; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[1] = 0x10; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[2] = 0x0e; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[3] = 0x08; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[21].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[0] = 0x0f; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[1] = 0x0f; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[2] = 0x0d; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[3] = 0x08; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[4] = 0x00; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[5] = 0x00; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[6] = 0x00; ++ priv->cck_txbbgain_ch14_table[22].ccktxbb_valuearray[7] = 0x00; ++ ++ priv->btxpower_tracking = TRUE; ++ priv->txpower_count = 0; ++ priv->btxpower_trackingInit = FALSE; ++ ++} ++#ifndef RTL8190P ++static void dm_InitializeTXPowerTracking_ThermalMeter(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ // Tx Power tracking by Theremal Meter require Firmware R/W 3-wire. This mechanism ++ // can be enabled only when Firmware R/W 3-wire is enabled. Otherwise, frequent r/w ++ // 3-wire by driver cause RF goes into wrong state. ++ if(priv->ieee80211->FwRWRF) ++ priv->btxpower_tracking = TRUE; ++ else ++ priv->btxpower_tracking = FALSE; ++ priv->txpower_count = 0; ++ priv->btxpower_trackingInit = FALSE; ++} ++#endif ++ ++void dm_initialize_txpower_tracking(struct net_device *dev) ++{ ++#ifndef RTL8190P ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++#ifdef RTL8190P ++ dm_InitializeTXPowerTracking_TSSI(dev); ++#else ++ //if(priv->bDcut == TRUE) ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ dm_InitializeTXPowerTracking_TSSI(dev); ++ else ++ dm_InitializeTXPowerTracking_ThermalMeter(dev); ++#endif ++} // dm_InitializeTXPowerTracking ++ ++ ++static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u32 tx_power_track_counter = 0; ++ RT_TRACE(COMP_POWER_TRACKING,"%s()\n",__FUNCTION__); ++ if(read_nic_byte(dev, 0x11e) ==1) ++ return; ++ if(!priv->btxpower_tracking) ++ return; ++ tx_power_track_counter++; ++ ++ ++ if(tx_power_track_counter > 90) ++ { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); ++ #else ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->txpower_tracking_wq); ++ #else ++ queue_work(priv->priv_wq,&priv->txpower_tracking_wq); ++ #endif ++ #endif ++ tx_power_track_counter =0; ++ } ++ ++} ++ ++#ifndef RTL8190P ++static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u8 TM_Trigger=0; ++#if 0 ++ u1Byte i; ++ u4Byte tmpRegA; ++ for(i=0; i<50; i++) ++ { ++ tmpRegA = PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7] ++ PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); ++ //delay_us(100); ++ PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); ++ //delay_us(100); ++ } ++ DbgPrint("Trigger and readback ThermalMeter, write RF reg0x2 = 0x4d to 0x4f for 50 times\n"); ++#else ++ //DbgPrint("dm_CheckTXPowerTracking() \n"); ++ if(!priv->btxpower_tracking) ++ return; ++ else ++ { ++ if(priv->txpower_count <= 2) ++ { ++ priv->txpower_count++; ++ return; ++ } ++ } ++ ++ if(!TM_Trigger) ++ { ++ //Attention!! You have to wirte all 12bits data to RF, or it may cause RF to crash ++ //actually write reg0x02 bit1=0, then bit1=1. ++ //DbgPrint("Trigger ThermalMeter, write RF reg0x2 = 0x4d to 0x4f\n"); ++ rtl8192_phy_SetRFReg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); ++ rtl8192_phy_SetRFReg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); ++ rtl8192_phy_SetRFReg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); ++ rtl8192_phy_SetRFReg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); ++ TM_Trigger = 1; ++ return; ++ } ++ else ++ { ++ //DbgPrint("Schedule TxPowerTrackingWorkItem\n"); ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); ++ #else ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->txpower_tracking_wq); ++ #else ++ queue_work(priv->priv_wq,&priv->txpower_tracking_wq); ++ #endif ++ #endif ++ TM_Trigger = 0; ++ } ++#endif ++ } ++#endif ++ ++static void dm_check_txpower_tracking(struct net_device *dev) ++{ ++#ifndef RTL8190P ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //static u32 tx_power_track_counter = 0; ++#endif ++#ifdef RTL8190P ++ dm_CheckTXPowerTracking_TSSI(dev); ++#else ++ //if(priv->bDcut == TRUE) ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ dm_CheckTXPowerTracking_TSSI(dev); ++ else ++ dm_CheckTXPowerTracking_ThermalMeter(dev); ++#endif ++ ++} // dm_CheckTXPowerTracking ++ ++ ++static void dm_CCKTxPowerAdjust_TSSI(struct net_device *dev, bool bInCH14) ++{ ++ u32 TempVal; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //Write 0xa22 0xa23 ++ TempVal = 0; ++ if(!bInCH14){ ++ //Write 0xa22 0xa23 ++ TempVal = (u32)(priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[0] + ++ (priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[1]<<8)) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_TxFilter1,bMaskHWord, TempVal); ++ //Write 0xa24 ~ 0xa27 ++ TempVal = 0; ++ TempVal = (u32)(priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[2] + ++ (priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[3]<<8) + ++ (priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[4]<<16 )+ ++ (priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[5]<<24)); ++ rtl8192_setBBreg(dev, rCCK0_TxFilter2,bMaskDWord, TempVal); ++ //Write 0xa28 0xa29 ++ TempVal = 0; ++ TempVal = (u32)(priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[6] + ++ (priv->cck_txbbgain_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[7]<<8)) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_DebugPort,bMaskLWord, TempVal); ++ } ++ else ++ { ++ TempVal = (u32)(priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[0] + ++ (priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[1]<<8)) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_TxFilter1,bMaskHWord, TempVal); ++ //Write 0xa24 ~ 0xa27 ++ TempVal = 0; ++ TempVal = (u32)(priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[2] + ++ (priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[3]<<8) + ++ (priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[4]<<16 )+ ++ (priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[5]<<24)); ++ rtl8192_setBBreg(dev, rCCK0_TxFilter2,bMaskDWord, TempVal); ++ //Write 0xa28 0xa29 ++ TempVal = 0; ++ TempVal = (u32)(priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[6] + ++ (priv->cck_txbbgain_ch14_table[(u8)(priv->CCKPresentAttentuation)].ccktxbb_valuearray[7]<<8)) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_DebugPort,bMaskLWord, TempVal); ++ } ++ ++ ++} ++#ifndef RTL8190P ++static void dm_CCKTxPowerAdjust_ThermalMeter(struct net_device *dev, bool bInCH14) ++{ ++ u32 TempVal; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ TempVal = 0; ++ if(!bInCH14) ++ { ++ //Write 0xa22 0xa23 ++ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][0] + ++ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][1]<<8) ; ++ rtl8192_setBBreg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_TxFilter1, TempVal); ++ //Write 0xa24 ~ 0xa27 ++ TempVal = 0; ++ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][2] + ++ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][3]<<8) + ++ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][4]<<16 )+ ++ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][5]<<24); ++ rtl8192_setBBreg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_TxFilter2, TempVal); ++ //Write 0xa28 0xa29 ++ TempVal = 0; ++ TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][6] + ++ (CCKSwingTable_Ch1_Ch13[priv->CCK_index][7]<<8) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_DebugPort, bMaskLWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING, "CCK not chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_DebugPort, TempVal); ++ } ++ else ++ { ++// priv->CCKTxPowerAdjustCntNotCh14++; //cosa add for debug. ++ //Write 0xa22 0xa23 ++ TempVal = CCKSwingTable_Ch14[priv->CCK_index][0] + ++ (CCKSwingTable_Ch14[priv->CCK_index][1]<<8) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_TxFilter1, TempVal); ++ //Write 0xa24 ~ 0xa27 ++ TempVal = 0; ++ TempVal = CCKSwingTable_Ch14[priv->CCK_index][2] + ++ (CCKSwingTable_Ch14[priv->CCK_index][3]<<8) + ++ (CCKSwingTable_Ch14[priv->CCK_index][4]<<16 )+ ++ (CCKSwingTable_Ch14[priv->CCK_index][5]<<24); ++ rtl8192_setBBreg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_TxFilter2, TempVal); ++ //Write 0xa28 0xa29 ++ TempVal = 0; ++ TempVal = CCKSwingTable_Ch14[priv->CCK_index][6] + ++ (CCKSwingTable_Ch14[priv->CCK_index][7]<<8) ; ++ ++ rtl8192_setBBreg(dev, rCCK0_DebugPort, bMaskLWord, TempVal); ++ RT_TRACE(COMP_POWER_TRACKING,"CCK chnl 14, reg 0x%x = 0x%x\n", ++ rCCK0_DebugPort, TempVal); ++ } ++ } ++#endif ++ ++ ++void dm_cck_txpower_adjust(struct net_device *dev, bool binch14) ++{ // dm_CCKTxPowerAdjust ++#ifndef RTL8190P ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++#ifdef RTL8190P ++ dm_CCKTxPowerAdjust_TSSI(dev, binch14); ++#else ++ //if(priv->bDcut == TRUE) ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ dm_CCKTxPowerAdjust_TSSI(dev, binch14); ++ else ++ dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14); ++#endif ++} ++ ++ ++#ifndef RTL8192U ++static void dm_txpower_reset_recovery( ++ struct net_device *dev ++) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ RT_TRACE(COMP_POWER_TRACKING, "Start Reset Recovery ==>\n"); ++ rtl8192_setBBreg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfa_txpowertrackingindex].txbbgain_value); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in 0xc80 is %08x\n",priv->txbbgain_table[priv->rfa_txpowertrackingindex].txbbgain_value); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in RFA_txPowerTrackingIndex is %x\n",priv->rfa_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery : RF A I/Q Amplify Gain is %ld\n",priv->txbbgain_table[priv->rfa_txpowertrackingindex].txbb_iq_amplifygain); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: CCK Attenuation is %d dB\n",priv->CCKPresentAttentuation); ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ ++ rtl8192_setBBreg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord, priv->txbbgain_table[priv->rfc_txpowertrackingindex].txbbgain_value); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in 0xc90 is %08x\n",priv->txbbgain_table[priv->rfc_txpowertrackingindex].txbbgain_value); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in RFC_txPowerTrackingIndex is %x\n",priv->rfc_txpowertrackingindex); ++ RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery : RF C I/Q Amplify Gain is %ld\n",priv->txbbgain_table[priv->rfc_txpowertrackingindex].txbb_iq_amplifygain); ++ ++} // dm_TXPowerResetRecovery ++ ++void dm_restore_dynamic_mechanism_state(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 reg_ratr = priv->rate_adaptive.last_ratr; ++ ++ if(!priv->up) ++ { ++ RT_TRACE(COMP_RATE, "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n"); ++ return; ++ } ++ ++ // ++ // Restore previous state for rate adaptive ++ // ++ if(priv->rate_adaptive.rate_adaptive_disabled) ++ return; ++ // TODO: Only 11n mode is implemented currently, ++ if( !(priv->ieee80211->mode==WIRELESS_MODE_N_24G || ++ priv->ieee80211->mode==WIRELESS_MODE_N_5G)) ++ return; ++ { ++ /* 2007/11/15 MH Copy from 8190PCI. */ ++ u32 ratr_value; ++ ratr_value = reg_ratr; ++ if(priv->rf_type == RF_1T2R) // 1T2R, Spatial Stream 2 should be disabled ++ { ++ ratr_value &=~ (RATE_ALL_OFDM_2SS); ++ //DbgPrint("HW_VAR_TATR_0 from 0x%x ==> 0x%x\n", ((pu4Byte)(val))[0], ratr_value); ++ } ++ //DbgPrint("set HW_VAR_TATR_0 = 0x%x\n", ratr_value); ++ //cosa PlatformEFIOWrite4Byte(Adapter, RATR0, ((pu4Byte)(val))[0]); ++ write_nic_dword(dev, RATR0, ratr_value); ++ write_nic_byte(dev, UFWP, 1); ++#if 0 // Disable old code. ++ u1Byte index; ++ u4Byte input_value; ++ index = (u1Byte)((((pu4Byte)(val))[0]) >> 28); ++ input_value = (((pu4Byte)(val))[0]) & 0x0fffffff; ++ // TODO: Correct it. Emily 2007.01.11 ++ PlatformEFIOWrite4Byte(Adapter, RATR0+index*4, input_value); ++#endif ++ } ++ //Resore TX Power Tracking Index ++ if(priv->btxpower_trackingInit && priv->btxpower_tracking){ ++ dm_txpower_reset_recovery(dev); ++ } ++ ++ // ++ //Restore BB Initial Gain ++ // ++ dm_bb_initialgain_restore(dev); ++ ++} // DM_RestoreDynamicMechanismState ++ ++static void dm_bb_initialgain_restore(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 bit_mask = 0x7f; //Bit0~ Bit6 ++ ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI) ++ return; ++ ++ //Disable Initial Gain ++ //PHY_SetBBReg(Adapter, UFWP, bMaskLWord, 0x800); ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // Only clear byte 1 and rewrite. ++ rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bit_mask, (u32)priv->initgain_backup.xaagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bit_mask, (u32)priv->initgain_backup.xbagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, bit_mask, (u32)priv->initgain_backup.xcagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, bit_mask, (u32)priv->initgain_backup.xdagccore1); ++ bit_mask = bMaskByte2; ++ rtl8192_setBBreg(dev, rCCK0_CCA, bit_mask, (u32)priv->initgain_backup.cca); ++ ++ RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc50 is %x\n",priv->initgain_backup.xaagccore1); ++ RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc58 is %x\n",priv->initgain_backup.xbagccore1); ++ RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc60 is %x\n",priv->initgain_backup.xcagccore1); ++ RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc68 is %x\n",priv->initgain_backup.xdagccore1); ++ RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xa0a is %x\n",priv->initgain_backup.cca); ++ //Enable Initial Gain ++ //PHY_SetBBReg(Adapter, UFWP, bMaskLWord, 0x100); ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x1); // Only clear byte 1 and rewrite. ++ ++} // dm_BBInitialGainRestore ++ ++ ++void dm_backup_dynamic_mechanism_state(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ // Fsync to avoid reset ++ priv->bswitch_fsync = false; ++ priv->bfsync_processing = false; ++ //Backup BB InitialGain ++ dm_bb_initialgain_backup(dev); ++ ++} // DM_BackupDynamicMechanismState ++ ++ ++static void dm_bb_initialgain_backup(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 bit_mask = bMaskByte0; //Bit0~ Bit6 ++ ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI) ++ return; ++ ++ //PHY_SetBBReg(Adapter, UFWP, bMaskLWord, 0x800); ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // Only clear byte 1 and rewrite. ++ priv->initgain_backup.xaagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XAAGCCore1, bit_mask); ++ priv->initgain_backup.xbagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XBAGCCore1, bit_mask); ++ priv->initgain_backup.xcagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XCAGCCore1, bit_mask); ++ priv->initgain_backup.xdagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XDAGCCore1, bit_mask); ++ bit_mask = bMaskByte2; ++ priv->initgain_backup.cca = (u8)rtl8192_QueryBBReg(dev, rCCK0_CCA, bit_mask); ++ ++ RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc50 is %x\n",priv->initgain_backup.xaagccore1); ++ RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc58 is %x\n",priv->initgain_backup.xbagccore1); ++ RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc60 is %x\n",priv->initgain_backup.xcagccore1); ++ RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc68 is %x\n",priv->initgain_backup.xdagccore1); ++ RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xa0a is %x\n",priv->initgain_backup.cca); ++ ++} // dm_BBInitialGainBakcup ++ ++#endif ++/*----------------------------------------------------------------------------- ++ * Function: dm_change_dynamic_initgain_thresh() ++ * ++ * Overview: ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/29/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, u32 dm_value) ++{ ++ if (dm_type == DIG_TYPE_THRESH_HIGH) ++ { ++ dm_digtable.rssi_high_thresh = dm_value; ++ } ++ else if (dm_type == DIG_TYPE_THRESH_LOW) ++ { ++ dm_digtable.rssi_low_thresh = dm_value; ++ } ++ else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) ++ { ++ dm_digtable.rssi_high_power_highthresh = dm_value; ++ } ++ else if (dm_type == DIG_TYPE_THRESH_HIGHPWR_HIGH) ++ { ++ dm_digtable.rssi_high_power_highthresh = dm_value; ++ } ++ else if (dm_type == DIG_TYPE_ENABLE) ++ { ++ dm_digtable.dig_state = DM_STA_DIG_MAX; ++ dm_digtable.dig_enable_flag = true; ++ } ++ else if (dm_type == DIG_TYPE_DISABLE) ++ { ++ dm_digtable.dig_state = DM_STA_DIG_MAX; ++ dm_digtable.dig_enable_flag = false; ++ } ++ else if (dm_type == DIG_TYPE_DBG_MODE) ++ { ++ if(dm_value >= DM_DBG_MAX) ++ dm_value = DM_DBG_OFF; ++ dm_digtable.dbg_mode = (u8)dm_value; ++ } ++ else if (dm_type == DIG_TYPE_RSSI) ++ { ++ if(dm_value > 100) ++ dm_value = 30; ++ dm_digtable.rssi_val = (long)dm_value; ++ } ++ else if (dm_type == DIG_TYPE_ALGORITHM) ++ { ++ if (dm_value >= DIG_ALGO_MAX) ++ dm_value = DIG_ALGO_BY_FALSE_ALARM; ++ if(dm_digtable.dig_algorithm != (u8)dm_value) ++ dm_digtable.dig_algorithm_switch = 1; ++ dm_digtable.dig_algorithm = (u8)dm_value; ++ } ++ else if (dm_type == DIG_TYPE_BACKOFF) ++ { ++ if(dm_value > 30) ++ dm_value = 30; ++ dm_digtable.backoff_val = (u8)dm_value; ++ } ++ else if(dm_type == DIG_TYPE_RX_GAIN_MIN) ++ { ++ if(dm_value == 0) ++ dm_value = 0x1; ++ dm_digtable.rx_gain_range_min = (u8)dm_value; ++ } ++ else if(dm_type == DIG_TYPE_RX_GAIN_MAX) ++ { ++ if(dm_value > 0x50) ++ dm_value = 0x50; ++ dm_digtable.rx_gain_range_max = (u8)dm_value; ++ } ++} /* DM_ChangeDynamicInitGainThresh */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_dig_init() ++ * ++ * Overview: Set DIG scheme init value. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/15/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void dm_dig_init(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ /* 2007/10/05 MH Disable DIG scheme now. Not tested. */ ++ dm_digtable.dig_enable_flag = true; ++ dm_digtable.dig_algorithm = DIG_ALGO_BY_RSSI; ++ dm_digtable.dbg_mode = DM_DBG_OFF; //off=by real rssi value, on=by DM_DigTable.Rssi_val for new dig ++ dm_digtable.dig_algorithm_switch = 0; ++ ++ /* 2007/10/04 MH Define init gain threshol. */ ++ dm_digtable.dig_state = DM_STA_DIG_MAX; ++ dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; ++ dm_digtable.initialgain_lowerbound_state = false; ++ ++ dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW; ++ dm_digtable.rssi_high_thresh = DM_DIG_THRESH_HIGH; ++ ++ dm_digtable.rssi_high_power_lowthresh = DM_DIG_HIGH_PWR_THRESH_LOW; ++ dm_digtable.rssi_high_power_highthresh = DM_DIG_HIGH_PWR_THRESH_HIGH; ++ ++ dm_digtable.rssi_val = 50; //for new dig debug rssi value ++ dm_digtable.backoff_val = DM_DIG_BACKOFF; ++ dm_digtable.rx_gain_range_max = DM_DIG_MAX; ++ if(priv->CustomerID == RT_CID_819x_Netcore) ++ dm_digtable.rx_gain_range_min = DM_DIG_MIN_Netcore; ++ else ++ dm_digtable.rx_gain_range_min = DM_DIG_MIN; ++ ++} /* dm_dig_init */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_ctrl_initgain_byrssi() ++ * ++ * Overview: Driver must monitor RSSI and notify firmware to change initial ++ * gain according to different threshold. BB team provide the ++ * suggested solution. ++ * ++ * Input: struct net_device *dev ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/27/2008 amy Create Version 0 porting from windows code. ++ *---------------------------------------------------------------------------*/ ++static void dm_ctrl_initgain_byrssi(struct net_device *dev) ++{ ++ ++ if (dm_digtable.dig_enable_flag == false) ++ return; ++ ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM) ++ dm_ctrl_initgain_byrssi_by_fwfalse_alarm(dev); ++ else if(dm_digtable.dig_algorithm == DIG_ALGO_BY_RSSI) ++ dm_ctrl_initgain_byrssi_by_driverrssi(dev); ++ else ++ return; ++} ++ ++ ++static void dm_ctrl_initgain_byrssi_by_driverrssi( ++ struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 i; ++ static u8 fw_dig=0; ++ ++ if (dm_digtable.dig_enable_flag == false) ++ return; ++ ++ //DbgPrint("Dig by Sw Rssi \n"); ++ if(dm_digtable.dig_algorithm_switch) // if swithed algorithm, we have to disable FW Dig. ++ fw_dig = 0; ++ if(fw_dig <= 3) // execute several times to make sure the FW Dig is disabled ++ {// FW DIG Off ++ for(i=0; i<3; i++) ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // Only clear byte 1 and rewrite. ++ fw_dig++; ++ dm_digtable.dig_state = DM_STA_DIG_OFF; //fw dig off. ++ } ++ ++ if(priv->ieee80211->state == IEEE80211_LINKED) ++ dm_digtable.cur_connect_state = DIG_CONNECT; ++ else ++ dm_digtable.cur_connect_state = DIG_DISCONNECT; ++ ++ //DbgPrint("DM_DigTable.PreConnectState = %d, DM_DigTable.CurConnectState = %d \n", ++ //DM_DigTable.PreConnectState, DM_DigTable.CurConnectState); ++ ++ if(dm_digtable.dbg_mode == DM_DBG_OFF) ++ dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; ++ //DbgPrint("DM_DigTable.Rssi_val = %d \n", DM_DigTable.Rssi_val); ++ dm_initial_gain(dev); ++ dm_pd_th(dev); ++ dm_cs_ratio(dev); ++ if(dm_digtable.dig_algorithm_switch) ++ dm_digtable.dig_algorithm_switch = 0; ++ dm_digtable.pre_connect_state = dm_digtable.cur_connect_state; ++ ++} /* dm_CtrlInitGainByRssi */ ++ ++static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( ++ struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u32 reset_cnt = 0; ++ u8 i; ++ ++ if (dm_digtable.dig_enable_flag == false) ++ return; ++ ++ if(dm_digtable.dig_algorithm_switch) ++ { ++ dm_digtable.dig_state = DM_STA_DIG_MAX; ++ // Fw DIG On. ++ for(i=0; i<3; i++) ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x1); // Only clear byte 1 and rewrite. ++ dm_digtable.dig_algorithm_switch = 0; ++ } ++ ++ if (priv->ieee80211->state != IEEE80211_LINKED) ++ return; ++ ++ // For smooth, we can not change DIG state. ++ if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) && ++ (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_thresh)) ++ { ++ return; ++ } ++ //DbgPrint("Dig by Fw False Alarm\n"); ++ //if (DM_DigTable.Dig_State == DM_STA_DIG_OFF) ++ /*DbgPrint("DIG Check\n\r RSSI=%d LOW=%d HIGH=%d STATE=%d", ++ pHalData->UndecoratedSmoothedPWDB, DM_DigTable.RssiLowThresh, ++ DM_DigTable.RssiHighThresh, DM_DigTable.Dig_State);*/ ++ /* 1. When RSSI decrease, We have to judge if it is smaller than a treshold ++ and then execute below step. */ ++ if ((priv->undecorated_smoothed_pwdb <= dm_digtable.rssi_low_thresh)) ++ { ++ /* 2008/02/05 MH When we execute silent reset, the DIG PHY parameters ++ will be reset to init value. We must prevent the condition. */ ++ if (dm_digtable.dig_state == DM_STA_DIG_OFF && ++ (priv->reset_count == reset_cnt)) ++ { ++ return; ++ } ++ else ++ { ++ reset_cnt = priv->reset_count; ++ } ++ ++ // If DIG is off, DIG high power state must reset. ++ dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; ++ dm_digtable.dig_state = DM_STA_DIG_OFF; ++ ++ // 1.1 DIG Off. ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // Only clear byte 1 and rewrite. ++ ++ // 1.2 Set initial gain. ++ write_nic_byte(dev, rOFDM0_XAAGCCore1, 0x17); ++ write_nic_byte(dev, rOFDM0_XBAGCCore1, 0x17); ++ write_nic_byte(dev, rOFDM0_XCAGCCore1, 0x17); ++ write_nic_byte(dev, rOFDM0_XDAGCCore1, 0x17); ++ ++ // 1.3 Lower PD_TH for OFDM. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ /* 2008/01/11 MH 40MHZ 90/92 register are not the same. */ ++ // 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x40); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x00); ++ #endif ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(pAdapter, rOFDM0_RxDetector1, 0x40); ++ */ ++ //else if (pAdapter->HardwareType == HARDWARE_TYPE_RTL8192E) ++ ++ ++ //else ++ //PlatformEFIOWrite1Byte(pAdapter, rOFDM0_RxDetector1, 0x40); ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ ++ // 1.4 Lower CS ratio for CCK. ++ write_nic_byte(dev, 0xa0a, 0x08); ++ ++ // 1.5 Higher EDCCA. ++ //PlatformEFIOWrite4Byte(pAdapter, rOFDM0_ECCAThreshold, 0x325); ++ return; ++ ++ } ++ ++ /* 2. When RSSI increase, We have to judge if it is larger than a treshold ++ and then execute below step. */ ++ if ((priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) ) ++ { ++ u8 reset_flag = 0; ++ ++ if (dm_digtable.dig_state == DM_STA_DIG_ON && ++ (priv->reset_count == reset_cnt)) ++ { ++ dm_ctrl_initgain_byrssi_highpwr(dev); ++ return; ++ } ++ else ++ { ++ if (priv->reset_count != reset_cnt) ++ reset_flag = 1; ++ ++ reset_cnt = priv->reset_count; ++ } ++ ++ dm_digtable.dig_state = DM_STA_DIG_ON; ++ //DbgPrint("DIG ON\n\r"); ++ ++ // 2.1 Set initial gain. ++ // 2008/02/26 MH SD3-Jerry suggest to prevent dirty environment. ++ if (reset_flag == 1) ++ { ++ write_nic_byte(dev, rOFDM0_XAAGCCore1, 0x2c); ++ write_nic_byte(dev, rOFDM0_XBAGCCore1, 0x2c); ++ write_nic_byte(dev, rOFDM0_XCAGCCore1, 0x2c); ++ write_nic_byte(dev, rOFDM0_XDAGCCore1, 0x2c); ++ } ++ else ++ { ++ write_nic_byte(dev, rOFDM0_XAAGCCore1, 0x20); ++ write_nic_byte(dev, rOFDM0_XBAGCCore1, 0x20); ++ write_nic_byte(dev, rOFDM0_XCAGCCore1, 0x20); ++ write_nic_byte(dev, rOFDM0_XDAGCCore1, 0x20); ++ } ++ ++ // 2.2 Higher PD_TH for OFDM. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ /* 2008/01/11 MH 40MHZ 90/92 register are not the same. */ ++ // 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20); ++ #endif ++ /* ++ else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ */ ++ //else if (pAdapter->HardwareType == HARDWARE_TYPE_RTL8192E) ++ ++ //else ++ //PlatformEFIOWrite1Byte(pAdapter, rOFDM0_RxDetector1, 0x42); ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x44); ++ ++ // 2.3 Higher CS ratio for CCK. ++ write_nic_byte(dev, 0xa0a, 0xcd); ++ ++ // 2.4 Lower EDCCA. ++ /* 2008/01/11 MH 90/92 series are the same. */ ++ //PlatformEFIOWrite4Byte(pAdapter, rOFDM0_ECCAThreshold, 0x346); ++ ++ // 2.5 DIG On. ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x1); // Only clear byte 1 and rewrite. ++ ++ } ++ ++ dm_ctrl_initgain_byrssi_highpwr(dev); ++ ++} /* dm_CtrlInitGainByRssi */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_ctrl_initgain_byrssi_highpwr() ++ * ++ * Overview: ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/28/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void dm_ctrl_initgain_byrssi_highpwr( ++ struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u32 reset_cnt_highpwr = 0; ++ ++ // For smooth, we can not change high power DIG state in the range. ++ if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_high_power_lowthresh) && ++ (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_highthresh)) ++ { ++ return; ++ } ++ ++ /* 3. When RSSI >75% or <70%, it is a high power issue. We have to judge if ++ it is larger than a treshold and then execute below step. */ ++ // 2008/02/05 MH SD3-Jerry Modify PD_TH for high power issue. ++ if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_power_highthresh) ++ { ++ if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON && ++ (priv->reset_count == reset_cnt_highpwr)) ++ return; ++ else ++ dm_digtable.dig_highpwr_state = DM_STA_DIG_ON; ++ ++ // 3.1 Higher PD_TH for OFDM for high power state. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x41); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x10); ++ #endif ++ ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x41); ++ */ ++ ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x43); ++ } ++ else ++ { ++ if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF&& ++ (priv->reset_count == reset_cnt_highpwr)) ++ return; ++ else ++ dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF; ++ ++ if (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_lowthresh && ++ priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) ++ { ++ // 3.2 Recover PD_TH for OFDM for normal power region. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20); ++ #endif ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ */ ++ ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x44); ++ } ++ } ++ ++ reset_cnt_highpwr = priv->reset_count; ++ ++} /* dm_CtrlInitGainByRssiHighPwr */ ++ ++ ++static void dm_initial_gain( ++ struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 initial_gain=0; ++ static u8 initialized=0, force_write=0; ++ static u32 reset_cnt=0; ++ ++ if(dm_digtable.dig_algorithm_switch) ++ { ++ initialized = 0; ++ reset_cnt = 0; ++ } ++ ++ if(dm_digtable.pre_connect_state == dm_digtable.cur_connect_state) ++ { ++ if(dm_digtable.cur_connect_state == DIG_CONNECT) ++ { ++ if((dm_digtable.rssi_val+10-dm_digtable.backoff_val) > dm_digtable.rx_gain_range_max) ++ dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max; ++ else if((dm_digtable.rssi_val+10-dm_digtable.backoff_val) < dm_digtable.rx_gain_range_min) ++ dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_min; ++ else ++ dm_digtable.cur_ig_value = dm_digtable.rssi_val+10-dm_digtable.backoff_val; ++ } ++ else //current state is disconnected ++ { ++ if(dm_digtable.cur_ig_value == 0) ++ dm_digtable.cur_ig_value = priv->DefaultInitialGain[0]; ++ else ++ dm_digtable.cur_ig_value = dm_digtable.pre_ig_value; ++ } ++ } ++ else // disconnected -> connected or connected -> disconnected ++ { ++ dm_digtable.cur_ig_value = priv->DefaultInitialGain[0]; ++ dm_digtable.pre_ig_value = 0; ++ } ++ //DbgPrint("DM_DigTable.CurIGValue = 0x%x, DM_DigTable.PreIGValue = 0x%x\n", DM_DigTable.CurIGValue, DM_DigTable.PreIGValue); ++ ++ // if silent reset happened, we should rewrite the values back ++ if(priv->reset_count != reset_cnt) ++ { ++ force_write = 1; ++ reset_cnt = priv->reset_count; ++ } ++ ++ if(dm_digtable.pre_ig_value != read_nic_byte(dev, rOFDM0_XAAGCCore1)) ++ force_write = 1; ++ ++ { ++ if((dm_digtable.pre_ig_value != dm_digtable.cur_ig_value) ++ || !initialized || force_write) ++ { ++ initial_gain = (u8)dm_digtable.cur_ig_value; ++ //DbgPrint("Write initial gain = 0x%x\n", initial_gain); ++ // Set initial gain. ++ write_nic_byte(dev, rOFDM0_XAAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XBAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XCAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XDAGCCore1, initial_gain); ++ dm_digtable.pre_ig_value = dm_digtable.cur_ig_value; ++ initialized = 1; ++ force_write = 0; ++ } ++ } ++} ++ ++static void dm_pd_th( ++ struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u8 initialized=0, force_write=0; ++ static u32 reset_cnt = 0; ++ ++ if(dm_digtable.dig_algorithm_switch) ++ { ++ initialized = 0; ++ reset_cnt = 0; ++ } ++ ++ if(dm_digtable.pre_connect_state == dm_digtable.cur_connect_state) ++ { ++ if(dm_digtable.cur_connect_state == DIG_CONNECT) ++ { ++ if (dm_digtable.rssi_val >= dm_digtable.rssi_high_power_highthresh) ++ dm_digtable.curpd_thstate = DIG_PD_AT_HIGH_POWER; ++ else if ((dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)) ++ dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER; ++ else if ((dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) && ++ (dm_digtable.rssi_val < dm_digtable.rssi_high_power_lowthresh)) ++ dm_digtable.curpd_thstate = DIG_PD_AT_NORMAL_POWER; ++ else ++ dm_digtable.curpd_thstate = dm_digtable.prepd_thstate; ++ } ++ else ++ { ++ dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER; ++ } ++ } ++ else // disconnected -> connected or connected -> disconnected ++ { ++ dm_digtable.curpd_thstate = DIG_PD_AT_LOW_POWER; ++ } ++ ++ // if silent reset happened, we should rewrite the values back ++ if(priv->reset_count != reset_cnt) ++ { ++ force_write = 1; ++ reset_cnt = priv->reset_count; ++ } ++ ++ { ++ if((dm_digtable.prepd_thstate != dm_digtable.curpd_thstate) || ++ (initialized<=3) || force_write) ++ { ++ //DbgPrint("Write PD_TH state = %d\n", DM_DigTable.CurPD_THState); ++ if(dm_digtable.curpd_thstate == DIG_PD_AT_LOW_POWER) ++ { ++ // Lower PD_TH for OFDM. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ /* 2008/01/11 MH 40MHZ 90/92 register are not the same. */ ++ // 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x40); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x00); ++ #endif ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x40); ++ */ ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ } ++ else if(dm_digtable.curpd_thstate == DIG_PD_AT_NORMAL_POWER) ++ { ++ // Higher PD_TH for OFDM. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ /* 2008/01/11 MH 40MHZ 90/92 register are not the same. */ ++ // 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20); ++ #endif ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x42); ++ */ ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x44); ++ } ++ else if(dm_digtable.curpd_thstate == DIG_PD_AT_HIGH_POWER) ++ { ++ // Higher PD_TH for OFDM for high power state. ++ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x41); ++ #else ++ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x10); ++ #endif ++ /*else if (priv->card_8192 == HARDWARE_TYPE_RTL8190P) ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x41); ++ */ ++ } ++ else ++ write_nic_byte(dev, rOFDM0_RxDetector1, 0x43); ++ } ++ dm_digtable.prepd_thstate = dm_digtable.curpd_thstate; ++ if(initialized <= 3) ++ initialized++; ++ force_write = 0; ++ } ++ } ++} ++ ++static void dm_cs_ratio( ++ struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ static u8 initialized=0,force_write=0; ++ static u32 reset_cnt = 0; ++ ++ if(dm_digtable.dig_algorithm_switch) ++ { ++ initialized = 0; ++ reset_cnt = 0; ++ } ++ ++ if(dm_digtable.pre_connect_state == dm_digtable.cur_connect_state) ++ { ++ if(dm_digtable.cur_connect_state == DIG_CONNECT) ++ { ++ if ((dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)) ++ dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; ++ else if ((dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) ) ++ dm_digtable.curcs_ratio_state = DIG_CS_RATIO_HIGHER; ++ else ++ dm_digtable.curcs_ratio_state = dm_digtable.precs_ratio_state; ++ } ++ else ++ { ++ dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; ++ } ++ } ++ else // disconnected -> connected or connected -> disconnected ++ { ++ dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; ++ } ++ ++ // if silent reset happened, we should rewrite the values back ++ if(priv->reset_count != reset_cnt) ++ { ++ force_write = 1; ++ reset_cnt = priv->reset_count; ++ } ++ ++ ++ { ++ if((dm_digtable.precs_ratio_state != dm_digtable.curcs_ratio_state) || ++ !initialized || force_write) ++ { ++ //DbgPrint("Write CS_ratio state = %d\n", DM_DigTable.CurCS_ratioState); ++ if(dm_digtable.curcs_ratio_state == DIG_CS_RATIO_LOWER) ++ { ++ // Lower CS ratio for CCK. ++ write_nic_byte(dev, 0xa0a, 0x08); ++ } ++ else if(dm_digtable.curcs_ratio_state == DIG_CS_RATIO_HIGHER) ++ { ++ // Higher CS ratio for CCK. ++ write_nic_byte(dev, 0xa0a, 0xcd); ++ } ++ dm_digtable.precs_ratio_state = dm_digtable.curcs_ratio_state; ++ initialized = 1; ++ force_write = 0; ++ } ++ } ++} ++ ++void dm_init_edca_turbo(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ priv->bcurrent_turbo_EDCA = false; ++ priv->ieee80211->bis_any_nonbepkts = false; ++ priv->bis_cur_rdlstate = false; ++} // dm_init_edca_turbo ++ ++#if 1 ++static void dm_check_edca_turbo( ++ struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo; ++ //PSTA_QOS pStaQos = pMgntInfo->pStaQos; ++ ++ // Keep past Tx/Rx packet count for RT-to-RT EDCA turbo. ++ static unsigned long lastTxOkCnt = 0; ++ static unsigned long lastRxOkCnt = 0; ++ unsigned long curTxOkCnt = 0; ++ unsigned long curRxOkCnt = 0; ++ ++ // ++ // Do not be Turbo if it's under WiFi config and Qos Enabled, because the EDCA parameters ++ // should follow the settings from QAP. By Bruce, 2007-12-07. ++ // ++ #if 1 ++ if(priv->ieee80211->state != IEEE80211_LINKED) ++ goto dm_CheckEdcaTurbo_EXIT; ++ #endif ++ // We do not turn on EDCA turbo mode for some AP that has IOT issue ++ if(priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO) ++ goto dm_CheckEdcaTurbo_EXIT; ++ ++// printk("========>%s():bis_any_nonbepkts is %d\n",__FUNCTION__,priv->bis_any_nonbepkts); ++ // Check the status for current condition. ++ if(!priv->ieee80211->bis_any_nonbepkts) ++ { ++ curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; ++ curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; ++ // For RT-AP, we needs to turn it on when Rx>Tx ++ if(curRxOkCnt > 4*curTxOkCnt) ++ { ++ //printk("%s():curRxOkCnt > 4*curTxOkCnt\n"); ++ if(!priv->bis_cur_rdlstate || !priv->bcurrent_turbo_EDCA) ++ { ++ write_nic_dword(dev, EDCAPARA_BE, edca_setting_DL[pHTInfo->IOTPeer]); ++ priv->bis_cur_rdlstate = true; ++ } ++ } ++ else ++ { ++ ++ //printk("%s():curRxOkCnt < 4*curTxOkCnt\n"); ++ if(priv->bis_cur_rdlstate || !priv->bcurrent_turbo_EDCA) ++ { ++ write_nic_dword(dev, EDCAPARA_BE, edca_setting_UL[pHTInfo->IOTPeer]); ++ priv->bis_cur_rdlstate = false; ++ } ++ ++ } ++ ++ priv->bcurrent_turbo_EDCA = true; ++ } ++ else ++ { ++ // ++ // Turn Off EDCA turbo here. ++ // Restore original EDCA according to the declaration of AP. ++ // ++ if(priv->bcurrent_turbo_EDCA) ++ { ++ ++ { ++ u8 u1bAIFS; ++ u32 u4bAcParam; ++ struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters; ++ u8 mode = priv->ieee80211->mode; ++ ++ // For Each time updating EDCA parameter, reset EDCA turbo mode status. ++ dm_init_edca_turbo(dev); ++ u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime; ++ u4bAcParam = ((((u32)(qos_parameters->tx_op_limit[0]))<< AC_PARAM_TXOP_LIMIT_OFFSET)| ++ (((u32)(qos_parameters->cw_max[0]))<< AC_PARAM_ECW_MAX_OFFSET)| ++ (((u32)(qos_parameters->cw_min[0]))<< AC_PARAM_ECW_MIN_OFFSET)| ++ ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET)); ++ printk("===>u4bAcParam:%x, ", u4bAcParam); ++ //write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam); ++ write_nic_dword(dev, EDCAPARA_BE, u4bAcParam); ++ ++ // Check ACM bit. ++ // If it is set, immediately set ACM control bit to downgrading AC for passing WMM testplan. Annie, 2005-12-13. ++ { ++ // TODO: Modified this part and try to set acm control in only 1 IO processing!! ++ ++ PACI_AIFSN pAciAifsn = (PACI_AIFSN)&(qos_parameters->aifs[0]); ++ u8 AcmCtrl = read_nic_byte( dev, AcmHwCtrl ); ++ if( pAciAifsn->f.ACM ) ++ { // ACM bit is 1. ++ AcmCtrl |= AcmHw_BeqEn; ++ } ++ else ++ { // ACM bit is 0. ++ AcmCtrl &= (~AcmHw_BeqEn); ++ } ++ ++ RT_TRACE( COMP_QOS,"SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n", AcmCtrl ) ; ++ write_nic_byte(dev, AcmHwCtrl, AcmCtrl ); ++ } ++ } ++ priv->bcurrent_turbo_EDCA = false; ++ } ++ } ++ ++ ++dm_CheckEdcaTurbo_EXIT: ++ // Set variables for next time. ++ priv->ieee80211->bis_any_nonbepkts = false; ++ lastTxOkCnt = priv->stats.txbytesunicast; ++ lastRxOkCnt = priv->stats.rxbytesunicast; ++} // dm_CheckEdcaTurbo ++#endif ++ ++static void dm_init_ctstoself(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); ++ ++ priv->ieee80211->bCTSToSelfEnable = TRUE; ++ priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal; ++} ++ ++static void dm_ctstoself(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); ++ PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo; ++ static unsigned long lastTxOkCnt = 0; ++ static unsigned long lastRxOkCnt = 0; ++ unsigned long curTxOkCnt = 0; ++ unsigned long curRxOkCnt = 0; ++ ++ if(priv->ieee80211->bCTSToSelfEnable != TRUE) ++ { ++ pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; ++ return; ++ } ++ /* ++ 1. Uplink ++ 2. Linksys350/Linksys300N ++ 3. <50 disable, >55 enable ++ */ ++ ++ if(pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) ++ { ++ curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; ++ curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; ++ if(curRxOkCnt > 4*curTxOkCnt) //downlink, disable CTS to self ++ { ++ pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; ++ //DbgPrint("dm_CTSToSelf() ==> CTS to self disabled -- downlink\n"); ++ } ++ else //uplink ++ { ++ #if 1 ++ pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF; ++ #else ++ if(priv->undecorated_smoothed_pwdb < priv->ieee80211->CTSToSelfTH) // disable CTS to self ++ { ++ pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; ++ //DbgPrint("dm_CTSToSelf() ==> CTS to self disabled\n"); ++ } ++ else if(priv->undecorated_smoothed_pwdb >= (priv->ieee80211->CTSToSelfTH+5)) // enable CTS to self ++ { ++ pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF; ++ //DbgPrint("dm_CTSToSelf() ==> CTS to self enabled\n"); ++ } ++ #endif ++ } ++ ++ lastTxOkCnt = priv->stats.txbytesunicast; ++ lastRxOkCnt = priv->stats.rxbytesunicast; ++ } ++} ++ ++ ++#if 0 ++/*----------------------------------------------------------------------------- ++ * Function: dm_rf_operation_test_callback() ++ * ++ * Overview: Only for RF operation test now. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/29/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++void dm_rf_operation_test_callback(unsigned long dev) ++{ ++// struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); ++ u8 erfpath; ++ ++ ++ for(erfpath=0; erfpath<4; erfpath++) ++ { ++ //DbgPrint("Set RF-%d\n\r", eRFPath); ++ //PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7); ++ udelay(100); ++ } ++ ++ { ++ //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500); ++ } ++ ++ // For test ++ { ++ //u8 i; ++ //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500); ++#if 0 ++ for(i=0; i<50; i++) ++ { ++ // Write Test ++ PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); ++ //delay_us(100); ++ PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); ++ //delay_us(100); ++ PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4d); ++ //delay_us(100); ++ PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4f); ++ //delay_us(100); ++ ++#if 0 ++ // Read test ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits); ++ //delay_us(100); ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits); ++ //delay_us(100); ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits); ++ //delay_us(100); ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits); ++ //delay_us(100); ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits); ++ //delay_us(100); ++ PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits); ++ //delay_us(100); ++#endif ++ } ++#endif ++ } ++ ++} /* DM_RfOperationTestCallBack */ ++#endif ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_check_rfctrl_gpio() ++ * ++ * Overview: Copy 8187B template for 9xseries. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/28/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++#if 1 ++static void dm_check_rfctrl_gpio(struct net_device * dev) ++{ ++#ifdef RTL8192E ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ ++ // Walk around for DTM test, we will not enable HW - radio on/off because r/w ++ // page 1 register before Lextra bus is enabled cause system fails when resuming ++ // from S4. 20080218, Emily ++ ++ // Stop to execute workitem to prevent S3/S4 bug. ++#ifdef RTL8190P ++ return; ++#endif ++#ifdef RTL8192U ++ return; ++#endif ++#ifdef RTL8192E ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0); ++ #else ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->gpio_change_rf_wq); ++ #else ++ queue_work(priv->priv_wq,&priv->gpio_change_rf_wq); ++ #endif ++ #endif ++#endif ++ ++} /* dm_CheckRfCtrlGPIO */ ++ ++#endif ++/*----------------------------------------------------------------------------- ++ * Function: dm_check_pbc_gpio() ++ * ++ * Overview: Check if PBC button is pressed. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/28/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void dm_check_pbc_gpio(struct net_device *dev) ++{ ++#ifdef RTL8192U ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 tmp1byte; ++ ++ ++ tmp1byte = read_nic_byte(dev,GPI); ++ if(tmp1byte == 0xff) ++ return; ++ ++ if (tmp1byte&BIT6 || tmp1byte&BIT0) ++ { ++ // Here we only set bPbcPressed to TRUE ++ // After trigger PBC, the variable will be set to FALSE ++ RT_TRACE(COMP_IO, "CheckPbcGPIO - PBC is pressed\n"); ++ priv->bpbc_pressed = true; ++ } ++#endif ++ ++} ++ ++#ifdef RTL8192E ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_GPIOChangeRF ++ * Overview: PCI will not support workitem call back HW radio on-off control. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 02/21/2008 MHC Create Version 0. ++ * ++ *---------------------------------------------------------------------------*/ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void dm_gpio_change_rf_callback(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); ++ struct net_device *dev = priv->ieee80211->dev; ++#else ++extern void dm_gpio_change_rf_callback(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ u8 tmp1byte; ++ RT_RF_POWER_STATE eRfPowerStateToSet; ++ bool bActuallySet = false; ++ ++ bActuallySet=false; ++ ++ if(!priv->up) ++ { ++ RT_TRACE((COMP_INIT | COMP_POWER | COMP_RF),"dm_gpio_change_rf_callback(): Callback function breaks out!!\n"); ++ } ++ else ++ { ++ // 0x108 GPIO input register is read only ++ //set 0x108 B1= 1: RF-ON; 0: RF-OFF. ++ tmp1byte = read_nic_byte(dev,GPI); ++ ++ eRfPowerStateToSet = (tmp1byte&BIT1) ? eRfOn : eRfOff; ++ ++ if( (priv->bHwRadioOff == true) && (eRfPowerStateToSet == eRfOn)) ++ { ++ RT_TRACE(COMP_RF, "gpiochangeRF - HW Radio ON\n"); ++ ++ priv->bHwRadioOff = false; ++ bActuallySet = true; ++ } ++ else if ( (priv->bHwRadioOff == false) && (eRfPowerStateToSet == eRfOff)) ++ { ++ RT_TRACE(COMP_RF, "gpiochangeRF - HW Radio OFF\n"); ++ priv->bHwRadioOff = true; ++ bActuallySet = true; ++ } ++ ++ if(bActuallySet) ++ { ++ priv->bHwRfOffAction = 1; ++ MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW); ++ //DrvIFIndicateCurrentPhyStatus(pAdapter); ++ ++ } ++ else ++ { ++ msleep(2000); ++ } ++ ++ } ++ ++} /* dm_GPIOChangeRF */ ++ ++#endif ++/*----------------------------------------------------------------------------- ++ * Function: DM_RFPathCheckWorkItemCallBack() ++ * ++ * Overview: Check if Current RF RX path is enabled ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 01/30/2008 MHC Create Version 0. ++ * ++ *---------------------------------------------------------------------------*/ ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++void dm_rf_pathcheck_workitemcallback(struct work_struct *work) ++{ ++ struct delayed_work *dwork = container_of(work,struct delayed_work,work); ++ struct r8192_priv *priv = container_of(dwork,struct r8192_priv,rfpath_check_wq); ++ struct net_device *dev =priv->ieee80211->dev; ++#else ++extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ //bool bactually_set = false; ++ u8 rfpath = 0, i; ++ ++ ++ /* 2008/01/30 MH After discussing with SD3 Jerry, 0xc04/0xd04 register will ++ always be the same. We only read 0xc04 now. */ ++ rfpath = read_nic_byte(dev, 0xc04); ++ ++ // Check Bit 0-3, it means if RF A-D is enabled. ++ for (i = 0; i < RF90_PATH_MAX; i++) ++ { ++ if (rfpath & (0x01<brfpath_rxenable[i] = 1; ++ else ++ priv->brfpath_rxenable[i] = 0; ++ } ++ if(!DM_RxPathSelTable.Enable) ++ return; ++ ++ dm_rxpath_sel_byrssi(dev); ++} /* DM_RFPathCheckWorkItemCallBack */ ++ ++static void dm_init_rxpath_selection(struct net_device * dev) ++{ ++ u8 i; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ DM_RxPathSelTable.Enable = 1; //default enabled ++ DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low; ++ DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH; ++ if(priv->CustomerID == RT_CID_819x_Netcore) ++ DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; ++ else ++ DM_RxPathSelTable.cck_method = CCK_Rx_Version_1; ++ DM_RxPathSelTable.DbgMode = DM_DBG_OFF; ++ DM_RxPathSelTable.disabledRF = 0; ++ for(i=0; i<4; i++) ++ { ++ DM_RxPathSelTable.rf_rssi[i] = 50; ++ DM_RxPathSelTable.cck_pwdb_sta[i] = -64; ++ DM_RxPathSelTable.rf_enable_rssi_th[i] = 100; ++ } ++} ++ ++static void dm_rxpath_sel_byrssi(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 i, max_rssi_index=0, min_rssi_index=0, sec_rssi_index=0, rf_num=0; ++ u8 tmp_max_rssi=0, tmp_min_rssi=0, tmp_sec_rssi=0; ++ u8 cck_default_Rx=0x2; //RF-C ++ u8 cck_optional_Rx=0x3;//RF-D ++ long tmp_cck_max_pwdb=0, tmp_cck_min_pwdb=0, tmp_cck_sec_pwdb=0; ++ u8 cck_rx_ver2_max_index=0, cck_rx_ver2_min_index=0, cck_rx_ver2_sec_index=0; ++ u8 cur_rf_rssi; ++ long cur_cck_pwdb; ++ static u8 disabled_rf_cnt=0, cck_Rx_Path_initialized=0; ++ u8 update_cck_rx_path; ++ ++ if(priv->rf_type != RF_2T4R) ++ return; ++ ++ if(!cck_Rx_Path_initialized) ++ { ++ DM_RxPathSelTable.cck_Rx_path = (read_nic_byte(dev, 0xa07)&0xf); ++ cck_Rx_Path_initialized = 1; ++ } ++ ++ DM_RxPathSelTable.disabledRF = 0xf; ++ DM_RxPathSelTable.disabledRF &=~ (read_nic_byte(dev, 0xc04)); ++ ++ if(priv->ieee80211->mode == WIRELESS_MODE_B) ++ { ++ DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; //pure B mode, fixed cck version2 ++ //DbgPrint("Pure B mode, use cck rx version2 \n"); ++ } ++ ++ //decide max/sec/min rssi index ++ for (i=0; istats.rx_rssi_percentage[i]; ++ ++ if(priv->brfpath_rxenable[i]) ++ { ++ rf_num++; ++ cur_rf_rssi = DM_RxPathSelTable.rf_rssi[i]; ++ ++ if(rf_num == 1) // find first enabled rf path and the rssi values ++ { //initialize, set all rssi index to the same one ++ max_rssi_index = min_rssi_index = sec_rssi_index = i; ++ tmp_max_rssi = tmp_min_rssi = tmp_sec_rssi = cur_rf_rssi; ++ } ++ else if(rf_num == 2) ++ { // we pick up the max index first, and let sec and min to be the same one ++ if(cur_rf_rssi >= tmp_max_rssi) ++ { ++ tmp_max_rssi = cur_rf_rssi; ++ max_rssi_index = i; ++ } ++ else ++ { ++ tmp_sec_rssi = tmp_min_rssi = cur_rf_rssi; ++ sec_rssi_index = min_rssi_index = i; ++ } ++ } ++ else ++ { ++ if(cur_rf_rssi > tmp_max_rssi) ++ { ++ tmp_sec_rssi = tmp_max_rssi; ++ sec_rssi_index = max_rssi_index; ++ tmp_max_rssi = cur_rf_rssi; ++ max_rssi_index = i; ++ } ++ else if(cur_rf_rssi == tmp_max_rssi) ++ { // let sec and min point to the different index ++ tmp_sec_rssi = cur_rf_rssi; ++ sec_rssi_index = i; ++ } ++ else if((cur_rf_rssi < tmp_max_rssi) &&(cur_rf_rssi > tmp_sec_rssi)) ++ { ++ tmp_sec_rssi = cur_rf_rssi; ++ sec_rssi_index = i; ++ } ++ else if(cur_rf_rssi == tmp_sec_rssi) ++ { ++ if(tmp_sec_rssi == tmp_min_rssi) ++ { // let sec and min point to the different index ++ tmp_sec_rssi = cur_rf_rssi; ++ sec_rssi_index = i; ++ } ++ else ++ { ++ // This case we don't need to set any index ++ } ++ } ++ else if((cur_rf_rssi < tmp_sec_rssi) && (cur_rf_rssi > tmp_min_rssi)) ++ { ++ // This case we don't need to set any index ++ } ++ else if(cur_rf_rssi == tmp_min_rssi) ++ { ++ if(tmp_sec_rssi == tmp_min_rssi) ++ { // let sec and min point to the different index ++ tmp_min_rssi = cur_rf_rssi; ++ min_rssi_index = i; ++ } ++ else ++ { ++ // This case we don't need to set any index ++ } ++ } ++ else if(cur_rf_rssi < tmp_min_rssi) ++ { ++ tmp_min_rssi = cur_rf_rssi; ++ min_rssi_index = i; ++ } ++ } ++ } ++ } ++ ++ rf_num = 0; ++ // decide max/sec/min cck pwdb index ++ if(DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) ++ { ++ for (i=0; ibrfpath_rxenable[i]) ++ { ++ rf_num++; ++ cur_cck_pwdb = DM_RxPathSelTable.cck_pwdb_sta[i]; ++ ++ if(rf_num == 1) // find first enabled rf path and the rssi values ++ { //initialize, set all rssi index to the same one ++ cck_rx_ver2_max_index = cck_rx_ver2_min_index = cck_rx_ver2_sec_index = i; ++ tmp_cck_max_pwdb = tmp_cck_min_pwdb = tmp_cck_sec_pwdb = cur_cck_pwdb; ++ } ++ else if(rf_num == 2) ++ { // we pick up the max index first, and let sec and min to be the same one ++ if(cur_cck_pwdb >= tmp_cck_max_pwdb) ++ { ++ tmp_cck_max_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_max_index = i; ++ } ++ else ++ { ++ tmp_cck_sec_pwdb = tmp_cck_min_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_sec_index = cck_rx_ver2_min_index = i; ++ } ++ } ++ else ++ { ++ if(cur_cck_pwdb > tmp_cck_max_pwdb) ++ { ++ tmp_cck_sec_pwdb = tmp_cck_max_pwdb; ++ cck_rx_ver2_sec_index = cck_rx_ver2_max_index; ++ tmp_cck_max_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_max_index = i; ++ } ++ else if(cur_cck_pwdb == tmp_cck_max_pwdb) ++ { // let sec and min point to the different index ++ tmp_cck_sec_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_sec_index = i; ++ } ++ else if((cur_cck_pwdb < tmp_cck_max_pwdb) &&(cur_cck_pwdb > tmp_cck_sec_pwdb)) ++ { ++ tmp_cck_sec_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_sec_index = i; ++ } ++ else if(cur_cck_pwdb == tmp_cck_sec_pwdb) ++ { ++ if(tmp_cck_sec_pwdb == tmp_cck_min_pwdb) ++ { // let sec and min point to the different index ++ tmp_cck_sec_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_sec_index = i; ++ } ++ else ++ { ++ // This case we don't need to set any index ++ } ++ } ++ else if((cur_cck_pwdb < tmp_cck_sec_pwdb) && (cur_cck_pwdb > tmp_cck_min_pwdb)) ++ { ++ // This case we don't need to set any index ++ } ++ else if(cur_cck_pwdb == tmp_cck_min_pwdb) ++ { ++ if(tmp_cck_sec_pwdb == tmp_cck_min_pwdb) ++ { // let sec and min point to the different index ++ tmp_cck_min_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_min_index = i; ++ } ++ else ++ { ++ // This case we don't need to set any index ++ } ++ } ++ else if(cur_cck_pwdb < tmp_cck_min_pwdb) ++ { ++ tmp_cck_min_pwdb = cur_cck_pwdb; ++ cck_rx_ver2_min_index = i; ++ } ++ } ++ ++ } ++ } ++ } ++ ++ ++ // Set CCK Rx path ++ // reg0xA07[3:2]=cck default rx path, reg0xa07[1:0]=cck optional rx path. ++ update_cck_rx_path = 0; ++ if(DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) ++ { ++ cck_default_Rx = cck_rx_ver2_max_index; ++ cck_optional_Rx = cck_rx_ver2_sec_index; ++ if(tmp_cck_max_pwdb != -64) ++ update_cck_rx_path = 1; ++ } ++ ++ if(tmp_min_rssi < DM_RxPathSelTable.SS_TH_low && disabled_rf_cnt < 2) ++ { ++ if((tmp_max_rssi - tmp_min_rssi) >= DM_RxPathSelTable.diff_TH) ++ { ++ //record the enabled rssi threshold ++ DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5; ++ //disable the BB Rx path, OFDM ++ rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0x1<>i) & 0x1) //disabled rf ++ { ++ if(tmp_max_rssi >= DM_RxPathSelTable.rf_enable_rssi_th[i]) ++ { ++ //enable the BB Rx path ++ //DbgPrint("RF-%d is enabled. \n", 0x1<= KERNEL_VERSION(2,6,20) ++ queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0); ++#else ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ schedule_task(&priv->rfpath_check_wq); ++#else ++ queue_work(priv->priv_wq,&priv->rfpath_check_wq); ++#endif ++#endif ++} /* dm_CheckRxRFPath */ ++ ++ ++static void dm_init_fsync (struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ priv->ieee80211->fsync_time_interval = 500; ++ priv->ieee80211->fsync_rate_bitmap = 0x0f000800; ++ priv->ieee80211->fsync_rssi_threshold = 30; ++#ifdef RTL8190P ++ priv->ieee80211->bfsync_enable = true; ++#else ++ priv->ieee80211->bfsync_enable = false; ++#endif ++ priv->ieee80211->fsync_multiple_timeinterval = 3; ++ priv->ieee80211->fsync_firstdiff_ratethreshold= 100; ++ priv->ieee80211->fsync_seconddiff_ratethreshold= 200; ++ priv->ieee80211->fsync_state = Default_Fsync; ++ priv->framesyncMonitor = 1; // current default 0xc38 monitor on ++ ++ init_timer(&priv->fsync_timer); ++ priv->fsync_timer.data = (unsigned long)dev; ++ priv->fsync_timer.function = dm_fsync_timer_callback; ++} ++ ++ ++static void dm_deInit_fsync(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ del_timer_sync(&priv->fsync_timer); ++} ++ ++void dm_fsync_timer_callback(unsigned long data) ++{ ++ struct net_device *dev = (struct net_device *)data; ++ struct r8192_priv *priv = ieee80211_priv((struct net_device *)data); ++ u32 rate_index, rate_count = 0, rate_count_diff=0; ++ bool bSwitchFromCountDiff = false; ++ bool bDoubleTimeInterval = false; ++ ++ if( priv->ieee80211->state == IEEE80211_LINKED && ++ priv->ieee80211->bfsync_enable && ++ (priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_CDD_FSYNC)) ++ { ++ // Count rate 54, MCS [7], [12, 13, 14, 15] ++ u32 rate_bitmap; ++ for(rate_index = 0; rate_index <= 27; rate_index++) ++ { ++ rate_bitmap = 1 << rate_index; ++ if(priv->ieee80211->fsync_rate_bitmap & rate_bitmap) ++ rate_count+= priv->stats.received_rate_histogram[1][rate_index]; ++ } ++ ++ if(rate_count < priv->rate_record) ++ rate_count_diff = 0xffffffff - rate_count + priv->rate_record; ++ else ++ rate_count_diff = rate_count - priv->rate_record; ++ if(rate_count_diff < priv->rateCountDiffRecord) ++ { ++ ++ u32 DiffNum = priv->rateCountDiffRecord - rate_count_diff; ++ // Contiune count ++ if(DiffNum >= priv->ieee80211->fsync_seconddiff_ratethreshold) ++ priv->ContiuneDiffCount++; ++ else ++ priv->ContiuneDiffCount = 0; ++ ++ // Contiune count over ++ if(priv->ContiuneDiffCount >=2) ++ { ++ bSwitchFromCountDiff = true; ++ priv->ContiuneDiffCount = 0; ++ } ++ } ++ else ++ { ++ // Stop contiune count ++ priv->ContiuneDiffCount = 0; ++ } ++ ++ //If Count diff <= FsyncRateCountThreshold ++ if(rate_count_diff <= priv->ieee80211->fsync_firstdiff_ratethreshold) ++ { ++ bSwitchFromCountDiff = true; ++ priv->ContiuneDiffCount = 0; ++ } ++ priv->rate_record = rate_count; ++ priv->rateCountDiffRecord = rate_count_diff; ++ RT_TRACE(COMP_HALDM, "rateRecord %d rateCount %d, rateCountdiff %d bSwitchFsync %d\n", priv->rate_record, rate_count, rate_count_diff , priv->bswitch_fsync); ++ // if we never receive those mcs rate and rssi > 30 % then switch fsyn ++ if(priv->undecorated_smoothed_pwdb > priv->ieee80211->fsync_rssi_threshold && bSwitchFromCountDiff) ++ { ++ bDoubleTimeInterval = true; ++ priv->bswitch_fsync = !priv->bswitch_fsync; ++ if(priv->bswitch_fsync) ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev,0xC36, 0x00); ++ #else ++ write_nic_byte(dev,0xC36, 0x1c); ++ #endif ++ write_nic_byte(dev, 0xC3e, 0x90); ++ } ++ else ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev, 0xC36, 0x40); ++ #else ++ write_nic_byte(dev, 0xC36, 0x5c); ++ #endif ++ write_nic_byte(dev, 0xC3e, 0x96); ++ } ++ } ++ else if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->fsync_rssi_threshold) ++ { ++ if(priv->bswitch_fsync) ++ { ++ priv->bswitch_fsync = false; ++ #ifdef RTL8190P ++ write_nic_byte(dev, 0xC36, 0x40); ++ #else ++ write_nic_byte(dev, 0xC36, 0x5c); ++ #endif ++ write_nic_byte(dev, 0xC3e, 0x96); ++ } ++ } ++ if(bDoubleTimeInterval){ ++ if(timer_pending(&priv->fsync_timer)) ++ del_timer_sync(&priv->fsync_timer); ++ priv->fsync_timer.expires = jiffies + MSECS(priv->ieee80211->fsync_time_interval*priv->ieee80211->fsync_multiple_timeinterval); ++ add_timer(&priv->fsync_timer); ++ } ++ else{ ++ if(timer_pending(&priv->fsync_timer)) ++ del_timer_sync(&priv->fsync_timer); ++ priv->fsync_timer.expires = jiffies + MSECS(priv->ieee80211->fsync_time_interval); ++ add_timer(&priv->fsync_timer); ++ } ++ } ++ else ++ { ++ // Let Register return to default value; ++ if(priv->bswitch_fsync) ++ { ++ priv->bswitch_fsync = false; ++ #ifdef RTL8190P ++ write_nic_byte(dev, 0xC36, 0x40); ++ #else ++ write_nic_byte(dev, 0xC36, 0x5c); ++ #endif ++ write_nic_byte(dev, 0xC3e, 0x96); ++ } ++ priv->ContiuneDiffCount = 0; ++ #ifdef RTL8190P ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x164052cd); ++ #else ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c52cd); ++ #endif ++ } ++ RT_TRACE(COMP_HALDM, "ContiuneDiffCount %d\n", priv->ContiuneDiffCount); ++ RT_TRACE(COMP_HALDM, "rateRecord %d rateCount %d, rateCountdiff %d bSwitchFsync %d\n", priv->rate_record, rate_count, rate_count_diff , priv->bswitch_fsync); ++} ++ ++static void dm_StartHWFsync(struct net_device *dev) ++{ ++ RT_TRACE(COMP_HALDM, "%s\n", __FUNCTION__); ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c12cf); ++ write_nic_byte(dev, 0xc3b, 0x41); ++} ++ ++static void dm_EndSWFsync(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ RT_TRACE(COMP_HALDM, "%s\n", __FUNCTION__); ++ del_timer_sync(&(priv->fsync_timer)); ++ ++ // Let Register return to default value; ++ if(priv->bswitch_fsync) ++ { ++ priv->bswitch_fsync = false; ++ ++ #ifdef RTL8190P ++ write_nic_byte(dev, 0xC36, 0x40); ++ #else ++ write_nic_byte(dev, 0xC36, 0x5c); ++#endif ++ ++ write_nic_byte(dev, 0xC3e, 0x96); ++ } ++ ++ priv->ContiuneDiffCount = 0; ++#ifndef RTL8190P ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c52cd); ++#endif ++ ++} ++ ++static void dm_StartSWFsync(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 rateIndex; ++ u32 rateBitmap; ++ ++ RT_TRACE(COMP_HALDM,"%s\n", __FUNCTION__); ++ // Initial rate record to zero, start to record. ++ priv->rate_record = 0; ++ // Initial contiune diff count to zero, start to record. ++ priv->ContiuneDiffCount = 0; ++ priv->rateCountDiffRecord = 0; ++ priv->bswitch_fsync = false; ++ ++ if(priv->ieee80211->mode == WIRELESS_MODE_N_24G) ++ { ++ priv->ieee80211->fsync_firstdiff_ratethreshold= 600; ++ priv->ieee80211->fsync_seconddiff_ratethreshold = 0xffff; ++ } ++ else ++ { ++ priv->ieee80211->fsync_firstdiff_ratethreshold= 200; ++ priv->ieee80211->fsync_seconddiff_ratethreshold = 200; ++ } ++ for(rateIndex = 0; rateIndex <= 27; rateIndex++) ++ { ++ rateBitmap = 1 << rateIndex; ++ if(priv->ieee80211->fsync_rate_bitmap & rateBitmap) ++ priv->rate_record += priv->stats.received_rate_histogram[1][rateIndex]; ++ } ++ if(timer_pending(&priv->fsync_timer)) ++ del_timer_sync(&priv->fsync_timer); ++ priv->fsync_timer.expires = jiffies + MSECS(priv->ieee80211->fsync_time_interval); ++ add_timer(&priv->fsync_timer); ++ ++#ifndef RTL8190P ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c12cd); ++#endif ++ ++} ++ ++static void dm_EndHWFsync(struct net_device *dev) ++{ ++ RT_TRACE(COMP_HALDM,"%s\n", __FUNCTION__); ++ write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c52cd); ++ write_nic_byte(dev, 0xc3b, 0x49); ++ ++} ++ ++void dm_check_fsync(struct net_device *dev) ++{ ++#define RegC38_Default 0 ++#define RegC38_NonFsync_Other_AP 1 ++#define RegC38_Fsync_AP_BCM 2 ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ //u32 framesyncC34; ++ static u8 reg_c38_State=RegC38_Default; ++ static u32 reset_cnt=0; ++ ++ RT_TRACE(COMP_HALDM, "RSSI %d TimeInterval %d MultipleTimeInterval %d\n", priv->ieee80211->fsync_rssi_threshold, priv->ieee80211->fsync_time_interval, priv->ieee80211->fsync_multiple_timeinterval); ++ RT_TRACE(COMP_HALDM, "RateBitmap 0x%x FirstDiffRateThreshold %d SecondDiffRateThreshold %d\n", priv->ieee80211->fsync_rate_bitmap, priv->ieee80211->fsync_firstdiff_ratethreshold, priv->ieee80211->fsync_seconddiff_ratethreshold); ++ ++ if( priv->ieee80211->state == IEEE80211_LINKED && ++ (priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_CDD_FSYNC)) ++ { ++ if(priv->ieee80211->bfsync_enable == 0) ++ { ++ switch(priv->ieee80211->fsync_state) ++ { ++ case Default_Fsync: ++ dm_StartHWFsync(dev); ++ priv->ieee80211->fsync_state = HW_Fsync; ++ break; ++ case SW_Fsync: ++ dm_EndSWFsync(dev); ++ dm_StartHWFsync(dev); ++ priv->ieee80211->fsync_state = HW_Fsync; ++ break; ++ case HW_Fsync: ++ default: ++ break; ++ } ++ } ++ else ++ { ++ switch(priv->ieee80211->fsync_state) ++ { ++ case Default_Fsync: ++ dm_StartSWFsync(dev); ++ priv->ieee80211->fsync_state = SW_Fsync; ++ break; ++ case HW_Fsync: ++ dm_EndHWFsync(dev); ++ dm_StartSWFsync(dev); ++ priv->ieee80211->fsync_state = SW_Fsync; ++ break; ++ case SW_Fsync: ++ default: ++ break; ++ ++ } ++ } ++ if(priv->framesyncMonitor) ++ { ++ if(reg_c38_State != RegC38_Fsync_AP_BCM) ++ { //For broadcom AP we write different default value ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector3, 0x15); ++ #else ++ write_nic_byte(dev, rOFDM0_RxDetector3, 0x95); ++ #endif ++ ++ reg_c38_State = RegC38_Fsync_AP_BCM; ++ } ++ } ++ } ++ else ++ { ++ switch(priv->ieee80211->fsync_state) ++ { ++ case HW_Fsync: ++ dm_EndHWFsync(dev); ++ priv->ieee80211->fsync_state = Default_Fsync; ++ break; ++ case SW_Fsync: ++ dm_EndSWFsync(dev); ++ priv->ieee80211->fsync_state = Default_Fsync; ++ break; ++ case Default_Fsync: ++ default: ++ break; ++ } ++ ++ if(priv->framesyncMonitor) ++ { ++ if(priv->ieee80211->state == IEEE80211_LINKED) ++ { ++ if(priv->undecorated_smoothed_pwdb <= RegC38_TH) ++ { ++ if(reg_c38_State != RegC38_NonFsync_Other_AP) ++ { ++ #ifdef RTL8190P ++ write_nic_byte(dev, rOFDM0_RxDetector3, 0x10); ++ #else ++ write_nic_byte(dev, rOFDM0_RxDetector3, 0x90); ++ #endif ++ ++ reg_c38_State = RegC38_NonFsync_Other_AP; ++ #if 0//cosa ++ if (Adapter->HardwareType == HARDWARE_TYPE_RTL8190P) ++ DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x10); ++ else ++ DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x90); ++ #endif ++ } ++ } ++ else if(priv->undecorated_smoothed_pwdb >= (RegC38_TH+5)) ++ { ++ if(reg_c38_State) ++ { ++ write_nic_byte(dev, rOFDM0_RxDetector3, priv->framesync); ++ reg_c38_State = RegC38_Default; ++ //DbgPrint("Fsync is idle, rssi>=40, write 0xc38 = 0x%x \n", pHalData->framesync); ++ } ++ } ++ } ++ else ++ { ++ if(reg_c38_State) ++ { ++ write_nic_byte(dev, rOFDM0_RxDetector3, priv->framesync); ++ reg_c38_State = RegC38_Default; ++ //DbgPrint("Fsync is idle, not connected, write 0xc38 = 0x%x \n", pHalData->framesync); ++ } ++ } ++ } ++ } ++ if(priv->framesyncMonitor) ++ { ++ if(priv->reset_count != reset_cnt) ++ { //After silent reset, the reg_c38_State will be returned to default value ++ write_nic_byte(dev, rOFDM0_RxDetector3, priv->framesync); ++ reg_c38_State = RegC38_Default; ++ reset_cnt = priv->reset_count; ++ //DbgPrint("reg_c38_State = 0 for silent reset. \n"); ++ } ++ } ++ else ++ { ++ if(reg_c38_State) ++ { ++ write_nic_byte(dev, rOFDM0_RxDetector3, priv->framesync); ++ reg_c38_State = RegC38_Default; ++ //DbgPrint("framesync no monitor, write 0xc38 = 0x%x \n", pHalData->framesync); ++ } ++ } ++} ++ ++#if 0 ++/*----------------------------------------------------------------------------- ++ * Function: DM_CheckLBusStatus() ++ * ++ * Overview: For 9x series, we must make sure LBUS is active for IO. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 02/22/2008 MHC Create Version 0. ++ * ++ *---------------------------------------------------------------------------*/ ++extern s1Byte DM_CheckLBusStatus(IN PADAPTER Adapter) ++{ ++ PMGNT_INFO pMgntInfo=&Adapter->MgntInfo; ++ ++#if (HAL_CODE_BASE & RTL819X) ++ ++#if (HAL_CODE_BASE == RTL8192) ++ ++#if( DEV_BUS_TYPE==PCI_INTERFACE) ++ //return (pMgntInfo->bLbusEnable); // For debug only ++ return TRUE; ++#endif ++ ++#if( DEV_BUS_TYPE==USB_INTERFACE) ++ return TRUE; ++#endif ++ ++#endif // #if (HAL_CODE_BASE == RTL8192) ++ ++#if (HAL_CODE_BASE == RTL8190) ++ return TRUE; ++#endif // #if (HAL_CODE_BASE == RTL8190) ++ ++#endif // #if (HAL_CODE_BASE & RTL819X) ++} /* DM_CheckLBusStatus */ ++ ++#endif ++ ++/*----------------------------------------------------------------------------- ++ * Function: dm_shadow_init() ++ * ++ * Overview: Store all NIC MAC/BB register content. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/29/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++void dm_shadow_init(struct net_device *dev) ++{ ++ u8 page; ++ u16 offset; ++ ++ for (page = 0; page < 5; page++) ++ for (offset = 0; offset < 256; offset++) ++ { ++ dm_shadow[page][offset] = read_nic_byte(dev, offset+page*256); ++ //DbgPrint("P-%d/O-%02x=%02x\r\n", page, offset, DM_Shadow[page][offset]); ++ } ++ ++ for (page = 8; page < 11; page++) ++ for (offset = 0; offset < 256; offset++) ++ dm_shadow[page][offset] = read_nic_byte(dev, offset+page*256); ++ ++ for (page = 12; page < 15; page++) ++ for (offset = 0; offset < 256; offset++) ++ dm_shadow[page][offset] = read_nic_byte(dev, offset+page*256); ++ ++} /* dm_shadow_init */ ++ ++/*---------------------------Define function prototype------------------------*/ ++/*----------------------------------------------------------------------------- ++ * Function: DM_DynamicTxPower() ++ * ++ * Overview: Detect Signal strength to control TX Registry ++ Tx Power Control For Near/Far Range ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 03/06/2008 Jacken Create Version 0. ++ * ++ *---------------------------------------------------------------------------*/ ++static void dm_init_dynamic_txpower(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ //Initial TX Power Control for near/far range , add by amy 2008/05/15, porting from windows code. ++ priv->ieee80211->bdynamic_txpower_enable = true; //Default to enable Tx Power Control ++ priv->bLastDTPFlag_High = false; ++ priv->bLastDTPFlag_Low = false; ++ priv->bDynamicTxHighPower = false; ++ priv->bDynamicTxLowPower = false; ++} ++ ++static void dm_dynamic_txpower(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ unsigned int txhipower_threshhold=0; ++ unsigned int txlowpower_threshold=0; ++ if(priv->ieee80211->bdynamic_txpower_enable != true) ++ { ++ priv->bDynamicTxHighPower = false; ++ priv->bDynamicTxLowPower = false; ++ return; ++ } ++ //printk("priv->ieee80211->current_network.unknown_cap_exist is %d ,priv->ieee80211->current_network.broadcom_cap_exist is %d\n",priv->ieee80211->current_network.unknown_cap_exist,priv->ieee80211->current_network.broadcom_cap_exist); ++ if((priv->ieee80211->current_network.atheros_cap_exist ) && (priv->ieee80211->mode == IEEE_G)){ ++ txhipower_threshhold = TX_POWER_ATHEROAP_THRESH_HIGH; ++ txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW; ++ } ++ else ++ { ++ txhipower_threshhold = TX_POWER_NEAR_FIELD_THRESH_HIGH; ++ txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW; ++ } ++ ++// printk("=======>%s(): txhipower_threshhold is %d,txlowpower_threshold is %d\n",__FUNCTION__,txhipower_threshhold,txlowpower_threshold); ++ ++ RT_TRACE(COMP_TXAGC,"priv->undecorated_smoothed_pwdb = %ld \n" , priv->undecorated_smoothed_pwdb); ++ ++ if(priv->ieee80211->state == IEEE80211_LINKED) ++ { ++ if(priv->undecorated_smoothed_pwdb >= txhipower_threshhold) ++ { ++ priv->bDynamicTxHighPower = true; ++ priv->bDynamicTxLowPower = false; ++ } ++ else ++ { ++ // high power state check ++ if(priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true) ++ { ++ priv->bDynamicTxHighPower = false; ++ } ++ // low power state check ++ if(priv->undecorated_smoothed_pwdb < 35) ++ { ++ priv->bDynamicTxLowPower = true; ++ } ++ else if(priv->undecorated_smoothed_pwdb >= 40) ++ { ++ priv->bDynamicTxLowPower = false; ++ } ++ } ++ } ++ else ++ { ++ //pHalData->bTXPowerCtrlforNearFarRange = !pHalData->bTXPowerCtrlforNearFarRange; ++ priv->bDynamicTxHighPower = false; ++ priv->bDynamicTxLowPower = false; ++ } ++ ++ if( (priv->bDynamicTxHighPower != priv->bLastDTPFlag_High ) || ++ (priv->bDynamicTxLowPower != priv->bLastDTPFlag_Low ) ) ++ { ++ RT_TRACE(COMP_TXAGC,"SetTxPowerLevel8190() channel = %d \n" , priv->ieee80211->current_network.channel); ++ ++ ++ rtl8192_phy_setTxPower(dev,priv->ieee80211->current_network.channel); ++ ++ } ++ priv->bLastDTPFlag_High = priv->bDynamicTxHighPower; ++ priv->bLastDTPFlag_Low = priv->bDynamicTxLowPower; ++ ++} /* dm_dynamic_txpower */ ++ ++//added by vivi, for read tx rate and retrycount ++static void dm_check_txrateandretrycount(struct net_device * dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ //for 11n tx rate ++// priv->stats.CurrentShowTxate = read_nic_byte(dev, Current_Tx_Rate_Reg); ++ ieee->softmac_stats.CurrentShowTxate = read_nic_byte(dev, Current_Tx_Rate_Reg); ++ //printk("=============>tx_rate_reg:%x\n", ieee->softmac_stats.CurrentShowTxate); ++ //for initial tx rate ++// priv->stats.last_packet_rate = read_nic_byte(dev, Initial_Tx_Rate_Reg); ++ ieee->softmac_stats.last_packet_rate = read_nic_byte(dev ,Initial_Tx_Rate_Reg); ++ //for tx tx retry count ++// priv->stats.txretrycount = read_nic_dword(dev, Tx_Retry_Count_Reg); ++ ieee->softmac_stats.txretrycount = read_nic_dword(dev, Tx_Retry_Count_Reg); ++} ++ ++static void dm_send_rssi_tofw(struct net_device *dev) ++{ ++ DCMD_TXCMD_T tx_cmd; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ // If we test chariot, we should stop the TX command ? ++ // Because 92E will always silent reset when we send tx command. We use register ++ // 0x1e0(byte) to botify driver. ++ write_nic_byte(dev, DRIVER_RSSI, (u8)priv->undecorated_smoothed_pwdb); ++ return; ++#if 1 ++ tx_cmd.Op = TXCMD_SET_RX_RSSI; ++ tx_cmd.Length = 4; ++ tx_cmd.Value = priv->undecorated_smoothed_pwdb; ++ ++ cmpk_message_handle_tx(dev, (u8*)&tx_cmd, ++ DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T)); ++#endif ++} ++ ++/*---------------------------Define function prototype------------------------*/ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_dm.h +@@ -0,0 +1,320 @@ ++/***************************************************************************** ++ * Copyright(c) 2007, RealTEK Technology Inc. All Right Reserved. ++ * ++ * Module: Hal819xUsbDM.h (RTL8192 Header H File) ++ * ++ * ++ * Note: For dynamic control definition constant structure. ++ * ++ * ++ * Export: ++ * ++ * Abbrev: ++ * ++ * History: ++ * Data Who Remark ++ * 10/04/2007 MHC Create initial version. ++ * ++ *****************************************************************************/ ++ /* Check to see if the file has been included already. */ ++#ifndef __R8192UDM_H__ ++#define __R8192UDM_H__ ++ ++ ++/*--------------------------Define Parameters-------------------------------*/ ++#define OFDM_Table_Length 19 ++#define CCK_Table_length 12 ++ ++#define DM_DIG_THRESH_HIGH 40 ++#define DM_DIG_THRESH_LOW 35 ++ ++#define DM_DIG_HIGH_PWR_THRESH_HIGH 75 ++#define DM_DIG_HIGH_PWR_THRESH_LOW 70 ++ ++#define BW_AUTO_SWITCH_HIGH_LOW 25 ++#define BW_AUTO_SWITCH_LOW_HIGH 30 ++ ++#define DM_check_fsync_time_interval 500 ++ ++ ++#define DM_DIG_BACKOFF 12 ++#define DM_DIG_MAX 0x36 ++#define DM_DIG_MIN 0x1c ++#define DM_DIG_MIN_Netcore 0x12 ++ ++#define RxPathSelection_SS_TH_low 30 ++#define RxPathSelection_diff_TH 18 ++ ++#define RateAdaptiveTH_High 50 ++#define RateAdaptiveTH_Low_20M 30 ++#define RateAdaptiveTH_Low_40M 10 ++#define VeryLowRSSI 15 ++#define CTSToSelfTHVal 35 ++ ++//defined by vivi, for tx power track ++#define E_FOR_TX_POWER_TRACK 300 ++//Dynamic Tx Power Control Threshold ++#define TX_POWER_NEAR_FIELD_THRESH_HIGH 68 ++#define TX_POWER_NEAR_FIELD_THRESH_LOW 62 ++//added by amy for atheros AP ++#define TX_POWER_ATHEROAP_THRESH_HIGH 78 ++#define TX_POWER_ATHEROAP_THRESH_LOW 72 ++ ++//defined by vivi, for showing on UI. Newer firmware has changed to 0x1e0 ++#define Current_Tx_Rate_Reg 0x1e0//0x1b8 ++#define Initial_Tx_Rate_Reg 0x1e1 //0x1b9 ++#define Tx_Retry_Count_Reg 0x1ac ++#define RegC38_TH 20 ++#if 0 ++//---------------------------------------------------------------------------- ++// 8190 Rate Adaptive Table Register (offset 0x320, 4 byte) ++//---------------------------------------------------------------------------- ++ ++//CCK ++#define RATR_1M 0x00000001 ++#define RATR_2M 0x00000002 ++#define RATR_55M 0x00000004 ++#define RATR_11M 0x00000008 ++//OFDM ++#define RATR_6M 0x00000010 ++#define RATR_9M 0x00000020 ++#define RATR_12M 0x00000040 ++#define RATR_18M 0x00000080 ++#define RATR_24M 0x00000100 ++#define RATR_36M 0x00000200 ++#define RATR_48M 0x00000400 ++#define RATR_54M 0x00000800 ++//MCS 1 Spatial Stream ++#define RATR_MCS0 0x00001000 ++#define RATR_MCS1 0x00002000 ++#define RATR_MCS2 0x00004000 ++#define RATR_MCS3 0x00008000 ++#define RATR_MCS4 0x00010000 ++#define RATR_MCS5 0x00020000 ++#define RATR_MCS6 0x00040000 ++#define RATR_MCS7 0x00080000 ++//MCS 2 Spatial Stream ++#define RATR_MCS8 0x00100000 ++#define RATR_MCS9 0x00200000 ++#define RATR_MCS10 0x00400000 ++#define RATR_MCS11 0x00800000 ++#define RATR_MCS12 0x01000000 ++#define RATR_MCS13 0x02000000 ++#define RATR_MCS14 0x04000000 ++#define RATR_MCS15 0x08000000 ++// ALL CCK Rate ++#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M ++#define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\ ++ |RATR_36M|RATR_48M|RATR_54M ++#define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11| \ ++ RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15 ++#endif ++/*--------------------------Define Parameters-------------------------------*/ ++ ++ ++/*------------------------------Define structure----------------------------*/ ++/* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */ ++typedef struct _dynamic_initial_gain_threshold_ ++{ ++ u8 dig_enable_flag; ++ u8 dig_algorithm; ++ u8 dbg_mode; ++ u8 dig_algorithm_switch; ++ ++ long rssi_low_thresh; ++ long rssi_high_thresh; ++ ++ long rssi_high_power_lowthresh; ++ long rssi_high_power_highthresh; ++ ++ u8 dig_state; ++ u8 dig_highpwr_state; ++ u8 cur_connect_state; ++ u8 pre_connect_state; ++ ++ u8 curpd_thstate; ++ u8 prepd_thstate; ++ u8 curcs_ratio_state; ++ u8 precs_ratio_state; ++ ++ u32 pre_ig_value; ++ u32 cur_ig_value; ++ ++ u8 backoff_val; ++ u8 rx_gain_range_max; ++ u8 rx_gain_range_min; ++ bool initialgain_lowerbound_state; ++ ++ long rssi_val; ++}dig_t; ++ ++typedef enum tag_dynamic_init_gain_state_definition ++{ ++ DM_STA_DIG_OFF = 0, ++ DM_STA_DIG_ON, ++ DM_STA_DIG_MAX ++}dm_dig_sta_e; ++ ++ ++/* 2007/10/08 MH Define RATR state. */ ++typedef enum tag_dynamic_ratr_state_definition ++{ ++ DM_RATR_STA_HIGH = 0, ++ DM_RATR_STA_MIDDLE = 1, ++ DM_RATR_STA_LOW = 2, ++ DM_RATR_STA_MAX ++}dm_ratr_sta_e; ++ ++/* 2007/10/11 MH Define DIG operation type. */ ++typedef enum tag_dynamic_init_gain_operation_type_definition ++{ ++ DIG_TYPE_THRESH_HIGH = 0, ++ DIG_TYPE_THRESH_LOW = 1, ++ DIG_TYPE_THRESH_HIGHPWR_HIGH = 2, ++ DIG_TYPE_THRESH_HIGHPWR_LOW = 3, ++ DIG_TYPE_DBG_MODE = 4, ++ DIG_TYPE_RSSI = 5, ++ DIG_TYPE_ALGORITHM = 6, ++ DIG_TYPE_BACKOFF = 7, ++ DIG_TYPE_PWDB_FACTOR = 8, ++ DIG_TYPE_RX_GAIN_MIN = 9, ++ DIG_TYPE_RX_GAIN_MAX = 10, ++ DIG_TYPE_ENABLE = 20, ++ DIG_TYPE_DISABLE = 30, ++ DIG_OP_TYPE_MAX ++}dm_dig_op_e; ++ ++typedef enum tag_dig_algorithm_definition ++{ ++ DIG_ALGO_BY_FALSE_ALARM = 0, ++ DIG_ALGO_BY_RSSI = 1, ++ DIG_ALGO_MAX ++}dm_dig_alg_e; ++ ++typedef enum tag_dig_dbgmode_definition ++{ ++ DIG_DBG_OFF = 0, ++ DIG_DBG_ON = 1, ++ DIG_DBG_MAX ++}dm_dig_dbg_e; ++ ++typedef enum tag_dig_connect_definition ++{ ++ DIG_DISCONNECT = 0, ++ DIG_CONNECT = 1, ++ DIG_CONNECT_MAX ++}dm_dig_connect_e; ++ ++typedef enum tag_dig_packetdetection_threshold_definition ++{ ++ DIG_PD_AT_LOW_POWER = 0, ++ DIG_PD_AT_NORMAL_POWER = 1, ++ DIG_PD_AT_HIGH_POWER = 2, ++ DIG_PD_MAX ++}dm_dig_pd_th_e; ++ ++typedef enum tag_dig_cck_cs_ratio_state_definition ++{ ++ DIG_CS_RATIO_LOWER = 0, ++ DIG_CS_RATIO_HIGHER = 1, ++ DIG_CS_MAX ++}dm_dig_cs_ratio_e; ++typedef struct _Dynamic_Rx_Path_Selection_ ++{ ++ u8 Enable; ++ u8 DbgMode; ++ u8 cck_method; ++ u8 cck_Rx_path; ++ ++ u8 SS_TH_low; ++ u8 diff_TH; ++ u8 disabledRF; ++ u8 reserved; ++ ++ u8 rf_rssi[4]; ++ u8 rf_enable_rssi_th[4]; ++ long cck_pwdb_sta[4]; ++}DRxPathSel; ++ ++typedef enum tag_CCK_Rx_Path_Method_Definition ++{ ++ CCK_Rx_Version_1 = 0, ++ CCK_Rx_Version_2= 1, ++ CCK_Rx_Version_MAX ++}DM_CCK_Rx_Path_Method; ++ ++typedef enum tag_DM_DbgMode_Definition ++{ ++ DM_DBG_OFF = 0, ++ DM_DBG_ON = 1, ++ DM_DBG_MAX ++}DM_DBG_E; ++ ++typedef struct tag_Tx_Config_Cmd_Format ++{ ++ u32 Op; /* Command packet type. */ ++ u32 Length; /* Command packet length. */ ++ u32 Value; ++}DCMD_TXCMD_T, *PDCMD_TXCMD_T; ++/*------------------------------Define structure----------------------------*/ ++ ++ ++/*------------------------Export global variable----------------------------*/ ++extern dig_t dm_digtable; ++extern u8 dm_shadow[16][256]; ++extern DRxPathSel DM_RxPathSelTable; ++/*------------------------Export global variable----------------------------*/ ++ ++ ++/*------------------------Export Marco Definition---------------------------*/ ++ ++/*------------------------Export Marco Definition---------------------------*/ ++ ++ ++/*--------------------------Exported Function prototype---------------------*/ ++/*--------------------------Exported Function prototype---------------------*/ ++extern void init_hal_dm(struct net_device *dev); ++extern void deinit_hal_dm(struct net_device *dev); ++ ++extern void hal_dm_watchdog(struct net_device *dev); ++ ++ ++extern void init_rate_adaptive(struct net_device *dev); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void dm_txpower_trackingcallback(struct work_struct *work); ++#else ++extern void dm_txpower_trackingcallback(struct net_device *dev); ++#endif ++ ++extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); ++extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); ++extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); ++extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, ++ u32 dm_type, ++ u32 dm_value); ++extern void DM_ChangeFsyncSetting(struct net_device *dev, ++ s32 DM_Type, ++ s32 DM_Value); ++extern void dm_force_tx_fw_info(struct net_device *dev, ++ u32 force_type, ++ u32 force_value); ++extern void dm_init_edca_turbo(struct net_device *dev); ++extern void dm_rf_operation_test_callback(unsigned long data); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) ++extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); ++#else ++extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev); ++#endif ++extern void dm_fsync_timer_callback(unsigned long data); ++#if 0 ++extern bool dm_check_lbus_status(struct net_device *dev); ++#endif ++extern void dm_check_fsync(struct net_device *dev); ++extern void dm_shadow_init(struct net_device *dev); ++extern void dm_initialize_txpower_tracking(struct net_device *dev); ++ ++ ++#endif /*__R8192UDM_H__ */ ++ ++ ++/* End of r8192U_dm.h */ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_hw.h +@@ -0,0 +1,811 @@ ++/* ++ This is part of rtl8187 OpenSource driver. ++ Copyright (C) Andrea Merello 2004-2005 ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part of the ++ official Realtek driver. ++ Parts of this driver are based on the rtl8180 driver skeleton ++ from Patric Schenke & Andres Salomon. ++ Parts of this driver are based on the Intel Pro Wireless ++ 2100 GPL driver. ++ ++ We want to tanks the Authors of those projects ++ and the Ndiswrapper project Authors. ++*/ ++ ++/* Mariusz Matuszek added full registers definition with Realtek's name */ ++ ++/* this file contains register definitions for the rtl8187 MAC controller */ ++#ifndef R8180_HW ++#define R8180_HW ++ ++typedef enum _VERSION_8190{ ++ // RTL8190 ++ VERSION_8190_BD=0x3, ++ VERSION_8190_BE ++}VERSION_8190,*PVERSION_8190; ++//added for different RF type ++typedef enum _RT_RF_TYPE_DEF ++{ ++ RF_1T2R = 0, ++ RF_2T4R, ++ ++ RF_819X_MAX_TYPE ++}RT_RF_TYPE_DEF; ++ ++typedef enum _BaseBand_Config_Type{ ++ BaseBand_Config_PHY_REG = 0, //Radio Path A ++ BaseBand_Config_AGC_TAB = 1, //Radio Path B ++}BaseBand_Config_Type, *PBaseBand_Config_Type; ++#if 0 ++typedef enum _RT_RF_TYPE_819xU{ ++ RF_TYPE_MIN = 0, ++ RF_8225, ++ RF_8256, ++ RF_8258, ++ RF_PSEUDO_11N = 4, ++}RT_RF_TYPE_819xU, *PRT_RF_TYPE_819xU; ++#endif ++#define RTL8187_REQT_READ 0xc0 ++#define RTL8187_REQT_WRITE 0x40 ++#define RTL8187_REQ_GET_REGS 0x05 ++#define RTL8187_REQ_SET_REGS 0x05 ++ ++#define R8180_MAX_RETRY 255 ++#define MAX_TX_URB 5 ++#define MAX_RX_URB 16 ++//#define MAX_RX_NORMAL_URB 3 ++//#define MAX_RX_COMMAND_URB 2 ++#define RX_URB_SIZE 9100 ++ ++#define BB_ANTATTEN_CHAN14 0x0c ++#define BB_ANTENNA_B 0x40 ++ ++#define BB_HOST_BANG (1<<30) ++#define BB_HOST_BANG_EN (1<<2) ++#define BB_HOST_BANG_CLK (1<<1) ++#define BB_HOST_BANG_RW (1<<3) ++#define BB_HOST_BANG_DATA 1 ++ ++//#if (RTL819X_FPGA_VER & RTL819X_FPGA_VIVI_070920) ++#define RTL8190_EEPROM_ID 0x8129 ++#define EEPROM_VID 0x02 ++#define EEPROM_DID 0x04 ++#define EEPROM_NODE_ADDRESS_BYTE_0 0x0C ++ ++#define EEPROM_TxPowerDiff 0x1F ++ ++ ++#define EEPROM_PwDiff 0x21 //0x21 ++#define EEPROM_CrystalCap 0x22 //0x22 ++ ++ ++ ++#define EEPROM_TxPwIndex_CCK_V1 0x29 //0x29~0x2B ++#define EEPROM_TxPwIndex_OFDM_24G_V1 0x2C //0x2C~0x2E ++#define EEPROM_TxPwIndex_Ver 0x27 //0x27 ++ ++#define EEPROM_Default_TxPowerDiff 0x0 ++#define EEPROM_Default_ThermalMeter 0x77 ++#define EEPROM_Default_AntTxPowerDiff 0x0 ++#define EEPROM_Default_TxPwDiff_CrystalCap 0x5 ++#define EEPROM_Default_PwDiff 0x4 ++#define EEPROM_Default_CrystalCap 0x5 ++#define EEPROM_Default_TxPower 0x1010 ++#define EEPROM_ICVersion_ChannelPlan 0x7C //0x7C:ChannelPlan, 0x7D:IC_Version ++#define EEPROM_Customer_ID 0x7B //0x7B:CustomerID ++#ifdef RTL8190P ++#define EEPROM_RFInd_PowerDiff 0x14 ++#define EEPROM_ThermalMeter 0x15 ++#define EEPROM_TxPwDiff_CrystalCap 0x16 ++#define EEPROM_TxPwIndex_CCK 0x18 //0x18~0x25 ++#define EEPROM_TxPwIndex_OFDM_24G 0x26 //0x26~0x33 ++#define EEPROM_TxPwIndex_OFDM_5G 0x34 //0x34~0x7B ++#define EEPROM_C56_CrystalCap 0x17 //0x17 ++#define EEPROM_C56_RfA_CCK_Chnl1_TxPwIndex 0x80 //0x80 ++#define EEPROM_C56_RfA_HT_OFDM_TxPwIndex 0x81 //0x81~0x83 ++#define EEPROM_C56_RfC_CCK_Chnl1_TxPwIndex 0xbc //0xb8 ++#define EEPROM_C56_RfC_HT_OFDM_TxPwIndex 0xb9 //0xb9~0xbb ++#else ++#ifdef RTL8192E ++#define EEPROM_RFInd_PowerDiff 0x28 ++#define EEPROM_ThermalMeter 0x29 ++#define EEPROM_TxPwDiff_CrystalCap 0x2A //0x2A~0x2B ++#define EEPROM_TxPwIndex_CCK 0x2C //0x23 ++#define EEPROM_TxPwIndex_OFDM_24G 0x3A //0x24~0x26 ++#endif ++#endif ++#define EEPROM_Default_TxPowerLevel 0x10 ++//#define EEPROM_ChannelPlan 0x7c //0x7C ++#define EEPROM_IC_VER 0x7d //0x7D ++#define EEPROM_CRC 0x7e //0x7E~0x7F ++ ++#define EEPROM_CID_DEFAULT 0x0 ++#define EEPROM_CID_CAMEO 0x1 ++#define EEPROM_CID_RUNTOP 0x2 ++#define EEPROM_CID_Senao 0x3 ++#define EEPROM_CID_TOSHIBA 0x4 // Toshiba setting, Merge by Jacken, 2008/01/31 ++#define EEPROM_CID_NetCore 0x5 ++#define EEPROM_CID_Nettronix 0x6 ++#define EEPROM_CID_Pronet 0x7 ++#define EEPROM_CID_DLINK 0x8 ++#define EEPROM_CID_WHQL 0xFE //added by sherry for dtm, 20080728 ++//#endif ++enum _RTL8192Pci_HW { ++ MAC0 = 0x000, ++ MAC1 = 0x001, ++ MAC2 = 0x002, ++ MAC3 = 0x003, ++ MAC4 = 0x004, ++ MAC5 = 0x005, ++ PCIF = 0x009, // PCI Function Register 0x0009h~0x000bh ++//---------------------------------------------------------------------------- ++// 8190 PCIF bits (Offset 0x009-000b, 24bit) ++//---------------------------------------------------------------------------- ++#define MXDMA2_16bytes 0x000 ++#define MXDMA2_32bytes 0x001 ++#define MXDMA2_64bytes 0x010 ++#define MXDMA2_128bytes 0x011 ++#define MXDMA2_256bytes 0x100 ++#define MXDMA2_512bytes 0x101 ++#define MXDMA2_1024bytes 0x110 ++#define MXDMA2_NoLimit 0x7 ++ ++#define MULRW_SHIFT 3 ++#define MXDMA2_RX_SHIFT 4 ++#define MXDMA2_TX_SHIFT 0 ++ PMR = 0x00c, // Power management register ++ EPROM_CMD = 0x00e, ++#define EPROM_CMD_RESERVED_MASK BIT5 ++#define EPROM_CMD_9356SEL BIT4 ++#define EPROM_CMD_OPERATING_MODE_SHIFT 6 ++#define EPROM_CMD_OPERATING_MODE_MASK ((1<<7)|(1<<6)) ++#define EPROM_CMD_CONFIG 0x3 ++#define EPROM_CMD_NORMAL 0 ++#define EPROM_CMD_LOAD 1 ++#define EPROM_CMD_PROGRAM 2 ++#define EPROM_CS_SHIFT 3 ++#define EPROM_CK_SHIFT 2 ++#define EPROM_W_SHIFT 1 ++#define EPROM_R_SHIFT 0 ++ ++ AFR = 0x010, ++#define AFR_CardBEn (1<<0) ++#define AFR_CLKRUN_SEL (1<<1) ++#define AFR_FuncRegEn (1<<2) ++ ++ ANAPAR = 0x17, ++#define BB_GLOBAL_RESET_BIT 0x1 ++ BB_GLOBAL_RESET = 0x020, // BasebandGlobal Reset Register ++ BSSIDR = 0x02E, // BSSID Register ++ CMDR = 0x037, // Command register ++#define CR_RST 0x10 ++#define CR_RE 0x08 ++#define CR_TE 0x04 ++#define CR_MulRW 0x01 ++ SIFS = 0x03E, // SIFS register ++ TCR = 0x040, // Transmit Configuration Register ++ RCR = 0x044, // Receive Configuration Register ++//---------------------------------------------------------------------------- ++//// 8190 (RCR) Receive Configuration Register (Offset 0x44~47, 32 bit) ++////---------------------------------------------------------------------------- ++#define RCR_FILTER_MASK (BIT0|BIT1|BIT2|BIT3|BIT5|BIT12|BIT18|BIT19|BIT20|BIT21|BIT22|BIT23) ++#define RCR_ONLYERLPKT BIT31 // Early Receiving based on Packet Size. ++#define RCR_ENCS2 BIT30 // Enable Carrier Sense Detection Method 2 ++#define RCR_ENCS1 BIT29 // Enable Carrier Sense Detection Method 1 ++#define RCR_ENMBID BIT27 // Enable Multiple BssId. ++#define RCR_ACKTXBW (BIT24|BIT25) // TXBW Setting of ACK frames ++#define RCR_CBSSID BIT23 // Accept BSSID match packet ++#define RCR_APWRMGT BIT22 // Accept power management packet ++#define RCR_ADD3 BIT21 // Accept address 3 match packet ++#define RCR_AMF BIT20 // Accept management type frame ++#define RCR_ACF BIT19 // Accept control type frame ++#define RCR_ADF BIT18 // Accept data type frame ++#define RCR_RXFTH BIT13 // Rx FIFO Threshold ++#define RCR_AICV BIT12 // Accept ICV error packet ++#define RCR_ACRC32 BIT5 // Accept CRC32 error packet ++#define RCR_AB BIT3 // Accept broadcast packet ++#define RCR_AM BIT2 // Accept multicast packet ++#define RCR_APM BIT1 // Accept physical match packet ++#define RCR_AAP BIT0 // Accept all unicast packet ++#define RCR_MXDMA_OFFSET 8 ++#define RCR_FIFO_OFFSET 13 ++ SLOT_TIME = 0x049, // Slot Time Register ++ ACK_TIMEOUT = 0x04c, // Ack Timeout Register ++ PIFS_TIME = 0x04d, // PIFS time ++ USTIME = 0x04e, // Microsecond Tuning Register, Sets the microsecond time unit used by MAC clock. ++ EDCAPARA_BE = 0x050, // EDCA Parameter of AC BE ++ EDCAPARA_BK = 0x054, // EDCA Parameter of AC BK ++ EDCAPARA_VO = 0x058, // EDCA Parameter of AC VO ++ EDCAPARA_VI = 0x05C, // EDCA Parameter of AC VI ++#define AC_PARAM_TXOP_LIMIT_OFFSET 16 ++#define AC_PARAM_ECW_MAX_OFFSET 12 ++#define AC_PARAM_ECW_MIN_OFFSET 8 ++#define AC_PARAM_AIFS_OFFSET 0 ++ RFPC = 0x05F, // Rx FIFO Packet Count ++ CWRR = 0x060, // Contention Window Report Register ++ BCN_TCFG = 0x062, // Beacon Time Configuration ++#define BCN_TCFG_CW_SHIFT 8 ++#define BCN_TCFG_IFS 0 ++ BCN_INTERVAL = 0x070, // Beacon Interval (TU) ++ ATIMWND = 0x072, // ATIM Window Size (TU) ++ BCN_DRV_EARLY_INT = 0x074, // Driver Early Interrupt Time (TU). Time to send interrupt to notify to change beacon content before TBTT ++#define BCN_DRV_EARLY_INT_SWBCN_SHIFT 8 ++#define BCN_DRV_EARLY_INT_TIME_SHIFT 0 ++ BCN_DMATIME = 0x076, // Beacon DMA and ATIM interrupt time (US). Indicates the time before TBTT to perform beacon queue DMA ++ BCN_ERR_THRESH = 0x078, // Beacon Error Threshold ++ RWCAM = 0x0A0, //IN 8190 Data Sheet is called CAMcmd ++ //---------------------------------------------------------------------------- ++ //// 8190 CAM Command Register (offset 0xA0, 4 byte) ++ ////---------------------------------------------------------------------------- ++#define CAM_CM_SecCAMPolling BIT31 //Security CAM Polling ++#define CAM_CM_SecCAMClr BIT30 //Clear all bits in CAM ++#define CAM_CM_SecCAMWE BIT16 //Security CAM enable ++#define CAM_VALID BIT15 ++#define CAM_NOTVALID 0x0000 ++#define CAM_USEDK BIT5 ++ ++#define CAM_NONE 0x0 ++#define CAM_WEP40 0x01 ++#define CAM_TKIP 0x02 ++#define CAM_AES 0x04 ++#define CAM_WEP104 0x05 ++ ++#define TOTAL_CAM_ENTRY 32 ++ ++#define CAM_CONFIG_USEDK true ++#define CAM_CONFIG_NO_USEDK false ++#define CAM_WRITE BIT16 ++#define CAM_READ 0x00000000 ++#define CAM_POLLINIG BIT31 ++#define SCR_UseDK 0x01 ++ WCAMI = 0x0A4, // Software write CAM input content ++ RCAMO = 0x0A8, // Software read/write CAM config ++ SECR = 0x0B0, //Security Configuration Register ++#define SCR_TxUseDK BIT0 //Force Tx Use Default Key ++#define SCR_RxUseDK BIT1 //Force Rx Use Default Key ++#define SCR_TxEncEnable BIT2 //Enable Tx Encryption ++#define SCR_RxDecEnable BIT3 //Enable Rx Decryption ++#define SCR_SKByA2 BIT4 //Search kEY BY A2 ++#define SCR_NoSKMC BIT5 //No Key Search for Multicast ++ SWREGULATOR = 0x0BD, // Switching Regulator ++ INTA_MASK = 0x0f4, ++//---------------------------------------------------------------------------- ++// 8190 IMR/ISR bits (offset 0xfd, 8bits) ++//---------------------------------------------------------------------------- ++#define IMR8190_DISABLED 0x0 ++#define IMR_ATIMEND BIT28 // ATIM Window End Interrupt ++#define IMR_TBDOK BIT27 // Transmit Beacon OK Interrupt ++#define IMR_TBDER BIT26 // Transmit Beacon Error Interrupt ++#define IMR_TXFOVW BIT15 // Transmit FIFO Overflow ++#define IMR_TIMEOUT0 BIT14 // TimeOut0 ++#define IMR_BcnInt BIT13 // Beacon DMA Interrupt 0 ++#define IMR_RXFOVW BIT12 // Receive FIFO Overflow ++#define IMR_RDU BIT11 // Receive Descriptor Unavailable ++#define IMR_RXCMDOK BIT10 // Receive Command Packet OK ++#define IMR_BDOK BIT9 // Beacon Queue DMA OK Interrup ++#define IMR_HIGHDOK BIT8 // High Queue DMA OK Interrupt ++#define IMR_COMDOK BIT7 // Command Queue DMA OK Interrupt ++#define IMR_MGNTDOK BIT6 // Management Queue DMA OK Interrupt ++#define IMR_HCCADOK BIT5 // HCCA Queue DMA OK Interrupt ++#define IMR_BKDOK BIT4 // AC_BK DMA OK Interrupt ++#define IMR_BEDOK BIT3 // AC_BE DMA OK Interrupt ++#define IMR_VIDOK BIT2 // AC_VI DMA OK Interrupt ++#define IMR_VODOK BIT1 // AC_VO DMA Interrupt ++#define IMR_ROK BIT0 // Receive DMA OK Interrupt ++ ISR = 0x0f8, // Interrupt Status Register ++ TPPoll = 0x0fd, // Transmit priority polling register ++#define TPPoll_BKQ BIT0 // BK queue polling ++#define TPPoll_BEQ BIT1 // BE queue polling ++#define TPPoll_VIQ BIT2 // VI queue polling ++#define TPPoll_VOQ BIT3 // VO queue polling ++#define TPPoll_BQ BIT4 // Beacon queue polling ++#define TPPoll_CQ BIT5 // Command queue polling ++#define TPPoll_MQ BIT6 // Management queue polling ++#define TPPoll_HQ BIT7 // High queue polling ++#define TPPoll_HCCAQ BIT8 // HCCA queue polling ++#define TPPoll_StopBK BIT9 // Stop BK queue ++#define TPPoll_StopBE BIT10 // Stop BE queue ++#define TPPoll_StopVI BIT11 // Stop VI queue ++#define TPPoll_StopVO BIT12 // Stop VO queue ++#define TPPoll_StopMgt BIT13 // Stop Mgnt queue ++#define TPPoll_StopHigh BIT14 // Stop High queue ++#define TPPoll_StopHCCA BIT15 // Stop HCCA queue ++#define TPPoll_SHIFT 8 // Queue ID mapping ++ ++ PSR = 0x0ff, // Page Select Register ++#define PSR_GEN 0x0 // Page 0 register general MAC Control ++#define PSR_CPU 0x1 // Page 1 register for CPU ++ CPU_GEN = 0x100, // CPU Reset Register ++ BB_RESET = 0x101, // Baseband Reset ++//---------------------------------------------------------------------------- ++// 8190 CPU General Register (offset 0x100, 4 byte) ++//---------------------------------------------------------------------------- ++#define CPU_CCK_LOOPBACK 0x00030000 ++#define CPU_GEN_SYSTEM_RESET 0x00000001 ++#define CPU_GEN_FIRMWARE_RESET 0x00000008 ++#define CPU_GEN_BOOT_RDY 0x00000010 ++#define CPU_GEN_FIRM_RDY 0x00000020 ++#define CPU_GEN_PUT_CODE_OK 0x00000080 ++#define CPU_GEN_BB_RST 0x00000100 ++#define CPU_GEN_PWR_STB_CPU 0x00000004 ++#define CPU_GEN_NO_LOOPBACK_MSK 0xFFF8FFFF // Set bit18,17,16 to 0. Set bit19 ++#define CPU_GEN_NO_LOOPBACK_SET 0x00080000 // Set BIT19 to 1 ++#define CPU_GEN_GPIO_UART 0x00007000 ++ ++ LED1Cfg = 0x154,// LED1 Configuration Register ++ LED0Cfg = 0x155,// LED0 Configuration Register ++ ++ AcmAvg = 0x170, // ACM Average Period Register ++ AcmHwCtrl = 0x171, // ACM Hardware Control Register ++//---------------------------------------------------------------------------- ++// ++// 8190 AcmHwCtrl bits (offset 0x171, 1 byte) ++//---------------------------------------------------------------------------- ++#define AcmHw_HwEn BIT0 ++#define AcmHw_BeqEn BIT1 ++#define AcmHw_ViqEn BIT2 ++#define AcmHw_VoqEn BIT3 ++#define AcmHw_BeqStatus BIT4 ++#define AcmHw_ViqStatus BIT5 ++#define AcmHw_VoqStatus BIT6 ++ AcmFwCtrl = 0x172, // ACM Firmware Control Register ++#define AcmFw_BeqStatus BIT0 ++#define AcmFw_ViqStatus BIT1 ++#define AcmFw_VoqStatus BIT2 ++ VOAdmTime = 0x174, // VO Queue Admitted Time Register ++ VIAdmTime = 0x178, // VI Queue Admitted Time Register ++ BEAdmTime = 0x17C, // BE Queue Admitted Time Register ++ RQPN1 = 0x180, // Reserved Queue Page Number , Vo Vi, Be, Bk ++ RQPN2 = 0x184, // Reserved Queue Page Number, HCCA, Cmd, Mgnt, High ++ RQPN3 = 0x188, // Reserved Queue Page Number, Bcn, Public, ++ QPRR = 0x1E0, // Queue Page Report per TID ++ QPNR = 0x1F0, // Queue Packet Number report per TID ++/* there's 9 tx descriptor base address available */ ++ BQDA = 0x200, // Beacon Queue Descriptor Address ++ HQDA = 0x204, // High Priority Queue Descriptor Address ++ CQDA = 0x208, // Command Queue Descriptor Address ++ MQDA = 0x20C, // Management Queue Descriptor Address ++ HCCAQDA = 0x210, // HCCA Queue Descriptor Address ++ VOQDA = 0x214, // VO Queue Descriptor Address ++ VIQDA = 0x218, // VI Queue Descriptor Address ++ BEQDA = 0x21C, // BE Queue Descriptor Address ++ BKQDA = 0x220, // BK Queue Descriptor Address ++/* there's 2 rx descriptor base address availalbe */ ++ RCQDA = 0x224, // Receive command Queue Descriptor Address ++ RDQDA = 0x228, // Receive Queue Descriptor Start Address ++ ++ MAR0 = 0x240, // Multicast filter. ++ MAR4 = 0x244, ++ ++ CCX_PERIOD = 0x250, // CCX Measurement Period Register, in unit of TU. ++ CLM_RESULT = 0x251, // CCA Busy fraction register. ++ NHM_PERIOD = 0x252, // NHM Measurement Period register, in unit of TU. ++ ++ NHM_THRESHOLD0 = 0x253, // Noise Histogram Meashorement0. ++ NHM_THRESHOLD1 = 0x254, // Noise Histogram Meashorement1. ++ NHM_THRESHOLD2 = 0x255, // Noise Histogram Meashorement2. ++ NHM_THRESHOLD3 = 0x256, // Noise Histogram Meashorement3. ++ NHM_THRESHOLD4 = 0x257, // Noise Histogram Meashorement4. ++ NHM_THRESHOLD5 = 0x258, // Noise Histogram Meashorement5. ++ NHM_THRESHOLD6 = 0x259, // Noise Histogram Meashorement6 ++ ++ MCTRL = 0x25A, // Measurement Control ++ ++ NHM_RPI_COUNTER0 = 0x264, // Noise Histogram RPI counter0, the fraction of signal strength < NHM_THRESHOLD0. ++ NHM_RPI_COUNTER1 = 0x265, // Noise Histogram RPI counter1, the fraction of signal strength in (NHM_THRESHOLD0, NHM_THRESHOLD1]. ++ NHM_RPI_COUNTER2 = 0x266, // Noise Histogram RPI counter2, the fraction of signal strength in (NHM_THRESHOLD1, NHM_THRESHOLD2]. ++ NHM_RPI_COUNTER3 = 0x267, // Noise Histogram RPI counter3, the fraction of signal strength in (NHM_THRESHOLD2, NHM_THRESHOLD3]. ++ NHM_RPI_COUNTER4 = 0x268, // Noise Histogram RPI counter4, the fraction of signal strength in (NHM_THRESHOLD3, NHM_THRESHOLD4]. ++ NHM_RPI_COUNTER5 = 0x269, // Noise Histogram RPI counter5, the fraction of signal strength in (NHM_THRESHOLD4, NHM_THRESHOLD5]. ++ NHM_RPI_COUNTER6 = 0x26A, // Noise Histogram RPI counter6, the fraction of signal strength in (NHM_THRESHOLD5, NHM_THRESHOLD6]. ++ NHM_RPI_COUNTER7 = 0x26B, // Noise Histogram RPI counter7, the fraction of signal strength in (NHM_THRESHOLD6, NHM_THRESHOLD7]. ++ WFCRC0 = 0x2f0, ++ WFCRC1 = 0x2f4, ++ WFCRC2 = 0x2f8, ++ ++ BW_OPMODE = 0x300, // Bandwidth operation mode ++#define BW_OPMODE_11J BIT0 ++#define BW_OPMODE_5G BIT1 ++#define BW_OPMODE_20MHZ BIT2 ++ IC_VERRSION = 0x301, //IC_VERSION ++ MSR = 0x303, // Media Status register ++#define MSR_LINK_MASK ((1<<0)|(1<<1)) ++#define MSR_LINK_MANAGED 2 ++#define MSR_LINK_NONE 0 ++#define MSR_LINK_SHIFT 0 ++#define MSR_LINK_ADHOC 1 ++#define MSR_LINK_MASTER 3 ++#define MSR_LINK_ENEDCA (1<<4) ++ RETRY_LIMIT = 0x304, // Retry Limit [15:8]-short, [7:0]-long ++#define RETRY_LIMIT_SHORT_SHIFT 8 ++#define RETRY_LIMIT_LONG_SHIFT 0 ++ TSFR = 0x308, ++ RRSR = 0x310, // Response Rate Set ++#define RRSR_RSC_OFFSET 21 ++#define RRSR_SHORT_OFFSET 23 ++#define RRSR_RSC_DUPLICATE 0x600000 ++#define RRSR_RSC_UPSUBCHNL 0x400000 ++#define RRSR_RSC_LOWSUBCHNL 0x200000 ++#define RRSR_SHORT 0x800000 ++#define RRSR_1M BIT0 ++#define RRSR_2M BIT1 ++#define RRSR_5_5M BIT2 ++#define RRSR_11M BIT3 ++#define RRSR_6M BIT4 ++#define RRSR_9M BIT5 ++#define RRSR_12M BIT6 ++#define RRSR_18M BIT7 ++#define RRSR_24M BIT8 ++#define RRSR_36M BIT9 ++#define RRSR_48M BIT10 ++#define RRSR_54M BIT11 ++#define RRSR_MCS0 BIT12 ++#define RRSR_MCS1 BIT13 ++#define RRSR_MCS2 BIT14 ++#define RRSR_MCS3 BIT15 ++#define RRSR_MCS4 BIT16 ++#define RRSR_MCS5 BIT17 ++#define RRSR_MCS6 BIT18 ++#define RRSR_MCS7 BIT19 ++#define BRSR_AckShortPmb BIT23 // CCK ACK: use Short Preamble or not ++ UFWP = 0x318, ++ RATR0 = 0x320, // Rate Adaptive Table register1 ++//---------------------------------------------------------------------------- ++// 8190 Rate Adaptive Table Register (offset 0x320, 4 byte) ++//---------------------------------------------------------------------------- ++//CCK ++#define RATR_1M 0x00000001 ++#define RATR_2M 0x00000002 ++#define RATR_55M 0x00000004 ++#define RATR_11M 0x00000008 ++//OFDM ++#define RATR_6M 0x00000010 ++#define RATR_9M 0x00000020 ++#define RATR_12M 0x00000040 ++#define RATR_18M 0x00000080 ++#define RATR_24M 0x00000100 ++#define RATR_36M 0x00000200 ++#define RATR_48M 0x00000400 ++#define RATR_54M 0x00000800 ++//MCS 1 Spatial Stream ++#define RATR_MCS0 0x00001000 ++#define RATR_MCS1 0x00002000 ++#define RATR_MCS2 0x00004000 ++#define RATR_MCS3 0x00008000 ++#define RATR_MCS4 0x00010000 ++#define RATR_MCS5 0x00020000 ++#define RATR_MCS6 0x00040000 ++#define RATR_MCS7 0x00080000 ++//MCS 2 Spatial Stream ++#define RATR_MCS8 0x00100000 ++#define RATR_MCS9 0x00200000 ++#define RATR_MCS10 0x00400000 ++#define RATR_MCS11 0x00800000 ++#define RATR_MCS12 0x01000000 ++#define RATR_MCS13 0x02000000 ++#define RATR_MCS14 0x04000000 ++#define RATR_MCS15 0x08000000 ++// ALL CCK Rate ++#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M ++#define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M|RATR_36M|RATR_48M|RATR_54M ++#define RATE_ALL_OFDM_1SS RATR_MCS0|RATR_MCS1|RATR_MCS2|RATR_MCS3 | \ ++ RATR_MCS4|RATR_MCS5|RATR_MCS6 |RATR_MCS7 ++#define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11| \ ++ RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15 ++ ++ ++ DRIVER_RSSI = 0x32c, // Driver tell Firmware current RSSI ++ MCS_TXAGC = 0x340, // MCS AGC ++ CCK_TXAGC = 0x348, // CCK AGC ++// IMR = 0x354, // Interrupt Mask Register ++// IMR_POLL = 0x360, ++ MacBlkCtrl = 0x403, // Mac block on/off control register ++ ++ //Cmd9346CR = 0x00e, ++//#define Cmd9346CR_9356SEL (1<<4) ++#if 0 ++/* 0x0006 - 0x0007 - reserved */ ++ RXFIFOCOUNT = 0x010, ++ TXFIFOCOUNT = 0x012, ++ BQREQ = 0x013, ++/* 0x0010 - 0x0017 - reserved */ ++ TSFTR = 0x018, ++ TLPDA = 0x020, ++ TNPDA = 0x024, ++ THPDA = 0x028, ++ BSSID = 0x02E, ++ RESP_RATE = 0x034, ++ CMD = 0x037, ++#define CMD_RST_SHIFT 4 ++#define CMD_RESERVED_MASK ((1<<1) | (1<<5) | (1<<6) | (1<<7)) ++#define CMD_RX_ENABLE_SHIFT 3 ++#define CMD_TX_ENABLE_SHIFT 2 ++#define CR_RST ((1<< 4)) ++#define CR_RE ((1<< 3)) ++#define CR_TE ((1<< 2)) ++#define CR_MulRW ((1<< 0)) ++ ++ INTA = 0x03e, ++#endif ++ ++/////////////////// ++////////////////// ++#if 0 ++ TX_CONF = 0x040, ++#define TX_CONF_HEADER_AUTOICREMENT_SHIFT 30 ++#define TX_LOOPBACK_SHIFT 17 ++#define TX_LOOPBACK_MAC 1 ++#define TX_LOOPBACK_BASEBAND 2 ++#define TX_LOOPBACK_NONE 0 ++#define TX_LOOPBACK_CONTINUE 3 ++#define TX_LOOPBACK_MASK ((1<<17)|(1<<18)) ++#define TX_LRLRETRY_SHIFT 0 ++#define TX_SRLRETRY_SHIFT 8 ++#define TX_NOICV_SHIFT 19 ++#define TX_NOCRC_SHIFT 16 ++#define TCR_DurProcMode ((1<<30)) ++#define TCR_DISReqQsize ((1<<28)) ++#define TCR_HWVERID_MASK ((1<<27)|(1<<26)|(1<<25)) ++#define TCR_HWVERID_SHIFT 25 ++#define TCR_SWPLCPLEN ((1<<24)) ++#define TCR_PLCP_LEN TCR_SAT // rtl8180 ++#define TCR_MXDMA_MASK ((1<<23)|(1<<22)|(1<<21)) ++#define TCR_MXDMA_1024 6 ++#define TCR_MXDMA_2048 7 ++#define TCR_MXDMA_SHIFT 21 ++#define TCR_DISCW ((1<<20)) ++#define TCR_ICV ((1<<19)) ++#define TCR_LBK ((1<<18)|(1<<17)) ++#define TCR_LBK1 ((1<<18)) ++#define TCR_LBK0 ((1<<17)) ++#define TCR_CRC ((1<<16)) ++#define TCR_SRL_MASK ((1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)) ++#define TCR_LRL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)) ++#define TCR_PROBE_NOTIMESTAMP_SHIFT 29 //rtl8185 ++ ++ RX_CONF = 0x044, ++#define MAC_FILTER_MASK ((1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<5) | \ ++(1<<12) | (1<<18) | (1<<19) | (1<<20) | (1<<21) | (1<<22) | (1<<23)) ++#define RX_CHECK_BSSID_SHIFT 23 ++#define ACCEPT_PWR_FRAME_SHIFT 22 ++#define ACCEPT_MNG_FRAME_SHIFT 20 ++#define ACCEPT_CTL_FRAME_SHIFT 19 ++#define ACCEPT_DATA_FRAME_SHIFT 18 ++#define ACCEPT_ICVERR_FRAME_SHIFT 12 ++#define ACCEPT_CRCERR_FRAME_SHIFT 5 ++#define ACCEPT_BCAST_FRAME_SHIFT 3 ++#define ACCEPT_MCAST_FRAME_SHIFT 2 ++#define ACCEPT_ALLMAC_FRAME_SHIFT 0 ++#define ACCEPT_NICMAC_FRAME_SHIFT 1 ++#define RX_FIFO_THRESHOLD_MASK ((1<<13) | (1<<14) | (1<<15)) ++#define RX_FIFO_THRESHOLD_SHIFT 13 ++#define RX_FIFO_THRESHOLD_128 3 ++#define RX_FIFO_THRESHOLD_256 4 ++#define RX_FIFO_THRESHOLD_512 5 ++#define RX_FIFO_THRESHOLD_1024 6 ++#define RX_FIFO_THRESHOLD_NONE 7 ++#define RX_AUTORESETPHY_SHIFT 28 ++#define MAX_RX_DMA_MASK ((1<<8) | (1<<9) | (1<<10)) ++#define MAX_RX_DMA_2048 7 ++#define MAX_RX_DMA_1024 6 ++#define MAX_RX_DMA_SHIFT 10 ++#define RCR_ONLYERLPKT ((1<<31)) ++#define RCR_CS_SHIFT 29 ++#define RCR_CS_MASK ((1<<30) | (1<<29)) ++#define RCR_ENMARP ((1<<28)) ++#define RCR_CBSSID ((1<<23)) ++#define RCR_APWRMGT ((1<<22)) ++#define RCR_ADD3 ((1<<21)) ++#define RCR_AMF ((1<<20)) ++#define RCR_ACF ((1<<19)) ++#define RCR_ADF ((1<<18)) ++#define RCR_RXFTH ((1<<15)|(1<<14)|(1<<13)) ++#define RCR_RXFTH2 ((1<<15)) ++#define RCR_RXFTH1 ((1<<14)) ++#define RCR_RXFTH0 ((1<<13)) ++#define RCR_AICV ((1<<12)) ++#define RCR_MXDMA ((1<<10)|(1<< 9)|(1<< 8)) ++#define RCR_MXDMA2 ((1<<10)) ++#define RCR_MXDMA1 ((1<< 9)) ++#define RCR_MXDMA0 ((1<< 8)) ++#define RCR_9356SEL ((1<< 6)) ++#define RCR_ACRC32 ((1<< 5)) ++#define RCR_AB ((1<< 3)) ++#define RCR_AM ((1<< 2)) ++#define RCR_APM ((1<< 1)) ++#define RCR_AAP ((1<< 0)) ++ ++ INT_TIMEOUT = 0x048, ++ ++ TX_BEACON_RING_ADDR = 0x04c, ++ ++#endif ++#if 0 ++ CONFIG0 = 0x051, ++#define CONFIG0_WEP104 ((1<<6)) ++#define CONFIG0_LEDGPO_En ((1<<4)) ++#define CONFIG0_Aux_Status ((1<<3)) ++#define CONFIG0_GL ((1<<1)|(1<<0)) ++#define CONFIG0_GL1 ((1<<1)) ++#define CONFIG0_GL0 ((1<<0)) ++ CONFIG1 = 0x052, ++#define CONFIG1_LEDS ((1<<7)|(1<<6)) ++#define CONFIG1_LEDS1 ((1<<7)) ++#define CONFIG1_LEDS0 ((1<<6)) ++#define CONFIG1_LWACT ((1<<4)) ++#define CONFIG1_MEMMAP ((1<<3)) ++#define CONFIG1_IOMAP ((1<<2)) ++#define CONFIG1_VPD ((1<<1)) ++#define CONFIG1_PMEn ((1<<0)) ++ CONFIG2 = 0x053, ++#define CONFIG2_LCK ((1<<7)) ++#define CONFIG2_ANT ((1<<6)) ++#define CONFIG2_DPS ((1<<3)) ++#define CONFIG2_PAPE_sign ((1<<2)) ++#define CONFIG2_PAPE_time ((1<<1)|(1<<0)) ++#define CONFIG2_PAPE_time1 ((1<<1)) ++#define CONFIG2_PAPE_time0 ((1<<0)) ++ ANA_PARAM = 0x054, ++ CONFIG3 = 0x059, ++#define CONFIG3_GNTSel ((1<<7)) ++#define CONFIG3_PARM_En ((1<<6)) ++#define CONFIG3_Magic ((1<<5)) ++#define CONFIG3_CardB_En ((1<<3)) ++#define CONFIG3_CLKRUN_En ((1<<2)) ++#define CONFIG3_FuncRegEn ((1<<1)) ++#define CONFIG3_FBtbEn ((1<<0)) ++#define CONFIG3_CLKRUN_SHIFT 2 ++#define CONFIG3_ANAPARAM_W_SHIFT 6 ++ CONFIG4 = 0x05a, ++#define CONFIG4_VCOPDN ((1<<7)) ++#define CONFIG4_PWROFF ((1<<6)) ++#define CONFIG4_PWRMGT ((1<<5)) ++#define CONFIG4_LWPME ((1<<4)) ++#define CONFIG4_LWPTN ((1<<2)) ++#define CONFIG4_RFTYPE ((1<<1)|(1<<0)) ++#define CONFIG4_RFTYPE1 ((1<<1)) ++#define CONFIG4_RFTYPE0 ((1<<0)) ++ TESTR = 0x05b, ++#define TFPC_AC 0x05C ++ ++#define SCR 0x05F ++ PGSELECT = 0x05e, ++#define PGSELECT_PG_SHIFT 0 ++ SECURITY = 0x05f, ++#define SECURITY_WEP_TX_ENABLE_SHIFT 1 ++#define SECURITY_WEP_RX_ENABLE_SHIFT 0 ++#define SECURITY_ENCRYP_104 1 ++#define SECURITY_ENCRYP_SHIFT 4 ++#define SECURITY_ENCRYP_MASK ((1<<4)|(1<<5)) ++ ++ ANA_PARAM2 = 0x060, ++ BEACON_INTERVAL = 0x070, ++#define BEACON_INTERVAL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)| \ ++(1<<6)|(1<<7)|(1<<8)|(1<<9)) ++ ++ ATIM_WND = 0x072, ++#define ATIM_WND_MASK (0x01FF) ++ ++ BCN_INTR_ITV = 0x074, ++#define BCN_INTR_ITV_MASK (0x01FF) ++ ++ ATIM_INTR_ITV = 0x076, ++#define ATIM_INTR_ITV_MASK (0x01FF) ++ ++ AckTimeOutReg = 0x079, //ACK timeout register, in unit of 4 us. ++ PHY_ADR = 0x07c, ++ PHY_READ = 0x07e, ++ RFPinsOutput = 0x080, ++ RFPinsEnable = 0x082, ++//Page 0 ++ RFPinsSelect = 0x084, ++#define SW_CONTROL_GPIO 0x400 ++ RFPinsInput = 0x086, ++ RF_PARA = 0x088, ++ RF_TIMING = 0x08c, ++ GP_ENABLE = 0x090, ++ GPIO = 0x091, ++ TX_AGC_CTL = 0x09c, ++#define TX_AGC_CTL_PER_PACKET_TXAGC 0x01 ++#define TX_AGC_CTL_PERPACKET_GAIN_SHIFT 0 ++#define TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT 1 ++#define TX_AGC_CTL_FEEDBACK_ANT 2 ++#define TXAGC_CTL_PER_PACKET_ANT_SEL 0x02 ++ OFDM_TXAGC = 0x09e, ++ ANTSEL = 0x09f, ++ ++ ++ ++ SIFS = 0x0b4, ++ DIFS = 0x0b5, ++ SLOT = 0x0b6, ++ CW_CONF = 0x0bc, ++#define CW_CONF_PERPACKET_RETRY_LIMIT 0x02 ++#define CW_CONF_PERPACKET_CW 0x01 ++#define CW_CONF_PERPACKET_RETRY_SHIFT 1 ++#define CW_CONF_PERPACKET_CW_SHIFT 0 ++ CW_VAL = 0x0bd, ++ RATE_FALLBACK = 0x0be, ++#define MAX_RESP_RATE_SHIFT 4 ++#define MIN_RESP_RATE_SHIFT 0 ++#define RATE_FALLBACK_CTL_ENABLE 0x80 ++#define RATE_FALLBACK_CTL_AUTO_STEP0 0x00 ++ ACM_CONTROL = 0x0BF, // ACM Control Registe ++//---------------------------------------------------------------------------- ++// 8187B ACM_CONTROL bits (Offset 0xBF, 1 Byte) ++//---------------------------------------------------------------------------- ++#define VOQ_ACM_EN (0x01 << 7) //BIT7 ++#define VIQ_ACM_EN (0x01 << 6) //BIT6 ++#define BEQ_ACM_EN (0x01 << 5) //BIT5 ++#define ACM_HW_EN (0x01 << 4) //BIT4 ++#define TXOPSEL (0x01 << 3) //BIT3 ++#define VOQ_ACM_CTL (0x01 << 2) //BIT2 // Set to 1 when AC_VO used time reaches or exceeds the admitted time ++#define VIQ_ACM_CTL (0x01 << 1) //BIT1 // Set to 1 when AC_VI used time reaches or exceeds the admitted time ++#define BEQ_ACM_CTL (0x01 << 0) //BIT0 // Set to 1 when AC_BE used time reaches or exceeds the admitted time ++ CONFIG5 = 0x0D8, ++#define CONFIG5_TX_FIFO_OK ((1<<7)) ++#define CONFIG5_RX_FIFO_OK ((1<<6)) ++#define CONFIG5_CALON ((1<<5)) ++#define CONFIG5_EACPI ((1<<2)) ++#define CONFIG5_LANWake ((1<<1)) ++#define CONFIG5_PME_STS ((1<<0)) ++ TX_DMA_POLLING = 0x0fd, ++#define TX_DMA_POLLING_BEACON_SHIFT 7 ++#define TX_DMA_POLLING_HIPRIORITY_SHIFT 6 ++#define TX_DMA_POLLING_NORMPRIORITY_SHIFT 5 ++#define TX_DMA_POLLING_LOWPRIORITY_SHIFT 4 ++#define TX_DMA_STOP_BEACON_SHIFT 3 ++#define TX_DMA_STOP_HIPRIORITY_SHIFT 2 ++#define TX_DMA_STOP_NORMPRIORITY_SHIFT 1 ++#define TX_DMA_STOP_LOWPRIORITY_SHIFT 0 ++ CWR = 0x0DC, ++ RetryCTR = 0x0DE, ++ INT_MIG = 0x0E2, // Interrupt Migration (0xE2 ~ 0xE3) ++ TID_AC_MAP = 0x0E8, // TID to AC Mapping Register ++ ANA_PARAM3 = 0x0EE, ++ ++ ++//page 1 ++ Wakeup0 = 0x084, ++ Wakeup1 = 0x08C, ++ Wakeup2LD = 0x094, ++ Wakeup2HD = 0x09C, ++ Wakeup3LD = 0x0A4, ++ Wakeup3HD = 0x0AC, ++ Wakeup4LD = 0x0B4, ++ Wakeup4HD = 0x0BC, ++ CRC0 = 0x0C4, ++ CRC1 = 0x0C6, ++ CRC2 = 0x0C8, ++ CRC3 = 0x0CA, ++ CRC4 = 0x0CC, ++/* 0x00CE - 0x00D3 - reserved */ ++ ++ RFSW_CTRL = 0x272, // 0x272-0x273. ++ ++/**************************************************************************/ ++ FER = 0x0F0, ++ FEMR = 0x0F4, ++ FPSR = 0x0F8, ++ FFER = 0x0FC, ++ ++ AC_VO_PARAM = 0x0F0, // AC_VO Parameters Record ++ AC_VI_PARAM = 0x0F4, // AC_VI Parameters Record ++ AC_BE_PARAM = 0x0F8, // AC_BE Parameters Record ++ AC_BK_PARAM = 0x0FC, // AC_BK Parameters Record ++ TALLY_SEL = 0x0fc, ++#endif ++} ++; ++//---------------------------------------------------------------------------- ++// 818xB AnaParm & AnaParm2 Register ++//---------------------------------------------------------------------------- ++//#define ANAPARM_ASIC_ON 0x45090658 ++//#define ANAPARM2_ASIC_ON 0x727f3f52 ++ ++#define GPI 0x108 ++#define GPO 0x109 ++#define GPE 0x10a ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_wx.c +@@ -0,0 +1,1409 @@ ++/* ++ This file contains wireless extension handlers. ++ ++ This is part of rtl8180 OpenSource driver. ++ Copyright (C) Andrea Merello 2004-2005 ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part ++ of the official realtek driver. ++ ++ Parts of this driver are based on the rtl8180 driver skeleton ++ from Patric Schenke & Andres Salomon. ++ ++ Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. ++ ++ We want to tanks the Authors of those projects and the Ndiswrapper ++ project Authors. ++*/ ++ ++#include ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#include "r8192E_wx.h" ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++ ++#define RATE_COUNT 12 ++static u32 rtl8180_rates[] = {1000000,2000000,5500000,11000000, ++ 6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000}; ++ ++ ++#ifndef ENETDOWN ++#define ENETDOWN 1 ++#endif ++static int r8192_wx_get_freq(struct net_device *dev, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ return ieee80211_wx_get_freq(priv->ieee80211,a,wrqu,b); ++} ++ ++ ++#if 0 ++ ++static int r8192_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa, ++ union iwreq_data *wrqu, char *b) ++{ ++ int *parms = (int *)b; ++ int bi = parms[0]; ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ DMESG("setting beacon interval to %x",bi); ++ ++ priv->ieee80211->beacon_interval=bi; ++ rtl8180_commit(dev); ++ up(&priv->wx_sem); ++ ++ return 0; ++} ++ ++ ++static int r8192_wx_set_forceassociate(struct net_device *dev, struct iw_request_info *aa, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv=ieee80211_priv(dev); ++ int *parms = (int *)extra; ++ ++ priv->ieee80211->force_associate = (parms[0] > 0); ++ ++ ++ return 0; ++} ++ ++#endif ++static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct r8192_priv *priv=ieee80211_priv(dev); ++ ++ return ieee80211_wx_get_mode(priv->ieee80211,a,wrqu,b); ++} ++ ++ ++ ++static int r8192_wx_get_rate(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ return ieee80211_wx_get_rate(priv->ieee80211,info,wrqu,extra); ++} ++ ++ ++ ++static int r8192_wx_set_rate(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_rate(priv->ieee80211,info,wrqu,extra); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++ ++static int r8192_wx_set_rts(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_rts(priv->ieee80211,info,wrqu,extra); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++static int r8192_wx_get_rts(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ return ieee80211_wx_get_rts(priv->ieee80211,info,wrqu,extra); ++} ++ ++static int r8192_wx_set_power(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_power(priv->ieee80211,info,wrqu,extra); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++static int r8192_wx_get_power(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ return ieee80211_wx_get_power(priv->ieee80211,info,wrqu,extra); ++} ++ ++#ifdef JOHN_IOCTL ++u16 read_rtl8225(struct net_device *dev, u8 addr); ++void write_rtl8225(struct net_device *dev, u8 adr, u16 data); ++u32 john_read_rtl8225(struct net_device *dev, u8 adr); ++void _write_rtl8225(struct net_device *dev, u8 adr, u16 data); ++ ++static int r8192_wx_read_regs(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 addr; ++ u16 data1; ++ ++ down(&priv->wx_sem); ++ ++ ++ get_user(addr,(u8*)wrqu->data.pointer); ++ data1 = read_rtl8225(dev, addr); ++ wrqu->data.length = data1; ++ ++ up(&priv->wx_sem); ++ return 0; ++ ++} ++ ++static int r8192_wx_write_regs(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 addr; ++ ++ down(&priv->wx_sem); ++ ++ get_user(addr, (u8*)wrqu->data.pointer); ++ write_rtl8225(dev, addr, wrqu->data.length); ++ ++ up(&priv->wx_sem); ++ return 0; ++ ++} ++ ++void rtl8187_write_phy(struct net_device *dev, u8 adr, u32 data); ++u8 rtl8187_read_phy(struct net_device *dev,u8 adr, u32 data); ++ ++static int r8192_wx_read_bb(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 databb; ++#if 0 ++ int i; ++ for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) ); ++#endif ++ ++ down(&priv->wx_sem); ++ ++ databb = rtl8187_read_phy(dev, (u8)wrqu->data.length, 0x00000000); ++ wrqu->data.length = databb; ++ ++ up(&priv->wx_sem); ++ return 0; ++} ++ ++void rtl8187_write_phy(struct net_device *dev, u8 adr, u32 data); ++static int r8192_wx_write_bb(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 databb; ++ ++ down(&priv->wx_sem); ++ ++ get_user(databb, (u8*)wrqu->data.pointer); ++ rtl8187_write_phy(dev, wrqu->data.length, databb); ++ ++ up(&priv->wx_sem); ++ return 0; ++ ++} ++ ++ ++static int r8192_wx_write_nicb(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 addr; ++ ++ down(&priv->wx_sem); ++ ++ get_user(addr, (u32*)wrqu->data.pointer); ++ write_nic_byte(dev, addr, wrqu->data.length); ++ ++ up(&priv->wx_sem); ++ return 0; ++ ++} ++static int r8192_wx_read_nicb(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 addr; ++ u16 data1; ++ ++ down(&priv->wx_sem); ++ ++ get_user(addr,(u32*)wrqu->data.pointer); ++ data1 = read_nic_byte(dev, addr); ++ wrqu->data.length = data1; ++ ++ up(&priv->wx_sem); ++ return 0; ++} ++ ++static int r8192_wx_get_ap_status(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device *ieee = priv->ieee80211; ++ struct ieee80211_network *target; ++ int name_len; ++ ++ down(&priv->wx_sem); ++ ++ //count the length of input ssid ++ for(name_len=0 ; ((char*)wrqu->data.pointer)[name_len]!='\0' ; name_len++); ++ ++ //search for the correspoding info which is received ++ list_for_each_entry(target, &ieee->network_list, list) { ++ if ( (target->ssid_len == name_len) && ++ (strncmp(target->ssid, (char*)wrqu->data.pointer, name_len)==0)){ ++ if(target->wpa_ie_len>0 || target->rsn_ie_len>0 ) ++ //set flags=1 to indicate this ap is WPA ++ wrqu->data.flags = 1; ++ else wrqu->data.flags = 0; ++ ++ ++ break; ++ } ++ } ++ ++ up(&priv->wx_sem); ++ return 0; ++} ++ ++ ++ ++#endif ++ ++static int r8192_wx_set_rawtx(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int ret; ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_rawtx(priv->ieee80211, info, wrqu, extra); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++ ++} ++ ++static int r8192_wx_force_reset(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ printk("%s(): force reset ! extra is %d\n",__FUNCTION__, *extra); ++ priv->force_reset = *extra; ++ up(&priv->wx_sem); ++ return 0; ++ ++} ++ ++ ++static int r8192_wx_set_crcmon(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int *parms = (int *)extra; ++ int enable = (parms[0] > 0); ++ short prev = priv->crcmon; ++ ++ down(&priv->wx_sem); ++ ++ if(enable) ++ priv->crcmon=1; ++ else ++ priv->crcmon=0; ++ ++ DMESG("bad CRC in monitor mode are %s", ++ priv->crcmon ? "accepted" : "rejected"); ++ ++ if(prev != priv->crcmon && priv->up){ ++ //rtl8180_down(dev); ++ //rtl8180_up(dev); ++ } ++ ++ up(&priv->wx_sem); ++ ++ return 0; ++} ++ ++static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_RF_POWER_STATE rtState; ++ int ret; ++ ++ rtState = priv->ieee80211->eRFPowerState; ++ down(&priv->wx_sem); ++#ifdef ENABLE_IPS ++ if(wrqu->mode == IW_MODE_ADHOC){ ++ ++ if(priv->ieee80211->PowerSaveControl.bInactivePs){ ++ if(rtState == eRfOff){ ++ if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS) ++ { ++ RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__); ++ up(&priv->wx_sem); ++ return -1; ++ } ++ else{ ++ printk("=========>%s(): IPSLeave\n",__FUNCTION__); ++ IPSLeave(dev); ++ } ++ } ++ } ++ } ++#endif ++ ret = ieee80211_wx_set_mode(priv->ieee80211,a,wrqu,b); ++ ++ //rtl8187_set_rxconf(dev); ++ ++ up(&priv->wx_sem); ++ return ret; ++} ++ ++struct iw_range_with_scan_capa ++{ ++ /* Informative stuff (to choose between different interface) */ ++ __u32 throughput; /* To give an idea... */ ++ /* In theory this value should be the maximum benchmarked ++ * TCP/IP throughput, because with most of these devices the ++ * bit rate is meaningless (overhead an co) to estimate how ++ * fast the connection will go and pick the fastest one. ++ * I suggest people to play with Netperf or any benchmark... ++ */ ++ ++ /* NWID (or domain id) */ ++ __u32 min_nwid; /* Minimal NWID we are able to set */ ++ __u32 max_nwid; /* Maximal NWID we are able to set */ ++ ++ /* Old Frequency (backward compat - moved lower ) */ ++ __u16 old_num_channels; ++ __u8 old_num_frequency; ++ ++ /* Scan capabilities */ ++ __u8 scan_capa; ++}; ++static int rtl8180_wx_get_range(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct iw_range *range = (struct iw_range *)extra; ++ struct iw_range_with_scan_capa* tmp = (struct iw_range_with_scan_capa*)range; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u16 val; ++ int i; ++ ++ wrqu->data.length = sizeof(*range); ++ memset(range, 0, sizeof(*range)); ++ ++ /* Let's try to keep this struct in the same order as in ++ * linux/include/wireless.h ++ */ ++ ++ /* TODO: See what values we can set, and remove the ones we can't ++ * set, or fill them with some default data. ++ */ ++ ++ /* ~5 Mb/s real (802.11b) */ ++ range->throughput = 5 * 1000 * 1000; ++ ++ // TODO: Not used in 802.11b? ++// range->min_nwid; /* Minimal NWID we are able to set */ ++ // TODO: Not used in 802.11b? ++// range->max_nwid; /* Maximal NWID we are able to set */ ++ ++ /* Old Frequency (backward compat - moved lower ) */ ++// range->old_num_channels; ++// range->old_num_frequency; ++// range->old_freq[6]; /* Filler to keep "version" at the same offset */ ++ if(priv->rf_set_sens != NULL) ++ range->sensitivity = priv->max_sens; /* signal level threshold range */ ++ ++ range->max_qual.qual = 100; ++ /* TODO: Find real max RSSI and stick here */ ++ range->max_qual.level = 0; ++ range->max_qual.noise = -98; ++ range->max_qual.updated = 7; /* Updated all three */ ++ ++ range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */ ++ /* TODO: Find real 'good' to 'bad' threshol value for RSSI */ ++ range->avg_qual.level = 20 + -98; ++ range->avg_qual.noise = 0; ++ range->avg_qual.updated = 7; /* Updated all three */ ++ ++ range->num_bitrates = RATE_COUNT; ++ ++ for (i = 0; i < RATE_COUNT && i < IW_MAX_BITRATES; i++) { ++ range->bitrate[i] = rtl8180_rates[i]; ++ } ++ ++ range->min_frag = MIN_FRAG_THRESHOLD; ++ range->max_frag = MAX_FRAG_THRESHOLD; ++ ++ range->min_pmp=0; ++ range->max_pmp = 5000000; ++ range->min_pmt = 0; ++ range->max_pmt = 65535*1000; ++ range->pmp_flags = IW_POWER_PERIOD; ++ range->pmt_flags = IW_POWER_TIMEOUT; ++ range->pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT | IW_POWER_ALL_R; ++ range->we_version_compiled = WIRELESS_EXT; ++ range->we_version_source = 16; ++ ++// range->retry_capa; /* What retry options are supported */ ++// range->retry_flags; /* How to decode max/min retry limit */ ++// range->r_time_flags; /* How to decode max/min retry life */ ++// range->min_retry; /* Minimal number of retries */ ++// range->max_retry; /* Maximal number of retries */ ++// range->min_r_time; /* Minimal retry lifetime */ ++// range->max_r_time; /* Maximal retry lifetime */ ++ ++ ++ for (i = 0, val = 0; i < 14; i++) { ++ ++ // Include only legal frequencies for some countries ++#ifdef ENABLE_DOT11D ++ if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) { ++#else ++ if ((priv->ieee80211->channel_map)[i+1]) { ++#endif ++ range->freq[val].i = i + 1; ++ range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000; ++ range->freq[val].e = 1; ++ val++; ++ } else { ++ // FIXME: do we need to set anything for channels ++ // we don't use ? ++ } ++ ++ if (val == IW_MAX_FREQUENCIES) ++ break; ++ } ++ range->num_frequency = val; ++ range->num_channels = val; ++#if WIRELESS_EXT > 17 ++ range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2| ++ IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP; ++#endif ++ tmp->scan_capa = 0x01; ++ return 0; ++} ++ ++ ++static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ RT_RF_POWER_STATE rtState; ++ int ret; ++ rtState = priv->ieee80211->eRFPowerState; ++ if(!priv->up) return -ENETDOWN; ++ if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true) ++ return -EAGAIN; ++ ++ if (wrqu->data.flags & IW_SCAN_THIS_ESSID) ++ { ++ struct iw_scan_req* req = (struct iw_scan_req*)b; ++ if (req->essid_len) ++ { ++ //printk("==**&*&*&**===>scan set ssid:%s\n", req->essid); ++ ieee->current_network.ssid_len = req->essid_len; ++ memcpy(ieee->current_network.ssid, req->essid, req->essid_len); ++ //printk("=====>network ssid:%s\n", ieee->current_network.ssid); ++ } ++ } ++ ++ down(&priv->wx_sem); ++#ifdef ENABLE_IPS ++ priv->ieee80211->actscanning = true; ++ if(priv->ieee80211->state != IEEE80211_LINKED){ ++ if(priv->ieee80211->PowerSaveControl.bInactivePs){ ++ if(rtState == eRfOff){ ++ if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS) ++ { ++ RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__); ++ up(&priv->wx_sem); ++ return -1; ++ } ++ else{ ++ printk("=========>%s(): IPSLeave\n",__FUNCTION__); ++ IPSLeave(dev); ++ } ++ } ++ } ++ priv->ieee80211->scanning = 0; ++ ieee80211_softmac_scan_syncro(priv->ieee80211); ++ ret = 0; ++ } ++ else ++#else ++ ++ if(priv->ieee80211->state != IEEE80211_LINKED){ ++ priv->ieee80211->scanning = 0; ++ ieee80211_softmac_scan_syncro(priv->ieee80211); ++ ret = 0; ++ } ++ else ++#endif ++ ret = ieee80211_wx_set_scan(priv->ieee80211,a,wrqu,b); ++ ++ up(&priv->wx_sem); ++ return ret; ++} ++ ++ ++static int r8192_wx_get_scan(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if(!priv->up) return -ENETDOWN; ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_get_scan(priv->ieee80211,a,wrqu,b); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++static int r8192_wx_set_essid(struct net_device *dev, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_RF_POWER_STATE rtState; ++ int ret; ++ ++ rtState = priv->ieee80211->eRFPowerState; ++ down(&priv->wx_sem); ++#ifdef ENABLE_IPS ++ if(priv->ieee80211->PowerSaveControl.bInactivePs){ ++ if(rtState == eRfOff){ ++ if(priv->ieee80211->RfOffReason > RF_CHANGE_BY_IPS) ++ { ++ RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__FUNCTION__); ++ up(&priv->wx_sem); ++ return -1; ++ } ++ else{ ++ printk("=========>%s(): IPSLeave\n",__FUNCTION__); ++ IPSLeave(dev); ++ } ++ } ++ } ++#endif ++ ret = ieee80211_wx_set_essid(priv->ieee80211,a,wrqu,b); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++ ++ ++ ++static int r8192_wx_get_essid(struct net_device *dev, ++ struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_get_essid(priv->ieee80211, a, wrqu, b); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++} ++ ++ ++static int r8192_wx_set_freq(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu, char *b) ++{ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_freq(priv->ieee80211, a, wrqu, b); ++ ++ up(&priv->wx_sem); ++ return ret; ++} ++ ++static int r8192_wx_get_name(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ return ieee80211_wx_get_name(priv->ieee80211, info, wrqu, extra); ++} ++ ++ ++static int r8192_wx_set_frag(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if (wrqu->frag.disabled) ++ priv->ieee80211->fts = DEFAULT_FRAG_THRESHOLD; ++ else { ++ if (wrqu->frag.value < MIN_FRAG_THRESHOLD || ++ wrqu->frag.value > MAX_FRAG_THRESHOLD) ++ return -EINVAL; ++ ++ priv->ieee80211->fts = wrqu->frag.value & ~0x1; ++ } ++ ++ return 0; ++} ++ ++ ++static int r8192_wx_get_frag(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ wrqu->frag.value = priv->ieee80211->fts; ++ wrqu->frag.fixed = 0; /* no auto select */ ++ wrqu->frag.disabled = (wrqu->frag.value == DEFAULT_FRAG_THRESHOLD); ++ ++ return 0; ++} ++ ++ ++static int r8192_wx_set_wap(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *awrq, ++ char *extra) ++{ ++ ++ int ret; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++// struct sockaddr *temp = (struct sockaddr *)awrq; ++ ++ down(&priv->wx_sem); ++ ++ ret = ieee80211_wx_set_wap(priv->ieee80211,info,awrq,extra); ++ ++ up(&priv->wx_sem); ++ ++ return ret; ++ ++} ++ ++ ++static int r8192_wx_get_wap(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ return ieee80211_wx_get_wap(priv->ieee80211,info,wrqu,extra); ++} ++ ++ ++static int r8192_wx_get_enc(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ return ieee80211_wx_get_encode(priv->ieee80211, info, wrqu, key); ++} ++ ++static int r8192_wx_set_enc(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *key) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int ret; ++ ++ struct ieee80211_device *ieee = priv->ieee80211; ++ //u32 TargetContent; ++ u32 hwkey[4]={0,0,0,0}; ++ u8 mask=0xff; ++ u32 key_idx=0; ++ u8 zero_addr[4][6] ={ {0x00,0x00,0x00,0x00,0x00,0x00}, ++ {0x00,0x00,0x00,0x00,0x00,0x01}, ++ {0x00,0x00,0x00,0x00,0x00,0x02}, ++ {0x00,0x00,0x00,0x00,0x00,0x03} }; ++ int i; ++ ++ if(!priv->up) return -ENETDOWN; ++ ++ down(&priv->wx_sem); ++ ++ RT_TRACE(COMP_SEC, "Setting SW wep key"); ++ ret = ieee80211_wx_set_encode(priv->ieee80211,info,wrqu,key); ++ ++ up(&priv->wx_sem); ++ ++ ++ //sometimes, the length is zero while we do not type key value ++ if(wrqu->encoding.length!=0){ ++ ++ for(i=0 ; i<4 ; i++){ ++ hwkey[i] |= key[4*i+0]&mask; ++ if(i==1&&(4*i+1)==wrqu->encoding.length) mask=0x00; ++ if(i==3&&(4*i+1)==wrqu->encoding.length) mask=0x00; ++ hwkey[i] |= (key[4*i+1]&mask)<<8; ++ hwkey[i] |= (key[4*i+2]&mask)<<16; ++ hwkey[i] |= (key[4*i+3]&mask)<<24; ++ } ++ ++ #define CONF_WEP40 0x4 ++ #define CONF_WEP104 0x14 ++ ++ switch(wrqu->encoding.flags & IW_ENCODE_INDEX){ ++ case 0: key_idx = ieee->tx_keyidx; break; ++ case 1: key_idx = 0; break; ++ case 2: key_idx = 1; break; ++ case 3: key_idx = 2; break; ++ case 4: key_idx = 3; break; ++ default: break; ++ } ++ ++ //printk("-------====>length:%d, key_idx:%d, flag:%x\n", wrqu->encoding.length, key_idx, wrqu->encoding.flags); ++ if(wrqu->encoding.length==0x5){ ++ ieee->pairwise_key_type = KEY_TYPE_WEP40; ++ EnableHWSecurityConfig8192(dev); ++ setKey( dev, ++ key_idx, //EntryNo ++ key_idx, //KeyIndex ++ KEY_TYPE_WEP40, //KeyType ++ zero_addr[key_idx], ++ 0, //DefaultKey ++ hwkey); //KeyContent ++ ++#if 0 ++ if(key_idx == 0){ ++ ++ //write_nic_byte(dev, SECR, 7); ++ setKey( dev, ++ 4, //EntryNo ++ key_idx, //KeyIndex ++ KEY_TYPE_WEP40, //KeyType ++ broadcast_addr, //addr ++ 0, //DefaultKey ++ hwkey); //KeyContent ++ } ++#endif ++ } ++ ++ else if(wrqu->encoding.length==0xd){ ++ ieee->pairwise_key_type = KEY_TYPE_WEP104; ++ EnableHWSecurityConfig8192(dev); ++ setKey( dev, ++ key_idx, //EntryNo ++ key_idx, //KeyIndex ++ KEY_TYPE_WEP104, //KeyType ++ zero_addr[key_idx], ++ 0, //DefaultKey ++ hwkey); //KeyContent ++#if 0 ++ if(key_idx == 0){ ++ ++ //write_nic_byte(dev, SECR, 7); ++ setKey( dev, ++ 4, //EntryNo ++ key_idx, //KeyIndex ++ KEY_TYPE_WEP104, //KeyType ++ broadcast_addr, //addr ++ 0, //DefaultKey ++ hwkey); //KeyContent ++ } ++#endif ++ } ++ else printk("wrong type in WEP, not WEP40 and WEP104\n"); ++ ++ ++ } ++ ++#if 0 ++ //consider the setting different key index situation ++ //wrqu->encoding.flags = 801 means that we set key with index "1" ++ if(wrqu->encoding.length==0 && (wrqu->encoding.flags >>8) == 0x8 ){ ++ printk("===>1\n"); ++ //write_nic_byte(dev, SECR, 7); ++ EnableHWSecurityConfig8192(dev); ++ //copy wpa config from default key(key0~key3) to broadcast key(key5) ++ // ++ key_idx = (wrqu->encoding.flags & 0xf)-1 ; ++ write_cam(dev, (4*6), 0xffff0000|read_cam(dev, key_idx*6) ); ++ write_cam(dev, (4*6)+1, 0xffffffff); ++ write_cam(dev, (4*6)+2, read_cam(dev, (key_idx*6)+2) ); ++ write_cam(dev, (4*6)+3, read_cam(dev, (key_idx*6)+3) ); ++ write_cam(dev, (4*6)+4, read_cam(dev, (key_idx*6)+4) ); ++ write_cam(dev, (4*6)+5, read_cam(dev, (key_idx*6)+5) ); ++ } ++#endif ++ ++ return ret; ++} ++ ++ ++static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, union ++ iwreq_data *wrqu, char *p){ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int *parms=(int*)p; ++ int mode=parms[0]; ++ ++ priv->ieee80211->active_scan = mode; ++ ++ return 1; ++} ++ ++ ++ ++static int r8192_wx_set_retry(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int err = 0; ++ ++ down(&priv->wx_sem); ++ ++ if (wrqu->retry.flags & IW_RETRY_LIFETIME || ++ wrqu->retry.disabled){ ++ err = -EINVAL; ++ goto exit; ++ } ++ if (!(wrqu->retry.flags & IW_RETRY_LIMIT)){ ++ err = -EINVAL; ++ goto exit; ++ } ++ ++ if(wrqu->retry.value > R8180_MAX_RETRY){ ++ err= -EINVAL; ++ goto exit; ++ } ++ if (wrqu->retry.flags & IW_RETRY_MAX) { ++ priv->retry_rts = wrqu->retry.value; ++ DMESG("Setting retry for RTS/CTS data to %d", wrqu->retry.value); ++ ++ }else { ++ priv->retry_data = wrqu->retry.value; ++ DMESG("Setting retry for non RTS/CTS data to %d", wrqu->retry.value); ++ } ++ ++ /* FIXME ! ++ * We might try to write directly the TX config register ++ * or to restart just the (R)TX process. ++ * I'm unsure if whole reset is really needed ++ */ ++ ++ rtl8192_commit(dev); ++ /* ++ if(priv->up){ ++ rtl8180_rtx_disable(dev); ++ rtl8180_rx_enable(dev); ++ rtl8180_tx_enable(dev); ++ ++ } ++ */ ++exit: ++ up(&priv->wx_sem); ++ ++ return err; ++} ++ ++static int r8192_wx_get_retry(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ ++ wrqu->retry.disabled = 0; /* can't be disabled */ ++ ++ if ((wrqu->retry.flags & IW_RETRY_TYPE) == ++ IW_RETRY_LIFETIME) ++ return -EINVAL; ++ ++ if (wrqu->retry.flags & IW_RETRY_MAX) { ++ wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MAX; ++ wrqu->retry.value = priv->retry_rts; ++ } else { ++ wrqu->retry.flags = IW_RETRY_LIMIT & IW_RETRY_MIN; ++ wrqu->retry.value = priv->retry_data; ++ } ++ //DMESG("returning %d",wrqu->retry.value); ++ ++ ++ return 0; ++} ++ ++static int r8192_wx_get_sens(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ if(priv->rf_set_sens == NULL) ++ return -1; /* we have not this support for this radio */ ++ wrqu->sens.value = priv->sens; ++ return 0; ++} ++ ++ ++static int r8192_wx_set_sens(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ short err = 0; ++ down(&priv->wx_sem); ++ //DMESG("attempt to set sensivity to %ddb",wrqu->sens.value); ++ if(priv->rf_set_sens == NULL) { ++ err= -1; /* we have not this support for this radio */ ++ goto exit; ++ } ++ if(priv->rf_set_sens(dev, wrqu->sens.value) == 0) ++ priv->sens = wrqu->sens.value; ++ else ++ err= -EINVAL; ++ ++exit: ++ up(&priv->wx_sem); ++ ++ return err; ++} ++ ++#if (WIRELESS_EXT >= 18) ++#if 0 ++static int r8192_wx_get_enc_ext(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int ret = 0; ++ ret = ieee80211_wx_get_encode_ext(priv->ieee80211, info, wrqu, extra); ++ return ret; ++} ++#endif ++static int r8192_wx_set_enc_ext(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ int ret=0; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ ++ down(&priv->wx_sem); ++ ret = ieee80211_wx_set_encode_ext(ieee, info, wrqu, extra); ++ ++ { ++ u8 broadcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff}; ++ u8 zero[6] = {0}; ++ u32 key[4] = {0}; ++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; ++ struct iw_point *encoding = &wrqu->encoding; ++#if 0 ++ static u8 CAM_CONST_ADDR[4][6] = { ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, ++ {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}; ++#endif ++ u8 idx = 0, alg = 0, group = 0; ++ if ((encoding->flags & IW_ENCODE_DISABLED) || ++ ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01 ++ { ++ ieee->pairwise_key_type = ieee->group_key_type = KEY_TYPE_NA; ++ CamResetAllEntry(dev); ++ goto end_hw_sec; ++ } ++ alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; // as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4; ++ idx = encoding->flags & IW_ENCODE_INDEX; ++ if (idx) ++ idx --; ++ group = ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY; ++ ++ if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg == KEY_TYPE_WEP40)) ++ { ++ if ((ext->key_len == 13) && (alg == KEY_TYPE_WEP40) ) ++ alg = KEY_TYPE_WEP104; ++ ieee->pairwise_key_type = alg; ++ EnableHWSecurityConfig8192(dev); ++ } ++ memcpy((u8*)key, ext->key, 16); //we only get 16 bytes key.why? WB 2008.7.1 ++ ++ if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode !=2) ) ++ { ++ if (ext->key_len == 13) ++ ieee->pairwise_key_type = alg = KEY_TYPE_WEP104; ++ setKey( dev, ++ idx,//EntryNo ++ idx, //KeyIndex ++ alg, //KeyType ++ zero, //MacAddr ++ 0, //DefaultKey ++ key); //KeyContent ++ } ++ else if (group) ++ { ++ ieee->group_key_type = alg; ++ setKey( dev, ++ idx,//EntryNo ++ idx, //KeyIndex ++ alg, //KeyType ++ broadcast_addr, //MacAddr ++ 0, //DefaultKey ++ key); //KeyContent ++ } ++ else //pairwise key ++ { ++ if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->pHTInfo->bCurrentHTSupport){ ++ write_nic_byte(dev, 0x173, 1); //fix aes bug ++ } ++ setKey( dev, ++ 4,//EntryNo ++ idx, //KeyIndex ++ alg, //KeyType ++ (u8*)ieee->ap_mac_addr, //MacAddr ++ 0, //DefaultKey ++ key); //KeyContent ++ } ++ ++ ++ } ++ ++end_hw_sec: ++ up(&priv->wx_sem); ++#endif ++ return ret; ++ ++} ++static int r8192_wx_set_auth(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *data, char *extra) ++{ ++ int ret=0; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ //printk("====>%s()\n", __FUNCTION__); ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ down(&priv->wx_sem); ++ ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra); ++ up(&priv->wx_sem); ++#endif ++ return ret; ++} ++ ++static int r8192_wx_set_mlme(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *wrqu, char *extra) ++{ ++ //printk("====>%s()\n", __FUNCTION__); ++ ++ int ret=0; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ down(&priv->wx_sem); ++ ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra); ++ up(&priv->wx_sem); ++#endif ++ return ret; ++} ++#endif ++static int r8192_wx_set_gen_ie(struct net_device *dev, ++ struct iw_request_info *info, ++ union iwreq_data *data, char *extra) ++{ ++ //printk("====>%s(), len:%d\n", __FUNCTION__, data->length); ++ int ret=0; ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ down(&priv->wx_sem); ++#if 1 ++ ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length); ++#endif ++ up(&priv->wx_sem); ++ //printk("<======%s(), ret:%d\n", __FUNCTION__, ret); ++#endif ++ return ret; ++ ++ ++} ++ ++static int dummy(struct net_device *dev, struct iw_request_info *a, ++ union iwreq_data *wrqu,char *b) ++{ ++ return -1; ++} ++ ++ ++static iw_handler r8192_wx_handlers[] = ++{ ++ NULL, /* SIOCSIWCOMMIT */ ++ r8192_wx_get_name, /* SIOCGIWNAME */ ++ dummy, /* SIOCSIWNWID */ ++ dummy, /* SIOCGIWNWID */ ++ r8192_wx_set_freq, /* SIOCSIWFREQ */ ++ r8192_wx_get_freq, /* SIOCGIWFREQ */ ++ r8192_wx_set_mode, /* SIOCSIWMODE */ ++ r8192_wx_get_mode, /* SIOCGIWMODE */ ++ r8192_wx_set_sens, /* SIOCSIWSENS */ ++ r8192_wx_get_sens, /* SIOCGIWSENS */ ++ NULL, /* SIOCSIWRANGE */ ++ rtl8180_wx_get_range, /* SIOCGIWRANGE */ ++ NULL, /* SIOCSIWPRIV */ ++ NULL, /* SIOCGIWPRIV */ ++ NULL, /* SIOCSIWSTATS */ ++ NULL, /* SIOCGIWSTATS */ ++ dummy, /* SIOCSIWSPY */ ++ dummy, /* SIOCGIWSPY */ ++ NULL, /* SIOCGIWTHRSPY */ ++ NULL, /* SIOCWIWTHRSPY */ ++ r8192_wx_set_wap, /* SIOCSIWAP */ ++ r8192_wx_get_wap, /* SIOCGIWAP */ ++#if (WIRELESS_EXT >= 18) ++ r8192_wx_set_mlme, /* MLME-- */ ++#else ++ NULL, ++#endif ++ dummy, /* SIOCGIWAPLIST -- depricated */ ++ r8192_wx_set_scan, /* SIOCSIWSCAN */ ++ r8192_wx_get_scan, /* SIOCGIWSCAN */ ++ r8192_wx_set_essid, /* SIOCSIWESSID */ ++ r8192_wx_get_essid, /* SIOCGIWESSID */ ++ dummy, /* SIOCSIWNICKN */ ++ dummy, /* SIOCGIWNICKN */ ++ NULL, /* -- hole -- */ ++ NULL, /* -- hole -- */ ++ r8192_wx_set_rate, /* SIOCSIWRATE */ ++ r8192_wx_get_rate, /* SIOCGIWRATE */ ++ r8192_wx_set_rts, /* SIOCSIWRTS */ ++ r8192_wx_get_rts, /* SIOCGIWRTS */ ++ r8192_wx_set_frag, /* SIOCSIWFRAG */ ++ r8192_wx_get_frag, /* SIOCGIWFRAG */ ++ dummy, /* SIOCSIWTXPOW */ ++ dummy, /* SIOCGIWTXPOW */ ++ r8192_wx_set_retry, /* SIOCSIWRETRY */ ++ r8192_wx_get_retry, /* SIOCGIWRETRY */ ++ r8192_wx_set_enc, /* SIOCSIWENCODE */ ++ r8192_wx_get_enc, /* SIOCGIWENCODE */ ++ r8192_wx_set_power, /* SIOCSIWPOWER */ ++ r8192_wx_get_power, /* SIOCGIWPOWER */ ++ NULL, /*---hole---*/ ++ NULL, /*---hole---*/ ++ r8192_wx_set_gen_ie,//NULL, /* SIOCSIWGENIE */ ++ NULL, /* SIOCSIWGENIE */ ++#if (WIRELESS_EXT >= 18) ++ r8192_wx_set_auth,//NULL, /* SIOCSIWAUTH */ ++ NULL,//r8192_wx_get_auth,//NULL, /* SIOCSIWAUTH */ ++ r8192_wx_set_enc_ext, /* SIOCSIWENCODEEXT */ ++#else ++ NULL, ++ NULL, ++ NULL, ++#endif ++ NULL,//r8192_wx_get_enc_ext,//NULL, /* SIOCSIWENCODEEXT */ ++ NULL, /* SIOCSIWPMKSA */ ++ NULL, /*---hole---*/ ++ ++}; ++ ++ ++static const struct iw_priv_args r8192_private_args[] = { ++ ++ { ++ SIOCIWFIRSTPRIV + 0x0, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "badcrc" ++ }, ++ ++ { ++ SIOCIWFIRSTPRIV + 0x1, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "activescan" ++ ++ }, ++ { ++ SIOCIWFIRSTPRIV + 0x2, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rawtx" ++ } ++#ifdef JOHN_IOCTL ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x3, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readRF" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x4, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeRF" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x5, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readBB" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x6, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeBB" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x7, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readnicb" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x8, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writenicb" ++ } ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x9, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo" ++ } ++ ++#endif ++ , ++ { ++ SIOCIWFIRSTPRIV + 0x3, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "forcereset" ++ ++ } ++ ++}; ++ ++ ++static iw_handler r8192_private_handler[] = { ++// r8192_wx_set_monitor, /* SIOCIWFIRSTPRIV */ ++ r8192_wx_set_crcmon, /*SIOCIWSECONDPRIV*/ ++// r8192_wx_set_forceassociate, ++// r8192_wx_set_beaconinterval, ++// r8192_wx_set_monitor_type, ++ r8192_wx_set_scan_type, ++ r8192_wx_set_rawtx, ++#ifdef JOHN_IOCTL ++ r8192_wx_read_regs, ++ r8192_wx_write_regs, ++ r8192_wx_read_bb, ++ r8192_wx_write_bb, ++ r8192_wx_read_nicb, ++ r8192_wx_write_nicb, ++ r8192_wx_get_ap_status ++#endif ++ r8192_wx_force_reset, ++}; ++ ++//#if WIRELESS_EXT >= 17 ++struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ struct ieee80211_device* ieee = priv->ieee80211; ++ struct iw_statistics* wstats = &priv->wstats; ++ int tmp_level = 0; ++ int tmp_qual = 0; ++ int tmp_noise = 0; ++ if(ieee->state < IEEE80211_LINKED) ++ { ++ wstats->qual.qual = 0; ++ wstats->qual.level = 0; ++ wstats->qual.noise = 0; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) ++ wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; ++#else ++ wstats->qual.updated = 0x0f; ++#endif ++ return wstats; ++ } ++ ++ tmp_level = (&ieee->current_network)->stats.rssi; ++ tmp_qual = (&ieee->current_network)->stats.signal; ++ tmp_noise = (&ieee->current_network)->stats.noise; ++ //printk("level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, tmp_noise); ++ ++ wstats->qual.level = tmp_level; ++ wstats->qual.qual = tmp_qual; ++ wstats->qual.noise = tmp_noise; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) ++ wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; ++#else ++ wstats->qual.updated = 0x0f; ++#endif ++ return wstats; ++} ++//#endif ++ ++ ++struct iw_handler_def r8192_wx_handlers_def={ ++ .standard = r8192_wx_handlers, ++ .num_standard = sizeof(r8192_wx_handlers) / sizeof(iw_handler), ++ .private = r8192_private_handler, ++ .num_private = sizeof(r8192_private_handler) / sizeof(iw_handler), ++ .num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args), ++#if WIRELESS_EXT >= 17 ++ .get_wireless_stats = r8192_get_wireless_stats, ++#endif ++ .private_args = (struct iw_priv_args *)r8192_private_args, ++}; +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192E_wx.h +@@ -0,0 +1,22 @@ ++/* ++ This is part of rtl8180 OpenSource driver - v 0.3 ++ Copyright (C) Andrea Merello 2004 ++ Released under the terms of GPL (General Public Licence) ++ ++ Parts of this driver are based on the GPL part of the official realtek driver ++ Parts of this driver are based on the rtl8180 driver skeleton from Patric Schenke & Andres Salomon ++ Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver ++ ++ We want to tanks the Authors of such projects and the Ndiswrapper project Authors. ++*/ ++ ++/* this file (will) contains wireless extension handlers*/ ++ ++#ifndef R8180_WX_H ++#define R8180_WX_H ++//#include ++//#include "ieee80211.h" ++extern struct iw_handler_def r8192_wx_handlers_def; ++/* Enable the rtl819x_core.c to share this function, david 2008.9.22 */ ++extern struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev); ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192_pm.c +@@ -0,0 +1,181 @@ ++/* ++ Power management interface routines. ++ Written by Mariusz Matuszek. ++ This code is currently just a placeholder for later work and ++ does not do anything useful. ++ ++ This is part of rtl8180 OpenSource driver. ++ Copyright (C) Andrea Merello 2004 ++ Released under the terms of GPL (General Public Licence) ++*/ ++ ++#ifdef CONFIG_PM_RTL ++ ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#include "r8192_pm.h" ++#include "r8190_rtl8256.h" ++ ++int rtl8192E_save_state (struct pci_dev *dev, pm_message_t state) ++{ ++ printk(KERN_NOTICE "r8192E save state call (state %u).\n", state.event); ++ return(-EAGAIN); ++} ++ ++ ++int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state) ++{ ++ struct net_device *dev = pci_get_drvdata(pdev); ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 ucRegRead; ++ u32 ulRegRead; ++ ++ RT_TRACE(COMP_POWER, "============> r8192E suspend call.\n"); ++ if (!netif_running(dev)) ++ goto out_pci_suspend; ++ ++ dev->stop(dev); ++#if 0 ++ ++ netif_carrier_off(dev); ++ ++ ieee80211_softmac_stop_protocol(priv->ieee80211); ++ ++ write_nic_byte(dev,MSR,(read_nic_byte(dev,MSR)&0xfc)|MSR_LINK_NONE); ++ if(!priv->ieee80211->bSupportRemoteWakeUp) { ++ /* disable tx/rx. In 8185 we write 0x10 (Reset bit), ++ * but here we make reference to WMAC and wirte 0x0. ++ * 2006.11.21 Emily ++ */ ++ write_nic_byte(dev, CMDR, 0); ++ } ++ //disable interrupt ++ write_nic_dword(dev,INTA_MASK,0); ++ priv->irq_enabled = 0; ++ write_nic_dword(dev,ISR,read_nic_dword(dev, ISR)); ++ ++ /* need to free DM related functions */ ++#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) ++ cancel_work_sync(&priv->reset_wq); ++#else ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&priv->reset_wq); ++#endif ++#endif ++ del_timer_sync(&priv->fsync_timer); ++ del_timer_sync(&priv->watch_dog_timer); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&priv->watch_dog_wq); ++ cancel_delayed_work(&priv->update_beacon_wq); ++#endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) ++ cancel_work_sync(&priv->qos_activate); ++#else ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ cancel_delayed_work(&priv->qos_activate); ++#endif ++#endif ++ ++ /* TODO ++#if ((DEV_BUS_TYPE == PCI_INTERFACE) && (HAL_CODE_BASE == RTL8192)) ++pHalData->bHwRfOffAction = 2; ++#endif ++*/ ++#endif ++ // Call MgntActSet_RF_State instead to prevent RF config race condition. ++ // By Bruce, 2008-01-17. ++ // ++ if(!priv->ieee80211->bSupportRemoteWakeUp) { ++ MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT); ++ // 2006.11.30. System reset bit ++ ulRegRead = read_nic_dword(dev, CPU_GEN); ++ ulRegRead|=CPU_GEN_SYSTEM_RESET; ++ write_nic_dword(dev, CPU_GEN, ulRegRead); ++ } else { ++ //2008.06.03 for WOL ++ write_nic_dword(dev, WFCRC0, 0xffffffff); ++ write_nic_dword(dev, WFCRC1, 0xffffffff); ++ write_nic_dword(dev, WFCRC2, 0xffffffff); ++#ifdef RTL8190P ++ //GPIO 0 = TRUE ++ ucRegRead = read_nic_byte(dev, GPO); ++ ucRegRead |= BIT0; ++ write_nic_byte(dev, GPO, ucRegRead); ++#endif ++ //Write PMR register ++ write_nic_byte(dev, PMR, 0x5); ++ //Disable tx, enanble rx ++ write_nic_byte(dev, MacBlkCtrl, 0xa); ++ } ++ ++out_pci_suspend: ++ RT_TRACE(COMP_POWER, "r8192E support WOL call??????????????????????\n"); ++ if(priv->ieee80211->bSupportRemoteWakeUp) { ++ RT_TRACE(COMP_POWER, "r8192E support WOL call!!!!!!!!!!!!!!!!!!.\n"); ++ } ++ netif_device_detach(dev); ++ pci_save_state(pdev); ++ pci_disable_device(pdev); ++ pci_enable_wake(pdev, pci_choose_state(pdev,state),\ ++ priv->ieee80211->bSupportRemoteWakeUp?1:0); ++ pci_set_power_state(pdev,pci_choose_state(pdev,state)); ++ ++ return 0; ++} ++ ++int rtl8192E_resume (struct pci_dev *pdev) ++{ ++ struct net_device *dev = pci_get_drvdata(pdev); ++ //struct r8192_priv *priv = ieee80211_priv(dev); ++ //union iwreq_data wrqu; ++ int err; ++ u32 val; ++ ++ RT_TRACE(COMP_POWER, "================>r8192E resume call."); ++ ++ pci_set_power_state(pdev, PCI_D0); ++ ++ err = pci_enable_device(pdev); ++ if(err) { ++ printk(KERN_ERR "%s: pci_enable_device failed on resume\n", ++ dev->name); ++ return err; ++ } ++ ++ pci_restore_state(pdev); ++ ++ /* ++ * 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_read_config_dword(pdev, 0x40, &val); ++ if ((val & 0x0000ff00) != 0) { ++ pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); ++ } ++ ++ ++ ++ pci_enable_wake(pdev, PCI_D0, 0); ++ ++ if(!netif_running(dev)) ++ goto out; ++ ++ netif_device_attach(dev); ++ ++ dev->open(dev); ++out: ++ RT_TRACE(COMP_POWER, "<================r8192E resume call.\n"); ++ return 0; ++} ++ ++ ++int rtl8192E_enable_wake (struct pci_dev *dev, pm_message_t state, int enable) ++{ ++ printk(KERN_NOTICE "r8192E enable wake call (state %u, enable %d).\n", ++ state.event, enable); ++ return(-EAGAIN); ++} ++ ++#endif //CONFIG_PM_RTL +--- /dev/null ++++ b/drivers/staging/rtl8192e/r8192_pm.h +@@ -0,0 +1,28 @@ ++/* ++ Power management interface routines. ++ Written by Mariusz Matuszek. ++ This code is currently just a placeholder for later work and ++ does not do anything useful. ++ ++ This is part of rtl8180 OpenSource driver. ++ Copyright (C) Andrea Merello 2004 ++ Released under the terms of GPL (General Public Licence) ++ ++*/ ++ ++#ifdef CONFIG_PM_RTL ++ ++#ifndef R8192E_PM_H ++#define R8192E_PM_H ++ ++#include ++#include ++ ++int rtl8192E_save_state (struct pci_dev *dev, pm_message_t state); ++int rtl8192E_suspend (struct pci_dev *dev, pm_message_t state); ++int rtl8192E_resume (struct pci_dev *dev); ++int rtl8192E_enable_wake (struct pci_dev *dev, pm_message_t state, int enable); ++ ++#endif //R8192E_PM_H ++ ++#endif // CONFIG_PM_RTL +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.c +@@ -0,0 +1,820 @@ ++/****************************************************************************** ++ ++ (c) Copyright 2008, RealTEK Technologies Inc. All Rights Reserved. ++ ++ Module: r819xusb_cmdpkt.c (RTL8190 TX/RX command packet handler Source C File) ++ ++ Note: The module is responsible for handling TX and RX command packet. ++ 1. TX : Send set and query configuration command packet. ++ 2. RX : Receive tx feedback, beacon state, query configuration ++ command packet. ++ ++ Function: ++ ++ Export: ++ ++ Abbrev: ++ ++ History: ++ Data Who Remark ++ ++ 05/06/2008 amy Create initial version porting from windows driver. ++ ++******************************************************************************/ ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#include "r819xE_cmdpkt.h" ++/*---------------------------Define Local Constant---------------------------*/ ++/* Debug constant*/ ++#define CMPK_DEBOUNCE_CNT 1 ++/* 2007/10/24 MH Add for printing a range of data. */ ++#define CMPK_PRINT(Address)\ ++{\ ++ unsigned char i;\ ++ u32 temp[10];\ ++ \ ++ memcpy(temp, Address, 40);\ ++ for (i = 0; i <40; i+=4)\ ++ printk("\r\n %08x", temp[i]);\ ++}\ ++ ++/*---------------------------Define functions---------------------------------*/ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_message_handle_tx() ++ * ++ * Overview: Driver internal module can call the API to send message to ++ * firmware side. For example, you can send a debug command packet. ++ * Or you can send a request for FW to modify RLX4181 LBUS HW bank. ++ * Otherwise, you can change MAC/PHT/RF register by firmware at ++ * run time. We do not support message more than one segment now. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/06/2008 amy porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++RT_STATUS cmpk_message_handle_tx( ++ struct net_device *dev, ++ u8* code_virtual_address, ++ u32 packettype, ++ u32 buffer_len) ++{ ++ ++ RT_STATUS rt_status = RT_STATUS_SUCCESS; ++#ifdef RTL8192U ++ return rt_status; ++#else ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u16 frag_threshold; ++ u16 frag_length = 0, frag_offset = 0; ++ rt_firmware *pfirmware = priv->pFirmware; ++ struct sk_buff *skb; ++ unsigned char *seg_ptr; ++ cb_desc *tcb_desc; ++ u8 bLastIniPkt; ++ ++ PTX_FWINFO_8190PCI pTxFwInfo = NULL; ++ int i; ++ ++ //spin_lock_irqsave(&priv->tx_lock,flags); ++ RT_TRACE(COMP_CMDPKT,"%s(),buffer_len is %d\n",__FUNCTION__,buffer_len); ++ firmware_init_param(dev); ++ //Fragmentation might be required ++ frag_threshold = pfirmware->cmdpacket_frag_thresold; ++ do { ++ if((buffer_len - frag_offset) > frag_threshold) { ++ frag_length = frag_threshold ; ++ bLastIniPkt = 0; ++ ++ } else { ++ frag_length =(u16)(buffer_len - frag_offset); ++ bLastIniPkt = 1; ++ ++ } ++ ++ /* Allocate skb buffer to contain firmware info and tx descriptor info ++ * add 4 to avoid packet appending overflow. ++ * */ ++#ifdef RTL8192U ++ skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4); ++#else ++ skb = dev_alloc_skb(frag_length + priv->ieee80211->tx_headroom + 4); ++#endif ++ if(skb == NULL) { ++ rt_status = RT_STATUS_FAILURE; ++ goto Failed; ++ } ++ ++ memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); ++ tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE); ++ tcb_desc->queue_index = TXCMD_QUEUE; ++ tcb_desc->bCmdOrInit = packettype; ++ tcb_desc->bLastIniPkt = bLastIniPkt; ++ tcb_desc->pkt_size = frag_length; ++ ++#ifdef RTL8192U ++ skb_reserve(skb, USB_HWDESC_HEADER_LEN); ++#endif ++ ++ //seg_ptr = skb_put(skb, frag_length + priv->ieee80211->tx_headroom); ++ seg_ptr = skb_put(skb, priv->ieee80211->tx_headroom); ++ ++ pTxFwInfo = (PTX_FWINFO_8190PCI)seg_ptr; ++ memset(pTxFwInfo,0,sizeof(TX_FWINFO_8190PCI)); ++ memset(pTxFwInfo,0x12,8); ++ ++ seg_ptr +=sizeof(TX_FWINFO_8190PCI); ++ ++ /* ++ * Transform from little endian to big endian ++ * and pending zero ++ */ ++ seg_ptr = skb->tail; ++ for(i=0 ; i < frag_length; i+=4) { ++ *seg_ptr++ = ((i+0)ieee80211->softmac_hard_start_xmit(skb,dev); ++ ++ code_virtual_address += frag_length; ++ frag_offset += frag_length; ++ ++#if 0 ++ { ++ int k; ++ printk("------------tx cmd------------\n"); ++ for(k = 0; ktx_lock,flags); ++ return rt_status; ++ ++ ++#endif ++} /* CMPK_Message_Handle_Tx */ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_counttxstatistic() ++ * ++ * Overview: ++ * ++ * Input: PADAPTER pAdapter - . ++ * CMPK_TXFB_T *psTx_FB - . ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_count_txstatistic( ++ struct net_device *dev, ++ cmpk_txfb_t *pstx_fb) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef ENABLE_PS ++ RT_RF_POWER_STATE rtState; ++ ++ pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); ++ ++ // When RF is off, we should not count the packet for hw/sw synchronize ++ // reason, ie. there may be a duration while sw switch is changed and hw ++ // switch is being changed. 2006.12.04, by shien chang. ++ if (rtState == eRfOff) ++ { ++ return; ++ } ++#endif ++ ++#ifdef TODO ++ if(pAdapter->bInHctTest) ++ return; ++#endif ++ /* We can not know the packet length and transmit type: broadcast or uni ++ or multicast. So the relative statistics must be collected in tx ++ feedback info. */ ++ if (pstx_fb->tok) ++ { ++ priv->stats.txfeedbackok++; ++ priv->stats.txoktotal++; ++ priv->stats.txokbytestotal += pstx_fb->pkt_length; ++ priv->stats.txokinperiod++; ++ ++ /* We can not make sure broadcast/multicast or unicast mode. */ ++ if (pstx_fb->pkt_type == PACKET_MULTICAST) ++ { ++ priv->stats.txmulticast++; ++ priv->stats.txbytesmulticast += pstx_fb->pkt_length; ++ } ++ else if (pstx_fb->pkt_type == PACKET_BROADCAST) ++ { ++ priv->stats.txbroadcast++; ++ priv->stats.txbytesbroadcast += pstx_fb->pkt_length; ++ } ++ else ++ { ++ priv->stats.txunicast++; ++ priv->stats.txbytesunicast += pstx_fb->pkt_length; ++ } ++ } ++ else ++ { ++ priv->stats.txfeedbackfail++; ++ priv->stats.txerrtotal++; ++ priv->stats.txerrbytestotal += pstx_fb->pkt_length; ++ ++ /* We can not make sure broadcast/multicast or unicast mode. */ ++ if (pstx_fb->pkt_type == PACKET_MULTICAST) ++ { ++ priv->stats.txerrmulticast++; ++ } ++ else if (pstx_fb->pkt_type == PACKET_BROADCAST) ++ { ++ priv->stats.txerrbroadcast++; ++ } ++ else ++ { ++ priv->stats.txerrunicast++; ++ } ++ } ++ ++ priv->stats.txretrycount += pstx_fb->retry_cnt; ++ priv->stats.txfeedbackretry += pstx_fb->retry_cnt; ++ ++} /* cmpk_CountTxStatistic */ ++ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_handle_tx_feedback() ++ * ++ * Overview: The function is responsible for extract the message inside TX ++ * feedbck message from firmware. It will contain dedicated info in ++ * ws-06-0063-rtl8190-command-packet-specification. Please ++ * refer to chapter "TX Feedback Element". We have to read 20 bytes ++ * in the command packet. ++ * ++ * Input: struct net_device * dev ++ * u8 * pmsg - Msg Ptr of the command packet. ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/08/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_handle_tx_feedback( ++ struct net_device *dev, ++ u8 * pmsg) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ cmpk_txfb_t rx_tx_fb; /* */ ++ ++ priv->stats.txfeedback++; ++ ++ /* 0. Display received message. */ ++ //cmpk_Display_Message(CMPK_RX_TX_FB_SIZE, pMsg); ++ ++ /* 1. Extract TX feedback info from RFD to temp structure buffer. */ ++ /* It seems that FW use big endian(MIPS) and DRV use little endian in ++ windows OS. So we have to read the content byte by byte or transfer ++ endian type before copy the message copy. */ ++#if 0 // The TX FEEDBACK packet element address ++ //rx_tx_fb.Element_ID = pMsg[0]; ++ //rx_tx_fb.Length = pMsg[1]; ++ rx_tx_fb.TOK = pMsg[2]>>7; ++ rx_tx_fb.Fail_Reason = (pMsg[2] & 0x70) >> 4; ++ rx_tx_fb.TID = (pMsg[2] & 0x0F); ++ rx_tx_fb.Qos_Pkt = pMsg[3] >> 7; ++ rx_tx_fb.Bandwidth = (pMsg[3] & 0x40) >> 6; ++ rx_tx_fb.Retry_Cnt = pMsg[5]; ++ rx_tx_fb.Pkt_ID = (pMsg[6] << 8) | pMsg[7]; ++ rx_tx_fb.Seq_Num = (pMsg[8] << 8) | pMsg[9]; ++ rx_tx_fb.S_Rate = pMsg[10]; ++ rx_tx_fb.F_Rate = pMsg[11]; ++ rx_tx_fb.S_RTS_Rate = pMsg[12]; ++ rx_tx_fb.F_RTS_Rate = pMsg[13]; ++ rx_tx_fb.pkt_length = (pMsg[14] << 8) | pMsg[15]; ++#endif ++ /* 2007/07/05 MH Use pointer to transfer structure memory. */ ++ //memcpy((UINT8 *)&rx_tx_fb, pMsg, sizeof(CMPK_TXFB_T)); ++ memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t)); ++ /* 2. Use tx feedback info to count TX statistics. */ ++ cmpk_count_txstatistic(dev, &rx_tx_fb); ++#if 0 ++ /* 2007/07/11 MH Assign current operate rate. */ ++ if (pAdapter->RegWirelessMode == WIRELESS_MODE_A || ++ pAdapter->RegWirelessMode == WIRELESS_MODE_B || ++ pAdapter->RegWirelessMode == WIRELESS_MODE_G) ++ { ++ pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F); ++ } ++ else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G || ++ pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G) ++ { ++ pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F); ++ } ++#endif ++ /* 2007/01/17 MH Comment previous method for TX statistic function. */ ++ /* Collect info TX feedback packet to fill TCB. */ ++ /* We can not know the packet length and transmit type: broadcast or uni ++ or multicast. */ ++ //CountTxStatistics( pAdapter, &tcb ); ++ ++} /* cmpk_Handle_Tx_Feedback */ ++ ++static void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u16 tx_rate; ++ { ++ // ++ // 070117, rcnjko: 87B have to S/W beacon for DTM encryption_cmn. ++ // ++ if((priv->ieee80211->current_network.mode == IEEE_A) || ++ (priv->ieee80211->current_network.mode == IEEE_N_5G) || ++ ((priv->ieee80211->current_network.mode == IEEE_N_24G) && (!priv->ieee80211->pHTInfo->bCurSuppCCK))) ++ { ++ tx_rate = 60; ++ DMESG("send beacon frame tx rate is 6Mbpm\n"); ++ } ++ else ++ { ++ tx_rate =10; ++ DMESG("send beacon frame tx rate is 1Mbpm\n"); ++ } ++ ++ //rtl819xusb_beacon_tx(dev,tx_rate); // HW Beacon ++ ++ } ++ ++} ++ ++ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_handle_interrupt_status() ++ * ++ * Overview: The function is responsible for extract the message from ++ * firmware. It will contain dedicated info in ++ * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc. ++ * Please refer to chapter "Interrupt Status Element". ++ * ++ * Input: struct net_device *dev, ++ * u8* pmsg - Message Pointer of the command packet. ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Add this for rtl8192 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_handle_interrupt_status( ++ struct net_device *dev, ++ u8* pmsg) ++{ ++ cmpk_intr_sta_t rx_intr_status; /* */ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ DMESG("---> cmpk_Handle_Interrupt_Status()\n"); ++ ++ /* 0. Display received message. */ ++ //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg); ++ ++ /* 1. Extract TX feedback info from RFD to temp structure buffer. */ ++ /* It seems that FW use big endian(MIPS) and DRV use little endian in ++ windows OS. So we have to read the content byte by byte or transfer ++ endian type before copy the message copy. */ ++ //rx_bcn_state.Element_ID = pMsg[0]; ++ //rx_bcn_state.Length = pMsg[1]; ++ rx_intr_status.length = pmsg[1]; ++ if (rx_intr_status.length != (sizeof(cmpk_intr_sta_t) - 2)) ++ { ++ DMESG("cmpk_Handle_Interrupt_Status: wrong length!\n"); ++ return; ++ } ++ ++ ++ // Statistics of beacon for ad-hoc mode. ++ if( priv->ieee80211->iw_mode == IW_MODE_ADHOC) ++ { ++ //2 maybe need endian transform? ++ rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4)); ++ //rx_intr_status.InterruptStatus = N2H4BYTE(*((UINT32 *)(pMsg + 4))); ++ ++ DMESG("interrupt status = 0x%x\n", rx_intr_status.interrupt_status); ++ ++ if (rx_intr_status.interrupt_status & ISR_TxBcnOk) ++ { ++ priv->ieee80211->bibsscoordinator = true; ++ priv->stats.txbeaconokint++; ++ } ++ else if (rx_intr_status.interrupt_status & ISR_TxBcnErr) ++ { ++ priv->ieee80211->bibsscoordinator = false; ++ priv->stats.txbeaconerr++; ++ } ++ ++ if (rx_intr_status.interrupt_status & ISR_BcnTimerIntr) ++ { ++ cmdpkt_beacontimerinterrupt_819xusb(dev); ++ } ++ ++ } ++ ++ // Other informations in interrupt status we need? ++ ++ ++ DMESG("<---- cmpk_handle_interrupt_status()\n"); ++ ++} /* cmpk_handle_interrupt_status */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_handle_query_config_rx() ++ * ++ * Overview: The function is responsible for extract the message from ++ * firmware. It will contain dedicated info in ++ * ws-06-0063-rtl8190-command-packet-specification. Please ++ * refer to chapter "Beacon State Element". ++ * ++ * Input: u8 * pmsg - Message Pointer of the command packet. ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_handle_query_config_rx( ++ struct net_device *dev, ++ u8* pmsg) ++{ ++ cmpk_query_cfg_t rx_query_cfg; /* */ ++ ++ /* 0. Display received message. */ ++ //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg); ++ ++ /* 1. Extract TX feedback info from RFD to temp structure buffer. */ ++ /* It seems that FW use big endian(MIPS) and DRV use little endian in ++ windows OS. So we have to read the content byte by byte or transfer ++ endian type before copy the message copy. */ ++ //rx_query_cfg.Element_ID = pMsg[0]; ++ //rx_query_cfg.Length = pMsg[1]; ++ rx_query_cfg.cfg_action = (pmsg[4] & 0x80000000)>>31; ++ rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5; ++ rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3; ++ rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0; ++ rx_query_cfg.cfg_offset = pmsg[7]; ++ rx_query_cfg.value = (pmsg[8] << 24) | (pmsg[9] << 16) | ++ (pmsg[10] << 8) | (pmsg[11] << 0); ++ rx_query_cfg.mask = (pmsg[12] << 24) | (pmsg[13] << 16) | ++ (pmsg[14] << 8) | (pmsg[15] << 0); ++ ++} /* cmpk_Handle_Query_Config_Rx */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_count_tx_status() ++ * ++ * Overview: Count aggregated tx status from firmwar of one type rx command ++ * packet element id = RX_TX_STATUS. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void cmpk_count_tx_status( struct net_device *dev, ++ cmpk_tx_status_t *pstx_status) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++#ifdef ENABLE_PS ++ ++ RT_RF_POWER_STATE rtstate; ++ ++ pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); ++ ++ // When RF is off, we should not count the packet for hw/sw synchronize ++ // reason, ie. there may be a duration while sw switch is changed and hw ++ // switch is being changed. 2006.12.04, by shien chang. ++ if (rtState == eRfOff) ++ { ++ return; ++ } ++#endif ++ ++ priv->stats.txfeedbackok += pstx_status->txok; ++ priv->stats.txoktotal += pstx_status->txok; ++ ++ priv->stats.txfeedbackfail += pstx_status->txfail; ++ priv->stats.txerrtotal += pstx_status->txfail; ++ ++ priv->stats.txretrycount += pstx_status->txretry; ++ priv->stats.txfeedbackretry += pstx_status->txretry; ++ ++ //pAdapter->TxStats.NumTxOkBytesTotal += psTx_FB->pkt_length; ++ //pAdapter->TxStats.NumTxErrBytesTotal += psTx_FB->pkt_length; ++ //pAdapter->MgntInfo.LinkDetectInfo.NumTxOkInPeriod++; ++ ++ priv->stats.txmulticast += pstx_status->txmcok; ++ priv->stats.txbroadcast += pstx_status->txbcok; ++ priv->stats.txunicast += pstx_status->txucok; ++ ++ priv->stats.txerrmulticast += pstx_status->txmcfail; ++ priv->stats.txerrbroadcast += pstx_status->txbcfail; ++ priv->stats.txerrunicast += pstx_status->txucfail; ++ ++ priv->stats.txbytesmulticast += pstx_status->txmclength; ++ priv->stats.txbytesbroadcast += pstx_status->txbclength; ++ priv->stats.txbytesunicast += pstx_status->txuclength; ++ ++ priv->stats.last_packet_rate = pstx_status->rate; ++} /* cmpk_CountTxStatus */ ++ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_handle_tx_status() ++ * ++ * Overview: Firmware add a new tx feedback status to reduce rx command ++ * packet buffer operation load. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_handle_tx_status( ++ struct net_device *dev, ++ u8* pmsg) ++{ ++ cmpk_tx_status_t rx_tx_sts; /* */ ++ ++ memcpy((void*)&rx_tx_sts, (void*)pmsg, sizeof(cmpk_tx_status_t)); ++ /* 2. Use tx feedback info to count TX statistics. */ ++ cmpk_count_tx_status(dev, &rx_tx_sts); ++ ++} /* cmpk_Handle_Tx_Status */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_handle_tx_rate_history() ++ * ++ * Overview: Firmware add a new tx rate history ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/12/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++static void ++cmpk_handle_tx_rate_history( ++ struct net_device *dev, ++ u8* pmsg) ++{ ++ cmpk_tx_rahis_t *ptxrate; ++// RT_RF_POWER_STATE rtState; ++ u8 i, j; ++ u16 length = sizeof(cmpk_tx_rahis_t); ++ u32 *ptemp; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ ++#ifdef ENABLE_PS ++ pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState)); ++ ++ // When RF is off, we should not count the packet for hw/sw synchronize ++ // reason, ie. there may be a duration while sw switch is changed and hw ++ // switch is being changed. 2006.12.04, by shien chang. ++ if (rtState == eRfOff) ++ { ++ return; ++ } ++#endif ++ ++ ptemp = (u32 *)pmsg; ++ ++ // ++ // Do endian transfer to word alignment(16 bits) for windows system. ++ // You must do different endian transfer for linux and MAC OS ++ // ++ for (i = 0; i < (length/4); i++) ++ { ++ u16 temp1, temp2; ++ ++ temp1 = ptemp[i]&0x0000FFFF; ++ temp2 = ptemp[i]>>16; ++ ptemp[i] = (temp1<<16)|temp2; ++ } ++ ++ ptxrate = (cmpk_tx_rahis_t *)pmsg; ++ ++ if (ptxrate == NULL ) ++ { ++ return; ++ } ++ ++ for (i = 0; i < 16; i++) ++ { ++ // Collect CCK rate packet num ++ if (i < 4) ++ priv->stats.txrate.cck[i] += ptxrate->cck[i]; ++ ++ // Collect OFDM rate packet num ++ if (i< 8) ++ priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i]; ++ ++ for (j = 0; j < 4; j++) ++ priv->stats.txrate.ht_mcs[j][i] += ptxrate->ht_mcs[j][i]; ++ } ++ ++} /* cmpk_Handle_Tx_Rate_History */ ++ ++ ++/*----------------------------------------------------------------------------- ++ * Function: cmpk_message_handle_rx() ++ * ++ * Overview: In the function, we will capture different RX command packet ++ * info. Every RX command packet element has different message ++ * length and meaning in content. We only support three type of RX ++ * command packet now. Please refer to document ++ * ws-06-0063-rtl8190-command-packet-specification. ++ * ++ * Input: NONE ++ * ++ * Output: NONE ++ * ++ * Return: NONE ++ * ++ * Revised History: ++ * When Who Remark ++ * 05/06/2008 amy Create Version 0 porting from windows code. ++ * ++ *---------------------------------------------------------------------------*/ ++u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *pstats) ++{ ++// u32 debug_level = DBG_LOUD; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ int total_length; ++ u8 cmd_length, exe_cnt = 0; ++ u8 element_id; ++ u8 *pcmd_buff; ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx()\n"); ++ ++ /* 0. Check inpt arguments. If is is a command queue message or pointer is ++ null. */ ++ if (/*(prfd->queue_id != CMPK_RX_QUEUE_ID) || */(pstats== NULL)) ++ { ++ /* Print error message. */ ++ /*RT_TRACE(COMP_SEND, DebugLevel, ++ ("\n\r[CMPK]-->Err queue id or pointer"));*/ ++ return 0; /* This is not a command packet. */ ++ } ++ ++ /* 1. Read received command packet message length from RFD. */ ++ total_length = pstats->Length; ++ ++ /* 2. Read virtual address from RFD. */ ++ pcmd_buff = pstats->virtual_address; ++ ++ /* 3. Read command pakcet element id and length. */ ++ element_id = pcmd_buff[0]; ++ /*RT_TRACE(COMP_SEND, DebugLevel, ++ ("\n\r[CMPK]-->element ID=%d Len=%d", element_id, total_length));*/ ++ ++ /* 4. Check every received command packet conent according to different ++ element type. Because FW may aggregate RX command packet to minimize ++ transmit time between DRV and FW.*/ ++ // Add a counter to prevent to locked in the loop too long ++ while (total_length > 0 || exe_cnt++ >100) ++ { ++ /* 2007/01/17 MH We support aggregation of different cmd in the same packet. */ ++ element_id = pcmd_buff[0]; ++ ++ switch(element_id) ++ { ++ case RX_TX_FEEDBACK: ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_FEEDBACK\n"); ++ cmpk_handle_tx_feedback (dev, pcmd_buff); ++ cmd_length = CMPK_RX_TX_FB_SIZE; ++ break; ++ ++ case RX_INTERRUPT_STATUS: ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_INTERRUPT_STATUS\n"); ++ cmpk_handle_interrupt_status(dev, pcmd_buff); ++ cmd_length = sizeof(cmpk_intr_sta_t); ++ break; ++ ++ case BOTH_QUERY_CONFIG: ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():BOTH_QUERY_CONFIG\n"); ++ cmpk_handle_query_config_rx(dev, pcmd_buff); ++ cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE; ++ break; ++ ++ case RX_TX_STATUS: ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_STATUS\n"); ++ cmpk_handle_tx_status(dev, pcmd_buff); ++ cmd_length = CMPK_RX_TX_STS_SIZE; ++ break; ++ ++ case RX_TX_PER_PKT_FEEDBACK: ++ // You must at lease add a switch case element here, ++ // Otherwise, we will jump to default case. ++ //DbgPrint("CCX Test\r\n"); ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_PER_PKT_FEEDBACK\n"); ++ cmd_length = CMPK_RX_TX_FB_SIZE; ++ break; ++ ++ case RX_TX_RATE_HISTORY: ++ //DbgPrint(" rx tx rate history\r\n"); ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_HISTORY\n"); ++ cmpk_handle_tx_rate_history(dev, pcmd_buff); ++ cmd_length = CMPK_TX_RAHIS_SIZE; ++ break; ++ ++ default: ++ ++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():unknow CMD Element\n"); ++ return 1; /* This is a command packet. */ ++ } ++ // 2007/01/22 MH Display received rx command packet info. ++ //cmpk_Display_Message(cmd_length, pcmd_buff); ++ ++ // 2007/01/22 MH Add to display tx statistic. ++ //cmpk_DisplayTxStatistic(pAdapter); ++ ++ /* 2007/03/09 MH Collect sidderent cmd element pkt num. */ ++ priv->stats.rxcmdpkt[element_id]++; ++ ++ total_length -= cmd_length; ++ pcmd_buff += cmd_length; ++ } /* while (total_length > 0) */ ++ return 1; /* This is a command packet. */ ++ ++ RT_TRACE(COMP_EVENTS, "<----cmpk_message_handle_rx()\n"); ++} /* CMPK_Message_Handle_Rx */ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.h +@@ -0,0 +1,207 @@ ++#ifndef R819XUSB_CMDPKT_H ++#define R819XUSB_CMDPKT_H ++/* Different command packet have dedicated message length and definition. */ ++#define CMPK_RX_TX_FB_SIZE sizeof(cmpk_txfb_t) //20 ++#define CMPK_TX_SET_CONFIG_SIZE sizeof(cmpk_set_cfg_t) //16 ++#define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(cmpk_set_cfg_t) //16 ++#define CMPK_RX_TX_STS_SIZE sizeof(cmpk_tx_status_t)// ++#define CMPK_RX_DBG_MSG_SIZE sizeof(cmpk_rx_dbginfo_t)// ++#define CMPK_TX_RAHIS_SIZE sizeof(cmpk_tx_rahis_t) ++ ++/* 2008/05/08 amy For USB constant. */ ++#define ISR_TxBcnOk BIT27 // Transmit Beacon OK ++#define ISR_TxBcnErr BIT26 // Transmit Beacon Error ++#define ISR_BcnTimerIntr BIT13 // Beacon Timer Interrupt ++ ++#if 0 ++/* Define packet type. */ ++typedef enum tag_packet_type ++{ ++ PACKET_BROADCAST, ++ PACKET_MULTICAST, ++ PACKET_UNICAST, ++ PACKET_TYPE_MAX ++}cmpk_pkt_type_e; ++#endif ++ ++/* Define element ID of command packet. */ ++ ++/*------------------------------Define structure----------------------------*/ ++/* Define different command packet structure. */ ++/* 1. RX side: TX feedback packet. */ ++typedef struct tag_cmd_pkt_tx_feedback ++{ ++ // DWORD 0 ++ u8 element_id; /* Command packet type. */ ++ u8 length; /* Command packet length. */ ++ /* 2007/07/05 MH Change tx feedback info field. */ ++ /*------TX Feedback Info Field */ ++ u8 TID:4; /* */ ++ u8 fail_reason:3; /* */ ++ u8 tok:1; /* Transmit ok. */ ++ u8 reserve1:4; /* */ ++ u8 pkt_type:2; /* */ ++ u8 bandwidth:1; /* */ ++ u8 qos_pkt:1; /* */ ++ ++ // DWORD 1 ++ u8 reserve2; /* */ ++ /*------TX Feedback Info Field */ ++ u8 retry_cnt; /* */ ++ u16 pkt_id; /* */ ++ ++ // DWORD 3 ++ u16 seq_num; /* */ ++ u8 s_rate; /* Start rate. */ ++ u8 f_rate; /* Final rate. */ ++ ++ // DWORD 4 ++ u8 s_rts_rate; /* */ ++ u8 f_rts_rate; /* */ ++ u16 pkt_length; /* */ ++ ++ // DWORD 5 ++ u16 reserve3; /* */ ++ u16 duration; /* */ ++}cmpk_txfb_t; ++ ++/* 2. RX side: Interrupt status packet. It includes Beacon State, ++ Beacon Timer Interrupt and other useful informations in MAC ISR Reg. */ ++typedef struct tag_cmd_pkt_interrupt_status ++{ ++ u8 element_id; /* Command packet type. */ ++ u8 length; /* Command packet length. */ ++ u16 reserve; ++ u32 interrupt_status; /* Interrupt Status. */ ++}cmpk_intr_sta_t; ++ ++ ++/* 3. TX side: Set configuration packet. */ ++typedef struct tag_cmd_pkt_set_configuration ++{ ++ u8 element_id; /* Command packet type. */ ++ u8 length; /* Command packet length. */ ++ u16 reserve1; /* */ ++ u8 cfg_reserve1:3; ++ u8 cfg_size:2; /* Configuration info. */ ++ u8 cfg_type:2; /* Configuration info. */ ++ u8 cfg_action:1; /* Configuration info. */ ++ u8 cfg_reserve2; /* Configuration info. */ ++ u8 cfg_page:4; /* Configuration info. */ ++ u8 cfg_reserve3:4; /* Configuration info. */ ++ u8 cfg_offset; /* Configuration info. */ ++ u32 value; /* */ ++ u32 mask; /* */ ++}cmpk_set_cfg_t; ++ ++/* 4. Both side : TX/RX query configuraton packet. The query structure is the ++ same as set configuration. */ ++#define cmpk_query_cfg_t cmpk_set_cfg_t ++ ++/* 5. Multi packet feedback status. */ ++typedef struct tag_tx_stats_feedback // PJ quick rxcmd 09042007 ++{ ++ // For endian transfer --> Driver will not the same as firmware structure. ++ // DW 0 ++ u16 reserve1; ++ u8 length; // Command packet length ++ u8 element_id; // Command packet type ++ ++ // DW 1 ++ u16 txfail; // Tx Fail count ++ u16 txok; // Tx ok count ++ ++ // DW 2 ++ u16 txmcok; // tx multicast ++ u16 txretry; // Tx Retry count ++ ++ // DW 3 ++ u16 txucok; // tx unicast ++ u16 txbcok; // tx broadcast ++ ++ // DW 4 ++ u16 txbcfail; // ++ u16 txmcfail; // ++ ++ // DW 5 ++ u16 reserve2; // ++ u16 txucfail; // ++ ++ // DW 6-8 ++ u32 txmclength; ++ u32 txbclength; ++ u32 txuclength; ++ ++ // DW 9 ++ u16 reserve3_23; ++ u8 reserve3_1; ++ u8 rate; ++}__attribute__((packed)) cmpk_tx_status_t; ++ ++/* 6. Debug feedback message. */ ++/* 2007/10/23 MH Define RX debug message */ ++typedef struct tag_rx_debug_message_feedback ++{ ++ // For endian transfer --> for driver ++ // DW 0 ++ u16 reserve1; ++ u8 length; // Command packet length ++ u8 element_id; // Command packet type ++ ++ // DW 1-?? ++ // Variable debug message. ++ ++}cmpk_rx_dbginfo_t; ++ ++/* 2008/03/20 MH Define transmit rate history. For big endian format. */ ++typedef struct tag_tx_rate_history ++{ ++ // For endian transfer --> for driver ++ // DW 0 ++ u8 element_id; // Command packet type ++ u8 length; // Command packet length ++ u16 reserved1; ++ ++ // DW 1-2 CCK rate counter ++ u16 cck[4]; ++ ++ // DW 3-6 ++ u16 ofdm[8]; ++ ++ // DW 7-14 ++ //UINT16 MCS_BW0_SG0[16]; ++ ++ // DW 15-22 ++ //UINT16 MCS_BW1_SG0[16]; ++ ++ // DW 23-30 ++ //UINT16 MCS_BW0_SG1[16]; ++ ++ // DW 31-38 ++ //UINT16 MCS_BW1_SG1[16]; ++ ++ // DW 7-14 BW=0 SG=0 ++ // DW 15-22 BW=1 SG=0 ++ // DW 23-30 BW=0 SG=1 ++ // DW 31-38 BW=1 SG=1 ++ u16 ht_mcs[4][16]; ++ ++}__attribute__((packed)) cmpk_tx_rahis_t; ++ ++typedef enum tag_command_packet_directories ++{ ++ RX_TX_FEEDBACK = 0, ++ RX_INTERRUPT_STATUS = 1, ++ TX_SET_CONFIG = 2, ++ BOTH_QUERY_CONFIG = 3, ++ RX_TX_STATUS = 4, ++ RX_DBGINFO_FEEDBACK = 5, ++ RX_TX_PER_PKT_FEEDBACK = 6, ++ RX_TX_RATE_HISTORY = 7, ++ RX_CMD_ELE_MAX ++}cmpk_element_e; ++ ++extern u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats * pstats); ++ ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_firmware.c +@@ -0,0 +1,620 @@ ++/************************************************************************************************** ++ * Procedure: Init boot code/firmware code/data session ++ * ++ * Description: This routine will intialize firmware. If any error occurs during the initialization ++ * process, the routine shall terminate immediately and return fail. ++ * NIC driver should call NdisOpenFile only from MiniportInitialize. ++ * ++ * Arguments: The pointer of the adapter ++ ++ * Returns: ++ * NDIS_STATUS_FAILURE - the following initialization process should be terminated ++ * NDIS_STATUS_SUCCESS - if firmware initialization process success ++**************************************************************************************************/ ++//#include "ieee80211.h" ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#ifdef RTL8190P ++#include "r819xP_firmware_img.h" ++#else ++#include "r819xE_firmware_img.h" ++#endif ++#include "r819xE_firmware.h" ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++#include ++#endif ++ ++void firmware_init_param(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ rt_firmware *pfirmware = priv->pFirmware; ++ ++ pfirmware->cmdpacket_frag_thresold = GET_COMMAND_PACKET_FRAG_THRESHOLD(MAX_TRANSMIT_BUFFER_SIZE); ++} ++ ++/* ++ * segment the img and use the ptr and length to remember info on each segment ++ * ++ */ ++static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buffer_len) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool rt_status = true; ++ u16 frag_threshold; ++ u16 frag_length, frag_offset = 0; ++ //u16 total_size; ++ int i; ++ ++ rt_firmware *pfirmware = priv->pFirmware; ++ struct sk_buff *skb; ++ unsigned char *seg_ptr; ++ cb_desc *tcb_desc; ++ u8 bLastIniPkt; ++ ++ firmware_init_param(dev); ++ //Fragmentation might be required ++ frag_threshold = pfirmware->cmdpacket_frag_thresold; ++ do { ++ if((buffer_len - frag_offset) > frag_threshold) { ++ frag_length = frag_threshold ; ++ bLastIniPkt = 0; ++ ++ } else { ++ frag_length = buffer_len - frag_offset; ++ bLastIniPkt = 1; ++ ++ } ++ ++ /* Allocate skb buffer to contain firmware info and tx descriptor info ++ * add 4 to avoid packet appending overflow. ++ * */ ++ //skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4); ++ skb = dev_alloc_skb(frag_length + 4); ++ memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); ++ tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE); ++ tcb_desc->queue_index = TXCMD_QUEUE; ++ tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT; ++ tcb_desc->bLastIniPkt = bLastIniPkt; ++ ++ //skb_reserve(skb, USB_HWDESC_HEADER_LEN); ++ seg_ptr = skb->data; ++ /* ++ * Transform from little endian to big endian ++ * and pending zero ++ */ ++ for(i=0 ; i < frag_length; i+=4) { ++ *seg_ptr++ = ((i+0)txbuf_size= (u16)i; ++ skb_put(skb, i); ++ priv->ieee80211->softmac_hard_start_xmit(skb,dev); ++ ++ code_virtual_address += frag_length; ++ frag_offset += frag_length; ++ ++ }while(frag_offset < buffer_len); ++ ++ return rt_status; ++ ++#if 0 ++cmdsend_downloadcode_fail: ++ rt_status = false; ++ RT_TRACE(COMP_ERR, "CmdSendDownloadCode fail !!\n"); ++ return rt_status; ++#endif ++} ++ ++//----------------------------------------------------------------------------- ++// Procedure: Check whether main code is download OK. If OK, turn on CPU ++// ++// Description: CPU register locates in different page against general register. ++// Switch to CPU register in the begin and switch back before return ++// ++// ++// Arguments: The pointer of the adapter ++// ++// Returns: ++// NDIS_STATUS_FAILURE - the following initialization process should be terminated ++// NDIS_STATUS_SUCCESS - if firmware initialization process success ++//----------------------------------------------------------------------------- ++static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev) ++{ ++ bool rt_status = true; ++ int check_putcodeOK_time = 200000, check_bootOk_time = 200000; ++ u32 CPU_status = 0; ++ ++ /* Check whether put code OK */ ++ do { ++ CPU_status = read_nic_dword(dev, CPU_GEN); ++ ++ if(CPU_status&CPU_GEN_PUT_CODE_OK) ++ break; ++ ++ }while(check_putcodeOK_time--); ++ ++ if(!(CPU_status&CPU_GEN_PUT_CODE_OK)) { ++ RT_TRACE(COMP_ERR, "Download Firmware: Put code fail!\n"); ++ goto CPUCheckMainCodeOKAndTurnOnCPU_Fail; ++ } else { ++ RT_TRACE(COMP_FIRMWARE, "Download Firmware: Put code ok!\n"); ++ } ++ ++ /* Turn On CPU */ ++ CPU_status = read_nic_dword(dev, CPU_GEN); ++ write_nic_byte(dev, CPU_GEN, (u8)((CPU_status|CPU_GEN_PWR_STB_CPU)&0xff)); ++ mdelay(1); ++ ++ /* Check whether CPU boot OK */ ++ do { ++ CPU_status = read_nic_dword(dev, CPU_GEN); ++ ++ if(CPU_status&CPU_GEN_BOOT_RDY) ++ break; ++ }while(check_bootOk_time--); ++ ++ if(!(CPU_status&CPU_GEN_BOOT_RDY)) { ++ goto CPUCheckMainCodeOKAndTurnOnCPU_Fail; ++ } else { ++ RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n"); ++ } ++ ++ return rt_status; ++ ++CPUCheckMainCodeOKAndTurnOnCPU_Fail: ++ RT_TRACE(COMP_ERR, "ERR in %s()\n", __FUNCTION__); ++ rt_status = FALSE; ++ return rt_status; ++} ++ ++static bool CPUcheck_firmware_ready(struct net_device *dev) ++{ ++ ++ bool rt_status = true; ++ int check_time = 200000; ++ u32 CPU_status = 0; ++ ++ /* Check Firmware Ready */ ++ do { ++ CPU_status = read_nic_dword(dev, CPU_GEN); ++ ++ if(CPU_status&CPU_GEN_FIRM_RDY) ++ break; ++ ++ }while(check_time--); ++ ++ if(!(CPU_status&CPU_GEN_FIRM_RDY)) ++ goto CPUCheckFirmwareReady_Fail; ++ else ++ RT_TRACE(COMP_FIRMWARE, "Download Firmware: Firmware ready!\n"); ++ ++ return rt_status; ++ ++CPUCheckFirmwareReady_Fail: ++ RT_TRACE(COMP_ERR, "ERR in %s()\n", __FUNCTION__); ++ rt_status = false; ++ return rt_status; ++ ++} ++ ++bool init_firmware(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ bool rt_status = TRUE; ++ ++#ifdef RTL8190P ++ u8 *firmware_img_buf[3] = { &rtl8190_fwboot_array[0], ++ &rtl8190_fwmain_array[0], ++ &rtl8190_fwdata_array[0]}; ++ ++ u32 firmware_img_len[3] = { sizeof(rtl8190_fwboot_array), ++ sizeof(rtl8190_fwmain_array), ++ sizeof(rtl8190_fwdata_array)}; ++#else ++ u8 *firmware_img_buf[3] = { &rtl8192e_fwboot_array[0], ++ &rtl8192e_fwmain_array[0], ++ &rtl8192e_fwdata_array[0]}; ++ ++ u32 firmware_img_len[3] = { sizeof(rtl8192e_fwboot_array), ++ sizeof(rtl8192e_fwmain_array), ++ sizeof(rtl8192e_fwdata_array)}; ++#endif ++ u32 file_length = 0; ++ u8 *mapped_file = NULL; ++ u32 init_step = 0; ++ opt_rst_type_e rst_opt = OPT_SYSTEM_RESET; ++ firmware_init_step_e starting_state = FW_INIT_STEP0_BOOT; ++ ++ rt_firmware *pfirmware = priv->pFirmware; ++ const struct firmware *fw_entry; ++#ifdef RTL8190P ++ const char *fw_name[3] = { "RTL8190P/boot.img", ++ "RTL8190P/main.img", ++ "RTL8190P/data.img"}; ++#endif ++#ifdef RTL8192E ++ const char *fw_name[3] = { "RTL8192E/boot.img", ++ "RTL8192E/main.img", ++ "RTL8192E/data.img"}; ++#endif ++ int rc; ++ ++ RT_TRACE(COMP_FIRMWARE, " PlatformInitFirmware()==>\n"); ++ ++ if (pfirmware->firmware_status == FW_STATUS_0_INIT ) { ++ /* it is called by reset */ ++ rst_opt = OPT_SYSTEM_RESET; ++ starting_state = FW_INIT_STEP0_BOOT; ++ // TODO: system reset ++ ++ }else if(pfirmware->firmware_status == FW_STATUS_5_READY) { ++ /* it is called by Initialize */ ++ rst_opt = OPT_FIRMWARE_RESET; ++ starting_state = FW_INIT_STEP2_DATA; ++ }else { ++ RT_TRACE(COMP_FIRMWARE, "PlatformInitFirmware: undefined firmware state\n"); ++ } ++ ++ /* ++ * Download boot, main, and data image for System reset. ++ * Download data image for firmware reseta ++ */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) ++ priv->firmware_source = FW_SOURCE_HEADER_FILE; ++#else ++ priv->firmware_source = FW_SOURCE_IMG_FILE; ++#endif ++ for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) { ++ /* ++ * Open Image file, and map file to contineous memory if open file success. ++ * or read image file from array. Default load from IMG file ++ */ ++ if(rst_opt == OPT_SYSTEM_RESET) { ++ switch(priv->firmware_source) { ++ case FW_SOURCE_IMG_FILE: ++ { ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ if(pfirmware->firmware_buf_size[init_step] == 0) { ++ rc = request_firmware(&fw_entry, fw_name[init_step],&priv->pdev->dev); ++ if(rc < 0 ) { ++ RT_TRACE(COMP_FIRMWARE, "request firmware fail!\n"); ++ goto download_firmware_fail; ++ } ++ ++ if(fw_entry->size > sizeof(pfirmware->firmware_buf[init_step])) { ++ RT_TRACE(COMP_FIRMWARE, "img file size exceed the container buffer fail!\n"); ++ goto download_firmware_fail; ++ } ++ ++ if(init_step != FW_INIT_STEP1_MAIN) { ++ memcpy(pfirmware->firmware_buf[init_step],fw_entry->data,fw_entry->size); ++ pfirmware->firmware_buf_size[init_step] = fw_entry->size; ++ ++ } else { ++#ifdef RTL8190P ++ memcpy(pfirmware->firmware_buf[init_step],fw_entry->data,fw_entry->size); ++ pfirmware->firmware_buf_size[init_step] = fw_entry->size; ++ ++#else ++ memset(pfirmware->firmware_buf[init_step],0,128); ++ memcpy(&pfirmware->firmware_buf[init_step][128],fw_entry->data,fw_entry->size); ++ //mapped_file = pfirmware->firmware_buf[init_step]; ++ pfirmware->firmware_buf_size[init_step] = fw_entry->size+128; ++ //file_length = fw_entry->size + 128; ++#endif ++ } ++ //pfirmware->firmware_buf_size = file_length; ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) ++ if(rst_opt == OPT_SYSTEM_RESET) { ++ release_firmware(fw_entry); ++ } ++#endif ++ } ++ mapped_file = pfirmware->firmware_buf[init_step]; ++ file_length = pfirmware->firmware_buf_size[init_step]; ++#endif ++ break; ++ } ++ case FW_SOURCE_HEADER_FILE: ++ mapped_file = firmware_img_buf[init_step]; ++ file_length = firmware_img_len[init_step]; ++ if(init_step == FW_INIT_STEP2_DATA) { ++ memcpy(pfirmware->firmware_buf[init_step], mapped_file, file_length); ++ pfirmware->firmware_buf_size[init_step] = file_length; ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ ++ }else if(rst_opt == OPT_FIRMWARE_RESET ) { ++ /* we only need to download data.img here */ ++ mapped_file = pfirmware->firmware_buf[init_step]; ++ file_length = pfirmware->firmware_buf_size[init_step]; ++ } ++ ++ /* Download image file */ ++ /* The firmware download process is just as following, ++ * 1. that is each packet will be segmented and inserted to the wait queue. ++ * 2. each packet segment will be put in the skb_buff packet. ++ * 3. each skb_buff packet data content will already include the firmware info ++ * and Tx descriptor info ++ * */ ++ rt_status = fw_download_code(dev,mapped_file,file_length); ++ if(rt_status != TRUE) { ++ goto download_firmware_fail; ++ } ++ ++ switch(init_step) { ++ case FW_INIT_STEP0_BOOT: ++ /* Download boot ++ * initialize command descriptor. ++ * will set polling bit when firmware code is also configured ++ */ ++ pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE; ++ //mdelay(1000); ++ /* ++ * To initialize IMEM, CPU move code from 0x80000080, ++ * hence, we send 0x80 byte packet ++ */ ++ break; ++ ++ case FW_INIT_STEP1_MAIN: ++ /* Download firmware code. Wait until Boot Ready and Turn on CPU */ ++ pfirmware->firmware_status = FW_STATUS_2_MOVE_MAIN_CODE; ++ ++ /* Check Put Code OK and Turn On CPU */ ++ rt_status = CPUcheck_maincodeok_turnonCPU(dev); ++ if(rt_status != TRUE) { ++ RT_TRACE(COMP_FIRMWARE, "CPUcheck_maincodeok_turnonCPU fail!\n"); ++ goto download_firmware_fail; ++ } ++ ++ pfirmware->firmware_status = FW_STATUS_3_TURNON_CPU; ++ break; ++ ++ case FW_INIT_STEP2_DATA: ++ /* download initial data code */ ++ pfirmware->firmware_status = FW_STATUS_4_MOVE_DATA_CODE; ++ mdelay(1); ++ ++ rt_status = CPUcheck_firmware_ready(dev); ++ if(rt_status != TRUE) { ++ RT_TRACE(COMP_FIRMWARE, "CPUcheck_firmware_ready fail(%d)!\n",rt_status); ++ goto download_firmware_fail; ++ } ++ ++ /* wait until data code is initialized ready.*/ ++ pfirmware->firmware_status = FW_STATUS_5_READY; ++ break; ++ } ++ } ++ ++ RT_TRACE(COMP_FIRMWARE, "Firmware Download Success\n"); ++ //assert(pfirmware->firmware_status == FW_STATUS_5_READY, ("Firmware Download Fail\n")); ++ ++ return rt_status; ++ ++download_firmware_fail: ++ RT_TRACE(COMP_ERR, "ERR in %s()\n", __FUNCTION__); ++ rt_status = FALSE; ++ return rt_status; ++ ++} ++ ++#if 0 ++/* ++ * Procedure: (1) Transform firmware code from little endian to big endian if required. ++ * (2) Number of bytes in Firmware downloading should be multiple ++ * of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required ++ * ++ */ ++void CmdAppendZeroAndEndianTransform( ++ u1Byte *pDst, ++ u1Byte *pSrc, ++ u2Byte *pLength) ++{ ++ ++ u2Byte ulAppendBytes = 0, i; ++ u2Byte ulLength = *pLength; ++ ++//test only ++ //memset(pDst, 0xcc, 12); ++ ++ ++ /* Transform from little endian to big endian */ ++//#if DEV_BUS_TYPE==PCI_INTERFACE ++#if 0 ++ for( i=0 ; i<(*pLength) ; i+=4) ++ { ++ if((i+3) < (*pLength)) pDst[i+0] = pSrc[i+3]; ++ if((i+2) < (*pLength)) pDst[i+1] = pSrc[i+2]; ++ if((i+1) < (*pLength)) pDst[i+2] = pSrc[i+1]; ++ if((i+0) < (*pLength)) pDst[i+3] = pSrc[i+0]; ++ } ++#else ++ pDst += USB_HWDESC_HEADER_LEN; ++ ulLength -= USB_HWDESC_HEADER_LEN; ++ ++ for( i=0 ; i0) ++ { ++ ulAppendBytes = 4-((*pLength) % 4); ++ ++ for(i=0 ; iFragLength[0] = (u2Byte)pTcb->BufferList[0].Length; ++ ++ QueueID=pTcb->SpecifiedQueueID; ++#if DEV_BUS_TYPE!=USB_INTERFACE ++ firstDesc=curDesc=Adapter->NextTxDescToFill[QueueID]; ++#endif ++ ++#if DEV_BUS_TYPE!=USB_INTERFACE ++ if(VacancyTxDescNum(Adapter, QueueID) > pTcb->BufferCount) ++#else ++ if(PlatformIsTxQueueAvailable(Adapter, QueueID, pTcb->BufferCount) && ++ RTIsListEmpty(&Adapter->TcbWaitQueue[QueueID])) ++#endif ++ { ++ pTcb->nDescUsed=0; ++ ++ for(i=0 ; iBufferCount ; i++) ++ { ++ Adapter->HalFunc.TxFillCmdDescHandler( ++ Adapter, ++ pTcb, ++ QueueID, //QueueIndex ++ curDesc, //index ++ FragBufferIndex==0, //bFirstSeg ++ FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1), //bLastSeg ++ pTcb->BufferList[i].VirtualAddress, //VirtualAddress ++ pTcb->BufferList[i].PhysicalAddressLow, //PhyAddressLow ++ pTcb->BufferList[i].Length, //BufferLen ++ i!=0, //bSetOwnBit ++ (i==(pTcb->BufferCount-1)) && bLastInitPacket, //bLastInitPacket ++ PacketType, //DescPacketType ++ pTcb->FragLength[FragIndex] //PktLen ++ ); ++ ++ if(FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1)) ++ { // Last segment of the fragment. ++ pTcb->nFragSent++; ++ } ++ ++ FragBufferIndex++; ++ if(FragBufferIndex==pTcb->FragBufCount[FragIndex]) ++ { ++ FragIndex++; ++ FragBufferIndex=0; ++ } ++ ++#if DEV_BUS_TYPE!=USB_INTERFACE ++ curDesc=(curDesc+1)%Adapter->NumTxDesc[QueueID]; ++#endif ++ pTcb->nDescUsed++; ++ } ++ ++#if DEV_BUS_TYPE!=USB_INTERFACE ++ RTInsertTailList(&Adapter->TcbBusyQueue[QueueID], &pTcb->List); ++ IncrementTxDescToFill(Adapter, QueueID, pTcb->nDescUsed); ++ Adapter->HalFunc.SetTxDescOWNHandler(Adapter, QueueID, firstDesc); ++ // TODO: should call poll use QueueID ++ Adapter->HalFunc.TxPollingHandler(Adapter, TXCMD_QUEUE); ++#endif ++ } ++ else ++#if DEV_BUS_TYPE!=USB_INTERFACE ++ goto CmdSendPacket_Fail; ++#else ++ { ++ pTcb->bLastInitPacket = bLastInitPacket; ++ RTInsertTailList(&Adapter->TcbWaitQueue[pTcb->SpecifiedQueueID], &pTcb->List); ++ } ++#endif ++ ++ return rtStatus; ++ ++#if DEV_BUS_TYPE!=USB_INTERFACE ++CmdSendPacket_Fail: ++ rtStatus = RT_STATUS_FAILURE; ++ return rtStatus; ++#endif ++ ++} ++#endif ++ ++ ++ ++ ++#if 0 ++RT_STATUS ++FWSendNullPacket( ++ IN PADAPTER Adapter, ++ IN u4Byte Length ++) ++{ ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ ++ ++ PRT_TCB pTcb; ++ PRT_TX_LOCAL_BUFFER pBuf; ++ BOOLEAN bLastInitPacket = FALSE; ++ ++ PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK); ++ ++#if DEV_BUS_TYPE==USB_INTERFACE ++ Length += USB_HWDESC_HEADER_LEN; ++#endif ++ ++ //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ) ++ if(MgntGetBuffer(Adapter, &pTcb, &pBuf)) ++ { ++ PlatformZeroMemory(pBuf->Buffer.VirtualAddress, Length); ++ rtStatus = CmdSendPacket(Adapter, pTcb, pBuf, Length, DESC_PACKET_TYPE_INIT, bLastInitPacket); //0 : always set LastInitPacket to zero ++//#if HAL_CODE_BASE != RTL8190HW ++// // TODO: for test only ++// ReturnTCB(Adapter, pTcb, RT_STATUS_SUCCESS); ++//#endif ++ if(rtStatus == RT_STATUS_FAILURE) ++ goto CmdSendNullPacket_Fail; ++ }else ++ goto CmdSendNullPacket_Fail; ++ ++ PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK); ++ return rtStatus; ++ ++ ++CmdSendNullPacket_Fail: ++ PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK); ++ rtStatus = RT_STATUS_FAILURE; ++ RT_ASSERT(rtStatus == RT_STATUS_SUCCESS, ("CmdSendDownloadCode fail !!\n")); ++ return rtStatus; ++} ++#endif ++ ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_firmware.h +@@ -0,0 +1,68 @@ ++#ifndef __INC_FIRMWARE_H ++#define __INC_FIRMWARE_H ++ ++#define RTL8190_CPU_START_OFFSET 0x80 ++/* TODO: this definition is TBD */ ++//#define USB_HWDESC_HEADER_LEN 0 ++ ++/* It should be double word alignment */ ++//#if DEV_BUS_TYPE==PCI_INTERFACE ++//#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) 4*(v/4) - 8 ++//#else ++#define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8 ) ++//#endif ++ ++typedef enum _firmware_init_step{ ++ FW_INIT_STEP0_BOOT = 0, ++ FW_INIT_STEP1_MAIN = 1, ++ FW_INIT_STEP2_DATA = 2, ++}firmware_init_step_e; ++ ++typedef enum _opt_rst_type{ ++ OPT_SYSTEM_RESET = 0, ++ OPT_FIRMWARE_RESET = 1, ++}opt_rst_type_e; ++ ++#if 0 ++/* CPU related */ ++RT_STATUS ++CPUCheckMainCodeOKAndTurnOnCPU( ++ IN PADAPTER Adapter ++ ); ++ ++RT_STATUS ++CPUCheckFirmwareReady( ++ IN PADAPTER Adapter ++ ); ++ ++/* Firmware related */ ++VOID ++FWInitializeParameters( ++ IN PADAPTER Adapter ++ ); ++ ++RT_STATUS ++FWSendDownloadCode( ++ IN PADAPTER Adapter, ++ IN pu1Byte CodeVirtualAddrress, ++ IN u4Byte BufferLen ++ ); ++ ++RT_STATUS ++FWSendNullPacket( ++ IN PADAPTER Adapter, ++ IN u4Byte Length ++ ); ++ ++RT_STATUS ++CmdSendPacket( ++ PADAPTER Adapter, ++ PRT_TCB pTcb, ++ PRT_TX_LOCAL_BUFFER pBuf, ++ u4Byte BufferLen, ++ u4Byte PacketType, ++ BOOLEAN bLastInitPacket ++ ); ++#endif ++#endif ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_firmware_img.h +@@ -0,0 +1,2778 @@ ++#ifndef __INC_R819XE_FIRMWARE_IMG_H ++#define __INC_R819XE_FIRMWARE_IMG_H ++ ++/*Created on 2008/ 8/28, 11:46*/ ++#include ++ ++static u8 rtl8192e_fwboot_array[] = { ++0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x3c,0x08,0xbf,0xc0,0x25,0x08,0x00,0x08, ++0x3c,0x09,0xb0,0x03,0xad,0x28,0x00,0x20,0x40,0x80,0x68,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0xd0,0x00,0x40,0x8a,0x60,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x01, ++0x25,0x08,0xa8,0x04,0x24,0x09,0x00,0x01,0x3c,0x01,0x7f,0xff,0x34,0x21,0xff,0xff, ++0x01,0x01,0x50,0x24,0x00,0x09,0x48,0x40,0x35,0x29,0x00,0x01,0x01,0x2a,0x10,0x2b, ++0x14,0x40,0xff,0xfc,0x00,0x00,0x00,0x00,0x3c,0x0a,0x00,0x00,0x25,0x4a,0x00,0x00, ++0x4c,0x8a,0x00,0x00,0x4c,0x89,0x08,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x01, ++0x25,0x08,0xa8,0x04,0x3c,0x01,0x80,0x00,0x01,0x21,0x48,0x25,0x3c,0x0a,0xbf,0xc0, ++0x25,0x4a,0x00,0x7c,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0xad,0x00,0x00,0x00, ++0x21,0x08,0x00,0x04,0x01,0x09,0x10,0x2b,0x14,0x40,0xff,0xf8,0x00,0x00,0x00,0x00, ++0x3c,0x08,0x80,0x01,0x25,0x08,0x7f,0xff,0x24,0x09,0x00,0x01,0x3c,0x01,0x7f,0xff, ++0x34,0x21,0xff,0xff,0x01,0x01,0x50,0x24,0x00,0x09,0x48,0x40,0x35,0x29,0x00,0x01, ++0x01,0x2a,0x10,0x2b,0x14,0x40,0xff,0xfc,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x01, ++0x25,0x4a,0x00,0x00,0x3c,0x01,0x7f,0xff,0x34,0x21,0xff,0xff,0x01,0x41,0x50,0x24, ++0x3c,0x09,0x00,0x01,0x35,0x29,0x7f,0xff,0x4c,0x8a,0x20,0x00,0x4c,0x89,0x28,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x08,0x04,0x10, ++0x00,0x00,0x00,0x00,0x40,0x88,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x08,0xbf,0xc0,0x00,0x00,0x00,0x00,0x8d,0x09,0x00,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0xbf,0xc0,0x25,0x4a,0x01,0x20,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20, ++0x3c,0x08,0xb0,0x03,0x8d,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x29,0x00,0x10, ++0xad,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x00,0x25,0x08,0x4b,0x94, ++0x01,0x00,0x00,0x08,0x00,0x00,0x00,0x00,}; ++ ++static u8 rtl8192e_fwmain_array[] = { ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x40,0x04,0x68,0x00,0x40,0x05,0x70,0x00,0x40,0x06,0x40,0x00,0x0c,0x00,0x12,0x98, ++0x00,0x00,0x00,0x00,0x40,0x1a,0x68,0x00,0x33,0x5b,0x00,0x3c,0x17,0x60,0x00,0x09, ++0x00,0x00,0x00,0x00,0x40,0x1b,0x60,0x00,0x00,0x00,0x00,0x00,0x03,0x5b,0xd0,0x24, ++0x40,0x1a,0x70,0x00,0x03,0x40,0x00,0x08,0x42,0x00,0x00,0x10,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0xff,0x34,0x42,0xff,0xff,0x8c,0x43,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x00,0xd0, ++0xac,0x62,0x00,0x00,0x00,0x00,0x20,0x21,0x27,0x85,0x8b,0x70,0x00,0x85,0x18,0x21, ++0x24,0x84,0x00,0x01,0x28,0x82,0x00,0x0a,0x14,0x40,0xff,0xfc,0xa0,0x60,0x00,0x00, ++0x27,0x82,0x8b,0x7a,0x24,0x04,0x00,0x06,0x24,0x84,0xff,0xff,0xa4,0x40,0x00,0x00, ++0x04,0x81,0xff,0xfd,0x24,0x42,0x00,0x02,0x24,0x02,0x00,0x03,0xa3,0x82,0x8b,0x70, ++0x24,0x02,0x00,0x0a,0x24,0x03,0x09,0xc4,0xa3,0x82,0x8b,0x72,0x24,0x02,0x00,0x04, ++0x24,0x04,0x00,0x01,0x24,0x05,0x00,0x02,0xa7,0x83,0x8b,0x86,0xa3,0x82,0x8b,0x78, ++0x24,0x03,0x04,0x00,0x24,0x02,0x02,0x00,0xaf,0x83,0x8b,0x8c,0xa3,0x85,0x8b,0x79, ++0xa7,0x82,0x8b,0x7a,0xa7,0x84,0x8b,0x7c,0xaf,0x84,0x8b,0x88,0xa3,0x84,0x8b,0x71, ++0xa3,0x80,0x8b,0x73,0xa3,0x80,0x8b,0x74,0xa3,0x80,0x8b,0x75,0xa3,0x84,0x8b,0x76, ++0xa3,0x85,0x8b,0x77,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x24,0x42,0x01,0x7c,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00, ++0x27,0x84,0x8b,0x98,0x00,0x00,0x10,0x21,0x24,0x42,0x00,0x01,0x00,0x02,0x16,0x00, ++0x00,0x02,0x16,0x03,0x28,0x43,0x00,0x03,0xac,0x80,0xff,0xfc,0xa0,0x80,0x00,0x00, ++0x14,0x60,0xff,0xf9,0x24,0x84,0x00,0x0c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x01,0xc0, ++0x3c,0x08,0xb0,0x03,0xac,0x62,0x00,0x00,0x35,0x08,0x00,0x70,0x8d,0x02,0x00,0x00, ++0x00,0xa0,0x48,0x21,0x00,0x04,0x26,0x00,0x00,0x02,0x2a,0x43,0x00,0x06,0x36,0x00, ++0x00,0x07,0x3e,0x00,0x00,0x02,0x12,0x03,0x29,0x23,0x00,0x03,0x00,0x04,0x56,0x03, ++0x00,0x06,0x36,0x03,0x00,0x07,0x3e,0x03,0x30,0x48,0x00,0x01,0x10,0x60,0x00,0x11, ++0x30,0xa5,0x00,0x07,0x24,0x02,0x00,0x02,0x00,0x49,0x10,0x23,0x00,0x45,0x10,0x07, ++0x30,0x42,0x00,0x01,0x10,0x40,0x00,0x66,0x00,0x00,0x00,0x00,0x8f,0xa2,0x00,0x10, ++0x00,0x00,0x00,0x00,0x00,0x02,0x21,0x43,0x11,0x00,0x00,0x10,0x00,0x07,0x20,0x0b, ++0x15,0x20,0x00,0x06,0x24,0x02,0x00,0x01,0x3c,0x02,0xb0,0x05,0x34,0x42,0x01,0x20, ++0xa4,0x44,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x11,0x22,0x00,0x04, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x05,0x08,0x00,0x00,0x94,0x34,0x42,0x01,0x24, ++0x3c,0x02,0xb0,0x05,0x08,0x00,0x00,0x94,0x34,0x42,0x01,0x22,0x15,0x20,0x00,0x54, ++0x24,0x02,0x00,0x01,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x74,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x83,0x8b,0x94,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x70, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x6b,0x00,0x08,0x11,0x60,0x00,0x18, ++0x00,0x09,0x28,0x40,0x00,0x00,0x40,0x21,0x27,0x85,0x8b,0x90,0x8c,0xa3,0x00,0x00, ++0x8c,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x62,0x38,0x23,0x00,0x43,0x10,0x2a, ++0x10,0x40,0x00,0x3d,0x00,0x00,0x00,0x00,0xac,0xa7,0x00,0x00,0x25,0x02,0x00,0x01, ++0x00,0x02,0x16,0x00,0x00,0x02,0x46,0x03,0x29,0x03,0x00,0x03,0x14,0x60,0xff,0xf3, ++0x24,0xa5,0x00,0x0c,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x70,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4b,0x10,0x23,0xa0,0x62,0x00,0x00,0x00,0x09,0x28,0x40, ++0x00,0xa9,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x8b,0x98,0x00,0x0a,0x20,0x0b, ++0x00,0x43,0x18,0x21,0x10,0xc0,0x00,0x05,0x00,0x00,0x38,0x21,0x80,0x62,0x00,0x01, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x80,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x03,0x00,0xa9,0x10,0x21,0x24,0x07,0x00,0x01, ++0x00,0xa9,0x10,0x21,0x00,0x02,0x30,0x80,0x27,0x82,0x8b,0x98,0xa0,0x67,0x00,0x01, ++0x00,0xc2,0x38,0x21,0x80,0xe3,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x07, ++0x00,0x00,0x00,0x00,0x27,0x83,0x8b,0x90,0x00,0xc3,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x21,0xac,0x62,0x00,0x00,0x27,0x85,0x8b,0x94, ++0x27,0x82,0x8b,0x90,0x00,0xc5,0x28,0x21,0x00,0xc2,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x8c,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x18,0x2a,0x14,0x60,0x00,0x03, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0xa0,0xe2,0x00,0x00,0xa0,0xe0,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0xb7,0xac,0xa0,0x00,0x00, ++0x11,0x22,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x7c, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x83,0x8b,0xac,0x08,0x00,0x00,0xa7, ++0x3c,0x02,0xb0,0x03,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x78,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x83,0x8b,0xa0,0x08,0x00,0x00,0xa7,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x04,0x10, ++0x3c,0x05,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0xa5,0x00,0x70,0x8c,0xa2,0x00,0x00, ++0x90,0x84,0x00,0x08,0x3c,0x06,0xb0,0x03,0x00,0x02,0x16,0x00,0x2c,0x83,0x00,0x03, ++0x34,0xc6,0x00,0x72,0x24,0x07,0x00,0x01,0x10,0x60,0x00,0x11,0x00,0x02,0x2f,0xc2, ++0x90,0xc2,0x00,0x00,0x00,0x00,0x18,0x21,0x00,0x02,0x16,0x00,0x10,0xa7,0x00,0x09, ++0x00,0x02,0x16,0x03,0x14,0x80,0x00,0x0c,0x30,0x43,0x00,0x03,0x83,0x82,0x8b,0x98, ++0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0x02,0x16,0x00, ++0x00,0x02,0x1e,0x03,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x72,0xa0,0x43,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0x45,0x00,0x05,0x10,0x87,0x00,0x04, ++0x30,0x43,0x00,0x06,0x93,0x82,0x8b,0xb0,0x08,0x00,0x01,0x1f,0x00,0x43,0x10,0x21, ++0x83,0x82,0x8b,0xa4,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x40,0x08,0x00,0x01,0x1f, ++0x00,0x45,0x10,0x21,0x10,0x80,0x00,0x05,0x00,0x00,0x18,0x21,0x24,0x63,0x00,0x01, ++0x00,0x64,0x10,0x2b,0x14,0x40,0xff,0xfd,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x04,0xe4, ++0x3c,0x04,0xb0,0x02,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0x08, ++0x24,0x02,0x00,0x01,0xaf,0x84,0x8b,0xc0,0xa3,0x82,0x8b,0xd0,0xa7,0x80,0x8b,0xc4, ++0xa7,0x80,0x8b,0xc6,0xaf,0x80,0x8b,0xc8,0xaf,0x80,0x8b,0xcc,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20, ++0x24,0x42,0x05,0x24,0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0xac, ++0x80,0xa2,0x00,0x15,0x8c,0x83,0x00,0x00,0x27,0xbd,0xff,0xf0,0x00,0x43,0x10,0x21, ++0xac,0x82,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x10,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x00,0x34,0x42,0x00,0x20,0x24,0x63,0x05,0x5c,0x27,0xbd,0xff,0xe0, ++0xac,0x43,0x00,0x00,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x18, ++0x8f,0x90,0x8b,0xc0,0x0c,0x00,0x02,0x98,0x00,0x80,0x88,0x21,0x14,0x40,0x00,0x2a, ++0x3c,0x02,0x00,0x80,0x16,0x20,0x00,0x02,0x34,0x42,0x02,0x01,0x24,0x02,0x02,0x01, ++0xae,0x02,0x00,0x00,0x97,0x84,0x8b,0xc4,0x97,0x82,0x8b,0xc6,0x3c,0x03,0xb0,0x02, ++0x00,0x83,0x20,0x21,0x24,0x42,0x00,0x04,0xa7,0x82,0x8b,0xc6,0xa4,0x82,0x00,0x00, ++0x8f,0x84,0x8b,0xc8,0x8f,0x82,0x8b,0xc0,0x93,0x85,0x8b,0x72,0x24,0x84,0x00,0x01, ++0x24,0x42,0x00,0x04,0x24,0x03,0x8f,0xff,0x3c,0x07,0xb0,0x06,0x3c,0x06,0xb0,0x03, ++0x00,0x43,0x10,0x24,0x00,0x85,0x28,0x2a,0x34,0xe7,0x80,0x18,0xaf,0x82,0x8b,0xc0, ++0xaf,0x84,0x8b,0xc8,0x10,0xa0,0x00,0x08,0x34,0xc6,0x01,0x08,0x8f,0x83,0x8b,0xcc, ++0x8f,0x84,0x8b,0x8c,0x8c,0xc2,0x00,0x00,0x00,0x64,0x18,0x21,0x00,0x43,0x10,0x2b, ++0x14,0x40,0x00,0x09,0x00,0x00,0x00,0x00,0x8c,0xe2,0x00,0x00,0x3c,0x03,0x0f,0x00, ++0x3c,0x04,0x04,0x00,0x00,0x43,0x10,0x24,0x10,0x44,0x00,0x03,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x04,0x96,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xd8,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x00,0x24,0x63,0x06,0x48,0xaf,0xb0,0x00,0x10,0x34,0x42,0x00,0x20, ++0x8f,0x90,0x8b,0xc0,0xac,0x43,0x00,0x00,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x20,0x00,0x80,0x88,0x21,0x00,0xa0,0x90,0x21, ++0x0c,0x00,0x02,0x98,0x00,0xc0,0x98,0x21,0x24,0x07,0x8f,0xff,0x14,0x40,0x00,0x19, ++0x26,0x03,0x00,0x04,0x24,0x02,0x0e,0x03,0xae,0x02,0x00,0x00,0x00,0x67,0x80,0x24, ++0x26,0x02,0x00,0x04,0xae,0x11,0x00,0x00,0x00,0x47,0x80,0x24,0x97,0x86,0x8b,0xc4, ++0x26,0x03,0x00,0x04,0xae,0x12,0x00,0x00,0x00,0x67,0x80,0x24,0xae,0x13,0x00,0x00, ++0x8f,0x84,0x8b,0xc0,0x3c,0x02,0xb0,0x02,0x97,0x85,0x8b,0xc6,0x00,0xc2,0x30,0x21, ++0x8f,0x82,0x8b,0xc8,0x24,0x84,0x00,0x10,0x24,0xa5,0x00,0x10,0x00,0x87,0x20,0x24, ++0x24,0x42,0x00,0x01,0xa7,0x85,0x8b,0xc6,0xaf,0x84,0x8b,0xc0,0xaf,0x82,0x8b,0xc8, ++0xa4,0xc5,0x00,0x00,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10, ++0x94,0x82,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0xe0,0x00,0x14,0x40,0x00,0x14, ++0x00,0x00,0x00,0x00,0x90,0x82,0x00,0x02,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfc, ++0x00,0x82,0x28,0x21,0x8c,0xa4,0x00,0x00,0x3c,0x02,0x00,0x70,0x8c,0xa6,0x00,0x08, ++0x00,0x82,0x10,0x21,0x2c,0x43,0x00,0x06,0x10,0x60,0x00,0x09,0x3c,0x03,0x80,0x01, ++0x00,0x02,0x10,0x80,0x24,0x63,0x01,0xe8,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0xaf,0x86,0x80,0x14, ++0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x8c,0xa4,0x00,0x00,0x0c,0x00,0x17,0x84,0x00,0x00,0x00,0x00,0x08,0x00,0x01,0xdc, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x24,0x49,0x00,0xc0,0x20,0x21,0x08,0x00,0x01,0xdc, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08,0x8c,0x44,0x00,0x00, ++0x8f,0x82,0x80,0x18,0x3c,0x03,0x00,0x0f,0x34,0x63,0x42,0x40,0x00,0x43,0x10,0x21, ++0x00,0x82,0x20,0x2b,0x10,0x80,0x00,0x09,0x24,0x03,0x00,0x05,0x8f,0x82,0x83,0x60, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xaf,0x82,0x83,0x60,0x10,0x43,0x00,0x03, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x8c,0x63,0x01,0x08,0x24,0x02,0x00,0x01,0xa3,0x82,0x80,0x11,0xaf,0x80,0x83,0x60, ++0xaf,0x83,0x80,0x18,0x08,0x00,0x01,0xf9,0x00,0x00,0x00,0x00,0x30,0x84,0x00,0xff, ++0x14,0x80,0x00,0x2f,0x00,0x00,0x00,0x00,0x8f,0x82,0x80,0x14,0xa3,0x85,0x83,0x93, ++0x10,0x40,0x00,0x2b,0x2c,0xa2,0x00,0x04,0x14,0x40,0x00,0x06,0x00,0x05,0x10,0x40, ++0x24,0xa2,0xff,0xfc,0x2c,0x42,0x00,0x08,0x10,0x40,0x00,0x09,0x24,0xa2,0xff,0xf0, ++0x00,0x05,0x10,0x40,0x27,0x84,0x83,0x9c,0x00,0x44,0x10,0x21,0x94,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08,0xa4,0x43,0x00,0x00, ++0x2c,0x42,0x00,0x10,0x14,0x40,0x00,0x0a,0x00,0x05,0x10,0x40,0x24,0xa2,0xff,0xe0, ++0x2c,0x42,0x00,0x10,0x14,0x40,0x00,0x06,0x00,0x05,0x10,0x40,0x24,0xa2,0xff,0xd0, ++0x2c,0x42,0x00,0x10,0x10,0x40,0x00,0x09,0x24,0xa2,0xff,0xc0,0x00,0x05,0x10,0x40, ++0x27,0x84,0x83,0x9c,0x00,0x44,0x10,0x21,0x94,0x43,0xff,0xf8,0x00,0x00,0x00,0x00, ++0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08,0xa4,0x43,0xff,0xf8,0x2c,0x42,0x00,0x10, ++0x10,0x40,0x00,0x07,0x00,0x05,0x10,0x40,0x27,0x84,0x83,0x9c,0x00,0x44,0x10,0x21, ++0x94,0x43,0xff,0xf8,0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0xa4,0x43,0xff,0xf8, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8f,0x86,0x8b,0xc0,0x8f,0x82,0x80,0x14, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x10,0x40,0x00,0x2a,0x00,0xc0,0x38,0x21, ++0x24,0x02,0x00,0x07,0x24,0x03,0xff,0x9c,0xa3,0x82,0x83,0x9b,0xa3,0x83,0x83,0x9a, ++0x27,0x8a,0x83,0x98,0x00,0x00,0x20,0x21,0x24,0x09,0x8f,0xff,0x00,0x04,0x10,0x80, ++0x00,0x4a,0x28,0x21,0x8c,0xa2,0x00,0x00,0x24,0xe3,0x00,0x04,0x24,0x88,0x00,0x01, ++0xac,0xe2,0x00,0x00,0x10,0x80,0x00,0x02,0x00,0x69,0x38,0x24,0xac,0xa0,0x00,0x00, ++0x31,0x04,0x00,0xff,0x2c,0x82,0x00,0x27,0x14,0x40,0xff,0xf5,0x00,0x04,0x10,0x80, ++0x97,0x83,0x8b,0xc6,0x97,0x85,0x8b,0xc4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x9c, ++0x00,0xa2,0x28,0x21,0x3c,0x04,0xb0,0x06,0xa7,0x83,0x8b,0xc6,0x34,0x84,0x80,0x18, ++0xa4,0xa3,0x00,0x00,0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x9c, ++0x3c,0x03,0x0f,0x00,0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00, ++0xaf,0x86,0x8b,0xc0,0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x96, ++0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x8f,0x86,0x8b,0xc0,0x27,0xbd,0xff,0xc8,0x24,0x02,0x00,0x08, ++0x24,0x03,0x00,0x20,0xaf,0xbf,0x00,0x30,0xa3,0xa2,0x00,0x13,0xa3,0xa3,0x00,0x12, ++0xa7,0xa4,0x00,0x10,0x00,0xc0,0x28,0x21,0x27,0xa9,0x00,0x10,0x00,0x00,0x38,0x21, ++0x24,0x08,0x8f,0xff,0x00,0x07,0x10,0x80,0x00,0x49,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x24,0xe3,0x00,0x01,0x30,0x67,0x00,0xff,0x24,0xa2,0x00,0x04,0x2c,0xe3,0x00,0x08, ++0xac,0xa4,0x00,0x00,0x14,0x60,0xff,0xf7,0x00,0x48,0x28,0x24,0x97,0x83,0x8b,0xc6, ++0x97,0x85,0x8b,0xc4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x20,0x00,0xa2,0x28,0x21, ++0x3c,0x04,0xb0,0x06,0xa7,0x83,0x8b,0xc6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00, ++0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x20,0x3c,0x03,0x0f,0x00, ++0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x86,0x8b,0xc0, ++0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x96,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x30,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38, ++0x93,0x82,0x8b,0xd0,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x11,0x24,0x06,0x00,0x01, ++0x8f,0x82,0x8b,0xc8,0x3c,0x05,0xb0,0x06,0x3c,0x04,0xb0,0x03,0x34,0xa5,0x80,0x18, ++0x34,0x84,0x01,0x08,0x14,0x40,0x00,0x09,0x00,0x00,0x30,0x21,0x97,0x82,0x8b,0xc4, ++0x8c,0x84,0x00,0x00,0x3c,0x03,0xb0,0x02,0x00,0x43,0x10,0x21,0xaf,0x84,0x8b,0xcc, ++0xa7,0x80,0x8b,0xc6,0xac,0x40,0x00,0x00,0xac,0x40,0x00,0x04,0x8c,0xa2,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0xc0,0x10,0x21,0x8f,0x86,0x8b,0xc0,0x8f,0x82,0x8b,0xc8, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x00,0xc0,0x40,0x21,0x14,0x40,0x00,0x0a, ++0x00,0x40,0x50,0x21,0x00,0x00,0x38,0x21,0x27,0x89,0x83,0x68,0x24,0xe2,0x00,0x01, ++0x00,0x07,0x18,0x80,0x30,0x47,0x00,0xff,0x00,0x69,0x18,0x21,0x2c,0xe2,0x00,0x0a, ++0x14,0x40,0xff,0xfa,0xac,0x60,0x00,0x00,0x3c,0x02,0x00,0x80,0x10,0x82,0x00,0x6f, ++0x00,0x00,0x00,0x00,0x97,0x82,0x83,0x6e,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x83,0x6e,0x90,0xa3,0x00,0x15,0x97,0x82,0x83,0x70,0x00,0x03,0x1e,0x00, ++0x00,0x03,0x1e,0x03,0x00,0x43,0x10,0x21,0xa7,0x82,0x83,0x70,0x8c,0xa4,0x00,0x20, ++0x3c,0x02,0x00,0x60,0x3c,0x03,0x00,0x20,0x00,0x82,0x20,0x24,0x10,0x83,0x00,0x54, ++0x00,0x00,0x00,0x00,0x14,0x80,0x00,0x47,0x00,0x00,0x00,0x00,0x97,0x82,0x83,0x74, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x83,0x74,0x84,0xa3,0x00,0x06, ++0x8f,0x82,0x83,0x84,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21,0xaf,0x82,0x83,0x84, ++0x25,0x42,0x00,0x01,0x28,0x43,0x27,0x10,0xaf,0x82,0x8b,0xc8,0x10,0x60,0x00,0x09, ++0x24,0x02,0x00,0x04,0x93,0x83,0x80,0x11,0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x05, ++0x24,0x02,0x00,0x04,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x24,0x03,0x00,0x28,0xa3,0x83,0x83,0x6a,0xa3,0x82,0x83,0x6b, ++0x90,0xa2,0x00,0x18,0x93,0x83,0x83,0x93,0x00,0x00,0x38,0x21,0x00,0x02,0x16,0x00, ++0x00,0x02,0x16,0x03,0xa7,0x82,0x83,0x7e,0xa3,0x83,0x83,0x8c,0x27,0x89,0x83,0x68, ++0x24,0x05,0x8f,0xff,0x00,0x07,0x10,0x80,0x00,0x49,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x24,0xe3,0x00,0x01,0x30,0x67,0x00,0xff,0x25,0x02,0x00,0x04,0x2c,0xe3,0x00,0x0a, ++0xad,0x04,0x00,0x00,0x14,0x60,0xff,0xf7,0x00,0x45,0x40,0x24,0x97,0x83,0x8b,0xc6, ++0x97,0x85,0x8b,0xc4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x28,0x00,0xa2,0x28,0x21, ++0x3c,0x04,0xb0,0x06,0xa7,0x83,0x8b,0xc6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00, ++0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x28,0x3c,0x03,0x0f,0x00, ++0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x86,0x8b,0xc0, ++0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x96,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x02,0x36,0x00,0x00,0x00,0x00,0xa3,0x80,0x80,0x11,0x08,0x00,0x02,0xe5, ++0x00,0x00,0x00,0x00,0x97,0x82,0x83,0x76,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x83,0x76,0x84,0xa3,0x00,0x06,0x8f,0x82,0x83,0x88,0x00,0x00,0x00,0x00, ++0x00,0x43,0x10,0x21,0xaf,0x82,0x83,0x88,0x08,0x00,0x02,0xdd,0x25,0x42,0x00,0x01, ++0x97,0x82,0x83,0x72,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x83,0x72, ++0x84,0xa3,0x00,0x06,0x8f,0x82,0x83,0x80,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21, ++0xaf,0x82,0x83,0x80,0x08,0x00,0x02,0xdd,0x25,0x42,0x00,0x01,0x97,0x82,0x83,0x6c, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x83,0x6c,0x08,0x00,0x02,0xc5, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xd0,0xaf,0xbf,0x00,0x28,0x8c,0xa3,0x00,0x20, ++0x8f,0x8a,0x8b,0xc0,0x3c,0x02,0x00,0x10,0x00,0x62,0x10,0x24,0x00,0xa0,0x38,0x21, ++0x01,0x40,0x48,0x21,0x10,0x40,0x00,0x3d,0x00,0x80,0x28,0x21,0x8c,0xe4,0x00,0x1c, ++0x34,0xa5,0x12,0x06,0xaf,0xa5,0x00,0x10,0x8c,0x82,0x00,0x08,0x00,0x03,0x1c,0x42, ++0x30,0x63,0x00,0x30,0x00,0x02,0x13,0x02,0x30,0x42,0x00,0x40,0x00,0x43,0x10,0x25, ++0x90,0xe6,0x00,0x10,0x90,0xe4,0x00,0x13,0x94,0xe8,0x00,0x0c,0x94,0xe3,0x00,0x1a, ++0x00,0x02,0x16,0x00,0x90,0xe7,0x00,0x12,0x00,0xa2,0x28,0x25,0x24,0x02,0x12,0x34, ++0xa7,0xa2,0x00,0x1c,0x24,0x02,0x56,0x78,0xaf,0xa5,0x00,0x10,0xa3,0xa6,0x00,0x18, ++0xa3,0xa7,0x00,0x1f,0xa7,0xa3,0x00,0x1a,0xa3,0xa4,0x00,0x19,0xa7,0xa8,0x00,0x20, ++0xa7,0xa2,0x00,0x22,0x00,0x00,0x28,0x21,0x27,0xa7,0x00,0x10,0x24,0x06,0x8f,0xff, ++0x00,0x05,0x10,0x80,0x00,0x47,0x10,0x21,0x8c,0x44,0x00,0x00,0x24,0xa3,0x00,0x01, ++0x30,0x65,0x00,0xff,0x25,0x22,0x00,0x04,0x2c,0xa3,0x00,0x05,0xad,0x24,0x00,0x00, ++0x14,0x60,0xff,0xf7,0x00,0x46,0x48,0x24,0x97,0x83,0x8b,0xc6,0x97,0x85,0x8b,0xc4, ++0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x14,0x00,0xa2,0x28,0x21,0x3c,0x04,0xb0,0x06, ++0xa7,0x83,0x8b,0xc6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00,0x8c,0x85,0x00,0x00, ++0x24,0x02,0x8f,0xff,0x25,0x46,0x00,0x14,0x3c,0x03,0x0f,0x00,0x00,0xc2,0x50,0x24, ++0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x8a,0x8b,0xc0,0x10,0xa2,0x00,0x03, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x96,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x28, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30,0x3c,0x05,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xc8,0x00,0x04,0x22,0x00,0x34,0xa5,0x00,0x20, ++0x24,0x42,0x0d,0xfc,0x3c,0x03,0xb0,0x00,0xaf,0xb5,0x00,0x24,0xaf,0xb4,0x00,0x20, ++0xaf,0xb2,0x00,0x18,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x30,0x00,0x83,0x80,0x21, ++0xaf,0xb7,0x00,0x2c,0xaf,0xb6,0x00,0x28,0xaf,0xb3,0x00,0x1c,0xaf,0xb1,0x00,0x14, ++0xac,0xa2,0x00,0x00,0x8e,0x09,0x00,0x00,0x00,0x00,0x90,0x21,0x26,0x10,0x00,0x08, ++0x00,0x09,0xa6,0x02,0x12,0x80,0x00,0x13,0x00,0x00,0xa8,0x21,0x24,0x13,0x00,0x02, ++0x3c,0x16,0x00,0xff,0x3c,0x17,0xff,0x00,0x8e,0x09,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x09,0x12,0x02,0x24,0x42,0x00,0x02,0x31,0x25,0x00,0xff,0x10,0xb3,0x00,0x76, ++0x30,0x51,0x00,0xff,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x18,0x00,0x00,0x00,0x00, ++0x02,0x51,0x10,0x21,0x30,0x52,0xff,0xff,0x02,0x54,0x18,0x2b,0x14,0x60,0xff,0xf2, ++0x02,0x11,0x80,0x21,0x12,0xa0,0x00,0x0a,0x3c,0x02,0xb0,0x06,0x34,0x42,0x80,0x18, ++0x8c,0x43,0x00,0x00,0x3c,0x04,0x0f,0x00,0x3c,0x02,0x04,0x00,0x00,0x64,0x18,0x24, ++0x10,0x62,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x96,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x30,0x7b,0xb6,0x01,0x7c,0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x8e,0x09,0x00,0x04, ++0x24,0x15,0x00,0x01,0x8e,0x06,0x00,0x0c,0x00,0x09,0x11,0x42,0x00,0x09,0x18,0xc2, ++0x30,0x48,0x00,0x03,0x00,0x09,0x14,0x02,0x30,0x6c,0x00,0x03,0x00,0x09,0x26,0x02, ++0x11,0x15,0x00,0x45,0x30,0x43,0x00,0x0f,0x29,0x02,0x00,0x02,0x14,0x40,0x00,0x26, ++0x00,0x00,0x00,0x00,0x11,0x13,0x00,0x0f,0x00,0x00,0x38,0x21,0x00,0x07,0x22,0x02, ++0x30,0x84,0xff,0x00,0x3c,0x03,0x00,0xff,0x00,0x07,0x2e,0x02,0x00,0x07,0x12,0x00, ++0x00,0x43,0x10,0x24,0x00,0xa4,0x28,0x25,0x00,0xa2,0x28,0x25,0x00,0x07,0x1e,0x00, ++0x00,0xa3,0x28,0x25,0x0c,0x00,0x01,0x92,0x01,0x20,0x20,0x21,0x08,0x00,0x03,0xa5, ++0x02,0x51,0x10,0x21,0x11,0x95,0x00,0x0f,0x00,0x00,0x00,0x00,0x11,0x88,0x00,0x07, ++0x00,0x00,0x00,0x00,0x00,0x04,0x10,0x80,0x27,0x83,0x8b,0x70,0x00,0x43,0x10,0x21, ++0x8c,0x47,0x00,0x18,0x08,0x00,0x03,0xcc,0x00,0x07,0x22,0x02,0x00,0x04,0x10,0x40, ++0x27,0x83,0x8b,0x78,0x00,0x43,0x10,0x21,0x94,0x47,0x00,0x02,0x08,0x00,0x03,0xcc, ++0x00,0x07,0x22,0x02,0x27,0x82,0x8b,0x70,0x00,0x82,0x10,0x21,0x90,0x47,0x00,0x00, ++0x08,0x00,0x03,0xcc,0x00,0x07,0x22,0x02,0x15,0x00,0xff,0xdc,0x00,0x00,0x38,0x21, ++0x10,0x75,0x00,0x05,0x00,0x80,0x38,0x21,0x00,0x65,0x18,0x26,0x24,0x82,0x01,0x00, ++0x00,0x00,0x38,0x21,0x00,0x43,0x38,0x0a,0x24,0x02,0x00,0x01,0x11,0x82,0x00,0x0e, ++0x3c,0x02,0xb0,0x03,0x24,0x02,0x00,0x02,0x11,0x82,0x00,0x06,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x00,0xe2,0x10,0x21,0x8c,0x47,0x00,0x00,0x08,0x00,0x03,0xcc, ++0x00,0x07,0x22,0x02,0x3c,0x02,0xb0,0x03,0x00,0xe2,0x10,0x21,0x94,0x43,0x00,0x00, ++0x08,0x00,0x03,0xcb,0x30,0x67,0xff,0xff,0x00,0xe2,0x10,0x21,0x90,0x43,0x00,0x00, ++0x08,0x00,0x03,0xcb,0x30,0x67,0x00,0xff,0x30,0x62,0x00,0x03,0x00,0x02,0x12,0x00, ++0x11,0x95,0x00,0x07,0x00,0x44,0x38,0x21,0x11,0x93,0x00,0x03,0x00,0x00,0x00,0x00, ++0x08,0x00,0x03,0xfd,0x3c,0x02,0xb0,0x0a,0x08,0x00,0x04,0x02,0x3c,0x02,0xb0,0x0a, ++0x08,0x00,0x04,0x06,0x3c,0x02,0xb0,0x0a,0x8e,0x09,0x00,0x04,0x8e,0x02,0x00,0x08, ++0x8e,0x03,0x00,0x0c,0x00,0x09,0x41,0x42,0x00,0x02,0x22,0x02,0x00,0x03,0x3a,0x02, ++0x30,0x84,0xff,0x00,0x30,0xe7,0xff,0x00,0x00,0x02,0x5e,0x02,0x00,0x02,0x32,0x00, ++0x00,0x03,0x56,0x02,0x00,0x03,0x2a,0x00,0x01,0x64,0x58,0x25,0x00,0xd6,0x30,0x24, ++0x01,0x47,0x50,0x25,0x00,0x02,0x16,0x00,0x00,0xb6,0x28,0x24,0x00,0x03,0x1e,0x00, ++0x01,0x66,0x58,0x25,0x01,0x45,0x50,0x25,0x00,0x57,0x10,0x24,0x00,0x77,0x18,0x24, ++0x01,0x62,0x38,0x25,0x01,0x43,0x30,0x25,0x00,0x09,0x10,0xc2,0x00,0x09,0x1c,0x02, ++0x31,0x08,0x00,0x03,0x30,0x4c,0x00,0x03,0x30,0x63,0x00,0x0f,0x00,0x09,0x26,0x02, ++0x00,0xe0,0x58,0x21,0x15,0x00,0x00,0x28,0x00,0xc0,0x50,0x21,0x24,0x02,0x00,0x01, ++0x10,0x62,0x00,0x06,0x00,0x80,0x28,0x21,0x24,0x02,0x00,0x03,0x14,0x62,0xff,0x69, ++0x02,0x51,0x10,0x21,0x24,0x85,0x01,0x00,0x24,0x02,0x00,0x01,0x11,0x82,0x00,0x15, ++0x24,0x02,0x00,0x02,0x11,0x82,0x00,0x0a,0x3c,0x03,0xb0,0x03,0x00,0xa3,0x18,0x21, ++0x8c,0x62,0x00,0x00,0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24,0x00,0x44,0x10,0x24, ++0x00,0x45,0x10,0x25,0xac,0x62,0x00,0x00,0x08,0x00,0x03,0xa5,0x02,0x51,0x10,0x21, ++0x00,0xa3,0x18,0x21,0x94,0x62,0x00,0x00,0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24, ++0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25,0xa4,0x62,0x00,0x00,0x08,0x00,0x03,0xa5, ++0x02,0x51,0x10,0x21,0x3c,0x03,0xb0,0x03,0x00,0xa3,0x18,0x21,0x90,0x62,0x00,0x00, ++0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24,0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25, ++0x08,0x00,0x03,0xa4,0xa0,0x62,0x00,0x00,0x24,0x02,0x00,0x01,0x11,0x02,0x00,0x21, ++0x00,0x00,0x00,0x00,0x15,0x13,0xff,0x42,0x00,0x00,0x00,0x00,0x11,0x82,0x00,0x17, ++0x00,0x00,0x00,0x00,0x11,0x88,0x00,0x0b,0x00,0x00,0x00,0x00,0x27,0x83,0x8b,0x70, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x18,0x00,0x06,0x18,0x27, ++0x00,0xe6,0x28,0x24,0x00,0x43,0x10,0x24,0x00,0x45,0x10,0x25,0x08,0x00,0x03,0xa4, ++0xac,0x82,0x00,0x18,0x27,0x83,0x8b,0x78,0x00,0x04,0x20,0x40,0x00,0x83,0x20,0x21, ++0x94,0x82,0x00,0x02,0x00,0x06,0x18,0x27,0x00,0xe6,0x28,0x24,0x00,0x43,0x10,0x24, ++0x00,0x45,0x10,0x25,0x08,0x00,0x03,0xa4,0xa4,0x82,0x00,0x02,0x27,0x83,0x8b,0x70, ++0x00,0x83,0x18,0x21,0x90,0x62,0x00,0x00,0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x5a, ++0x00,0xe6,0x28,0x24,0x30,0x62,0x00,0x07,0x00,0x02,0x12,0x00,0x11,0x88,0x00,0x0f, ++0x00,0x44,0x10,0x21,0x11,0x93,0x00,0x07,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a, ++0x00,0x43,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x47, ++0x00,0xe6,0x28,0x24,0x3c,0x03,0xb0,0x0a,0x00,0x43,0x18,0x21,0x94,0x62,0x00,0x00, ++0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x50,0x00,0xe6,0x28,0x24,0x3c,0x03,0xb0,0x0a, ++0x08,0x00,0x04,0x7d,0x00,0x43,0x18,0x21,0x97,0x85,0x8b,0xc4,0x3c,0x07,0xb0,0x02, ++0x3c,0x04,0xb0,0x03,0x3c,0x02,0x80,0x00,0x00,0xa7,0x28,0x21,0x34,0x84,0x00,0x20, ++0x24,0x42,0x12,0x58,0x24,0x03,0xff,0x80,0xac,0x82,0x00,0x00,0xa0,0xa3,0x00,0x07, ++0x97,0x82,0x8b,0xc6,0x97,0x85,0x8b,0xc4,0x3c,0x06,0xb0,0x06,0x30,0x42,0xff,0xf8, ++0x24,0x42,0x00,0x10,0x00,0xa2,0x10,0x21,0x30,0x42,0x0f,0xff,0x24,0x44,0x00,0x08, ++0x30,0x84,0x0f,0xff,0x00,0x05,0x28,0xc2,0x3c,0x03,0x00,0x40,0x00,0xa3,0x28,0x25, ++0x00,0x87,0x20,0x21,0x34,0xc6,0x80,0x18,0xac,0xc5,0x00,0x00,0xaf,0x84,0x8b,0xc0, ++0xa7,0x82,0x8b,0xc4,0xa7,0x80,0x8b,0xc6,0xaf,0x80,0x8b,0xc8,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa5,0x00,0xff,0x30,0x84,0x00,0xff,0x24,0x02,0x00,0x01, ++0x00,0xe0,0x48,0x21,0x30,0xc6,0x00,0xff,0x8f,0xa7,0x00,0x10,0x10,0x82,0x00,0x07, ++0x00,0xa0,0x40,0x21,0x24,0x02,0x00,0x03,0x10,0x82,0x00,0x03,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x24,0xa8,0x01,0x00,0x3c,0x03,0xb0,0x03, ++0x24,0x02,0x00,0x01,0x00,0x07,0x20,0x27,0x01,0x27,0x28,0x24,0x10,0xc2,0x00,0x14, ++0x01,0x03,0x18,0x21,0x24,0x02,0x00,0x02,0x10,0xc2,0x00,0x09,0x00,0x07,0x50,0x27, ++0x3c,0x03,0xb0,0x03,0x01,0x03,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x45,0x10,0x25,0x08,0x00,0x04,0xe1,0xac,0x62,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x01,0x03,0x18,0x21,0x94,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x45,0x10,0x25,0x03,0xe0,0x00,0x08,0xa4,0x62,0x00,0x00, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25, ++0xa0,0x62,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0x84,0x00,0x07, ++0x00,0x04,0x22,0x00,0x30,0xa5,0x00,0xff,0x00,0x85,0x28,0x21,0x3c,0x02,0xb0,0x0a, ++0x00,0xa2,0x40,0x21,0x30,0xc6,0x00,0xff,0x24,0x02,0x00,0x01,0x8f,0xa4,0x00,0x10, ++0x10,0xc2,0x00,0x14,0x24,0x02,0x00,0x02,0x00,0x04,0x50,0x27,0x10,0xc2,0x00,0x09, ++0x00,0xe4,0x48,0x24,0x3c,0x03,0xb0,0x0a,0x00,0xa3,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4a,0x10,0x24,0x00,0x49,0x10,0x25,0x03,0xe0,0x00,0x08, ++0xac,0x62,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x00,0xa3,0x18,0x21,0x94,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4a,0x10,0x24,0x00,0x49,0x10,0x25,0x03,0xe0,0x00,0x08, ++0xa4,0x62,0x00,0x00,0x91,0x02,0x00,0x00,0x00,0x04,0x18,0x27,0x00,0xe4,0x20,0x24, ++0x00,0x43,0x10,0x24,0x00,0x44,0x10,0x25,0x03,0xe0,0x00,0x08,0xa1,0x02,0x00,0x00, ++0x30,0xa9,0x00,0xff,0x27,0x83,0x8b,0x70,0x30,0x85,0x00,0xff,0x24,0x02,0x00,0x01, ++0x00,0x07,0x50,0x27,0x00,0xc7,0x40,0x24,0x11,0x22,0x00,0x17,0x00,0xa3,0x18,0x21, ++0x00,0x05,0x20,0x40,0x27,0x82,0x8b,0x70,0x00,0x05,0x28,0x80,0x27,0x83,0x8b,0x78, ++0x00,0x83,0x50,0x21,0x00,0xa2,0x20,0x21,0x24,0x02,0x00,0x02,0x00,0x07,0x40,0x27, ++0x11,0x22,0x00,0x07,0x00,0xc7,0x28,0x24,0x8c,0x82,0x00,0x18,0x00,0x00,0x00,0x00, ++0x00,0x48,0x10,0x24,0x00,0x45,0x10,0x25,0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x18, ++0x95,0x42,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x48,0x10,0x24,0x00,0x45,0x10,0x25, ++0x03,0xe0,0x00,0x08,0xa5,0x42,0x00,0x02,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x48,0x10,0x25,0x03,0xe0,0x00,0x08,0xa0,0x62,0x00,0x00, ++0x00,0x04,0x32,0x02,0x30,0xc6,0xff,0x00,0x00,0x04,0x16,0x02,0x00,0x04,0x1a,0x00, ++0x3c,0x05,0x00,0xff,0x00,0x65,0x18,0x24,0x00,0x46,0x10,0x25,0x00,0x43,0x10,0x25, ++0x00,0x04,0x26,0x00,0x03,0xe0,0x00,0x08,0x00,0x44,0x10,0x25,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xe8,0x34,0x63,0x00,0x20,0x24,0x42,0x14,0xdc, ++0x3c,0x04,0xb0,0x03,0xaf,0xbf,0x00,0x14,0xac,0x62,0x00,0x00,0xaf,0xb0,0x00,0x10, ++0x34,0x84,0x00,0x2c,0x8c,0x83,0x00,0x00,0xa7,0x80,0xbc,0x00,0x00,0x03,0x12,0x02, ++0x00,0x03,0x2d,0x02,0x30,0x42,0x0f,0xff,0xa3,0x83,0xbc,0x08,0xa7,0x85,0xbc,0x0c, ++0xa7,0x82,0xbc,0x0a,0xa7,0x80,0xbc,0x02,0xa7,0x80,0xbc,0x04,0xa7,0x80,0xbc,0x06, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x05,0x00,0x3c,0x05,0x08,0x00,0x00,0x45,0x28,0x25, ++0x24,0x04,0x05,0x00,0x0c,0x00,0x06,0xbf,0x00,0x40,0x80,0x21,0x3c,0x02,0xf7,0xff, ++0x34,0x42,0xff,0xff,0x02,0x02,0x80,0x24,0x02,0x00,0x28,0x21,0x0c,0x00,0x06,0xbf, ++0x24,0x04,0x05,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0xb0,0x03,0x34,0x42,0x01,0x08, ++0x34,0x63,0x01,0x18,0x8c,0x45,0x00,0x00,0x8c,0x64,0x00,0x00,0x3c,0x02,0x00,0x0f, ++0x3c,0x03,0x00,0x4c,0x30,0x84,0x02,0x00,0x34,0x63,0x4b,0x40,0xaf,0x85,0xbc,0x10, ++0x10,0x80,0x00,0x06,0x34,0x42,0x42,0x40,0xaf,0x83,0xbc,0x14,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0xaf,0x82,0xbc,0x14, ++0x08,0x00,0x05,0x67,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x27,0xbd,0xff,0xc8,0x34,0x63,0x00,0x20,0x24,0x42,0x15,0xb8,0x30,0x84,0x00,0xff, ++0xaf,0xbf,0x00,0x30,0xaf,0xb7,0x00,0x2c,0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24, ++0xaf,0xb4,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0xac,0x62,0x00,0x00,0x10,0x80,0x00,0x1c,0x24,0x02,0x00,0x02, ++0x10,0x82,0x00,0x08,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x30,0x7b,0xb6,0x01,0x7c, ++0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x38,0xa7,0x80,0xbc,0x00,0xa7,0x80,0xbc,0x02,0xa7,0x80,0xbc,0x04, ++0xa7,0x80,0xbc,0x06,0x0c,0x00,0x06,0xd1,0x24,0x04,0x05,0x00,0x3c,0x05,0x08,0x00, ++0x00,0x45,0x28,0x25,0x24,0x04,0x05,0x00,0x0c,0x00,0x06,0xbf,0x00,0x40,0x80,0x21, ++0x3c,0x05,0xf7,0xff,0x34,0xa5,0xff,0xff,0x02,0x05,0x28,0x24,0x0c,0x00,0x06,0xbf, ++0x24,0x04,0x05,0x00,0x08,0x00,0x05,0x82,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xd1, ++0x24,0x04,0x05,0xa0,0x24,0x04,0x05,0xa4,0x0c,0x00,0x06,0xd1,0x00,0x02,0xbc,0x02, ++0x24,0x04,0x05,0xa8,0x00,0x02,0xb4,0x02,0x0c,0x00,0x06,0xd1,0x30,0x55,0xff,0xff, ++0x00,0x40,0x80,0x21,0x97,0x84,0xbc,0x00,0x97,0x82,0xbc,0x02,0x97,0x83,0xbc,0x06, ++0x02,0xe4,0x20,0x23,0x02,0xa2,0x10,0x23,0x00,0x82,0x20,0x21,0x97,0x82,0xbc,0x04, ++0x32,0x14,0xff,0xff,0x02,0x83,0x18,0x23,0x02,0xc2,0x10,0x23,0x00,0x82,0x20,0x21, ++0x93,0x82,0xbc,0x08,0x00,0x83,0x20,0x21,0x30,0x84,0xff,0xff,0x00,0x82,0x10,0x2b, ++0x14,0x40,0x00,0xaa,0x00,0x00,0x00,0x00,0x97,0x82,0xbc,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x44,0x10,0x2b,0x14,0x40,0x00,0x7f,0x00,0x00,0x00,0x00,0x97,0x82,0xbc,0x0a, ++0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x2b,0x10,0x40,0x00,0x3a,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0x50,0x30,0x51,0x00,0x7f,0x00,0x40,0x80,0x21, ++0x2e,0x22,0x00,0x32,0x10,0x40,0x00,0x13,0x24,0x02,0x00,0x20,0x12,0x22,0x00,0x17, ++0x24,0x02,0xff,0x80,0x02,0x02,0x10,0x24,0x26,0x31,0x00,0x01,0x00,0x51,0x80,0x25, ++0x02,0x00,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x04,0x50,0x02,0x00,0x28,0x21, ++0x0c,0x00,0x06,0xbf,0x24,0x04,0x04,0x58,0x02,0x00,0x28,0x21,0x0c,0x00,0x06,0xbf, ++0x24,0x04,0x04,0x60,0x02,0x00,0x28,0x21,0x24,0x04,0x04,0x68,0x0c,0x00,0x06,0xbf, ++0x00,0x00,0x00,0x00,0xa7,0x97,0xbc,0x00,0xa7,0x95,0xbc,0x02,0xa7,0x96,0xbc,0x04, ++0xa7,0x94,0xbc,0x06,0x08,0x00,0x05,0x82,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xd1, ++0x24,0x04,0x02,0x08,0x3c,0x04,0x00,0xc0,0x00,0x40,0x28,0x21,0x00,0x44,0x10,0x24, ++0x00,0x02,0x15,0x82,0x24,0x03,0x00,0x03,0x10,0x43,0x00,0x07,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff,0x00,0xa2,0x10,0x24,0x00,0x44,0x28,0x25, ++0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x08,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x2c, ++0x00,0x40,0x90,0x21,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x02,0x42,0x90,0x24, ++0x02,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x2c,0x08,0x00,0x05,0xc9, ++0x24,0x02,0xff,0x80,0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0x50,0x30,0x51,0x00,0x7f, ++0x24,0x02,0x00,0x20,0x16,0x22,0xff,0xdb,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xd1, ++0x24,0x04,0x02,0x2c,0x34,0x52,0x40,0x00,0x02,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf, ++0x24,0x04,0x02,0x2c,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x58,0x24,0x04,0x02,0x5c, ++0x0c,0x00,0x06,0xd1,0x00,0x02,0x9e,0x02,0x30,0x43,0x00,0xff,0x00,0x13,0x12,0x00, ++0x00,0x43,0x10,0x25,0x2c,0x43,0x00,0x04,0x14,0x60,0x00,0x1d,0x2c,0x42,0x00,0x11, ++0x10,0x40,0x00,0x0b,0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff, ++0x02,0x42,0x90,0x24,0x02,0x40,0x28,0x21,0x24,0x04,0x02,0x2c,0x0c,0x00,0x06,0xbf, ++0x36,0x52,0x80,0x00,0x02,0x40,0x28,0x21,0x08,0x00,0x05,0xd7,0x24,0x04,0x02,0x2c, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x08,0x3c,0x04,0x00,0xc0,0x00,0x40,0x28,0x21, ++0x00,0x44,0x10,0x24,0x00,0x02,0x15,0x82,0x24,0x03,0x00,0x02,0x14,0x43,0xff,0xee, ++0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff,0x00,0xa2,0x10,0x24,0x00,0x44,0x28,0x25, ++0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x08,0x08,0x00,0x06,0x13,0x3c,0x02,0xff,0xff, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x08,0x00,0x40,0x28,0x21,0x00,0x02,0x15,0x82, ++0x30,0x42,0x00,0x03,0x24,0x03,0x00,0x03,0x14,0x43,0xff,0xdf,0x3c,0x02,0xff,0x3f, ++0x34,0x42,0xff,0xff,0x00,0xa2,0x10,0x24,0x3c,0x03,0x00,0x80,0x08,0x00,0x06,0x28, ++0x00,0x43,0x28,0x25,0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0x50,0x30,0x51,0x00,0x7f, ++0x00,0x40,0x80,0x21,0x2e,0x22,0x00,0x32,0x10,0x40,0xff,0x9a,0x24,0x02,0x00,0x20, ++0x12,0x22,0x00,0x04,0x24,0x02,0xff,0x80,0x02,0x02,0x10,0x24,0x08,0x00,0x05,0xcb, ++0x26,0x31,0x00,0x02,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x08,0x3c,0x04,0x00,0xc0, ++0x00,0x40,0x28,0x21,0x00,0x44,0x10,0x24,0x00,0x02,0x15,0x82,0x24,0x03,0x00,0x03, ++0x10,0x43,0x00,0x07,0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff, ++0x00,0xa2,0x10,0x24,0x00,0x44,0x28,0x25,0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x08, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x2c,0x00,0x40,0x90,0x21,0x3c,0x02,0xff,0xff, ++0x34,0x42,0x3f,0xff,0x02,0x42,0x90,0x24,0x02,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf, ++0x24,0x04,0x02,0x2c,0x08,0x00,0x06,0x42,0x24,0x02,0xff,0x80,0x0c,0x00,0x06,0xd1, ++0x24,0x04,0x04,0x50,0x00,0x40,0x80,0x21,0x30,0x51,0x00,0x7f,0x24,0x02,0x00,0x20, ++0x12,0x22,0x00,0x1d,0x2e,0x22,0x00,0x21,0x14,0x40,0xff,0x72,0x24,0x02,0xff,0x80, ++0x02,0x02,0x10,0x24,0x26,0x31,0xff,0xff,0x00,0x51,0x80,0x25,0x24,0x04,0x04,0x50, ++0x0c,0x00,0x06,0xbf,0x02,0x00,0x28,0x21,0x24,0x04,0x04,0x58,0x0c,0x00,0x06,0xbf, ++0x02,0x00,0x28,0x21,0x24,0x04,0x04,0x60,0x0c,0x00,0x06,0xbf,0x02,0x00,0x28,0x21, ++0x02,0x00,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x04,0x68,0x24,0x02,0x00,0x20, ++0x16,0x22,0xff,0x60,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x2c, ++0x00,0x40,0x90,0x21,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x02,0x42,0x10,0x24, ++0x08,0x00,0x06,0x19,0x34,0x52,0x80,0x00,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x2c, ++0x34,0x52,0x40,0x00,0x02,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x2c, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x58,0x24,0x04,0x02,0x5c,0x0c,0x00,0x06,0xd1, ++0x00,0x02,0x9e,0x02,0x30,0x43,0x00,0xff,0x00,0x13,0x12,0x00,0x00,0x43,0x10,0x25, ++0x2c,0x43,0x00,0x04,0x14,0x60,0x00,0x20,0x2c,0x42,0x00,0x11,0x10,0x40,0x00,0x0d, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x02,0x42,0x90,0x24, ++0x02,0x40,0x28,0x21,0x24,0x04,0x02,0x2c,0x0c,0x00,0x06,0xbf,0x36,0x52,0x80,0x00, ++0x02,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x2c,0x08,0x00,0x06,0x66, ++0x2e,0x22,0x00,0x21,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x08,0x3c,0x04,0x00,0xc0, ++0x00,0x40,0x28,0x21,0x00,0x44,0x10,0x24,0x00,0x02,0x15,0x82,0x24,0x03,0x00,0x02, ++0x14,0x43,0xff,0xec,0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff, ++0x00,0xa2,0x10,0x24,0x00,0x44,0x28,0x25,0x0c,0x00,0x06,0xbf,0x24,0x04,0x02,0x08, ++0x08,0x00,0x06,0x96,0x3c,0x02,0xff,0xff,0x0c,0x00,0x06,0xd1,0x24,0x04,0x02,0x08, ++0x00,0x40,0x28,0x21,0x00,0x02,0x15,0x82,0x30,0x42,0x00,0x03,0x24,0x03,0x00,0x03, ++0x14,0x43,0xff,0xdc,0x3c,0x03,0x00,0x80,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff, ++0x00,0xa2,0x10,0x24,0x08,0x00,0x06,0xae,0x00,0x43,0x28,0x25,0x30,0x83,0x00,0x03, ++0x00,0x04,0x20,0x40,0x00,0x83,0x20,0x23,0x3c,0x02,0xb0,0x0a,0x00,0x82,0x20,0x21, ++0x3c,0x06,0x00,0x01,0xac,0x85,0x00,0x00,0x24,0x07,0x00,0x01,0x00,0x00,0x28,0x21, ++0x34,0xc6,0x86,0x9f,0x8c,0x82,0x10,0x00,0x24,0xa5,0x00,0x01,0x10,0x47,0x00,0x03, ++0x00,0xc5,0x18,0x2b,0x10,0x60,0xff,0xfb,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0x83,0x00,0x03,0x00,0x04,0x20,0x40,0x3c,0x02,0xb0,0x0a, ++0x00,0x83,0x20,0x23,0x00,0x82,0x20,0x21,0x3c,0x06,0x00,0x01,0x24,0x02,0xff,0xff, ++0xac,0x82,0x10,0x00,0x00,0x00,0x28,0x21,0x24,0x07,0x00,0x01,0x34,0xc6,0x86,0x9f, ++0x8c,0x82,0x10,0x00,0x24,0xa5,0x00,0x01,0x10,0x47,0x00,0x03,0x00,0xc5,0x18,0x2b, ++0x10,0x60,0xff,0xfb,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x05,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x1b,0x94, ++0x24,0x03,0x00,0x01,0x34,0xa5,0x00,0x20,0x3c,0x06,0xb0,0x03,0xac,0xa2,0x00,0x00, ++0x34,0xc6,0x01,0x04,0xa0,0x83,0x00,0x48,0xa0,0x80,0x00,0x04,0xa0,0x80,0x00,0x05, ++0xa0,0x80,0x00,0x06,0xa0,0x80,0x00,0x07,0xa0,0x80,0x00,0x08,0xa0,0x80,0x00,0x09, ++0xa0,0x80,0x00,0x0a,0xa0,0x80,0x00,0x11,0xa0,0x80,0x00,0x13,0xa0,0x80,0x00,0x49, ++0x94,0xc2,0x00,0x00,0xac,0x80,0x00,0x00,0xa0,0x80,0x00,0x4e,0x00,0x02,0x14,0x00, ++0x00,0x02,0x14,0x03,0x30,0x43,0x00,0xff,0x30,0x42,0xff,0x00,0xa4,0x82,0x00,0x44, ++0xa4,0x83,0x00,0x46,0xac,0x80,0x00,0x24,0xac,0x80,0x00,0x28,0xac,0x80,0x00,0x2c, ++0xac,0x80,0x00,0x30,0xac,0x80,0x00,0x34,0xac,0x80,0x00,0x38,0xac,0x80,0x00,0x3c, ++0x03,0xe0,0x00,0x08,0xac,0x80,0x00,0x40,0x84,0x83,0x00,0x0c,0x3c,0x07,0xb0,0x03, ++0x34,0xe7,0x00,0x20,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x90,0x04,0x00,0x43,0x10,0x21,0x8c,0x48,0x00,0x18,0x3c,0x02,0x80,0x00, ++0x24,0x42,0x1c,0x28,0xac,0xe2,0x00,0x00,0x8d,0x03,0x00,0x08,0x80,0x82,0x00,0x13, ++0x00,0x05,0x2c,0x00,0x00,0x03,0x1e,0x02,0x00,0x02,0x12,0x00,0x30,0x63,0x00,0x7e, ++0x00,0x62,0x18,0x21,0x00,0x65,0x18,0x21,0x3c,0x02,0xc0,0x00,0x3c,0x05,0xb0,0x05, ++0x34,0x42,0x04,0x00,0x24,0x63,0x00,0x01,0x3c,0x07,0xb0,0x05,0x3c,0x08,0xb0,0x05, ++0x34,0xa5,0x04,0x20,0xac,0xa3,0x00,0x00,0x00,0xc2,0x30,0x21,0x34,0xe7,0x04,0x24, ++0x35,0x08,0x02,0x28,0x24,0x02,0x00,0x01,0x24,0x03,0x00,0x20,0xac,0xe6,0x00,0x00, ++0xac,0x82,0x00,0x3c,0x03,0xe0,0x00,0x08,0xa1,0x03,0x00,0x00,0x27,0xbd,0xff,0xa8, ++0x00,0x07,0x60,0x80,0x27,0x82,0xb4,0x00,0xaf,0xbe,0x00,0x50,0xaf,0xb7,0x00,0x4c, ++0xaf,0xb5,0x00,0x44,0xaf,0xb4,0x00,0x40,0xaf,0xbf,0x00,0x54,0xaf,0xb6,0x00,0x48, ++0xaf,0xb3,0x00,0x3c,0xaf,0xb2,0x00,0x38,0xaf,0xb1,0x00,0x34,0xaf,0xb0,0x00,0x30, ++0x01,0x82,0x10,0x21,0x8c,0x43,0x00,0x00,0x00,0xe0,0x70,0x21,0x3c,0x02,0x80,0x00, ++0x94,0x73,0x00,0x14,0x3c,0x07,0xb0,0x03,0x34,0xe7,0x00,0x20,0x24,0x42,0x1c,0xbc, ++0x3c,0x03,0xb0,0x05,0xac,0xe2,0x00,0x00,0x34,0x63,0x01,0x28,0x90,0x67,0x00,0x00, ++0x00,0x13,0xa8,0xc0,0x02,0xb3,0x18,0x21,0x27,0x82,0x90,0x04,0x00,0x03,0x18,0x80, ++0x00,0x62,0x18,0x21,0x00,0x05,0x2c,0x00,0x00,0x07,0x3e,0x00,0x28,0xc2,0x00,0x03, ++0x00,0xc0,0xa0,0x21,0x00,0x80,0x78,0x21,0x00,0x05,0xbc,0x03,0x8c,0x68,0x00,0x18, ++0x02,0xa0,0x58,0x21,0x10,0x40,0x01,0x81,0x00,0x07,0xf6,0x03,0x00,0xde,0x10,0x07, ++0x30,0x5e,0x00,0x01,0x01,0x73,0x10,0x21,0x27,0x83,0x90,0x08,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x80,0x4d,0x00,0x06,0x8d,0x03,0x00,0x00,0x8d,0x02,0x00,0x04, ++0x8d,0x0a,0x00,0x08,0x8d,0x03,0x00,0x0c,0xaf,0xa2,0x00,0x20,0x11,0xa0,0x01,0x71, ++0xaf,0xa3,0x00,0x18,0x27,0x82,0xb4,0x00,0x01,0x82,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x00,0x00,0x00,0x00,0x90,0x83,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x04, ++0x14,0x60,0x00,0x12,0x00,0x00,0xb0,0x21,0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x46, ++0x90,0x43,0x00,0x00,0x2a,0x84,0x00,0x04,0x10,0x80,0x01,0x56,0x30,0x65,0x00,0x01, ++0x91,0xe2,0x00,0x09,0x00,0x00,0x00,0x00,0x12,0x82,0x00,0x02,0x00,0x00,0x00,0x00, ++0x00,0x00,0x28,0x21,0x14,0xa0,0x00,0x03,0x00,0x00,0x38,0x21,0x13,0xc0,0x00,0x03, ++0x38,0xf6,0x00,0x01,0x24,0x07,0x00,0x01,0x38,0xf6,0x00,0x01,0x01,0x73,0x10,0x21, ++0x00,0x02,0x30,0x80,0x27,0x83,0x90,0x10,0x00,0xc3,0x48,0x21,0x91,0x25,0x00,0x00, ++0x8f,0xa4,0x00,0x20,0x2c,0xa3,0x00,0x04,0x00,0x04,0x11,0xc3,0x30,0x42,0x00,0x01, ++0x00,0x03,0xb0,0x0b,0x12,0xc0,0x00,0xd8,0xaf,0xa2,0x00,0x24,0x93,0x90,0xbb,0xea, ++0x00,0x0a,0x16,0x42,0x30,0x52,0x00,0x3f,0x2e,0x06,0x00,0x0c,0x10,0xc0,0x00,0xc0, ++0x00,0xa0,0x20,0x21,0x2c,0xa2,0x00,0x10,0x14,0x40,0x00,0x04,0x00,0x90,0x10,0x2b, ++0x30,0xa2,0x00,0x07,0x24,0x44,0x00,0x04,0x00,0x90,0x10,0x2b,0x10,0x40,0x00,0x0b, ++0x01,0x73,0x10,0x21,0x27,0x85,0xbb,0x1c,0x00,0x10,0x10,0x40,0x00,0x50,0x10,0x21, ++0x00,0x45,0x10,0x21,0x90,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x18,0x2b, ++0x14,0x60,0xff,0xfa,0x00,0x10,0x10,0x40,0x01,0x73,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x90,0x08,0x00,0x43,0x10,0x21,0x31,0xa4,0x00,0x01,0x10,0x80,0x00,0xa5, ++0xa0,0x50,0x00,0x07,0x3c,0x04,0xb0,0x05,0x34,0x84,0x00,0x08,0x24,0x02,0x00,0x01, ++0x3c,0x03,0x80,0x00,0xa1,0xe2,0x00,0x4e,0xac,0x83,0x00,0x00,0x8c,0x85,0x00,0x00, ++0x3c,0x02,0x00,0xf0,0x3c,0x03,0x40,0xf0,0x34,0x42,0xf0,0x00,0x34,0x63,0xf0,0x00, ++0x24,0x17,0x00,0x0e,0x24,0x13,0x01,0x06,0xac,0x82,0x00,0x00,0xac,0x83,0x00,0x00, ++0x27,0x82,0xb4,0x00,0x01,0x82,0x10,0x21,0x8c,0x43,0x00,0x00,0x24,0x05,0x00,0x01, ++0xaf,0xa5,0x00,0x1c,0x90,0x62,0x00,0x16,0x00,0x13,0xa8,0xc0,0x32,0x51,0x00,0x02, ++0x34,0x42,0x00,0x04,0xa0,0x62,0x00,0x16,0x8f,0xa3,0x00,0x20,0x8f,0xa4,0x00,0x18, ++0x00,0x03,0x13,0x43,0x00,0x04,0x1a,0x02,0x30,0x47,0x00,0x01,0x12,0x20,0x00,0x04, ++0x30,0x64,0x07,0xff,0x2e,0x03,0x00,0x04,0x32,0x42,0x00,0x33,0x00,0x43,0x90,0x0b, ++0x8f,0xa5,0x00,0x24,0x8f,0xa6,0x00,0x1c,0x00,0x12,0x10,0x40,0x00,0x05,0x19,0xc0, ++0x00,0x47,0x10,0x21,0x00,0x06,0x2a,0x80,0x00,0x43,0x10,0x21,0x00,0x10,0x32,0x00, ++0x00,0x04,0x24,0x80,0x02,0x65,0x28,0x21,0x00,0xa4,0x28,0x21,0x00,0x46,0x10,0x21, ++0x00,0x17,0x1c,0x00,0x3c,0x04,0xc0,0x00,0x00,0x43,0x30,0x21,0x16,0x80,0x00,0x29, ++0x00,0xa4,0x28,0x21,0x3c,0x02,0xb0,0x05,0x34,0x42,0x04,0x00,0x3c,0x03,0xb0,0x05, ++0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x04,0x34,0x84,0x02,0x28, ++0x24,0x02,0x00,0x01,0xac,0x65,0x00,0x00,0xa0,0x82,0x00,0x00,0x3c,0x02,0xb0,0x09, ++0x34,0x42,0x01,0x46,0x90,0x44,0x00,0x00,0x91,0xe3,0x00,0x09,0x30,0x86,0x00,0x01, ++0x02,0x83,0x18,0x26,0x00,0x03,0x30,0x0b,0x14,0xc0,0x00,0x03,0x00,0x00,0x28,0x21, ++0x13,0xc0,0x00,0x03,0x02,0xb3,0x10,0x21,0x24,0x05,0x00,0x01,0x02,0xb3,0x10,0x21, ++0x27,0x83,0x90,0x08,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x84,0x48,0x00,0x04, ++0x00,0xa0,0x30,0x21,0x00,0xe0,0x20,0x21,0x02,0x80,0x28,0x21,0x02,0xc0,0x38,0x21, ++0x0c,0x00,0x00,0x70,0xaf,0xa8,0x00,0x10,0x7b,0xbe,0x02,0xbc,0x7b,0xb6,0x02,0x7c, ++0x7b,0xb4,0x02,0x3c,0x7b,0xb2,0x01,0xfc,0x7b,0xb0,0x01,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x58,0x24,0x02,0x00,0x01,0x12,0x82,0x00,0x3d,0x3c,0x02,0xb0,0x05, ++0x24,0x02,0x00,0x02,0x12,0x82,0x00,0x31,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x03, ++0x12,0x82,0x00,0x25,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x10,0x12,0x82,0x00,0x19, ++0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x11,0x12,0x82,0x00,0x0d,0x3c,0x02,0xb0,0x05, ++0x24,0x02,0x00,0x12,0x16,0x82,0xff,0xd1,0x3c,0x02,0xb0,0x05,0x3c,0x03,0xb0,0x05, ++0x34,0x42,0x04,0x20,0x3c,0x04,0xb0,0x05,0x34,0x63,0x04,0x24,0xac,0x46,0x00,0x00, ++0x34,0x84,0x02,0x28,0xac,0x65,0x00,0x00,0x08,0x00,0x07,0xe6,0x24,0x02,0x00,0x20, ++0x34,0x42,0x04,0x40,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00, ++0x34,0x63,0x04,0x44,0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x40,0x08,0x00,0x07,0xe6, ++0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x28,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05, ++0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x2c,0x34,0x84,0x02,0x28,0x24,0x02,0xff,0x80, ++0x08,0x00,0x07,0xe6,0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x18,0x3c,0x03,0xb0,0x05, ++0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x1c,0x34,0x84,0x02,0x28, ++0x24,0x02,0x00,0x08,0x08,0x00,0x07,0xe6,0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x10, ++0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x14, ++0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x04,0x08,0x00,0x07,0xe6,0xac,0x65,0x00,0x00, ++0x34,0x42,0x04,0x08,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00, ++0x34,0x63,0x04,0x0c,0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x02,0x08,0x00,0x07,0xe6, ++0xac,0x65,0x00,0x00,0x24,0x17,0x00,0x14,0x08,0x00,0x07,0xb8,0x24,0x13,0x01,0x02, ++0x30,0xa2,0x00,0x07,0x24,0x44,0x00,0x0c,0x00,0x90,0x18,0x2b,0x10,0x60,0x00,0x0c, ++0x26,0x02,0x00,0x04,0x27,0x85,0xbb,0x1c,0x00,0x10,0x10,0x40,0x00,0x50,0x10,0x21, ++0x00,0x45,0x10,0x21,0x90,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x18,0x2b, ++0x14,0x60,0xff,0xfa,0x00,0x10,0x10,0x40,0x2e,0x06,0x00,0x0c,0x26,0x02,0x00,0x04, ++0x08,0x00,0x07,0xa2,0x00,0x46,0x80,0x0a,0x27,0x82,0xb4,0x00,0x01,0x82,0x20,0x21, ++0x8c,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xe2,0x00,0x19,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x07,0x00,0x00,0x00,0x00,0x27,0x82,0x90,0x20,0x00,0xc2,0x10,0x21, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x14,0x00,0x00,0x00,0x00, ++0x90,0xe3,0x00,0x16,0x27,0x82,0x90,0x08,0x00,0xc2,0x10,0x21,0x34,0x63,0x00,0x20, ++0x90,0x50,0x00,0x07,0xa0,0xe3,0x00,0x16,0x8c,0x84,0x00,0x00,0x00,0x0a,0x1e,0x42, ++0x24,0x06,0x00,0x01,0x90,0x82,0x00,0x16,0x30,0x71,0x00,0x02,0x30,0x72,0x00,0x3f, ++0x30,0x42,0x00,0xfb,0x24,0x17,0x00,0x18,0x24,0x13,0x01,0x03,0x24,0x15,0x08,0x18, ++0xaf,0xa6,0x00,0x1c,0x08,0x00,0x07,0xc2,0xa0,0x82,0x00,0x16,0x8d,0x02,0x00,0x04, ++0x00,0x0a,0x1c,0x42,0x30,0x42,0x00,0x10,0x14,0x40,0x00,0x15,0x30,0x72,0x00,0x3f, ++0x81,0x22,0x00,0x05,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x11,0x30,0x72,0x00,0x3e, ++0x27,0x83,0x90,0x18,0x00,0xc3,0x18,0x21,0x80,0x64,0x00,0x00,0x27,0x83,0xb5,0x78, ++0x00,0x04,0x11,0x00,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x05,0x90,0x43,0x00,0x04, ++0x00,0x00,0x00,0x00,0x00,0x64,0x18,0x24,0x30,0x63,0x00,0x01,0x02,0x43,0x90,0x25, ++0x27,0x85,0xb4,0x00,0x01,0x85,0x28,0x21,0x8c,0xa6,0x00,0x00,0x01,0x73,0x10,0x21, ++0x27,0x83,0x90,0x10,0x90,0xc4,0x00,0x16,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x30,0x84,0x00,0xdf,0x90,0x50,0x00,0x00,0xa0,0xc4,0x00,0x16,0x80,0xc6,0x00,0x12, ++0x8c,0xa3,0x00,0x00,0x2d,0xc4,0x00,0x02,0xaf,0xa6,0x00,0x1c,0x90,0x62,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfb,0x14,0x80,0x00,0x06,0xa0,0x62,0x00,0x16, ++0x24,0x02,0x00,0x06,0x11,0xc2,0x00,0x03,0x24,0x02,0x00,0x04,0x15,0xc2,0xff,0x0e, ++0x32,0x51,0x00,0x02,0x32,0x51,0x00,0x02,0x2e,0x02,0x00,0x0c,0x14,0x40,0x00,0x0f, ++0x00,0x11,0x18,0x2b,0x32,0x02,0x00,0x0f,0x34,0x42,0x00,0x10,0x00,0x03,0x19,0x00, ++0x00,0x43,0x18,0x21,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xe0,0xa0,0x43,0x00,0x00, ++0x00,0x00,0x20,0x21,0x02,0x00,0x28,0x21,0x0c,0x00,0x02,0x03,0xaf,0xaf,0x00,0x28, ++0x8f,0xaf,0x00,0x28,0x08,0x00,0x07,0xc2,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0xbd, ++0x32,0x03,0x00,0xff,0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x42,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x0f,0x14,0x40,0xfe,0xaa,0x00,0x00,0x00,0x00, ++0x91,0xe2,0x00,0x09,0x00,0x00,0x00,0x00,0x02,0x82,0x10,0x26,0x08,0x00,0x07,0x79, ++0x00,0x02,0x28,0x0b,0x08,0x00,0x07,0x7f,0x00,0x00,0xb0,0x21,0x24,0x02,0x00,0x10, ++0x10,0xc2,0x00,0x08,0x24,0x02,0x00,0x11,0x10,0xc2,0xfe,0x7d,0x00,0x07,0x17,0x83, ++0x24,0x02,0x00,0x12,0x14,0xc2,0xfe,0x7b,0x00,0x07,0x17,0x43,0x08,0x00,0x07,0x59, ++0x30,0x5e,0x00,0x01,0x08,0x00,0x07,0x59,0x00,0x07,0xf7,0xc2,0x00,0x04,0x10,0x40, ++0x27,0x83,0x80,0x1c,0x00,0x43,0x10,0x21,0x00,0x80,0x40,0x21,0x94,0x44,0x00,0x00, ++0x2d,0x07,0x00,0x04,0x24,0xc2,0x00,0x03,0x00,0x47,0x30,0x0a,0x00,0x86,0x00,0x18, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x23,0x8c, ++0xac,0x62,0x00,0x00,0x2d,0x06,0x00,0x10,0x00,0x00,0x20,0x12,0x00,0x04,0x22,0x42, ++0x24,0x84,0x00,0x01,0x24,0x83,0x00,0xc0,0x10,0xe0,0x00,0x0b,0x24,0x82,0x00,0x60, ++0x00,0x40,0x20,0x21,0x00,0x65,0x20,0x0a,0x3c,0x03,0xb0,0x03,0x34,0x63,0x01,0x00, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x00,0x44,0x20,0x04, ++0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x24,0x85,0x00,0x28,0x24,0x83,0x00,0x24, ++0x31,0x02,0x00,0x08,0x14,0xc0,0xff,0xf4,0x24,0x84,0x00,0x14,0x00,0x60,0x20,0x21, ++0x08,0x00,0x08,0xfa,0x00,0xa2,0x20,0x0b,0x27,0xbd,0xff,0xe0,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0xaf,0xb0,0x00,0x10,0x24,0x42,0x24,0x28,0x00,0x80,0x80,0x21, ++0x34,0x63,0x00,0x20,0x3c,0x04,0xb0,0x03,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xbf,0x00,0x1c,0x83,0xb1,0x00,0x33,0x83,0xa8,0x00,0x37,0x34,0x84,0x01,0x10, ++0xac,0x62,0x00,0x00,0x2e,0x02,0x00,0x10,0x00,0xe0,0x90,0x21,0x8c,0x87,0x00,0x00, ++0x14,0x40,0x00,0x0c,0x2e,0x02,0x00,0x0c,0x3c,0x02,0x00,0x0f,0x34,0x42,0xf0,0x00, ++0x00,0xe2,0x10,0x24,0x14,0x40,0x00,0x37,0x32,0x02,0x00,0x08,0x32,0x02,0x00,0x07, ++0x27,0x83,0x80,0xcc,0x00,0x43,0x10,0x21,0x90,0x50,0x00,0x00,0x00,0x00,0x00,0x00, ++0x2e,0x02,0x00,0x0c,0x14,0x40,0x00,0x03,0x02,0x00,0x20,0x21,0x32,0x02,0x00,0x0f, ++0x24,0x44,0x00,0x0c,0x00,0x87,0x10,0x06,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0x07, ++0x2c,0x82,0x00,0x0c,0x00,0x04,0x10,0x80,0x27,0x83,0xb4,0x50,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x82,0x00,0x0c,0x14,0x40,0x00,0x05, ++0x00,0x05,0x10,0x40,0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0x82,0x10,0x21, ++0x24,0x44,0x00,0x04,0x15,0x00,0x00,0x02,0x24,0x06,0x00,0x20,0x24,0x06,0x00,0x0e, ++0x0c,0x00,0x08,0xe3,0x00,0x00,0x00,0x00,0x00,0x40,0x30,0x21,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x00,0x90,0x43,0x00,0x00,0x2e,0x04,0x00,0x04,0x24,0x02,0x00,0x10, ++0x24,0x05,0x00,0x0a,0x00,0x44,0x28,0x0a,0x30,0x63,0x00,0x01,0x14,0x60,0x00,0x02, ++0x00,0x05,0x10,0x40,0x00,0xa0,0x10,0x21,0x30,0x45,0x00,0xff,0x00,0xc5,0x10,0x21, ++0x24,0x46,0x00,0x46,0x02,0x26,0x18,0x04,0xa6,0x43,0x00,0x00,0x8f,0xbf,0x00,0x1c, ++0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x00,0xc0,0x10,0x21,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x10,0x40,0xff,0xcf,0x2e,0x02,0x00,0x0c,0x32,0x02,0x00,0x07, ++0x27,0x83,0x80,0xc4,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x00,0x08,0x00,0x09,0x28, ++0x02,0x04,0x80,0x23,0x27,0xbd,0xff,0xb8,0x00,0x05,0x38,0x80,0x27,0x82,0xb4,0x00, ++0xaf,0xbe,0x00,0x40,0xaf,0xb6,0x00,0x38,0xaf,0xb3,0x00,0x2c,0xaf,0xbf,0x00,0x44, ++0xaf,0xb7,0x00,0x3c,0xaf,0xb5,0x00,0x34,0xaf,0xb4,0x00,0x30,0xaf,0xb2,0x00,0x28, ++0xaf,0xb1,0x00,0x24,0xaf,0xb0,0x00,0x20,0x00,0xe2,0x38,0x21,0x8c,0xe6,0x00,0x00, ++0xaf,0xa5,0x00,0x4c,0x3c,0x02,0x80,0x00,0x3c,0x05,0xb0,0x03,0x34,0xa5,0x00,0x20, ++0x24,0x42,0x25,0x84,0x24,0x03,0x00,0x01,0xac,0xa2,0x00,0x00,0xa0,0xc3,0x00,0x12, ++0x8c,0xe5,0x00,0x00,0x94,0xc3,0x00,0x06,0x90,0xa2,0x00,0x16,0xa4,0xc3,0x00,0x14, ++0x27,0x83,0x90,0x00,0x34,0x42,0x00,0x08,0xa0,0xa2,0x00,0x16,0x8c,0xe8,0x00,0x00, ++0xaf,0xa4,0x00,0x48,0x27,0x82,0x90,0x04,0x95,0x11,0x00,0x14,0x00,0x00,0x00,0x00, ++0x00,0x11,0x98,0xc0,0x02,0x71,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x82,0x10,0x21, ++0x8c,0x52,0x00,0x18,0x00,0x83,0x18,0x21,0x84,0x75,0x00,0x06,0x8e,0x45,0x00,0x08, ++0x8e,0x46,0x00,0x04,0x8e,0x47,0x00,0x04,0x00,0x05,0x1c,0x82,0x00,0x06,0x31,0x42, ++0x27,0x82,0x90,0x10,0x30,0x63,0x00,0x01,0x30,0xc6,0x00,0x01,0x00,0x82,0x20,0x21, ++0xa5,0x15,0x00,0x1a,0x00,0x05,0x14,0x42,0xaf,0xa3,0x00,0x18,0xaf,0xa6,0x00,0x1c, ++0x30,0xe7,0x00,0x10,0x30,0x56,0x00,0x01,0x80,0x97,0x00,0x06,0x14,0xe0,0x00,0x47, ++0x00,0x05,0xf7,0xc2,0x80,0x82,0x00,0x05,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x44, ++0x02,0x71,0x10,0x21,0x93,0x90,0xbb,0xe9,0x00,0x00,0x00,0x00,0x2e,0x02,0x00,0x0c, ++0x14,0x40,0x00,0x06,0x02,0x00,0x20,0x21,0x00,0x16,0x10,0x40,0x00,0x43,0x10,0x21, ++0x00,0x02,0x11,0x00,0x02,0x02,0x10,0x21,0x24,0x44,0x00,0x04,0x02,0x71,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0x00,0x80,0x80,0x21, ++0xa0,0x44,0x00,0x03,0xa0,0x44,0x00,0x00,0x02,0x00,0x20,0x21,0x02,0xc0,0x28,0x21, ++0x0c,0x00,0x08,0xe3,0x02,0xa0,0x30,0x21,0x02,0x71,0x18,0x21,0x00,0x03,0x88,0x80, ++0x00,0x40,0xa0,0x21,0x27,0x82,0x90,0x20,0x02,0x22,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x26,0xe3,0x00,0x02,0x00,0x03,0x17,0xc2,0x00,0x62,0x18,0x21,0x00,0x04,0x25,0xc2, ++0x00,0x03,0x18,0x43,0x30,0x84,0x00,0x01,0x00,0x03,0x18,0x40,0x03,0xc4,0x20,0x24, ++0x14,0x80,0x00,0x15,0x02,0x43,0x38,0x21,0x3c,0x08,0xb0,0x03,0x35,0x08,0x00,0x28, ++0x8d,0x03,0x00,0x00,0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x48,0x27,0x82,0x90,0x08, ++0x02,0x22,0x10,0x21,0x24,0x63,0x00,0x01,0x02,0xa0,0x28,0x21,0xa4,0x54,0x00,0x04, ++0x00,0xc0,0x38,0x21,0x0c,0x00,0x07,0x2f,0xad,0x03,0x00,0x00,0x7b,0xbe,0x02,0x3c, ++0x7b,0xb6,0x01,0xfc,0x7b,0xb4,0x01,0xbc,0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x48,0x8f,0xa2,0x00,0x1c,0x8f,0xa6,0x00,0x18, ++0x02,0x00,0x20,0x21,0x02,0xc0,0x28,0x21,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0x0a, ++0xaf,0xa0,0x00,0x14,0x08,0x00,0x09,0xc6,0x02,0x82,0xa0,0x21,0x02,0x71,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0x90,0x50,0x00,0x00, ++0x08,0x00,0x09,0xb2,0xa0,0x50,0x00,0x03,0x27,0xbd,0xff,0xb8,0xaf,0xb1,0x00,0x24, ++0x8f,0xb1,0x00,0x5c,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20, ++0x24,0x42,0x27,0xa8,0xaf,0xbe,0x00,0x40,0xaf,0xb7,0x00,0x3c,0xaf,0xb6,0x00,0x38, ++0xaf,0xb5,0x00,0x34,0xaf,0xb4,0x00,0x30,0xaf,0xa5,0x00,0x4c,0x8f,0xb5,0x00,0x58, ++0xaf,0xbf,0x00,0x44,0xaf,0xb3,0x00,0x2c,0xaf,0xb2,0x00,0x28,0xaf,0xb0,0x00,0x20, ++0x00,0xe0,0xb0,0x21,0xac,0x62,0x00,0x00,0x00,0x80,0xf0,0x21,0x00,0x00,0xb8,0x21, ++0x16,0x20,0x00,0x2b,0x00,0x00,0xa0,0x21,0x27,0x85,0xb4,0x00,0x00,0x07,0x10,0x80, ++0x00,0x45,0x10,0x21,0x8c,0x53,0x00,0x00,0x00,0x15,0x18,0x80,0x00,0x65,0x18,0x21, ++0x92,0x62,0x00,0x16,0x8c,0x72,0x00,0x00,0x30,0x42,0x00,0x03,0x14,0x40,0x00,0x2d, ++0x00,0x00,0x00,0x00,0x92,0x42,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x03, ++0x14,0x40,0x00,0x28,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x34,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x18,0x02,0x20,0x10,0x21,0x8c,0x82,0x00,0x38,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x14,0x02,0x20,0x10,0x21,0x8c,0x82,0x00,0x3c,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x0f,0x3c,0x03,0xb0,0x09,0x3c,0x05,0xb0,0x05,0x34,0x63,0x01,0x44, ++0x34,0xa5,0x02,0x52,0x94,0x66,0x00,0x00,0x90,0xa2,0x00,0x00,0x8f,0xa3,0x00,0x4c, ++0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x06,0x30,0x42,0x00,0x01,0x10,0x40,0x00,0x04, ++0x30,0xc6,0xff,0xff,0x2c,0xc2,0x00,0x41,0x10,0x40,0x00,0x09,0x24,0x05,0x00,0x14, ++0x02,0x20,0x10,0x21,0x7b,0xbe,0x02,0x3c,0x7b,0xb6,0x01,0xfc,0x7b,0xb4,0x01,0xbc, ++0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x48, ++0x0c,0x00,0x07,0x0a,0x24,0x06,0x01,0x07,0x24,0x02,0x00,0x01,0x08,0x00,0x0a,0x2c, ++0xa3,0xc2,0x00,0x11,0x10,0xc0,0x00,0x1c,0x24,0x02,0x00,0x01,0x10,0xc2,0x00,0x17, ++0x00,0xc0,0x88,0x21,0x96,0x54,0x00,0x1a,0x02,0xa0,0xb8,0x21,0x12,0x20,0xff,0xed, ++0x02,0x20,0x10,0x21,0x27,0x83,0xb4,0x00,0x00,0x17,0x10,0x80,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x28,0x80,0x86,0x00,0x12, ++0x8c,0x62,0x00,0x00,0x00,0x14,0x2c,0x00,0x00,0x05,0x2c,0x03,0x00,0x46,0x10,0x21, ++0x8f,0xa6,0x00,0x4c,0x02,0xe0,0x38,0x21,0x03,0xc0,0x20,0x21,0x0c,0x00,0x07,0x2f, ++0xac,0x62,0x00,0x00,0x08,0x00,0x0a,0x2c,0xaf,0xd1,0x00,0x40,0x96,0x74,0x00,0x1a, ++0x08,0x00,0x0a,0x3f,0x02,0xc0,0xb8,0x21,0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08, ++0x8c,0x50,0x00,0x00,0x02,0x60,0x20,0x21,0x0c,0x00,0x1e,0xf3,0x02,0x00,0x28,0x21, ++0x30,0x42,0x00,0xff,0x02,0x00,0x28,0x21,0x02,0x40,0x20,0x21,0x0c,0x00,0x1e,0xf3, ++0xaf,0xa2,0x00,0x18,0x8f,0xa4,0x00,0x18,0x00,0x00,0x00,0x00,0x10,0x80,0x00,0xed, ++0x30,0x50,0x00,0xff,0x12,0x00,0x00,0x18,0x24,0x11,0x00,0x01,0x96,0x63,0x00,0x14, ++0x96,0x44,0x00,0x14,0x27,0x85,0x90,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21,0x00,0x04,0x18,0xc0,0x8c,0x46,0x00,0x08, ++0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x65,0x18,0x21,0x00,0x06,0x17,0x02, ++0x24,0x04,0x00,0xff,0x8c,0x63,0x00,0x08,0x10,0x44,0x00,0xd6,0x00,0x03,0x17,0x02, ++0x10,0x44,0x00,0xd5,0x3c,0x02,0x80,0x00,0x00,0x66,0x18,0x2b,0x24,0x11,0x00,0x02, ++0x24,0x02,0x00,0x01,0x00,0x43,0x88,0x0a,0x24,0x02,0x00,0x01,0x12,0x22,0x00,0x5a, ++0x24,0x02,0x00,0x02,0x16,0x22,0xff,0xbd,0x00,0x00,0x00,0x00,0x96,0x49,0x00,0x14, ++0x27,0x82,0x90,0x04,0x02,0xa0,0xb8,0x21,0x00,0x09,0x50,0xc0,0x01,0x49,0x18,0x21, ++0x00,0x03,0x40,0x80,0x01,0x02,0x10,0x21,0x8c,0x43,0x00,0x18,0x00,0x00,0x00,0x00, ++0x8c,0x65,0x00,0x08,0x8c,0x62,0x00,0x0c,0x8c,0x62,0x00,0x04,0x00,0x05,0x24,0x42, ++0x00,0x05,0x1c,0x82,0x30,0x42,0x00,0x10,0x30,0x66,0x00,0x01,0x14,0x40,0x00,0x41, ++0x30,0x87,0x00,0x01,0x27,0x82,0x90,0x18,0x01,0x02,0x10,0x21,0x80,0x44,0x00,0x00, ++0x27,0x82,0xb5,0x78,0x00,0x04,0x19,0x00,0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80, ++0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21,0x90,0x45,0x00,0x05, ++0x27,0x84,0xb4,0xa0,0x00,0x64,0x18,0x21,0x90,0x63,0x00,0x00,0x10,0xa0,0x00,0x2b, ++0x2c,0x64,0x00,0x0c,0x14,0x80,0x00,0x04,0x00,0x60,0x10,0x21,0x00,0x06,0x11,0x00, ++0x00,0x62,0x10,0x21,0x24,0x42,0x00,0x24,0x3c,0x01,0xb0,0x03,0xa0,0x22,0x00,0xe1, ++0x14,0x80,0x00,0x06,0x00,0x60,0x28,0x21,0x00,0x07,0x10,0x40,0x00,0x46,0x10,0x21, ++0x00,0x02,0x11,0x00,0x00,0x62,0x10,0x21,0x24,0x45,0x00,0x04,0x01,0x49,0x10,0x21, ++0x27,0x83,0x90,0x10,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0xa0,0x18,0x21, ++0xa0,0x45,0x00,0x03,0xa0,0x45,0x00,0x00,0x24,0x02,0x00,0x08,0x12,0x02,0x00,0x0b, ++0x24,0x02,0x00,0x01,0x00,0x60,0x28,0x21,0x02,0x40,0x20,0x21,0x0c,0x00,0x1f,0x6f, ++0xaf,0xa2,0x00,0x10,0x30,0x54,0xff,0xff,0x92,0x42,0x00,0x16,0x00,0x00,0x00,0x00, ++0x02,0x02,0x10,0x25,0x08,0x00,0x0a,0x3f,0xa2,0x42,0x00,0x16,0x00,0x60,0x28,0x21, ++0x02,0x40,0x20,0x21,0x0c,0x00,0x1f,0x20,0xaf,0xa0,0x00,0x10,0x08,0x00,0x0a,0xc2, ++0x30,0x54,0xff,0xff,0x08,0x00,0x0a,0xaa,0x00,0x60,0x10,0x21,0x14,0x80,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21,0x08,0x00,0x0a,0xaa, ++0x24,0x42,0x00,0x04,0x27,0x82,0x90,0x10,0x01,0x02,0x10,0x21,0x90,0x43,0x00,0x00, ++0x08,0x00,0x0a,0xba,0xa0,0x43,0x00,0x03,0x96,0x69,0x00,0x14,0x02,0xc0,0xb8,0x21, ++0x24,0x0b,0x00,0x01,0x00,0x09,0x10,0xc0,0x00,0x49,0x18,0x21,0x00,0x03,0x40,0x80, ++0x00,0x40,0x50,0x21,0x27,0x82,0x90,0x04,0x01,0x02,0x10,0x21,0x8c,0x43,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x65,0x00,0x08,0x8c,0x62,0x00,0x0c,0x8c,0x62,0x00,0x04, ++0x00,0x05,0x24,0x42,0x00,0x05,0x1c,0x82,0x30,0x42,0x00,0x10,0x30,0x66,0x00,0x01, ++0x10,0x40,0x00,0x0d,0x30,0x87,0x00,0x01,0x27,0x82,0x90,0x18,0x01,0x02,0x10,0x21, ++0x80,0x43,0x00,0x00,0x00,0x00,0x58,0x21,0x00,0x03,0x11,0x00,0x00,0x43,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x23,0x00,0x02,0x10,0x80,0x27,0x83,0xb5,0x70, ++0x00,0x43,0x10,0x21,0xa0,0x40,0x00,0x04,0x11,0x60,0x00,0x4f,0x00,0x00,0x00,0x00, ++0x01,0x49,0x10,0x21,0x00,0x02,0x20,0x80,0x27,0x85,0x90,0x10,0x00,0x85,0x10,0x21, ++0x80,0x43,0x00,0x05,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x42,0x01,0x49,0x10,0x21, ++0x27,0x82,0x90,0x18,0x00,0x82,0x10,0x21,0x80,0x44,0x00,0x00,0x27,0x82,0xb5,0x78, ++0x00,0x04,0x19,0x00,0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80,0x00,0x64,0x18,0x23, ++0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21,0x90,0x45,0x00,0x05,0x27,0x84,0xb4,0xa0, ++0x00,0x64,0x18,0x21,0x90,0x63,0x00,0x00,0x10,0xa0,0x00,0x2c,0x2c,0x64,0x00,0x0c, ++0x14,0x80,0x00,0x04,0x00,0x60,0x10,0x21,0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21, ++0x24,0x42,0x00,0x24,0x3c,0x01,0xb0,0x03,0xa0,0x22,0x00,0xe1,0x14,0x80,0x00,0x06, ++0x00,0x60,0x28,0x21,0x00,0x07,0x10,0x40,0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00, ++0x00,0x62,0x10,0x21,0x24,0x45,0x00,0x04,0x01,0x49,0x10,0x21,0x27,0x83,0x90,0x10, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0xa0,0x18,0x21,0xa0,0x45,0x00,0x03, ++0xa0,0x45,0x00,0x00,0x8f,0xa4,0x00,0x18,0x24,0x02,0x00,0x08,0x10,0x82,0x00,0x0c, ++0x00,0x60,0x28,0x21,0x24,0x02,0x00,0x01,0x02,0x60,0x20,0x21,0x0c,0x00,0x1f,0x6f, ++0xaf,0xa2,0x00,0x10,0x8f,0xa3,0x00,0x18,0x30,0x54,0xff,0xff,0x92,0x62,0x00,0x16, ++0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x25,0x08,0x00,0x0a,0x3f,0xa2,0x62,0x00,0x16, ++0x02,0x60,0x20,0x21,0x0c,0x00,0x1f,0x20,0xaf,0xa0,0x00,0x10,0x08,0x00,0x0b,0x31, ++0x00,0x00,0x00,0x00,0x08,0x00,0x0b,0x19,0x00,0x60,0x10,0x21,0x14,0x80,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21,0x08,0x00,0x0b,0x19, ++0x24,0x42,0x00,0x04,0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21,0x90,0x43,0x00,0x00, ++0x08,0x00,0x0b,0x29,0xa0,0x43,0x00,0x03,0x27,0x85,0x90,0x10,0x08,0x00,0x0b,0x45, ++0x01,0x49,0x10,0x21,0x3c,0x02,0x80,0x00,0x00,0x62,0x18,0x26,0x08,0x00,0x0a,0x7a, ++0x00,0xc2,0x30,0x26,0x12,0x00,0xff,0x2d,0x24,0x02,0x00,0x01,0x08,0x00,0x0a,0x7f, ++0x24,0x11,0x00,0x02,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xd0, ++0x24,0x42,0x2d,0x54,0x34,0x63,0x00,0x20,0x3c,0x05,0xb0,0x05,0xaf,0xb3,0x00,0x24, ++0xaf,0xb2,0x00,0x20,0xaf,0xb1,0x00,0x1c,0xaf,0xbf,0x00,0x28,0xaf,0xb0,0x00,0x18, ++0xac,0x62,0x00,0x00,0x34,0xa5,0x02,0x42,0x90,0xa2,0x00,0x00,0x00,0x80,0x90,0x21, ++0x24,0x11,0x00,0x10,0x30,0x53,0x00,0xff,0x24,0x02,0x00,0x10,0x12,0x22,0x00,0xcf, ++0x00,0x00,0x18,0x21,0x24,0x02,0x00,0x11,0x12,0x22,0x00,0xc1,0x24,0x02,0x00,0x12, ++0x12,0x22,0x00,0xb4,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0xad,0xae,0x43,0x00,0x40, ++0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c,0x8c,0x44,0x00,0x00,0x3c,0x03,0x00,0x02, ++0x34,0x63,0x00,0xff,0x00,0x83,0x80,0x24,0x00,0x10,0x14,0x43,0x10,0x40,0x00,0x05, ++0x00,0x00,0x00,0x00,0x8e,0x42,0x00,0x34,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x92, ++0x00,0x00,0x00,0x00,0x93,0x83,0x8b,0x71,0x00,0x00,0x00,0x00,0x30,0x62,0x00,0x02, ++0x10,0x40,0x00,0x04,0x32,0x10,0x00,0xff,0x00,0x10,0x11,0xc3,0x14,0x40,0x00,0x86, ++0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x15,0x02,0x00,0x10,0x21,0x26,0x22,0x00,0x01, ++0x30,0x51,0x00,0xff,0x2e,0x23,0x00,0x13,0x14,0x60,0xff,0xdb,0x24,0x03,0x00,0x02, ++0x12,0x63,0x00,0x73,0x24,0x02,0x00,0x05,0x2a,0x62,0x00,0x03,0x10,0x40,0x00,0x58, ++0x24,0x02,0x00,0x04,0x24,0x02,0x00,0x01,0x12,0x62,0x00,0x4b,0x02,0x40,0x20,0x21, ++0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x70,0x00,0xff,0x12,0x00,0x00,0x06,0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x28, ++0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30, ++0x92,0x46,0x00,0x04,0x8e,0x43,0x00,0x24,0x24,0x02,0x00,0x07,0x02,0x40,0x20,0x21, ++0x00,0x00,0x28,0x21,0x24,0x07,0x00,0x06,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0xea, ++0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x24,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x02,0x2c, ++0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xec,0x02,0x00,0x10,0x21, ++0x92,0x46,0x00,0x05,0x8e,0x43,0x00,0x28,0x24,0x02,0x00,0x05,0x02,0x40,0x20,0x21, ++0x24,0x05,0x00,0x01,0x24,0x07,0x00,0x04,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0xea, ++0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x28,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x02,0x2c, ++0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xdc,0x02,0x00,0x10,0x21, ++0x92,0x46,0x00,0x06,0x8e,0x43,0x00,0x2c,0x24,0x02,0x00,0x03,0x02,0x40,0x20,0x21, ++0x24,0x05,0x00,0x02,0x00,0x00,0x38,0x21,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0xea, ++0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x2c,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x02,0x2c, ++0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xcc,0x02,0x00,0x10,0x21, ++0x92,0x46,0x00,0x07,0x8e,0x43,0x00,0x30,0x24,0x02,0x00,0x02,0x02,0x40,0x20,0x21, ++0x24,0x05,0x00,0x03,0x24,0x07,0x00,0x01,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0xea, ++0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x30,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x02,0x2c, ++0x08,0x00,0x0b,0x9b,0x30,0x42,0x00,0xff,0x92,0x46,0x00,0x04,0x8e,0x43,0x00,0x24, ++0x24,0x02,0x00,0x07,0x00,0x00,0x28,0x21,0x24,0x07,0x00,0x06,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x09,0xea,0xaf,0xa3,0x00,0x14,0x08,0x00,0x0b,0x94,0xae,0x42,0x00,0x24, ++0x12,0x62,0x00,0x0d,0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x08,0x16,0x62,0xff,0xa8, ++0x02,0x40,0x20,0x21,0x92,0x46,0x00,0x07,0x8e,0x42,0x00,0x30,0x24,0x05,0x00,0x03, ++0x24,0x07,0x00,0x01,0xaf,0xa3,0x00,0x10,0x0c,0x00,0x09,0xea,0xaf,0xa2,0x00,0x14, ++0x08,0x00,0x0b,0x94,0xae,0x42,0x00,0x30,0x92,0x46,0x00,0x06,0x8e,0x43,0x00,0x2c, ++0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x02,0x00,0x00,0x38,0x21,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x09,0xea,0xaf,0xa3,0x00,0x14,0x08,0x00,0x0b,0x94,0xae,0x42,0x00,0x2c, ++0x92,0x46,0x00,0x05,0x8e,0x43,0x00,0x28,0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x01, ++0x24,0x07,0x00,0x04,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x09,0xea,0xaf,0xa3,0x00,0x14, ++0x08,0x00,0x0b,0x94,0xae,0x42,0x00,0x28,0x0c,0x00,0x01,0x57,0x24,0x04,0x00,0x01, ++0x08,0x00,0x0b,0x85,0x00,0x00,0x00,0x00,0x8f,0x84,0xb4,0x40,0xae,0x40,0x00,0x34, ++0x94,0x85,0x00,0x14,0x0c,0x00,0x1b,0x66,0x00,0x00,0x00,0x00,0x93,0x83,0x8b,0x71, ++0x00,0x00,0x00,0x00,0x30,0x62,0x00,0x02,0x10,0x40,0xff,0x69,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x01,0x57,0x00,0x00,0x20,0x21,0x08,0x00,0x0b,0x7d,0x00,0x00,0x00,0x00, ++0x02,0x40,0x20,0x21,0x0c,0x00,0x09,0x61,0x02,0x20,0x28,0x21,0x08,0x00,0x0b,0x71, ++0x3c,0x02,0xb0,0x05,0x8e,0x42,0x00,0x3c,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x4a, ++0x00,0x00,0x00,0x00,0x8f,0x82,0xb4,0x48,0x00,0x00,0x00,0x00,0x90,0x42,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x2b,0x08,0x00,0x0b,0x6e,0xae,0x43,0x00,0x3c, ++0x8e,0x42,0x00,0x38,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x3d,0x24,0x02,0x00,0x12, ++0x8f,0x82,0xb4,0x44,0x00,0x00,0x00,0x00,0x90,0x42,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x00,0x02,0x18,0x2b,0x08,0x00,0x0b,0x6e,0xae,0x43,0x00,0x38,0x8e,0x42,0x00,0x34, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x30,0x24,0x02,0x00,0x11,0x8f,0x82,0xb4,0x40, ++0x00,0x00,0x00,0x00,0x90,0x42,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x2b, ++0x08,0x00,0x0b,0x6e,0xae,0x43,0x00,0x34,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x27,0xbd,0xff,0xe0,0x34,0x63,0x00,0x20,0x24,0x42,0x31,0x08,0x3c,0x08,0xb0,0x03, ++0xaf,0xb1,0x00,0x14,0xac,0x62,0x00,0x00,0x35,0x08,0x01,0x00,0xaf,0xbf,0x00,0x18, ++0xaf,0xb0,0x00,0x10,0x91,0x03,0x00,0x00,0x00,0xa0,0x48,0x21,0x24,0x11,0x00,0x0a, ++0x2c,0xa5,0x00,0x04,0x24,0x02,0x00,0x10,0x00,0x45,0x88,0x0a,0x30,0x63,0x00,0x01, ++0x00,0xc0,0x28,0x21,0x14,0x60,0x00,0x02,0x00,0x11,0x40,0x40,0x02,0x20,0x40,0x21, ++0x84,0x83,0x00,0x0c,0x31,0x11,0x00,0xff,0x01,0x20,0x20,0x21,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x08,0x00,0x43,0x10,0x21, ++0x84,0x43,0x00,0x04,0x24,0x06,0x00,0x0e,0x10,0xe0,0x00,0x06,0x02,0x23,0x80,0x21, ++0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x0c,0x00,0x08,0xe3,0x00,0x00,0x00,0x00,0x02,0x11,0x18,0x21, ++0x08,0x00,0x0c,0x64,0x00,0x62,0x80,0x21,0x27,0xbd,0xff,0xd0,0xaf,0xbf,0x00,0x28, ++0xaf,0xb4,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb5,0x00,0x24, ++0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0x84,0x82,0x00,0x0c,0x3c,0x06,0xb0,0x03, ++0x34,0xc6,0x00,0x20,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80, ++0x27,0x82,0x90,0x04,0x00,0x62,0x10,0x21,0x8c,0x55,0x00,0x18,0x3c,0x02,0x80,0x00, ++0x24,0x42,0x31,0xb8,0xac,0xc2,0x00,0x00,0x8e,0xb0,0x00,0x08,0x27,0x82,0x90,0x08, ++0x00,0x62,0x18,0x21,0x90,0x71,0x00,0x07,0x00,0x10,0x86,0x43,0x32,0x10,0x00,0x01, ++0x00,0xa0,0x38,0x21,0x02,0x00,0x30,0x21,0x00,0xa0,0x98,0x21,0x02,0x20,0x28,0x21, ++0x0c,0x00,0x0c,0x42,0x00,0x80,0x90,0x21,0x02,0x20,0x20,0x21,0x02,0x00,0x28,0x21, ++0x24,0x06,0x00,0x14,0x0c,0x00,0x08,0xe3,0x00,0x40,0xa0,0x21,0x86,0x43,0x00,0x0c, ++0x3c,0x09,0xb0,0x09,0x3c,0x08,0xb0,0x09,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0x80,0x43,0x00,0x06, ++0x3c,0x07,0xb0,0x09,0x3c,0x05,0xb0,0x09,0x28,0x62,0x00,0x00,0x24,0x64,0x00,0x03, ++0x00,0x82,0x18,0x0b,0x00,0x03,0x18,0x83,0x3c,0x02,0xb0,0x09,0x00,0x03,0x18,0x80, ++0x34,0x42,0x01,0x02,0x35,0x29,0x01,0x10,0x35,0x08,0x01,0x14,0x34,0xe7,0x01,0x20, ++0x34,0xa5,0x01,0x24,0xa4,0x54,0x00,0x00,0x12,0x60,0x00,0x11,0x02,0xa3,0xa8,0x21, ++0x8e,0xa2,0x00,0x0c,0x8e,0xa3,0x00,0x08,0x00,0x02,0x14,0x00,0x00,0x03,0x1c,0x02, ++0x00,0x43,0x10,0x21,0xad,0x22,0x00,0x00,0x8e,0xa3,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x03,0x1c,0x02,0xa5,0x03,0x00,0x00,0x8f,0xbf,0x00,0x28,0x7b,0xb4,0x01,0x3c, ++0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30, ++0x8e,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0xad,0x22,0x00,0x00,0x8e,0xa4,0x00,0x08, ++0x00,0x00,0x00,0x00,0xa5,0x04,0x00,0x00,0x7a,0xa2,0x00,0x7c,0x00,0x00,0x00,0x00, ++0x00,0x03,0x1c,0x00,0x00,0x02,0x14,0x02,0x00,0x62,0x18,0x21,0xac,0xe3,0x00,0x00, ++0x8e,0xa2,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x02,0x14,0x02,0x08,0x00,0x0c,0xb6, ++0xa4,0xa2,0x00,0x00,0x27,0xbd,0xff,0xe0,0xaf,0xb2,0x00,0x18,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x1c,0xaf,0xb1,0x00,0x14,0x84,0x82,0x00,0x0c,0x00,0x80,0x90,0x21, ++0x3c,0x05,0xb0,0x03,0x00,0x02,0x20,0xc0,0x00,0x82,0x20,0x21,0x00,0x04,0x20,0x80, ++0x27,0x82,0x90,0x04,0x00,0x82,0x10,0x21,0x8c,0x51,0x00,0x18,0x3c,0x02,0x80,0x00, ++0x34,0xa5,0x00,0x20,0x24,0x42,0x33,0x34,0x27,0x83,0x90,0x08,0xac,0xa2,0x00,0x00, ++0x00,0x83,0x20,0x21,0x3c,0x02,0xb0,0x03,0x90,0x86,0x00,0x07,0x34,0x42,0x01,0x00, ++0x8e,0x23,0x00,0x08,0x90,0x44,0x00,0x00,0x2c,0xc5,0x00,0x04,0x24,0x02,0x00,0x10, ++0x24,0x10,0x00,0x0a,0x00,0x45,0x80,0x0a,0x00,0x03,0x1e,0x43,0x30,0x84,0x00,0x01, ++0x30,0x65,0x00,0x01,0x14,0x80,0x00,0x02,0x00,0x10,0x10,0x40,0x02,0x00,0x10,0x21, ++0x00,0xc0,0x20,0x21,0x24,0x06,0x00,0x20,0x0c,0x00,0x08,0xe3,0x30,0x50,0x00,0xff, ++0x86,0x44,0x00,0x0c,0x27,0x85,0x90,0x10,0x3c,0x06,0xb0,0x09,0x00,0x04,0x18,0xc0, ++0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x65,0x18,0x21,0x80,0x64,0x00,0x06, ++0x00,0x50,0x10,0x21,0x34,0xc6,0x01,0x02,0x24,0x85,0x00,0x03,0x28,0x83,0x00,0x00, ++0x00,0xa3,0x20,0x0b,0x00,0x04,0x20,0x83,0x00,0x04,0x20,0x80,0xa4,0xc2,0x00,0x00, ++0x02,0x24,0x20,0x21,0x8c,0x83,0x00,0x04,0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x10, ++0xac,0x43,0x00,0x00,0x8c,0x86,0x00,0x08,0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x14, ++0xa4,0x46,0x00,0x00,0x8c,0x85,0x00,0x0c,0x8c,0x82,0x00,0x08,0x3c,0x06,0xb0,0x09, ++0x00,0x05,0x2c,0x00,0x00,0x02,0x14,0x02,0x00,0xa2,0x28,0x21,0x34,0xc6,0x01,0x20, ++0xac,0xc5,0x00,0x00,0x8c,0x83,0x00,0x0c,0x3c,0x05,0xb0,0x09,0x34,0xa5,0x01,0x24, ++0x00,0x03,0x1c,0x02,0xa4,0xa3,0x00,0x00,0x92,0x42,0x00,0x0a,0x3c,0x03,0xb0,0x09, ++0x34,0x63,0x01,0x30,0x00,0x02,0x13,0x00,0x24,0x42,0x00,0x04,0x30,0x42,0xff,0xff, ++0xa4,0x62,0x00,0x00,0x86,0x44,0x00,0x0c,0x27,0x83,0x90,0x18,0x8f,0xbf,0x00,0x1c, ++0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x94,0x44,0x00,0x02,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x3c,0x05,0xb0,0x09, ++0x34,0xa5,0x01,0x32,0xa4,0xa4,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x27,0xbd,0xff,0xe0,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x00,0xaf,0xb0,0x00,0x10, ++0x34,0x42,0x00,0x20,0x00,0xa0,0x80,0x21,0x24,0x63,0x34,0xc0,0x00,0x05,0x2c,0x43, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x18,0xac,0x43,0x00,0x00,0x10,0xa0,0x00,0x05, ++0x00,0x80,0x88,0x21,0x8c,0x82,0x00,0x34,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0xb6, ++0x00,0x00,0x00,0x00,0x32,0x10,0x00,0xff,0x12,0x00,0x00,0x4c,0x00,0x00,0x10,0x21, ++0x24,0x02,0x00,0x08,0x12,0x02,0x00,0xa3,0x2a,0x02,0x00,0x09,0x10,0x40,0x00,0x89, ++0x24,0x02,0x00,0x40,0x24,0x04,0x00,0x02,0x12,0x04,0x00,0x79,0x2a,0x02,0x00,0x03, ++0x10,0x40,0x00,0x69,0x24,0x02,0x00,0x04,0x24,0x02,0x00,0x01,0x12,0x02,0x00,0x5a, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x05,0x34,0x42,0x00,0x08,0x3c,0x03,0x80,0x00, ++0xa2,0x20,0x00,0x4e,0xac,0x43,0x00,0x00,0x82,0x24,0x00,0x11,0x92,0x27,0x00,0x11, ++0x10,0x80,0x00,0x4e,0x00,0x00,0x00,0x00,0x92,0x26,0x00,0x0a,0x24,0x02,0x00,0x12, ++0x10,0x46,0x00,0x09,0x30,0xc2,0x00,0xff,0x27,0x83,0xb4,0x00,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x83,0x00,0x14, ++0x00,0x00,0x00,0x00,0xa6,0x23,0x00,0x0c,0x3c,0x02,0xb0,0x09,0x34,0x42,0x00,0x40, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x03,0xa2,0x23,0x00,0x10, ++0x14,0x60,0x00,0x2b,0x30,0x65,0x00,0x01,0x30,0xc2,0x00,0xff,0x27,0x83,0xb4,0x00, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x82,0x23,0x00,0x12, ++0x90,0x82,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x42,0x30,0x42,0x00,0x01, ++0x00,0x62,0x18,0x21,0x00,0x03,0x26,0x00,0x14,0x80,0x00,0x18,0xa2,0x23,0x00,0x12, ++0x00,0x07,0x16,0x00,0x14,0x40,0x00,0x11,0x24,0x02,0x00,0x01,0x96,0x23,0x00,0x0c, ++0x27,0x84,0x90,0x10,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x44,0x10,0x21,0x80,0x45,0x00,0x06,0x00,0x03,0x1a,0x00,0x3c,0x02,0xb0,0x00, ++0x00,0x65,0x18,0x21,0x00,0x62,0x18,0x21,0x90,0x64,0x00,0x00,0x90,0x62,0x00,0x04, ++0xa2,0x20,0x00,0x15,0xa3,0x80,0x8b,0xd4,0x24,0x02,0x00,0x01,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x0c,0xcd, ++0x02,0x20,0x20,0x21,0x92,0x27,0x00,0x11,0x08,0x00,0x0d,0x7d,0x00,0x07,0x16,0x00, ++0x0c,0x00,0x0c,0x6e,0x02,0x20,0x20,0x21,0x86,0x23,0x00,0x0c,0x27,0x84,0x90,0x08, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x44,0x20,0x21, ++0x90,0x85,0x00,0x07,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0xa2,0x25,0x00,0x13, ++0x90,0x83,0x00,0x07,0x08,0x00,0x0d,0x95,0xa0,0x43,0x00,0x02,0x92,0x26,0x00,0x0a, ++0x08,0x00,0x0d,0x5e,0x30,0xc2,0x00,0xff,0x8e,0x22,0x00,0x24,0x00,0x00,0x00,0x00, ++0x10,0x50,0x00,0x07,0xa2,0x20,0x00,0x08,0x24,0x02,0x00,0x07,0xa2,0x22,0x00,0x0a, ++0x92,0x22,0x00,0x27,0xae,0x20,0x00,0x24,0x08,0x00,0x0d,0x51,0xa2,0x22,0x00,0x04, ++0x08,0x00,0x0d,0xaf,0x24,0x02,0x00,0x06,0x16,0x02,0xff,0x9b,0x3c,0x02,0xb0,0x05, ++0x8e,0x23,0x00,0x2c,0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x07,0xa2,0x24,0x00,0x08, ++0x24,0x02,0x00,0x03,0xa2,0x22,0x00,0x0a,0x92,0x22,0x00,0x2f,0xae,0x20,0x00,0x2c, ++0x08,0x00,0x0d,0x51,0xa2,0x22,0x00,0x06,0x08,0x00,0x0d,0xbe,0xa2,0x20,0x00,0x0a, ++0x8e,0x22,0x00,0x28,0x24,0x03,0x00,0x01,0x24,0x04,0x00,0x01,0x10,0x44,0x00,0x07, ++0xa2,0x23,0x00,0x08,0x24,0x02,0x00,0x05,0xa2,0x22,0x00,0x0a,0x92,0x22,0x00,0x2b, ++0xae,0x20,0x00,0x28,0x08,0x00,0x0d,0x51,0xa2,0x22,0x00,0x05,0x08,0x00,0x0d,0xca, ++0x24,0x02,0x00,0x04,0x12,0x02,0x00,0x12,0x2a,0x02,0x00,0x41,0x10,0x40,0x00,0x09, ++0x24,0x02,0x00,0x80,0x24,0x02,0x00,0x20,0x16,0x02,0xff,0x7b,0x3c,0x02,0xb0,0x05, ++0x24,0x02,0x00,0x12,0xa2,0x22,0x00,0x0a,0xa2,0x22,0x00,0x08,0x08,0x00,0x0d,0x51, ++0xae,0x20,0x00,0x3c,0x16,0x02,0xff,0x74,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x10, ++0xa2,0x22,0x00,0x0a,0xa2,0x22,0x00,0x08,0x08,0x00,0x0d,0x51,0xae,0x20,0x00,0x34, ++0x24,0x02,0x00,0x11,0xa2,0x22,0x00,0x0a,0xa2,0x22,0x00,0x08,0x08,0x00,0x0d,0x51, ++0xae,0x20,0x00,0x38,0x8e,0x24,0x00,0x30,0x24,0x02,0x00,0x03,0x24,0x03,0x00,0x01, ++0x10,0x83,0x00,0x07,0xa2,0x22,0x00,0x08,0x24,0x02,0x00,0x02,0xa2,0x22,0x00,0x0a, ++0x92,0x22,0x00,0x33,0xae,0x20,0x00,0x30,0x08,0x00,0x0d,0x51,0xa2,0x22,0x00,0x07, ++0x08,0x00,0x0d,0xf0,0xa2,0x24,0x00,0x0a,0x8f,0x84,0xb4,0x40,0xae,0x20,0x00,0x34, ++0x94,0x85,0x00,0x14,0x0c,0x00,0x1b,0x66,0x32,0x10,0x00,0xff,0x08,0x00,0x0d,0x42, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x37,0xf4, ++0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00,0x80,0xa2,0x00,0x15,0x3c,0x06,0xb0,0x05, ++0x10,0x40,0x00,0x0a,0x34,0xc6,0x02,0x54,0x83,0x83,0x8b,0xd4,0x00,0x00,0x00,0x00, ++0xac,0x83,0x00,0x24,0x8c,0xc2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x17,0x42, ++0x30,0x42,0x00,0x01,0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x28,0x8c,0x82,0x00,0x2c, ++0x3c,0x06,0xb0,0x05,0x34,0xc6,0x04,0x50,0x00,0x02,0x18,0x43,0x30,0x63,0x00,0x01, ++0x10,0x40,0x00,0x04,0x30,0x45,0x00,0x01,0xac,0x83,0x00,0x28,0x03,0xe0,0x00,0x08, ++0xac,0x85,0x00,0x24,0x90,0xc2,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0x30,0x43,0x00,0x02,0x30,0x42,0x00,0x01,0xac,0x83,0x00,0x28,0x03,0xe0,0x00,0x08, ++0xac,0x82,0x00,0x24,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xd8, ++0x34,0x63,0x00,0x20,0x24,0x42,0x38,0x84,0xac,0x62,0x00,0x00,0xaf,0xb1,0x00,0x1c, ++0xaf,0xbf,0x00,0x20,0xaf,0xb0,0x00,0x18,0x90,0xa6,0x00,0x0a,0x27,0x83,0xb4,0x00, ++0x00,0xa0,0x88,0x21,0x00,0x06,0x10,0x80,0x00,0x43,0x10,0x21,0x8c,0x50,0x00,0x00, ++0x80,0xa5,0x00,0x11,0x92,0x03,0x00,0x12,0x10,0xa0,0x00,0x04,0xa2,0x20,0x00,0x15, ++0x24,0x02,0x00,0x12,0x10,0xc2,0x00,0xda,0x00,0x00,0x00,0x00,0x82,0x22,0x00,0x12, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x67,0x00,0x00,0x00,0x00,0xa2,0x20,0x00,0x12, ++0xa2,0x00,0x00,0x19,0x86,0x23,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x20,0x00,0x43,0x10,0x21, ++0xa0,0x40,0x00,0x00,0x92,0x03,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0xdf, ++0xa2,0x03,0x00,0x16,0x82,0x02,0x00,0x12,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x20, ++0x00,0x00,0x00,0x00,0x92,0x23,0x00,0x08,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x45, ++0x24,0x02,0x00,0x01,0xa2,0x20,0x00,0x04,0x92,0x08,0x00,0x04,0x00,0x00,0x00,0x00, ++0x15,0x00,0x00,0x1e,0x24,0x02,0x00,0x01,0x92,0x07,0x00,0x0a,0xa2,0x02,0x00,0x17, ++0x92,0x02,0x00,0x16,0x30,0xe3,0x00,0xff,0x30,0x42,0x00,0xe4,0x10,0x60,0x00,0x03, ++0xa2,0x02,0x00,0x16,0x34,0x42,0x00,0x01,0xa2,0x02,0x00,0x16,0x11,0x00,0x00,0x05, ++0x00,0x00,0x00,0x00,0x92,0x02,0x00,0x16,0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02, ++0xa2,0x02,0x00,0x16,0x92,0x02,0x00,0x17,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x08, ++0x00,0x00,0x00,0x00,0x96,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0xa6,0x02,0x00,0x14, ++0x8f,0xbf,0x00,0x20,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28, ++0x96,0x02,0x00,0x00,0x08,0x00,0x0e,0x6c,0xa6,0x02,0x00,0x14,0x92,0x07,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x14,0xe0,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,0x0e,0x58, ++0xa2,0x00,0x00,0x17,0x96,0x04,0x00,0x00,0x96,0x05,0x00,0x06,0x27,0x86,0x90,0x00, ++0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x05,0x10,0xc0,0x00,0x45,0x10,0x21, ++0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21,0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21, ++0x8c,0x66,0x00,0x08,0x8c,0x45,0x00,0x08,0x3c,0x03,0x80,0x00,0x00,0xc3,0x20,0x24, ++0x10,0x80,0x00,0x08,0x00,0xa3,0x10,0x24,0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21, ++0x10,0x80,0x00,0x02,0x24,0x03,0x00,0x01,0x00,0xa6,0x18,0x2b,0x08,0x00,0x0e,0x58, ++0xa2,0x03,0x00,0x17,0x10,0x40,0xff,0xfd,0x00,0xa6,0x18,0x2b,0x08,0x00,0x0e,0x8c, ++0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x09,0x24,0x02,0x00,0x02,0x10,0x62,0x00,0x05, ++0x24,0x02,0x00,0x03,0x14,0x62,0xff,0xb8,0x00,0x00,0x00,0x00,0x08,0x00,0x0e,0x52, ++0xa2,0x20,0x00,0x07,0x08,0x00,0x0e,0x52,0xa2,0x20,0x00,0x06,0x08,0x00,0x0e,0x52, ++0xa2,0x20,0x00,0x05,0x82,0x22,0x00,0x10,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x69, ++0x2c,0x62,0x00,0x02,0x10,0x40,0x00,0x49,0x3c,0x02,0xb0,0x09,0x92,0x25,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa6,0x00,0xff,0x2c,0xc2,0x00,0x04,0x10,0x40,0x00,0x3b, ++0x2c,0xc2,0x00,0x10,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x24,0x02,0x00,0x01,0x00,0xc2,0x10,0x04,0x00,0x02,0x10,0x27,0x00,0x62,0x18,0x24, ++0xa0,0x83,0x00,0x00,0x86,0x23,0x00,0x0c,0x96,0x26,0x00,0x0c,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x28,0x80,0x27,0x83,0x90,0x04,0x00,0xa3,0x18,0x21, ++0x8c,0x64,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x04,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x10,0x10,0x40,0x00,0x18,0x24,0x07,0x00,0x01,0x93,0x82,0x8b,0x71, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0x0a,0x24,0x05,0x00,0x24, ++0x00,0x06,0x2c,0x00,0x00,0x05,0x2c,0x03,0x0c,0x00,0x1b,0x66,0x02,0x00,0x20,0x21, ++0x92,0x02,0x00,0x16,0xa2,0x00,0x00,0x12,0x30,0x42,0x00,0xe7,0x08,0x00,0x0e,0x49, ++0xa2,0x02,0x00,0x16,0xf0,0xc5,0x00,0x06,0x00,0x00,0x28,0x12,0x27,0x82,0x90,0x00, ++0x00,0xa2,0x28,0x21,0x0c,0x00,0x01,0x49,0x3c,0x04,0x00,0x80,0x96,0x26,0x00,0x0c, ++0x08,0x00,0x0e,0xc9,0x00,0x06,0x2c,0x00,0x27,0x83,0x90,0x10,0x27,0x82,0x90,0x18, ++0x00,0xa2,0x10,0x21,0x00,0xa3,0x18,0x21,0x90,0x44,0x00,0x00,0x90,0x65,0x00,0x05, ++0x93,0x82,0x80,0x10,0x00,0x00,0x30,0x21,0x0c,0x00,0x21,0x9a,0xaf,0xa2,0x00,0x10, ++0x96,0x26,0x00,0x0c,0x08,0x00,0x0e,0xc3,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xcd, ++0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x30,0xa5,0x00,0x0f, ++0x24,0x02,0x00,0x80,0x08,0x00,0x0e,0xb2,0x00,0xa2,0x10,0x07,0x86,0x26,0x00,0x0c, ++0x3c,0x03,0xb0,0x09,0x34,0x42,0x01,0x72,0x34,0x63,0x01,0x78,0x94,0x47,0x00,0x00, ++0x8c,0x65,0x00,0x00,0x00,0x06,0x10,0xc0,0x00,0x46,0x10,0x21,0x3c,0x04,0xb0,0x09, ++0xae,0x25,0x00,0x1c,0x34,0x84,0x01,0x7c,0x27,0x83,0x90,0x04,0x00,0x02,0x10,0x80, ++0x8c,0x85,0x00,0x00,0x00,0x43,0x10,0x21,0x8c,0x43,0x00,0x18,0xae,0x25,0x00,0x20, ++0xa6,0x27,0x00,0x18,0x8c,0x66,0x00,0x08,0x02,0x20,0x20,0x21,0x0c,0x00,0x0f,0x19, ++0x00,0x00,0x28,0x21,0x86,0x25,0x00,0x18,0x8e,0x26,0x00,0x1c,0x8e,0x27,0x00,0x20, ++0x02,0x20,0x20,0x21,0x0c,0x00,0x1c,0x68,0xaf,0xa2,0x00,0x10,0x08,0x00,0x0e,0x49, ++0xa2,0x02,0x00,0x12,0x92,0x22,0x00,0x08,0x08,0x00,0x0e,0x49,0xa2,0x22,0x00,0x09, ++0xa2,0x20,0x00,0x11,0x80,0x82,0x00,0x50,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0,0xac,0x40,0x00,0x00,0x08,0x00,0x0e,0x49, ++0xa0,0x80,0x00,0x50,0x94,0x8a,0x00,0x0c,0x24,0x03,0x00,0x24,0x00,0x80,0x70,0x21, ++0x3c,0x02,0x80,0x00,0x3c,0x04,0xb0,0x03,0x24,0x42,0x3c,0x64,0xf1,0x43,0x00,0x06, ++0x34,0x84,0x00,0x20,0x00,0x00,0x18,0x12,0x00,0xa0,0x68,0x21,0xac,0x82,0x00,0x00, ++0x27,0x85,0x90,0x10,0x27,0x82,0x90,0x0f,0x27,0xbd,0xff,0xf8,0x00,0x62,0x60,0x21, ++0x00,0x65,0x58,0x21,0x00,0x00,0xc0,0x21,0x11,0xa0,0x00,0xcc,0x00,0x00,0x78,0x21, ++0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21,0x91,0x87,0x00,0x00,0x80,0x48,0x00,0x04, ++0x03,0xa0,0x60,0x21,0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x48,0x80,0x27,0x83,0x90,0x04,0xa3,0xa7,0x00,0x00, ++0x01,0x23,0x18,0x21,0x8c,0x64,0x00,0x18,0x25,0x02,0xff,0xff,0x00,0x48,0x40,0x0b, ++0x8c,0x83,0x00,0x04,0x2d,0x05,0x00,0x07,0x24,0x02,0x00,0x06,0x30,0x63,0x00,0x08, ++0x14,0x60,0x00,0x35,0x00,0x45,0x40,0x0a,0x93,0xa7,0x00,0x00,0x27,0x82,0x90,0x18, ++0x01,0x22,0x10,0x21,0x30,0xe3,0x00,0xf0,0x38,0x63,0x00,0x50,0x30,0xe5,0x00,0xff, ++0x00,0x05,0x20,0x2b,0x00,0x03,0x18,0x2b,0x00,0x64,0x18,0x24,0x90,0x49,0x00,0x00, ++0x10,0x60,0x00,0x16,0x30,0xe4,0x00,0x0f,0x24,0x02,0x00,0x04,0x10,0xa2,0x00,0x9d, ++0x00,0x00,0x00,0x00,0x11,0xa0,0x00,0x3a,0x2c,0xa2,0x00,0x0c,0x10,0x40,0x00,0x02, ++0x24,0x84,0x00,0x0c,0x00,0xe0,0x20,0x21,0x30,0x84,0x00,0xff,0x00,0x04,0x10,0x40, ++0x27,0x83,0xbb,0x1c,0x00,0x44,0x10,0x21,0x00,0x43,0x10,0x21,0x90,0x47,0x00,0x00, ++0x00,0x00,0x00,0x00,0x2c,0xe3,0x00,0x0c,0xa3,0xa7,0x00,0x00,0x10,0x60,0x00,0x02, ++0x24,0xe2,0x00,0x04,0x00,0xe0,0x10,0x21,0xa3,0xa2,0x00,0x00,0x91,0x65,0x00,0x00, ++0x91,0x82,0x00,0x00,0x30,0xa3,0x00,0xff,0x00,0x62,0x10,0x2b,0x10,0x40,0x00,0x0e, ++0x2c,0x62,0x00,0x0c,0x14,0x40,0x00,0x03,0x00,0x60,0x20,0x21,0x30,0xa2,0x00,0x0f, ++0x24,0x44,0x00,0x0c,0x00,0x04,0x10,0x40,0x00,0x44,0x20,0x21,0x27,0x83,0xbb,0x1c, ++0x00,0x83,0x18,0x21,0x90,0x62,0x00,0x02,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x05, ++0x00,0x09,0x11,0x00,0xa1,0x85,0x00,0x00,0x93,0xa2,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x08,0x00,0x49,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21,0x27,0x83,0xb4,0xa8,0x00,0x43,0x10,0x21, ++0x90,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x83,0x00,0x0c,0x14,0x60,0x00,0x06, ++0x00,0x80,0x10,0x21,0x00,0x18,0x10,0x40,0x00,0x4f,0x10,0x21,0x00,0x02,0x11,0x00, ++0x00,0x82,0x10,0x21,0x24,0x42,0x00,0x04,0x08,0x00,0x0f,0x7a,0xa1,0x82,0x00,0x00, ++0x8f,0x8d,0x81,0x5c,0x00,0x00,0x00,0x00,0x01,0xa8,0x10,0x21,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x10,0x60,0xff,0xd1,0x00,0x00,0x28,0x21,0x00,0x06,0x74,0x82, ++0x30,0xe2,0x00,0xff,0x2c,0x42,0x00,0x0c,0x14,0x40,0x00,0x03,0x00,0xe0,0x10,0x21, ++0x30,0xe2,0x00,0x0f,0x24,0x42,0x00,0x0c,0x30,0x44,0x00,0xff,0xa3,0xa2,0x00,0x00, ++0x24,0x02,0x00,0x0c,0x10,0x82,0x00,0x0d,0x00,0x09,0x11,0x00,0x00,0x49,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x04,0x18,0x40,0x00,0x49,0x10,0x23,0x00,0x64,0x18,0x21, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x27,0x84,0xb4,0xa8,0x00,0x44,0x10,0x21, ++0x90,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0xa3,0xa7,0x00,0x00,0x00,0x0a,0x1c,0x00, ++0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x90,0x04,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x18,0x00,0x00,0x00,0x00, ++0x8c,0x83,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x10,0x14,0x60,0x00,0x33, ++0x00,0x06,0x14,0x42,0x00,0x09,0x11,0x00,0x00,0x49,0x10,0x23,0x00,0x02,0x10,0x80, ++0x00,0x49,0x10,0x23,0x27,0x83,0xb5,0x78,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x90,0x44,0x00,0x04,0x90,0x43,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x64,0xc0,0x24, ++0x93,0xa7,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xe2,0x00,0x0f,0x10,0x40,0x00,0x0f, ++0x31,0xcf,0x00,0x01,0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x84,0x90,0x00,0x00,0x44,0x10,0x21, ++0x84,0x43,0x00,0x06,0x00,0x00,0x00,0x00,0x28,0x63,0x06,0x41,0x14,0x60,0x00,0x04, ++0x30,0xe2,0x00,0xff,0x24,0x07,0x00,0x0f,0xa3,0xa7,0x00,0x00,0x30,0xe2,0x00,0xff, ++0x2c,0x42,0x00,0x0c,0x14,0x40,0x00,0x06,0x00,0xe0,0x10,0x21,0x00,0x18,0x10,0x40, ++0x00,0x4f,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0x47,0x10,0x21,0x24,0x42,0x00,0x04, ++0xa3,0xa2,0x00,0x00,0x00,0x40,0x38,0x21,0x01,0xa8,0x10,0x21,0x90,0x43,0x00,0x00, ++0x24,0xa4,0x00,0x01,0x30,0x85,0xff,0xff,0x00,0xa3,0x18,0x2b,0x14,0x60,0xff,0xad, ++0x30,0xe2,0x00,0xff,0x08,0x00,0x0f,0x67,0x00,0x00,0x00,0x00,0x08,0x00,0x0f,0xc8, ++0x30,0x58,0x00,0x01,0x81,0xc2,0x00,0x48,0x00,0x00,0x00,0x00,0x10,0x40,0xff,0x73, ++0x00,0x00,0x00,0x00,0x08,0x00,0x0f,0x55,0x00,0x00,0x00,0x00,0x00,0x0a,0x1c,0x00, ++0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x45,0x10,0x21,0x80,0x48,0x00,0x05,0x91,0x67,0x00,0x00,0x08,0x00,0x0f,0x35, ++0x03,0xa0,0x58,0x21,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20, ++0x24,0x42,0x40,0x04,0x03,0xe0,0x00,0x08,0xac,0x62,0x00,0x00,0x27,0xbd,0xff,0xc0, ++0xaf,0xb7,0x00,0x34,0xaf,0xb6,0x00,0x30,0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28, ++0xaf,0xb3,0x00,0x24,0xaf,0xb2,0x00,0x20,0xaf,0xbf,0x00,0x3c,0xaf,0xbe,0x00,0x38, ++0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18,0x84,0x82,0x00,0x0c,0x27,0x93,0x90,0x04, ++0x3c,0x05,0xb0,0x03,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80, ++0x00,0x73,0x10,0x21,0x8c,0x5e,0x00,0x18,0x3c,0x02,0x80,0x00,0x34,0xa5,0x00,0x20, ++0x24,0x42,0x40,0x1c,0xac,0xa2,0x00,0x00,0x8f,0xd0,0x00,0x08,0x27,0x95,0x90,0x10, ++0x00,0x75,0x18,0x21,0x00,0x00,0x28,0x21,0x02,0x00,0x30,0x21,0x90,0x71,0x00,0x00, ++0x0c,0x00,0x0f,0x19,0x00,0x80,0xb0,0x21,0x00,0x40,0x90,0x21,0x00,0x10,0x14,0x42, ++0x30,0x54,0x00,0x01,0x02,0x40,0x20,0x21,0x00,0x10,0x14,0x82,0x02,0x80,0x28,0x21, ++0x12,0x51,0x00,0x23,0x00,0x10,0xbf,0xc2,0x86,0xc3,0x00,0x0c,0x30,0x50,0x00,0x01, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x55,0x10,0x21, ++0xa0,0x52,0x00,0x00,0x86,0xc3,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x53,0x30,0x21,0x8c,0xc7,0x00,0x18, ++0x27,0x83,0x90,0x00,0x00,0x43,0x10,0x21,0x8c,0xe3,0x00,0x04,0x84,0x46,0x00,0x06, ++0x00,0x03,0x19,0x42,0x0c,0x00,0x08,0xe3,0x30,0x73,0x00,0x01,0x00,0x40,0x88,0x21, ++0x02,0x40,0x20,0x21,0x02,0x80,0x28,0x21,0x16,0xe0,0x00,0x10,0x02,0x00,0x30,0x21, ++0x86,0xc2,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21, ++0x00,0x03,0x18,0x80,0x27,0x82,0x90,0x08,0x00,0x62,0x18,0x21,0xa4,0x71,0x00,0x04, ++0x7b,0xbe,0x01,0xfc,0x7b,0xb6,0x01,0xbc,0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c, ++0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40,0x86,0xc3,0x00,0x0c, ++0xaf,0xb3,0x00,0x10,0xaf,0xa0,0x00,0x14,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x55,0x10,0x21,0x80,0x47,0x00,0x06,0x00,0x00,0x00,0x00, ++0x24,0xe7,0x00,0x02,0x00,0x07,0x17,0xc2,0x00,0xe2,0x38,0x21,0x00,0x07,0x38,0x43, ++0x00,0x07,0x38,0x40,0x0c,0x00,0x09,0x0a,0x03,0xc7,0x38,0x21,0x08,0x00,0x10,0x48, ++0x02,0x22,0x88,0x21,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xd0, ++0x34,0x63,0x00,0x20,0x24,0x42,0x41,0xa4,0xaf,0xb2,0x00,0x20,0xac,0x62,0x00,0x00, ++0xaf,0xbf,0x00,0x28,0xaf,0xb3,0x00,0x24,0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18, ++0x3c,0x02,0xb0,0x03,0x90,0x83,0x00,0x0a,0x34,0x42,0x01,0x04,0x94,0x45,0x00,0x00, ++0x00,0x03,0x18,0x80,0x27,0x82,0xb4,0x00,0x00,0x62,0x18,0x21,0x30,0xa6,0xff,0xff, ++0x8c,0x71,0x00,0x00,0x80,0x85,0x00,0x12,0x30,0xc9,0x00,0xff,0x00,0x06,0x32,0x02, ++0xa4,0x86,0x00,0x44,0xa4,0x89,0x00,0x46,0x82,0x22,0x00,0x12,0x00,0x80,0x90,0x21, ++0x10,0xa0,0x00,0x1b,0xa0,0x80,0x00,0x15,0x00,0xc5,0x10,0x2a,0x10,0x40,0x00,0x14, ++0x00,0x00,0x00,0x00,0xa2,0x20,0x00,0x19,0x84,0x83,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x20, ++0x00,0x43,0x10,0x21,0xa0,0x40,0x00,0x00,0xa0,0x80,0x00,0x12,0x92,0x22,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xdf,0xa2,0x22,0x00,0x16,0x8f,0xbf,0x00,0x28, ++0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30, ++0x0c,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x97,0x00,0x00,0x00,0x00, ++0x28,0x42,0x00,0x02,0x10,0x40,0x01,0x76,0x00,0x00,0x28,0x21,0x94,0x87,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x00,0xe0,0x10,0x21,0x00,0x02,0x14,0x00,0x00,0x02,0x14,0x03, ++0x00,0x07,0x24,0x00,0x00,0x04,0x24,0x03,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21, ++0x00,0x04,0x28,0xc0,0x00,0xa4,0x28,0x21,0x27,0x82,0x90,0x20,0x00,0x03,0x18,0x80, ++0x00,0x62,0x18,0x21,0x00,0x05,0x28,0x80,0x27,0x82,0x90,0x08,0x00,0xa2,0x10,0x21, ++0x8c,0x68,0x00,0x00,0x80,0x44,0x00,0x06,0x27,0x82,0x90,0x10,0x00,0x08,0x1d,0x02, ++0x00,0xa2,0x28,0x21,0x38,0x84,0x00,0x00,0x30,0x63,0x00,0x01,0x01,0x24,0x30,0x0b, ++0x80,0xaa,0x00,0x04,0x80,0xa9,0x00,0x05,0x10,0x60,0x00,0x02,0x00,0x08,0x14,0x02, ++0x30,0x46,0x00,0x0f,0x15,0x20,0x00,0x28,0x01,0x49,0x10,0x21,0x15,0x40,0x00,0x11, ++0x30,0xe3,0xff,0xff,0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa8,0x00,0xff, ++0x2d,0x02,0x00,0x04,0x10,0x40,0x01,0x46,0x2d,0x02,0x00,0x10,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x24,0x02,0x00,0x01,0x01,0x02,0x10,0x04, ++0x00,0x62,0x18,0x25,0xa0,0x83,0x00,0x00,0x96,0x47,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x30,0xe3,0xff,0xff,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x27,0x84,0x90,0x10, ++0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21,0x80,0x45,0x00,0x06,0x00,0x03,0x1a,0x00, ++0x3c,0x04,0xb0,0x00,0x00,0x65,0x18,0x21,0x00,0x64,0x20,0x21,0x94,0x82,0x00,0x00, ++0x82,0x43,0x00,0x10,0x00,0x02,0x14,0x00,0x14,0x60,0x00,0x06,0x00,0x02,0x3c,0x03, ++0x30,0xe2,0x00,0x04,0x14,0x40,0x00,0x04,0x01,0x49,0x10,0x21,0x34,0xe2,0x08,0x00, ++0xa4,0x82,0x00,0x00,0x01,0x49,0x10,0x21,0x00,0x02,0x16,0x00,0x00,0x02,0x16,0x03, ++0x00,0x46,0x10,0x2a,0x10,0x40,0x00,0x7c,0x00,0x00,0x00,0x00,0x82,0x42,0x00,0x10, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0e,0x00,0x00,0x00,0x00,0x86,0x43,0x00,0x0c, ++0x25,0x44,0x00,0x01,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0xa0,0x44,0x00,0x04,0x92,0x23,0x00,0x16, ++0x02,0x40,0x20,0x21,0x30,0x63,0x00,0xfb,0x08,0x00,0x10,0x9c,0xa2,0x23,0x00,0x16, ++0x86,0x43,0x00,0x0c,0x25,0x24,0x00,0x01,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21,0xa0,0x44,0x00,0x05, ++0x86,0x45,0x00,0x0c,0x0c,0x00,0x1e,0xea,0x02,0x20,0x20,0x21,0x10,0x40,0x00,0x5a, ++0x00,0x00,0x00,0x00,0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa6,0x00,0xff, ++0x2c,0xc2,0x00,0x04,0x10,0x40,0x00,0x4c,0x2c,0xc2,0x00,0x10,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x24,0x02,0x00,0x01,0x00,0xc2,0x10,0x04, ++0x00,0x02,0x10,0x27,0x00,0x62,0x18,0x24,0xa0,0x83,0x00,0x00,0x92,0x45,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa5,0x00,0xff,0x14,0xa0,0x00,0x33,0x24,0x02,0x00,0x01, ++0xa2,0x40,0x00,0x04,0x92,0x22,0x00,0x04,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x0c, ++0x24,0x02,0x00,0x01,0xa2,0x22,0x00,0x17,0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x96,0x22,0x00,0x06,0x08,0x00,0x10,0x97, ++0xa6,0x22,0x00,0x14,0x96,0x22,0x00,0x00,0x08,0x00,0x10,0x97,0xa6,0x22,0x00,0x14, ++0x92,0x22,0x00,0x0a,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x03,0x00,0x00,0x00,0x00, ++0x08,0x00,0x11,0x26,0xa2,0x20,0x00,0x17,0x96,0x24,0x00,0x00,0x96,0x25,0x00,0x06, ++0x27,0x86,0x90,0x00,0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x05,0x10,0xc0, ++0x00,0x45,0x10,0x21,0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21,0x00,0x02,0x10,0x80, ++0x00,0x46,0x10,0x21,0x8c,0x65,0x00,0x08,0x8c,0x44,0x00,0x08,0x3c,0x03,0x80,0x00, ++0x00,0xa3,0x30,0x24,0x10,0xc0,0x00,0x08,0x00,0x83,0x10,0x24,0x10,0x40,0x00,0x04, ++0x00,0x00,0x18,0x21,0x10,0xc0,0x00,0x02,0x24,0x03,0x00,0x01,0x00,0x85,0x18,0x2b, ++0x08,0x00,0x11,0x26,0xa2,0x23,0x00,0x17,0x10,0x40,0xff,0xfd,0x00,0x85,0x18,0x2b, ++0x08,0x00,0x11,0x49,0x00,0x00,0x00,0x00,0x10,0xa2,0x00,0x09,0x24,0x02,0x00,0x02, ++0x10,0xa2,0x00,0x05,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xca,0x00,0x00,0x00,0x00, ++0x08,0x00,0x11,0x21,0xa2,0x40,0x00,0x07,0x08,0x00,0x11,0x21,0xa2,0x40,0x00,0x06, ++0x08,0x00,0x11,0x21,0xa2,0x40,0x00,0x05,0x14,0x40,0xff,0xbe,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80, ++0x08,0x00,0x11,0x18,0x00,0xa2,0x10,0x07,0x0c,0x00,0x10,0x07,0x02,0x40,0x20,0x21, ++0x08,0x00,0x10,0x97,0x00,0x00,0x00,0x00,0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00, ++0x30,0xa6,0x00,0xff,0x2c,0xc2,0x00,0x04,0x10,0x40,0x00,0x99,0x2c,0xc2,0x00,0x10, ++0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x24,0x02,0x00,0x01, ++0x00,0xc2,0x10,0x04,0x00,0x02,0x10,0x27,0x00,0x62,0x18,0x24,0xa0,0x83,0x00,0x00, ++0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa5,0x00,0xff,0x14,0xa0,0x00,0x80, ++0x24,0x02,0x00,0x01,0xa2,0x40,0x00,0x04,0x86,0x43,0x00,0x0c,0x27,0x93,0x90,0x04, ++0x96,0x47,0x00,0x0c,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x28,0x80, ++0x00,0xb3,0x18,0x21,0x8c,0x64,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x04, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x10,0x10,0x40,0x00,0x64,0x00,0x00,0x30,0x21, ++0x00,0x07,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x53,0x10,0x21,0x8c,0x43,0x00,0x18,0x93,0x82,0x8b,0x71, ++0x8c,0x64,0x00,0x04,0x30,0x42,0x00,0x01,0x00,0x04,0x21,0x42,0x14,0x40,0x00,0x4d, ++0x30,0x90,0x00,0x01,0x00,0x07,0x2c,0x00,0x00,0x05,0x2c,0x03,0x0c,0x00,0x1b,0x66, ++0x02,0x20,0x20,0x21,0x96,0x26,0x00,0x06,0x12,0x00,0x00,0x14,0x30,0xc5,0xff,0xff, ++0x02,0x60,0x90,0x21,0x00,0x05,0x10,0xc0,0x00,0x45,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x52,0x18,0x21,0x92,0x22,0x00,0x0a,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0b, ++0x02,0x20,0x20,0x21,0x8c,0x63,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x62,0x00,0x04, ++0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x42,0x0c,0x00,0x1b,0x66,0x30,0x50,0x00,0x01, ++0x96,0x26,0x00,0x06,0x16,0x00,0xff,0xef,0x30,0xc5,0xff,0xff,0x92,0x22,0x00,0x04, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x0d,0x24,0x02,0x00,0x01,0xa2,0x22,0x00,0x17, ++0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x05,0x00,0x00,0x00,0x00, ++0xa6,0x26,0x00,0x14,0x92,0x22,0x00,0x16,0x08,0x00,0x10,0x96,0x30,0x42,0x00,0xc3, ++0x96,0x22,0x00,0x00,0x08,0x00,0x11,0xbd,0xa6,0x22,0x00,0x14,0x92,0x22,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,0x11,0xb8, ++0xa2,0x20,0x00,0x17,0x96,0x24,0x00,0x00,0x30,0xc5,0xff,0xff,0x00,0x05,0x18,0xc0, ++0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21,0x00,0x65,0x18,0x21,0x27,0x84,0x90,0x00, ++0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21,0x00,0x03,0x18,0x80,0x8c,0x45,0x00,0x08, ++0x00,0x64,0x18,0x21,0x8c,0x64,0x00,0x08,0x3c,0x02,0x80,0x00,0x00,0xa2,0x38,0x24, ++0x10,0xe0,0x00,0x08,0x00,0x82,0x10,0x24,0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21, ++0x10,0xe0,0x00,0x02,0x24,0x03,0x00,0x01,0x00,0x85,0x18,0x2b,0x08,0x00,0x11,0xb8, ++0xa2,0x23,0x00,0x17,0x10,0x40,0xff,0xfd,0x00,0x85,0x18,0x2b,0x08,0x00,0x11,0xdc, ++0x00,0x00,0x00,0x00,0x24,0x05,0x00,0x24,0xf0,0xe5,0x00,0x06,0x00,0x00,0x28,0x12, ++0x27,0x82,0x90,0x00,0x00,0xa2,0x28,0x21,0x0c,0x00,0x01,0x49,0x00,0x00,0x20,0x21, ++0x96,0x47,0x00,0x0c,0x08,0x00,0x11,0x9a,0x00,0x07,0x2c,0x00,0x27,0x83,0x90,0x10, ++0x27,0x82,0x90,0x18,0x00,0xa2,0x10,0x21,0x00,0xa3,0x18,0x21,0x90,0x44,0x00,0x00, ++0x90,0x65,0x00,0x05,0x93,0x82,0x80,0x10,0x24,0x07,0x00,0x01,0x0c,0x00,0x21,0x9a, ++0xaf,0xa2,0x00,0x10,0x96,0x47,0x00,0x0c,0x08,0x00,0x11,0x8d,0x00,0x07,0x1c,0x00, ++0x10,0xa2,0x00,0x09,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x05,0x24,0x02,0x00,0x03, ++0x14,0xa2,0xff,0x7d,0x00,0x00,0x00,0x00,0x08,0x00,0x11,0x7e,0xa2,0x40,0x00,0x07, ++0x08,0x00,0x11,0x7e,0xa2,0x40,0x00,0x06,0x08,0x00,0x11,0x7e,0xa2,0x40,0x00,0x05, ++0x14,0x40,0xff,0x71,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80,0x08,0x00,0x11,0x75,0x00,0xa2,0x10,0x07, ++0x14,0x40,0xfe,0xc3,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80,0x08,0x00,0x10,0xd0,0x00,0xa2,0x10,0x07, ++0x84,0x83,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x04,0x00,0x43,0x10,0x21,0x8c,0x47,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0xe6,0x00,0x08,0x0c,0x00,0x0f,0x19,0x00,0x00,0x00,0x00, ++0x02,0x40,0x20,0x21,0x00,0x00,0x28,0x21,0x00,0x00,0x30,0x21,0x00,0x00,0x38,0x21, ++0x0c,0x00,0x1c,0x68,0xaf,0xa2,0x00,0x10,0x00,0x02,0x1e,0x00,0x14,0x60,0xfe,0x6b, ++0xa2,0x22,0x00,0x12,0x92,0x43,0x00,0x08,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x40, ++0x24,0x02,0x00,0x01,0xa2,0x40,0x00,0x04,0x92,0x28,0x00,0x04,0x00,0x00,0x00,0x00, ++0x15,0x00,0x00,0x19,0x24,0x02,0x00,0x01,0x92,0x27,0x00,0x0a,0xa2,0x22,0x00,0x17, ++0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x10,0x00,0x00,0x00,0x00, ++0x96,0x22,0x00,0x06,0x00,0x00,0x00,0x00,0xa6,0x22,0x00,0x14,0x92,0x22,0x00,0x16, ++0x30,0xe3,0x00,0xff,0x30,0x42,0x00,0xc0,0x10,0x60,0x00,0x03,0xa2,0x22,0x00,0x16, ++0x34,0x42,0x00,0x01,0xa2,0x22,0x00,0x16,0x11,0x00,0xfe,0x50,0x00,0x00,0x00,0x00, ++0x92,0x22,0x00,0x16,0x08,0x00,0x10,0x96,0x34,0x42,0x00,0x02,0x96,0x22,0x00,0x00, ++0x08,0x00,0x12,0x3f,0xa6,0x22,0x00,0x14,0x92,0x27,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x14,0xe0,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,0x12,0x38,0xa2,0x20,0x00,0x17, ++0x96,0x24,0x00,0x00,0x96,0x25,0x00,0x06,0x27,0x86,0x90,0x00,0x00,0x04,0x18,0xc0, ++0x00,0x64,0x18,0x21,0x00,0x05,0x10,0xc0,0x00,0x45,0x10,0x21,0x00,0x03,0x18,0x80, ++0x00,0x66,0x18,0x21,0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21,0x8c,0x65,0x00,0x08, ++0x8c,0x44,0x00,0x08,0x3c,0x03,0x80,0x00,0x00,0xa3,0x30,0x24,0x10,0xc0,0x00,0x08, ++0x00,0x83,0x10,0x24,0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21,0x10,0xc0,0x00,0x02, ++0x24,0x03,0x00,0x01,0x00,0x85,0x18,0x2b,0x08,0x00,0x12,0x38,0xa2,0x23,0x00,0x17, ++0x10,0x40,0xff,0xfd,0x00,0x85,0x18,0x2b,0x08,0x00,0x12,0x67,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x09,0x24,0x02,0x00,0x02,0x10,0x62,0x00,0x05,0x24,0x02,0x00,0x03, ++0x14,0x62,0xff,0xbd,0x00,0x00,0x00,0x00,0x08,0x00,0x12,0x32,0xa2,0x40,0x00,0x07, ++0x08,0x00,0x12,0x32,0xa2,0x40,0x00,0x06,0x08,0x00,0x12,0x32,0xa2,0x40,0x00,0x05, ++0x3c,0x02,0x80,0x00,0x00,0x82,0x30,0x24,0x10,0xc0,0x00,0x08,0x00,0xa2,0x18,0x24, ++0x10,0x60,0x00,0x04,0x00,0x00,0x10,0x21,0x10,0xc0,0x00,0x02,0x24,0x02,0x00,0x01, ++0x00,0xa4,0x10,0x2b,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x10,0x60,0xff,0xfd, ++0x00,0xa4,0x10,0x2b,0x08,0x00,0x12,0x82,0x00,0x00,0x00,0x00,0x30,0x82,0xff,0xff, ++0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21,0x27,0x84,0x90,0x10,0x00,0x03,0x18,0x80, ++0x00,0x64,0x18,0x21,0x80,0x66,0x00,0x06,0x00,0x02,0x12,0x00,0x3c,0x03,0xb0,0x00, ++0x00,0x46,0x10,0x21,0x00,0x45,0x10,0x21,0x03,0xe0,0x00,0x08,0x00,0x43,0x10,0x21, ++0x27,0xbd,0xff,0xe0,0x30,0x82,0x00,0x7c,0x30,0x84,0xff,0x00,0xaf,0xbf,0x00,0x1c, ++0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0x14,0x40,0x00,0x41, ++0x00,0x04,0x22,0x03,0x24,0x02,0x00,0x04,0x3c,0x10,0xb0,0x03,0x8e,0x10,0x00,0x00, ++0x10,0x82,0x00,0x32,0x24,0x02,0x00,0x08,0x10,0x82,0x00,0x03,0x32,0x02,0x00,0x20, ++0x08,0x00,0x12,0xa8,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x17,0x3c,0x02,0xb0,0x06, ++0x34,0x42,0x80,0x24,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x67,0x00,0xff, ++0x10,0xe0,0x00,0x23,0x00,0x00,0x88,0x21,0x8f,0x85,0x8f,0xe0,0x00,0x40,0x30,0x21, ++0x94,0xa2,0x00,0x08,0x8c,0xc3,0x00,0x00,0x26,0x31,0x00,0x01,0x24,0x42,0x00,0x02, ++0x30,0x42,0x01,0xff,0x34,0x63,0x01,0x00,0x02,0x27,0x20,0x2a,0xa4,0xa2,0x00,0x08, ++0x14,0x80,0xff,0xf7,0xac,0xc3,0x00,0x00,0x84,0xa3,0x00,0x08,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x00,0x30,0xac,0x43,0x00,0x00,0x27,0x92,0xb4,0x00,0x24,0x11,0x00,0x12, ++0x8e,0x44,0x00,0x00,0x26,0x31,0xff,0xff,0x90,0x82,0x00,0x10,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x03,0x26,0x52,0x00,0x04,0x0c,0x00,0x18,0xd0,0x00,0x00,0x00,0x00, ++0x06,0x21,0xff,0xf7,0x24,0x02,0xff,0xdf,0x02,0x02,0x80,0x24,0x3c,0x01,0xb0,0x03, ++0x0c,0x00,0x13,0x1c,0xac,0x30,0x00,0x00,0x08,0x00,0x12,0xa8,0x00,0x00,0x00,0x00, ++0x8f,0x85,0x8f,0xe0,0x08,0x00,0x12,0xbe,0x00,0x00,0x00,0x00,0x24,0x02,0xff,0x95, ++0x3c,0x03,0xb0,0x03,0x02,0x02,0x80,0x24,0x34,0x63,0x00,0x30,0x3c,0x01,0xb0,0x03, ++0xac,0x30,0x00,0x00,0x0c,0x00,0x12,0xe5,0xac,0x60,0x00,0x00,0x08,0x00,0x12,0xa8, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x50,0x08,0x00,0x12,0xa8, ++0xac,0x46,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4b,0x94,0x3c,0x0b,0xb0,0x03, ++0xad,0x6a,0x00,0x20,0x3c,0x08,0x80,0x01,0x25,0x08,0x00,0x00,0x3c,0x09,0x80,0x01, ++0x25,0x29,0x03,0x50,0x11,0x09,0x00,0x10,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00, ++0x25,0x4a,0x4b,0xbc,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x08,0xb0,0x06, ++0x35,0x08,0x80,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8d,0x09,0x00,0x00, ++0x00,0x00,0x00,0x00,0x31,0x29,0x00,0x01,0x00,0x00,0x00,0x00,0x24,0x01,0x00,0x01, ++0x15,0x21,0xff,0xf2,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4b,0xf8, ++0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x02,0xb0,0x03,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x34,0x63,0x00,0x40,0x00,0x00,0x00,0x00,0xac,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4c,0x24,0x3c,0x0b,0xb0,0x03, ++0xad,0x6a,0x00,0x20,0x3c,0x02,0x80,0x01,0x24,0x42,0x00,0x00,0x3c,0x03,0x80,0x01, ++0x24,0x63,0x03,0x50,0x3c,0x04,0xb0,0x00,0x8c,0x85,0x00,0x00,0x00,0x00,0x00,0x00, ++0xac,0x45,0x00,0x00,0x24,0x42,0x00,0x04,0x24,0x84,0x00,0x04,0x00,0x43,0x08,0x2a, ++0x14,0x20,0xff,0xf9,0x00,0x00,0x00,0x00,0x0c,0x00,0x13,0x1c,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4c,0x70,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20, ++0x3c,0x02,0x80,0x01,0x24,0x42,0x03,0x50,0x3c,0x03,0x80,0x01,0x24,0x63,0x3f,0x24, ++0xac,0x40,0x00,0x00,0xac,0x40,0x00,0x04,0xac,0x40,0x00,0x08,0xac,0x40,0x00,0x0c, ++0x24,0x42,0x00,0x10,0x00,0x43,0x08,0x2a,0x14,0x20,0xff,0xf9,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4c,0xb0,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20, ++0x3c,0x1c,0x80,0x01,0x27,0x9c,0x7f,0xf0,0x27,0x9d,0x8b,0xe0,0x00,0x00,0x00,0x00, ++0x27,0x9d,0x8f,0xc8,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x4c,0xd4,0x3c,0x0b,0xb0,0x03, ++0xad,0x6a,0x00,0x20,0x40,0x80,0x68,0x00,0x40,0x08,0x60,0x00,0x00,0x00,0x00,0x00, ++0x35,0x08,0xff,0x01,0x40,0x88,0x60,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x15,0x62, ++0x00,0x00,0x00,0x00,0x24,0x84,0xf8,0x00,0x30,0x87,0x00,0x03,0x00,0x04,0x30,0x40, ++0x00,0xc7,0x20,0x23,0x3c,0x02,0xb0,0x0a,0x27,0xbd,0xff,0xe0,0x24,0x03,0xff,0xff, ++0x00,0x82,0x20,0x21,0xaf,0xb1,0x00,0x14,0xac,0x83,0x10,0x00,0xaf,0xbf,0x00,0x18, ++0xaf,0xb0,0x00,0x10,0x00,0xa0,0x88,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x10,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0xc7,0x10,0x23,0x3c,0x03,0xb0,0x0a, ++0x00,0x43,0x10,0x21,0x8c,0x50,0x00,0x00,0x0c,0x00,0x13,0x99,0x02,0x20,0x20,0x21, ++0x02,0x11,0x80,0x24,0x00,0x50,0x80,0x06,0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xd8, ++0xaf,0xb2,0x00,0x18,0x00,0xa0,0x90,0x21,0x24,0x05,0xff,0xff,0xaf,0xb3,0x00,0x1c, ++0xaf,0xbf,0x00,0x20,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0x00,0xc0,0x98,0x21, ++0x12,0x45,0x00,0x23,0x24,0x84,0xf8,0x00,0x30,0x83,0x00,0x03,0x00,0x04,0x10,0x40, ++0x00,0x40,0x88,0x21,0x00,0x60,0x20,0x21,0x00,0x43,0x10,0x23,0x3c,0x03,0xb0,0x0a, ++0x00,0x43,0x10,0x21,0xac,0x45,0x10,0x00,0x00,0x40,0x18,0x21,0x24,0x05,0x00,0x01, ++0x8c,0x62,0x10,0x00,0x00,0x00,0x00,0x00,0x14,0x45,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x02,0x24,0x88,0x23,0x02,0x22,0x88,0x21,0x8e,0x30,0x00,0x00,0x0c,0x00,0x13,0x99, ++0x02,0x40,0x20,0x21,0x00,0x12,0x18,0x27,0x02,0x03,0x80,0x24,0x00,0x53,0x10,0x04, ++0x02,0x02,0x80,0x25,0xae,0x30,0x00,0x00,0x24,0x03,0x00,0x01,0x8e,0x22,0x10,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x20, ++0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28, ++0x30,0x82,0x00,0x03,0x00,0x04,0x18,0x40,0x00,0x62,0x18,0x23,0x3c,0x04,0xb0,0x0a, ++0x00,0x64,0x18,0x21,0xac,0x66,0x00,0x00,0x24,0x04,0x00,0x01,0x8c,0x62,0x10,0x00, ++0x00,0x00,0x00,0x00,0x14,0x44,0xff,0xfd,0x00,0x00,0x00,0x00,0x08,0x00,0x13,0x87, ++0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x21,0x00,0x64,0x10,0x06,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0x2c,0x62,0x00,0x20, ++0x14,0x40,0xff,0xf9,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21, ++0x27,0xbd,0xff,0xe0,0x3c,0x03,0xb0,0x05,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x1c,0x00,0x80,0x90,0x21,0x00,0xa0,0x80,0x21, ++0x00,0xc0,0x88,0x21,0x34,0x63,0x02,0x2e,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x01,0x14,0x40,0xff,0xfc,0x24,0x04,0x08,0x24,0x3c,0x05,0x00,0xc0, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x03,0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0xc0, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x03,0x3c,0x02,0xc0,0x00,0x00,0x10,0x1c,0x00, ++0x34,0x42,0x04,0x00,0x3c,0x04,0xb0,0x05,0x3c,0x05,0xb0,0x05,0x24,0x63,0x16,0x09, ++0x02,0x22,0x10,0x21,0x34,0x84,0x04,0x20,0x34,0xa5,0x04,0x24,0x3c,0x06,0xb0,0x05, ++0xac,0x83,0x00,0x00,0x24,0x07,0x00,0x01,0xac,0xa2,0x00,0x00,0x34,0xc6,0x02,0x28, ++0x24,0x02,0x00,0x20,0xae,0x47,0x00,0x3c,0x24,0x04,0x08,0x24,0xa0,0xc2,0x00,0x00, ++0x3c,0x05,0x00,0xc0,0xa2,0x47,0x00,0x11,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x01, ++0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0xc0,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x01, ++0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x24,0x02,0x00,0x06,0xac,0x82,0x00,0x0c,0xa0,0x80,0x00,0x50, ++0xac,0x80,0x00,0x00,0xac,0x80,0x00,0x04,0xac,0x80,0x00,0x08,0xac,0x80,0x00,0x14, ++0xac,0x80,0x00,0x18,0xac,0x80,0x00,0x1c,0xa4,0x80,0x00,0x20,0xac,0x80,0x00,0x24, ++0xac,0x80,0x00,0x28,0xac,0x80,0x00,0x2c,0xa0,0x80,0x00,0x30,0xa0,0x80,0x00,0x31, ++0xac,0x80,0x00,0x34,0xac,0x80,0x00,0x38,0xa0,0x80,0x00,0x3c,0xac,0x82,0x00,0x10, ++0xa0,0x80,0x00,0x44,0xac,0x80,0x00,0x48,0x03,0xe0,0x00,0x08,0xac,0x80,0x00,0x4c, ++0x3c,0x04,0xb0,0x06,0x34,0x84,0x80,0x00,0x8c,0x83,0x00,0x00,0x3c,0x02,0x12,0x00, ++0x3c,0x05,0xb0,0x03,0x00,0x62,0x18,0x25,0x34,0xa5,0x00,0x8b,0x24,0x02,0xff,0x80, ++0xac,0x83,0x00,0x00,0x03,0xe0,0x00,0x08,0xa0,0xa2,0x00,0x00,0x3c,0x04,0xb0,0x03, ++0x34,0x84,0x00,0x0b,0x24,0x02,0x00,0x22,0x3c,0x05,0xb0,0x01,0x3c,0x06,0x45,0x67, ++0x3c,0x0a,0xb0,0x09,0xa0,0x82,0x00,0x00,0x34,0xa5,0x00,0x04,0x34,0xc6,0x89,0xaa, ++0x35,0x4a,0x00,0x04,0x24,0x02,0x01,0x23,0x3c,0x0b,0xb0,0x09,0x3c,0x07,0x01,0x23, ++0x3c,0x0c,0xb0,0x09,0x3c,0x01,0xb0,0x01,0xac,0x20,0x00,0x00,0x27,0xbd,0xff,0xe0, ++0xac,0xa0,0x00,0x00,0x35,0x6b,0x00,0x08,0x3c,0x01,0xb0,0x09,0xac,0x26,0x00,0x00, ++0x34,0xe7,0x45,0x66,0xa5,0x42,0x00,0x00,0x35,0x8c,0x00,0x0c,0x24,0x02,0xcd,0xef, ++0x3c,0x0d,0xb0,0x09,0x3c,0x08,0xcd,0xef,0x3c,0x0e,0xb0,0x09,0xad,0x67,0x00,0x00, ++0xaf,0xb7,0x00,0x1c,0xa5,0x82,0x00,0x00,0xaf,0xb6,0x00,0x18,0xaf,0xb5,0x00,0x14, ++0xaf,0xb4,0x00,0x10,0xaf,0xb3,0x00,0x0c,0xaf,0xb2,0x00,0x08,0xaf,0xb1,0x00,0x04, ++0xaf,0xb0,0x00,0x00,0x35,0xad,0x00,0x10,0x35,0x08,0x01,0x22,0x35,0xce,0x00,0x14, ++0x24,0x02,0x89,0xab,0x3c,0x0f,0xb0,0x09,0x3c,0x09,0x89,0xab,0x3c,0x10,0xb0,0x09, ++0x3c,0x11,0xb0,0x09,0x3c,0x12,0xb0,0x09,0x3c,0x13,0xb0,0x09,0x3c,0x14,0xb0,0x09, ++0x3c,0x15,0xb0,0x09,0x3c,0x16,0xb0,0x09,0x3c,0x17,0xb0,0x09,0xad,0xa8,0x00,0x00, ++0x24,0x03,0xff,0xff,0xa5,0xc2,0x00,0x00,0x35,0xef,0x00,0x18,0x35,0x29,0xcd,0xee, ++0x36,0x10,0x00,0x1c,0x36,0x31,0x00,0x20,0x36,0x52,0x00,0x24,0x36,0x73,0x00,0x28, ++0x36,0x94,0x00,0x2c,0x36,0xb5,0x00,0x30,0x36,0xd6,0x00,0x34,0x36,0xf7,0x00,0x38, ++0x24,0x02,0x45,0x67,0xad,0xe9,0x00,0x00,0xa6,0x02,0x00,0x00,0xae,0x23,0x00,0x00, ++0x8f,0xb0,0x00,0x00,0xa6,0x43,0x00,0x00,0x8f,0xb1,0x00,0x04,0xae,0x63,0x00,0x00, ++0x8f,0xb2,0x00,0x08,0xa6,0x83,0x00,0x00,0x8f,0xb3,0x00,0x0c,0xae,0xa3,0x00,0x00, ++0x8f,0xb4,0x00,0x10,0xa6,0xc3,0x00,0x00,0x8f,0xb5,0x00,0x14,0xae,0xe3,0x00,0x00, ++0x7b,0xb6,0x00,0xfc,0x3c,0x18,0xb0,0x09,0x37,0x18,0x00,0x3c,0xa7,0x03,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x51,0x48,0xac,0x62,0x00,0x00,0x8c,0x83,0x00,0x34, ++0x34,0x02,0xff,0xff,0x00,0x43,0x10,0x2a,0x14,0x40,0x01,0x04,0x00,0x80,0x28,0x21, ++0x8c,0x86,0x00,0x08,0x24,0x02,0x00,0x03,0x10,0xc2,0x00,0xf7,0x00,0x00,0x00,0x00, ++0x8c,0xa2,0x00,0x2c,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x4f,0x24,0x02,0x00,0x06, ++0x3c,0x03,0xb0,0x05,0x34,0x63,0x04,0x50,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0x14,0x40,0x00,0xdd,0xac,0xa2,0x00,0x2c,0x24,0x02,0x00,0x01, ++0x10,0xc2,0x00,0xdc,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xc2,0x00,0xca, ++0x00,0x00,0x00,0x00,0x8c,0xa7,0x00,0x04,0x24,0x02,0x00,0x02,0x10,0xe2,0x00,0xc0, ++0x00,0x00,0x00,0x00,0x8c,0xa2,0x00,0x14,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x09, ++0x24,0x02,0x00,0x01,0x3c,0x03,0xb0,0x09,0x34,0x63,0x01,0x60,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x10,0x40,0x00,0x05,0xac,0xa2,0x00,0x14, ++0x24,0x02,0x00,0x01,0xac,0xa2,0x00,0x00,0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x14, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x04,0x61,0x00,0x19,0x3c,0x02,0xb0,0x03,0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2e, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0x12, ++0x3c,0x02,0xb0,0x03,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x42,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x0c,0x3c,0x02,0xb0,0x03,0x80,0xa2,0x00,0x50, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x08,0x3c,0x02,0xb0,0x03,0x14,0xc0,0x00,0x07, ++0x34,0x42,0x00,0x3f,0x24,0x02,0x00,0x0e,0x24,0x03,0x00,0x01,0xac,0xa2,0x00,0x00, ++0x03,0xe0,0x00,0x08,0xa0,0xa3,0x00,0x50,0x34,0x42,0x00,0x3f,0x90,0x44,0x00,0x00, ++0x24,0x03,0x00,0x01,0x10,0x64,0x00,0x7f,0x3c,0x03,0xb0,0x05,0x80,0xa2,0x00,0x31, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0a,0x3c,0x02,0xb0,0x06,0x34,0x42,0x80,0x18, ++0x8c,0x43,0x00,0x00,0x3c,0x04,0xf0,0x00,0x3c,0x02,0x80,0x00,0x00,0x64,0x18,0x24, ++0x10,0x62,0x00,0x03,0x24,0x02,0x00,0x09,0x03,0xe0,0x00,0x08,0xac,0xa2,0x00,0x00, ++0x8c,0xa2,0x00,0x40,0x00,0x00,0x00,0x00,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x10,0x60,0x00,0x09,0x3c,0x03,0xb0,0x03,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c, ++0x8c,0x43,0x00,0x00,0x3c,0x04,0x00,0x02,0x00,0x64,0x18,0x24,0x14,0x60,0xff,0xf2, ++0x24,0x02,0x00,0x10,0x3c,0x03,0xb0,0x03,0x34,0x63,0x02,0x01,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x80,0x10,0x40,0x00,0x0e,0x00,0x00,0x00,0x00, ++0x8c,0xa3,0x00,0x0c,0x00,0x00,0x00,0x00,0xac,0xa3,0x00,0x10,0x3c,0x02,0xb0,0x03, ++0x90,0x42,0x02,0x01,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x0f,0xac,0xa2,0x00,0x0c, ++0x90,0xa3,0x00,0x0f,0x24,0x02,0x00,0x0d,0x3c,0x01,0xb0,0x03,0x08,0x00,0x14,0xb2, ++0xa0,0x23,0x02,0x01,0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x80,0x90,0x44,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x04,0x1e,0x00,0x00,0x03,0x1e,0x03,0x10,0x60,0x00,0x15, ++0xa0,0xa4,0x00,0x44,0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x0b,0x24,0x02,0x00,0x02, ++0x10,0x62,0x00,0x03,0x24,0x03,0x00,0x0d,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x8c,0xa2,0x00,0x0c,0xac,0xa3,0x00,0x00,0x24,0x03,0x00,0x04,0xac,0xa2,0x00,0x10, ++0x03,0xe0,0x00,0x08,0xac,0xa3,0x00,0x0c,0x24,0x02,0x00,0x0d,0xac,0xa2,0x00,0x00, ++0x24,0x03,0x00,0x04,0x24,0x02,0x00,0x06,0xac,0xa3,0x00,0x10,0x03,0xe0,0x00,0x08, ++0xac,0xa2,0x00,0x0c,0x8c,0xa3,0x00,0x38,0x24,0x04,0x00,0x01,0x10,0x64,0x00,0x2d, ++0x24,0x02,0x00,0x02,0x10,0x60,0x00,0x19,0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x10, ++0x24,0x02,0x00,0x04,0x10,0x62,0x00,0x04,0x00,0x00,0x00,0x00,0xac,0xa0,0x00,0x38, ++0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x00,0x10,0xe4,0x00,0x07,0x24,0x02,0x00,0x03, ++0x80,0xa2,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x0b,0xac,0xa3,0x00,0x00, ++0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x38,0x08,0x00,0x15,0x04,0xac,0xa2,0x00,0x00, ++0x10,0xe4,0x00,0x02,0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x0c,0xac,0xa2,0x00,0x00, ++0x24,0x02,0x00,0x04,0x03,0xe0,0x00,0x08,0xac,0xa2,0x00,0x38,0x10,0xe4,0x00,0x0e, ++0x3c,0x03,0xb0,0x06,0x34,0x63,0x80,0x24,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0x10,0x40,0x00,0x06,0xac,0xa2,0x00,0x18,0x24,0x02,0x00,0x02, ++0xac,0xa2,0x00,0x00,0xac,0xa0,0x00,0x18,0x08,0x00,0x15,0x0d,0x24,0x02,0x00,0x01, ++0x08,0x00,0x15,0x1a,0xac,0xa0,0x00,0x00,0x24,0x02,0x00,0x03,0x08,0x00,0x15,0x1a, ++0xac,0xa2,0x00,0x00,0x24,0x03,0x00,0x0b,0xac,0xa2,0x00,0x38,0x03,0xe0,0x00,0x08, ++0xac,0xa3,0x00,0x00,0x34,0x63,0x02,0x2e,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x01,0x14,0x40,0xff,0x7d,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x42, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x60,0xff,0x78,0x00,0x00,0x00,0x00, ++0x10,0xc0,0xff,0x81,0x24,0x02,0x00,0x0e,0x08,0x00,0x14,0xa7,0x00,0x00,0x00,0x00, ++0x80,0xa2,0x00,0x30,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x3e,0x24,0x02,0x00,0x04, ++0x08,0x00,0x14,0xb2,0x00,0x00,0x00,0x00,0x84,0xa2,0x00,0x20,0x00,0x00,0x00,0x00, ++0x10,0x40,0xff,0x75,0x24,0x02,0x00,0x06,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff, ++0x00,0x60,0x10,0x21,0x14,0x40,0xff,0x2b,0xa4,0xa3,0x00,0x20,0x08,0x00,0x14,0xb2, ++0x24,0x02,0x00,0x06,0x8c,0xa2,0x00,0x1c,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x66, ++0x24,0x02,0x00,0x05,0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2c,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x10,0x40,0xff,0x1b,0xac,0xa2,0x00,0x1c, ++0x08,0x00,0x14,0xb2,0x24,0x02,0x00,0x05,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x17,0x42,0x30,0x42,0x00,0x01,0x14,0x40,0xff,0x56, ++0x24,0x02,0x00,0x06,0x08,0x00,0x14,0x60,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x0a, ++0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x00,0x27,0xbd,0xff,0xd8,0xaf,0xb0,0x00,0x10, ++0x27,0x90,0x86,0x58,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18, ++0x0c,0x00,0x29,0xd5,0xaf,0xb1,0x00,0x14,0xaf,0x90,0x8f,0xe0,0x48,0x02,0x00,0x00, ++0x0c,0x00,0x13,0xf0,0x00,0x00,0x00,0x00,0x0c,0x00,0x18,0x1f,0x02,0x00,0x20,0x21, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x3a,0x94,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0xa3,0x83,0x8f,0xe4,0x0c,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x0c,0x00,0x13,0xfb, ++0x00,0x00,0x00,0x00,0x27,0x84,0x84,0x98,0x0c,0x00,0x27,0x59,0x00,0x00,0x00,0x00, ++0x93,0x84,0x80,0x10,0x0c,0x00,0x21,0x3f,0x00,0x00,0x00,0x00,0x27,0x84,0x89,0x18, ++0x0c,0x00,0x06,0xe5,0x00,0x00,0x00,0x00,0x0c,0x00,0x01,0x39,0x00,0x00,0x00,0x00, ++0x27,0x84,0x84,0x40,0x0c,0x00,0x13,0xd9,0x00,0x00,0x00,0x00,0x27,0x82,0x89,0x4c, ++0xaf,0x82,0x84,0x80,0x0c,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x34,0x63,0x01,0x08,0x3c,0x04,0xb0,0x09,0x3c,0x05,0xb0,0x09,0x8c,0x66,0x00,0x00, ++0x34,0x84,0x01,0x68,0x34,0xa5,0x01,0x40,0x24,0x02,0xc8,0x80,0x24,0x03,0x00,0x0a, ++0xa4,0x82,0x00,0x00,0xa4,0xa3,0x00,0x00,0x3c,0x04,0xb0,0x03,0x8c,0x82,0x00,0x00, ++0x8f,0x85,0x84,0x40,0xaf,0x86,0x84,0x38,0x34,0x42,0x00,0x20,0xac,0x82,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x58,0x8c,0x43,0x00,0x00,0x2c,0xa4,0x00,0x11, ++0x34,0x63,0x01,0x00,0xac,0x43,0x00,0x00,0x10,0x80,0xff,0xfa,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x01,0x00,0x05,0x10,0x80,0x24,0x63,0x02,0x00,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00, ++0x27,0x84,0x84,0x98,0x0c,0x00,0x26,0x8e,0x00,0x00,0x00,0x00,0x27,0x84,0x84,0x40, ++0x0c,0x00,0x14,0x52,0x00,0x00,0x00,0x00,0x93,0x83,0x81,0xf1,0x24,0x02,0x00,0x01, ++0x10,0x62,0x00,0x08,0x00,0x00,0x00,0x00,0x8f,0x85,0x84,0x40,0x8f,0x82,0x84,0x74, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xaf,0x82,0x84,0x74,0x08,0x00,0x15,0x9d, ++0x3c,0x02,0xb0,0x03,0x27,0x84,0x84,0x98,0x0c,0x00,0x27,0x0d,0x00,0x00,0x00,0x00, ++0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00,0x27,0x84,0x84,0x98,0x0c,0x00,0x28,0xdd, ++0x00,0x00,0x00,0x00,0xa3,0x82,0x84,0x71,0x8f,0x82,0x84,0x74,0xaf,0x80,0x84,0x40, ++0x24,0x42,0x00,0x01,0xaf,0x82,0x84,0x74,0x08,0x00,0x15,0x9c,0x00,0x00,0x28,0x21, ++0x27,0x84,0x86,0x58,0x0c,0x00,0x19,0x5b,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0x14,0x40,0x00,0x05,0x3c,0x03,0xb0,0x05,0xaf,0x80,0x84,0x40,0xaf,0x80,0x84,0x44, ++0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00,0x34,0x63,0x04,0x50,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0xaf,0x82,0x84,0x6c,0x14,0x40,0x00,0x20, ++0x24,0x02,0x00,0x01,0x8f,0x84,0x84,0x48,0x00,0x00,0x00,0x00,0x10,0x82,0x00,0x20, ++0x3c,0x03,0xb0,0x09,0x34,0x63,0x01,0x60,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0xaf,0x82,0x84,0x54,0x14,0x40,0x00,0x15,0x24,0x02,0x00,0x01, ++0x24,0x02,0x00,0x02,0x10,0x82,0x00,0x07,0x00,0x00,0x00,0x00,0x24,0x05,0x00,0x03, ++0x24,0x02,0x00,0x01,0xaf,0x82,0x84,0x44,0xaf,0x85,0x84,0x40,0x08,0x00,0x15,0xb6, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff,0x00,0x60,0x10,0x21, ++0xa7,0x83,0x84,0x60,0x14,0x40,0xff,0xf1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0xaf,0x82,0x84,0x44,0xaf,0x80,0x84,0x40,0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2c,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0xaf,0x82,0x84,0x5c,0x14,0x40,0xff,0xf5,0x24,0x02,0x00,0x01, ++0x08,0x00,0x15,0xe1,0x3c,0x03,0xb0,0x09,0x27,0x84,0x86,0x58,0x0c,0x00,0x1a,0xd1, ++0x00,0x00,0x00,0x00,0x83,0x82,0x84,0x70,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xec, ++0x24,0x02,0x00,0x02,0x3c,0x03,0xb0,0x05,0x34,0x63,0x04,0x50,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0xaf,0x82,0x84,0x6c,0x14,0x40,0xff,0xe4, ++0x24,0x02,0x00,0x02,0x8f,0x84,0x84,0x48,0x24,0x02,0x00,0x01,0x10,0x82,0x00,0x12, ++0x24,0x02,0x00,0x02,0x10,0x82,0x00,0x04,0x00,0x00,0x00,0x00,0x24,0x05,0x00,0x04, ++0x08,0x00,0x15,0xed,0x24,0x02,0x00,0x02,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff, ++0x00,0x60,0x10,0x21,0xa7,0x83,0x84,0x60,0x14,0x40,0xff,0xf4,0x00,0x00,0x00,0x00, ++0x08,0x00,0x15,0xfc,0x24,0x02,0x00,0x02,0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2c, ++0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0xaf,0x82,0x84,0x5c, ++0x14,0x40,0xff,0xf7,0x00,0x00,0x00,0x00,0x08,0x00,0x16,0x1d,0x24,0x02,0x00,0x02, ++0x27,0x84,0x89,0x18,0x0c,0x00,0x0b,0x55,0x00,0x00,0x00,0x00,0x8f,0x83,0x84,0x44, ++0xaf,0x82,0x84,0x5c,0x38,0x64,0x00,0x02,0x00,0x04,0x18,0x0a,0xaf,0x83,0x84,0x44, ++0x14,0x40,0xff,0xad,0x24,0x05,0x00,0x05,0x8f,0x82,0x89,0x58,0xaf,0x80,0x84,0x40, ++0x10,0x40,0x00,0x02,0x24,0x04,0x00,0x01,0xaf,0x84,0x84,0x48,0x93,0x82,0x89,0x66, ++0x00,0x00,0x00,0x00,0x10,0x40,0xff,0x6c,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x05, ++0x34,0x42,0x00,0x08,0x8c,0x43,0x00,0x00,0x3c,0x04,0x20,0x00,0x00,0x64,0x18,0x24, ++0x10,0x60,0xff,0x65,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xa0, ++0x8c,0x43,0x00,0x00,0x3c,0x04,0x80,0x00,0xaf,0x80,0x89,0x40,0x24,0x63,0x00,0x01, ++0xac,0x43,0x00,0x00,0x3c,0x01,0xb0,0x05,0xac,0x24,0x00,0x08,0xaf,0x80,0x89,0x3c, ++0xaf,0x80,0x89,0x44,0xaf,0x80,0x89,0x48,0xaf,0x80,0x89,0x54,0xaf,0x80,0x89,0x4c, ++0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00,0x83,0x82,0x84,0x90,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x02,0x24,0x02,0x00,0x20,0xaf,0x82,0x84,0x5c,0x8f,0x85,0x84,0x5c, ++0x27,0x84,0x89,0x18,0x0c,0x00,0x0d,0x30,0x00,0x00,0x00,0x00,0x00,0x02,0x1e,0x00, ++0xa3,0x82,0x84,0x70,0xaf,0x80,0x84,0x5c,0x10,0x60,0xff,0x8e,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e,0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff,0x00,0x60,0x10,0x21,0xa7,0x83,0x84,0x60, ++0x10,0x40,0x00,0x04,0x24,0x04,0x00,0x02,0xaf,0x84,0x84,0x48,0x08,0x00,0x15,0xfd, ++0x00,0x00,0x00,0x00,0x08,0x00,0x15,0xee,0x24,0x05,0x00,0x06,0x27,0x84,0x84,0x40, ++0x27,0x85,0x89,0x18,0x0c,0x00,0x0d,0xfd,0x00,0x00,0x00,0x00,0x8f,0x82,0x84,0x64, ++0xaf,0x80,0x84,0x6c,0x14,0x40,0x00,0x19,0x00,0x40,0x18,0x21,0x8f,0x82,0x84,0x68, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x15,0x24,0x02,0x00,0x02,0x8f,0x83,0x84,0x48, ++0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x0b,0x3c,0x02,0x40,0x00,0x8f,0x83,0x84,0x44, ++0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x02,0x24,0x05,0x00,0x03,0x24,0x05,0x00,0x06, ++0xaf,0x85,0x84,0x40,0x24,0x04,0x00,0x03,0xaf,0x84,0x84,0x48,0x08,0x00,0x15,0xb6, ++0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x14,0x3c,0x01,0xb0,0x05,0xac,0x22,0x00,0x00, ++0xaf,0x80,0x84,0x40,0x08,0x00,0x16,0x96,0x24,0x04,0x00,0x03,0x10,0x60,0x00,0x10, ++0x00,0x00,0x00,0x00,0x27,0x85,0x89,0x18,0x27,0x84,0x84,0x40,0x0c,0x00,0x0e,0x21, ++0x00,0x00,0x00,0x00,0x8f,0x83,0x84,0x44,0x24,0x02,0x00,0x01,0xa3,0x80,0x84,0x70, ++0xaf,0x80,0x84,0x48,0x10,0x62,0x00,0x02,0x24,0x05,0x00,0x03,0x24,0x05,0x00,0x04, ++0xaf,0x85,0x84,0x40,0xaf,0x80,0x84,0x64,0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00, ++0x83,0x82,0x84,0x90,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00, ++0x27,0x84,0x89,0x18,0x0c,0x00,0x10,0x69,0x00,0x00,0x00,0x00,0x8f,0x82,0x84,0x44, ++0xa3,0x80,0x84,0x70,0xaf,0x80,0x84,0x40,0xaf,0x80,0x84,0x48,0x14,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0xaf,0x82,0x84,0x44,0xaf,0x80,0x84,0x68, ++0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00,0x27,0x84,0x84,0x40,0x27,0x85,0x89,0x18, ++0x0c,0x00,0x0e,0x21,0x00,0x00,0x00,0x00,0x8f,0x82,0x84,0x44,0xa3,0x80,0x84,0x70, ++0xaf,0x80,0x84,0x40,0xaf,0x80,0x84,0x48,0x14,0x40,0xfe,0xeb,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x02,0xaf,0x82,0x84,0x44,0x08,0x00,0x15,0xb6,0x00,0x00,0x00,0x00, ++0x27,0x84,0x89,0x18,0x0c,0x00,0x10,0x69,0x00,0x00,0x00,0x00,0x08,0x00,0x16,0xc6, ++0x00,0x00,0x00,0x00,0x27,0x84,0x84,0x98,0x0c,0x00,0x29,0x73,0x00,0x00,0x00,0x00, ++0x08,0x00,0x15,0xc5,0x00,0x00,0x00,0x00,0x0c,0x00,0x24,0x05,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x26,0xff,0x00,0x00,0x00,0x00,0x0c,0x00,0x18,0x11,0x00,0x00,0x00,0x00, ++0x93,0x83,0xbc,0x18,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x2b,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x08,0x8c,0x44,0x00,0x00,0x8f,0x83,0xbc,0x10,0x8f,0x82,0xbc,0x14, ++0x00,0x83,0x18,0x23,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x23,0x3c,0x02,0xb0,0x03, ++0x24,0x04,0x05,0xa0,0x34,0x42,0x01,0x18,0x8c,0x42,0x00,0x00,0x0c,0x00,0x06,0xd1, ++0x00,0x00,0x00,0x00,0x24,0x04,0x05,0xa4,0x0c,0x00,0x06,0xd1,0x00,0x02,0x84,0x02, ++0x30,0x51,0xff,0xff,0x24,0x04,0x05,0xa8,0x00,0x02,0x94,0x02,0x0c,0x00,0x06,0xd1, ++0x3a,0x10,0xff,0xff,0x3a,0x31,0xff,0xff,0x30,0x42,0xff,0xff,0x2e,0x10,0x00,0x01, ++0x2e,0x31,0x00,0x01,0x3a,0x52,0xff,0xff,0x02,0x11,0x80,0x25,0x2e,0x52,0x00,0x01, ++0x38,0x42,0xff,0xff,0x02,0x12,0x80,0x25,0x2c,0x42,0x00,0x01,0x02,0x02,0x80,0x25, ++0x16,0x00,0x00,0x02,0x24,0x04,0x00,0x02,0x00,0x00,0x20,0x21,0x0c,0x00,0x05,0x6e, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x83,0xbc,0x10,0x0c,0x00,0x01,0xe9,0x00,0x00,0x00,0x00, ++0xaf,0x80,0x84,0x40,0xaf,0x80,0x84,0x74,0x08,0x00,0x15,0x9c,0x00,0x00,0x28,0x21, ++0x27,0x90,0xb4,0x00,0x24,0x11,0x00,0x12,0x8e,0x04,0x00,0x00,0x00,0x00,0x00,0x00, ++0x90,0x82,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x18,0xd0,0x00,0x00,0x00,0x00,0x26,0x31,0xff,0xff,0x06,0x21,0xff,0xf6, ++0x26,0x10,0x00,0x04,0xaf,0x80,0x84,0x40,0x08,0x00,0x15,0xb7,0x00,0x00,0x28,0x21, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08,0x8c,0x44,0x00,0x00,0x8f,0x82,0x84,0x38, ++0x00,0x04,0x19,0xc2,0x00,0x02,0x11,0xc2,0x10,0x62,0xff,0xf6,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x02,0x90,0x43,0x00,0x00,0x3c,0x12,0xb0,0x05, ++0xaf,0x84,0x84,0x38,0x30,0x63,0x00,0xff,0x00,0x03,0x11,0x40,0x00,0x43,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0x02,0x99,0x00,0x00,0x00,0x88,0x21, ++0x36,0x52,0x02,0x2c,0x27,0x90,0xb4,0x00,0x8e,0x04,0x00,0x00,0x00,0x00,0x00,0x00, ++0x90,0x83,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x62,0x00,0x03,0x10,0x40,0x00,0x06, ++0x30,0x62,0x00,0x1c,0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x8f,0x85,0x84,0x38, ++0x0c,0x00,0x1e,0x94,0x02,0x60,0x30,0x21,0x8e,0x42,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0x14,0x40,0xff,0xd7,0x00,0x00,0x00,0x00,0x26,0x31,0x00,0x01, ++0x2a,0x22,0x00,0x13,0x14,0x40,0xff,0xec,0x26,0x10,0x00,0x04,0x08,0x00,0x17,0x21, ++0x00,0x00,0x00,0x00,0x8f,0x84,0x84,0x4c,0x27,0x85,0x89,0x18,0x0c,0x00,0x17,0xa4, ++0x00,0x00,0x00,0x00,0x8f,0x83,0x84,0x4c,0x24,0x02,0x00,0x04,0x14,0x62,0xfe,0xa5, ++0x00,0x00,0x00,0x00,0x08,0x00,0x15,0xee,0x24,0x05,0x00,0x05,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x00,0x3f,0x90,0x44,0x00,0x00,0x24,0x03,0x00,0x01,0x10,0x64,0x00,0x08, ++0x00,0x00,0x00,0x00,0x27,0x84,0x89,0x18,0x0c,0x00,0x24,0x2c,0x00,0x00,0x00,0x00, ++0x24,0x05,0x00,0x05,0xaf,0x85,0x84,0x40,0x08,0x00,0x15,0xb7,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x14,0x8c,0x44,0x00,0x00,0x0c,0x00,0x24,0x49, ++0x00,0x00,0x00,0x00,0x08,0x00,0x17,0x65,0x24,0x05,0x00,0x05,0x8f,0x82,0x89,0x4c, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0d,0x00,0x00,0x00,0x00,0x8f,0x84,0xb4,0x40, ++0xaf,0x80,0x89,0x4c,0x94,0x85,0x00,0x14,0x0c,0x00,0x1b,0x66,0x00,0x00,0x00,0x00, ++0x93,0x82,0x8b,0x71,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x02,0x10,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x01,0x57,0x00,0x00,0x20,0x21,0x8f,0x84,0xb4,0x40, ++0x0c,0x00,0x18,0xd0,0x00,0x00,0x00,0x00,0x08,0x00,0x17,0x21,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xff,0x90,0x27,0xbd,0xff,0xe8,0x00,0x80,0x18,0x21,0x34,0x42,0x00,0x01, ++0x27,0x84,0x89,0x18,0x10,0x62,0x00,0x05,0xaf,0xbf,0x00,0x10,0x8f,0xbf,0x00,0x10, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x06,0xe5, ++0x00,0x00,0x00,0x00,0x27,0x84,0x86,0x58,0x0c,0x00,0x18,0x1f,0x00,0x00,0x00,0x00, ++0x27,0x84,0x84,0x40,0x0c,0x00,0x13,0xd9,0x00,0x00,0x00,0x00,0x08,0x00,0x17,0x8b, ++0x00,0x00,0x00,0x00,0x8f,0x82,0x89,0x58,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05, ++0x00,0x00,0x18,0x21,0x8f,0x82,0x84,0x48,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x02, ++0x00,0x00,0x00,0x00,0x24,0x03,0x00,0x01,0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21, ++0x27,0xbd,0xff,0xe0,0x3c,0x06,0xb0,0x03,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0x34,0xc6,0x00,0x5f,0xaf,0xbf,0x00,0x18,0x90,0xc3,0x00,0x00,0x3c,0x07,0xb0,0x03, ++0x34,0xe7,0x00,0x5d,0x34,0x63,0x00,0x01,0x3c,0x09,0xb0,0x03,0x24,0x02,0x00,0x01, ++0xa0,0xc3,0x00,0x00,0x00,0x80,0x80,0x21,0xa0,0xe2,0x00,0x00,0x00,0xa0,0x88,0x21, ++0x35,0x29,0x00,0x5e,0x00,0xe0,0x40,0x21,0x24,0x04,0x00,0x01,0x91,0x22,0x00,0x00, ++0x91,0x03,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x83,0x00,0x03,0x30,0x42,0x00,0x01, ++0x14,0x40,0xff,0xfa,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x04,0x12,0x02,0x00,0x2c, ++0x24,0x05,0x0f,0x00,0x24,0x02,0x00,0x06,0x12,0x02,0x00,0x08,0x24,0x05,0x00,0x0f, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x02,0x00,0xa0,0x50,0x00,0x00,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x24,0x04,0x0c,0x04, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x0f,0x24,0x04,0x0d,0x04,0x24,0x05,0x00,0x0f, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x80,0x24,0x05,0x1e,0x00, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x8c,0x24,0x05,0x0f,0x00, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x24,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x2c,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x3c,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x02,0x08,0x00,0x17,0xc5,0x3c,0x02,0xb0,0x03, ++0x24,0x04,0x08,0x8c,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x04,0x24,0x04,0x08,0x80, ++0x24,0x05,0x1e,0x00,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x04,0x24,0x04,0x0c,0x04, ++0x24,0x05,0x00,0x0f,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x04,0x24,0x04,0x0d,0x04, ++0x24,0x05,0x00,0x0f,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x04,0x24,0x04,0x08,0x24, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x03,0x24,0x04,0x08,0x2c, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x03,0x24,0x04,0x08,0x34, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x02,0x3c,0x05,0x00,0x30, ++0x24,0x06,0x00,0x03,0x0c,0x00,0x13,0x5f,0x24,0x04,0x08,0x3c,0x02,0x20,0x20,0x21, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x13,0xa4,0x24,0x06,0x01,0x07,0x08,0x00,0x17,0xc5, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x73,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x02,0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00, ++0xa3,0x80,0x81,0x58,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0xa3,0x82,0x81,0x58,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x00,0x80,0x70,0x21,0x34,0x63,0x00,0x20,0x24,0x42,0x60,0x7c, ++0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0x30,0xad,0xc0,0x02,0xb8, ++0x8c,0x83,0x00,0x00,0x24,0x02,0x00,0xff,0xa5,0xc0,0x00,0x0a,0x00,0x00,0x30,0x21, ++0xa7,0x82,0x8f,0xf0,0x27,0x88,0x90,0x00,0xa5,0xc3,0x00,0x08,0x3c,0x07,0xb0,0x08, ++0x30,0xc2,0xff,0xff,0x00,0x02,0x20,0xc0,0x24,0xc3,0x00,0x01,0x00,0x82,0x10,0x21, ++0x00,0x60,0x30,0x21,0x00,0x02,0x10,0x80,0x30,0x63,0xff,0xff,0x00,0x48,0x10,0x21, ++0x00,0x87,0x20,0x21,0x28,0xc5,0x00,0xff,0xac,0x83,0x00,0x00,0x14,0xa0,0xff,0xf4, ++0xa4,0x43,0x00,0x00,0x3c,0x02,0xb0,0x08,0x34,0x03,0xff,0xff,0x25,0xc4,0x00,0x0c, ++0x24,0x0a,0x00,0x02,0x34,0x42,0x07,0xf8,0x3c,0x06,0xb0,0x03,0xa7,0x83,0xb3,0xdc, ++0xac,0x43,0x00,0x00,0xaf,0x84,0xb4,0x00,0x34,0xc6,0x00,0x64,0xa0,0x8a,0x00,0x18, ++0x94,0xc5,0x00,0x00,0x8f,0x82,0xb4,0x00,0x25,0xc4,0x00,0x30,0x24,0x08,0x00,0x03, ++0x3c,0x03,0xb0,0x03,0xa0,0x45,0x00,0x21,0x34,0x63,0x00,0x66,0xaf,0x84,0xb4,0x04, ++0xa0,0x88,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xb4,0x04,0x25,0xc4,0x00,0x54, ++0x25,0xc7,0x00,0x78,0xa0,0x45,0x00,0x21,0xaf,0x84,0xb4,0x08,0xa0,0x88,0x00,0x18, ++0x94,0x65,0x00,0x00,0x8f,0x82,0xb4,0x08,0x25,0xc8,0x00,0x9c,0x24,0x09,0x00,0x01, ++0xa0,0x45,0x00,0x21,0xaf,0x87,0xb4,0x0c,0xa0,0xea,0x00,0x18,0x94,0xc4,0x00,0x00, ++0x8f,0x82,0xb4,0x0c,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x62,0xa0,0x44,0x00,0x21, ++0xaf,0x88,0xb4,0x10,0xa1,0x09,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xb4,0x10, ++0x25,0xc4,0x00,0xc0,0x3c,0x06,0xb0,0x03,0xa0,0x45,0x00,0x21,0xaf,0x84,0xb4,0x14, ++0xa0,0x89,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xb4,0x14,0x25,0xc4,0x00,0xe4, ++0x34,0xc6,0x00,0x60,0xa0,0x45,0x00,0x21,0xaf,0x84,0xb4,0x18,0xa0,0x80,0x00,0x18, ++0x94,0xc5,0x00,0x00,0x8f,0x82,0xb4,0x18,0x25,0xc3,0x01,0x08,0x25,0xc7,0x01,0x2c, ++0xa0,0x45,0x00,0x21,0xaf,0x83,0xb4,0x1c,0xa0,0x60,0x00,0x18,0x94,0xc8,0x00,0x00, ++0x8f,0x82,0xb4,0x1c,0x25,0xc4,0x01,0x50,0x25,0xc5,0x01,0x74,0xa0,0x48,0x00,0x21, ++0x25,0xc6,0x01,0x98,0x25,0xc9,0x01,0xbc,0x25,0xca,0x01,0xe0,0x25,0xcb,0x02,0x04, ++0x25,0xcc,0x02,0x28,0x25,0xcd,0x02,0x4c,0x24,0x02,0x00,0x10,0x3c,0x03,0xb0,0x03, ++0xaf,0x87,0xb4,0x20,0x34,0x63,0x00,0x38,0xa0,0xe0,0x00,0x18,0xaf,0x84,0xb4,0x24, ++0xa0,0x80,0x00,0x18,0xaf,0x85,0xb4,0x28,0xa0,0xa0,0x00,0x18,0xaf,0x86,0xb4,0x2c, ++0xa0,0xc0,0x00,0x18,0xaf,0x89,0xb4,0x30,0xa1,0x20,0x00,0x18,0xaf,0x8a,0xb4,0x34, ++0xa1,0x40,0x00,0x18,0xaf,0x8b,0xb4,0x38,0xa1,0x60,0x00,0x18,0xaf,0x8c,0xb4,0x3c, ++0xa1,0x80,0x00,0x18,0xaf,0x8d,0xb4,0x40,0xa1,0xa2,0x00,0x18,0x94,0x64,0x00,0x00, ++0x8f,0x82,0xb4,0x40,0x25,0xc5,0x02,0x70,0x3c,0x03,0xb0,0x03,0xa0,0x44,0x00,0x21, ++0x24,0x02,0x00,0x11,0xaf,0x85,0xb4,0x44,0x34,0x63,0x00,0x6e,0xa0,0xa2,0x00,0x18, ++0x94,0x64,0x00,0x00,0x8f,0x82,0xb4,0x44,0x25,0xc5,0x02,0x94,0x3c,0x03,0xb0,0x03, ++0xa0,0x44,0x00,0x21,0x24,0x02,0x00,0x12,0xaf,0x85,0xb4,0x48,0x34,0x63,0x00,0x6c, ++0xa0,0xa2,0x00,0x18,0x94,0x64,0x00,0x00,0x8f,0x82,0xb4,0x48,0x24,0x05,0xff,0xff, ++0x24,0x07,0x00,0x01,0xa0,0x44,0x00,0x21,0x24,0x06,0x00,0x12,0x27,0x84,0xb4,0x00, ++0x8c,0x82,0x00,0x00,0x24,0xc6,0xff,0xff,0xa0,0x40,0x00,0x04,0x8c,0x83,0x00,0x00, ++0xa4,0x45,0x00,0x00,0xa4,0x45,0x00,0x02,0xa0,0x60,0x00,0x0a,0x8c,0x82,0x00,0x00, ++0xa4,0x65,0x00,0x06,0xa4,0x65,0x00,0x08,0xa0,0x40,0x00,0x10,0x8c,0x83,0x00,0x00, ++0xa4,0x45,0x00,0x0c,0xa4,0x45,0x00,0x0e,0xa0,0x60,0x00,0x12,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0xa0,0x40,0x00,0x16,0x8c,0x83,0x00,0x00,0xa4,0x45,0x00,0x14, ++0xa0,0x67,0x00,0x17,0x8c,0x82,0x00,0x00,0x24,0x84,0x00,0x04,0xa0,0x40,0x00,0x20, ++0x04,0xc1,0xff,0xe7,0xac,0x40,0x00,0x1c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x00,0x34,0x42,0x00,0x20,0x24,0x63,0x63,0x40, ++0xac,0x43,0x00,0x00,0x90,0x82,0x00,0x10,0x00,0x80,0x60,0x21,0x10,0x40,0x00,0x56, ++0x00,0x00,0x70,0x21,0x97,0x82,0x8f,0xf0,0x94,0x8a,0x00,0x0c,0x27,0x87,0x90,0x00, ++0x00,0x02,0x40,0xc0,0x01,0x02,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21, ++0x90,0x8b,0x00,0x18,0xa4,0x4a,0x00,0x00,0x94,0x83,0x00,0x0e,0x39,0x64,0x00,0x10, ++0x2c,0x84,0x00,0x01,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x34,0x85,0x00,0x02, ++0x39,0x63,0x00,0x11,0x00,0x83,0x28,0x0b,0x34,0xa3,0x00,0x08,0x39,0x64,0x00,0x12, ++0x00,0x02,0x10,0x80,0x00,0xa4,0x18,0x0b,0x00,0x47,0x10,0x21,0x94,0x49,0x00,0x04, ++0x34,0x64,0x00,0x20,0x00,0x6b,0x20,0x0b,0x34,0x83,0x00,0x40,0x39,0x62,0x00,0x01, ++0x00,0x82,0x18,0x0b,0x00,0x09,0x30,0xc0,0x34,0x64,0x00,0x80,0x00,0xc9,0x28,0x21, ++0x39,0x62,0x00,0x02,0x00,0x60,0x68,0x21,0x00,0x82,0x68,0x0a,0x00,0x05,0x28,0x80, ++0x3c,0x02,0xb0,0x08,0x00,0xa7,0x28,0x21,0x00,0xc2,0x30,0x21,0x01,0x02,0x40,0x21, ++0x34,0x03,0xff,0xff,0x35,0xa4,0x01,0x00,0x39,0x62,0x00,0x03,0x2d,0x67,0x00,0x13, ++0xad,0x0a,0x00,0x00,0xa4,0xa3,0x00,0x00,0xac,0xc3,0x00,0x00,0xa7,0x89,0x8f,0xf0, ++0x10,0xe0,0x00,0x0f,0x00,0x82,0x68,0x0a,0x3c,0x03,0x80,0x01,0x00,0x0b,0x10,0x80, ++0x24,0x63,0x02,0x44,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x60, ++0x94,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x14,0x00,0x00,0x02,0x74,0x03, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x3a,0x94,0x44,0x00,0x00,0x93,0x83,0x8f,0xe4, ++0x91,0x82,0x00,0x21,0x01,0xc4,0x20,0x21,0x91,0x85,0x00,0x10,0x00,0x04,0x24,0x00, ++0x00,0x62,0x18,0x21,0x00,0x04,0x74,0x03,0x00,0x6e,0x18,0x23,0x00,0x65,0x10,0x2a, ++0x00,0xa2,0x18,0x0a,0x00,0x0d,0x24,0x00,0x3c,0x02,0xb0,0x06,0x24,0x05,0xff,0xff, ++0x00,0x64,0x18,0x25,0x34,0x42,0x80,0x20,0xac,0x43,0x00,0x00,0xa5,0x85,0x00,0x0e, ++0xa1,0x80,0x00,0x10,0xa5,0x85,0x00,0x0c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x08,0x00,0x19,0x14,0x34,0x63,0x00,0x62,0x3c,0x03,0xb0,0x03, ++0x08,0x00,0x19,0x14,0x34,0x63,0x00,0x64,0x3c,0x03,0xb0,0x03,0x08,0x00,0x19,0x14, ++0x34,0x63,0x00,0x66,0x3c,0x03,0xb0,0x03,0x08,0x00,0x19,0x14,0x34,0x63,0x00,0x38, ++0x3c,0x03,0xb0,0x03,0x08,0x00,0x19,0x14,0x34,0x63,0x00,0x6e,0x3c,0x03,0xb0,0x03, ++0x08,0x00,0x19,0x14,0x34,0x63,0x00,0x6c,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x65,0x08,0x00,0x05,0x28,0x40,0xac,0x62,0x00,0x00, ++0x00,0xa6,0x28,0x21,0x2c,0xe2,0x00,0x10,0x14,0x80,0x00,0x06,0x00,0x00,0x18,0x21, ++0x10,0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0xe0,0x18,0x21,0x03,0xe0,0x00,0x08, ++0x00,0x60,0x10,0x21,0x24,0x02,0x00,0x20,0x10,0xe2,0x00,0x06,0x2c,0xe4,0x00,0x10, ++0x24,0xa2,0x00,0x01,0x10,0x80,0xff,0xf9,0x00,0x02,0x11,0x00,0x08,0x00,0x19,0x4f, ++0x00,0x47,0x18,0x21,0x08,0x00,0x19,0x4f,0x24,0xa3,0x00,0x50,0x27,0xbd,0xff,0xc8, ++0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x30, ++0xaf,0xb7,0x00,0x2c,0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24,0xaf,0xb4,0x00,0x20, ++0xaf,0xb0,0x00,0x10,0x00,0x80,0x88,0x21,0x84,0x84,0x00,0x08,0x3c,0x05,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x34,0xa5,0x00,0x20,0x24,0x42,0x65,0x6c,0x3c,0x03,0xb0,0x06, ++0x00,0x04,0x20,0x80,0xac,0xa2,0x00,0x00,0x00,0x83,0x20,0x21,0x3c,0x06,0xb0,0x06, ++0x8c,0x82,0x00,0x00,0x34,0xc6,0x80,0x24,0x8c,0x88,0x00,0x00,0x8c,0xc4,0x00,0x00, ++0x96,0x25,0x00,0x08,0x30,0x52,0xff,0xff,0x00,0x08,0x44,0x02,0x34,0x84,0x01,0x00, ++0x3c,0x02,0xb0,0x00,0x00,0x08,0x18,0xc0,0x00,0x12,0x3a,0x00,0xac,0xc4,0x00,0x00, ++0x00,0xe2,0x38,0x21,0xae,0x32,0x02,0xb8,0x00,0x68,0x18,0x21,0x24,0xa5,0x00,0x02, ++0x8c,0xf6,0x00,0x00,0x30,0xa5,0x01,0xff,0x8c,0xf4,0x00,0x04,0x27,0x86,0x90,0x00, ++0x00,0x03,0x18,0x80,0x00,0x12,0x98,0xc0,0xa6,0x25,0x00,0x08,0x00,0x66,0x18,0x21, ++0x02,0x72,0x10,0x21,0x94,0x65,0x00,0x00,0x00,0x02,0x48,0x80,0x01,0x26,0x30,0x21, ++0x24,0x02,0xff,0xff,0x00,0x14,0x1a,0x02,0x27,0x84,0x90,0x10,0xa4,0xc2,0x00,0x02, ++0x30,0x63,0x00,0x1f,0x24,0x02,0x00,0x10,0x01,0x24,0x20,0x21,0xa4,0xc8,0x00,0x04, ++0x8c,0xf0,0x00,0x08,0xa6,0x23,0x00,0x06,0xa6,0x25,0x00,0x0a,0xa0,0x82,0x00,0x06, ++0x86,0x25,0x00,0x06,0x27,0x82,0x90,0x04,0x01,0x22,0x10,0x21,0x24,0x03,0x00,0x13, ++0x10,0xa3,0x00,0xee,0xac,0x47,0x00,0x18,0x3c,0x03,0xb0,0x03,0x34,0x63,0x01,0x00, ++0xa6,0x20,0x00,0x02,0x3c,0x02,0xb0,0x03,0x90,0x64,0x00,0x00,0x34,0x42,0x01,0x08, ++0x8c,0x45,0x00,0x00,0x00,0x10,0x1b,0xc2,0x00,0x04,0x20,0x82,0x30,0x63,0x00,0x01, ++0xac,0xc5,0x00,0x08,0x10,0x60,0x00,0xc7,0x30,0x97,0x00,0x01,0x00,0x10,0x16,0x82, ++0x30,0x46,0x00,0x01,0x00,0x10,0x12,0x02,0x00,0x10,0x19,0xc2,0x00,0x10,0x26,0x02, ++0x00,0x10,0x2e,0x42,0x30,0x48,0x00,0x7f,0x24,0x02,0x00,0x01,0x30,0x75,0x00,0x01, ++0x30,0x84,0x00,0x01,0x10,0xc2,0x00,0xb3,0x30,0xa3,0x00,0x01,0x00,0x60,0x28,0x21, ++0x0c,0x00,0x19,0x42,0x01,0x00,0x38,0x21,0x02,0x72,0x18,0x21,0x00,0x03,0x18,0x80, ++0x2c,0x46,0x00,0x54,0x27,0x85,0x90,0x10,0x27,0x84,0x90,0x08,0x00,0x06,0x10,0x0a, ++0x00,0x65,0x28,0x21,0x26,0xa6,0x00,0x02,0x00,0x64,0x18,0x21,0xa0,0xa2,0x00,0x02, ++0xa0,0x66,0x00,0x06,0xa0,0x62,0x00,0x07,0xa0,0xa2,0x00,0x01,0x02,0x72,0x28,0x21, ++0x00,0x05,0x28,0x80,0x27,0x82,0x90,0x04,0x00,0xa2,0x58,0x21,0x8d,0x64,0x00,0x18, ++0x00,0x10,0x15,0xc2,0x30,0x42,0x00,0x01,0x8c,0x83,0x00,0x0c,0x27,0x84,0x90,0x20, ++0x00,0xa4,0x48,0x21,0xa6,0x22,0x00,0x00,0xa6,0x36,0x00,0x04,0x8d,0x26,0x00,0x00, ++0x00,0x03,0x19,0x42,0x3c,0x02,0xff,0xef,0x34,0x42,0xff,0xff,0x30,0x63,0x00,0x01, ++0x00,0xc2,0x40,0x24,0x00,0x03,0x1d,0x00,0x01,0x03,0x40,0x25,0x00,0x08,0x15,0x02, ++0x00,0x14,0x19,0x82,0x00,0x14,0x25,0x82,0x00,0x10,0x34,0x42,0x00,0x10,0x3c,0x82, ++0x00,0x10,0x2c,0x02,0x30,0x42,0x00,0x01,0x30,0xcd,0x00,0x01,0x30,0x6c,0x00,0x01, ++0x30,0xe6,0x00,0x01,0x30,0x8a,0x00,0x03,0x32,0x94,0x00,0x07,0x30,0xa5,0x00,0x01, ++0xad,0x28,0x00,0x00,0x10,0x40,0x00,0x0b,0x32,0x07,0x00,0x7f,0x8d,0x64,0x00,0x18, ++0x3c,0x03,0xff,0xf0,0x34,0x63,0xff,0xff,0x8c,0x82,0x00,0x0c,0x01,0x03,0x18,0x24, ++0x00,0x02,0x13,0x82,0x30,0x42,0x00,0x0f,0x00,0x02,0x14,0x00,0x00,0x62,0x18,0x25, ++0xad,0x23,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xc2,0x00,0x6a,0x00,0x00,0x00,0x00, ++0x15,0x80,0x00,0x03,0x00,0x00,0x00,0x00,0x15,0x40,0x00,0x5b,0x24,0x02,0x00,0x01, ++0x96,0x22,0x00,0x04,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x04,0xa6,0x22,0x00,0x04, ++0x00,0xa0,0x20,0x21,0x0c,0x00,0x19,0x42,0x01,0xa0,0x28,0x21,0x02,0x72,0x18,0x21, ++0x00,0x03,0x40,0x80,0x2c,0x45,0x00,0x54,0x27,0x84,0x90,0x10,0x01,0x04,0x20,0x21, ++0x00,0x05,0x10,0x0a,0xa0,0x82,0x00,0x00,0xa0,0x80,0x00,0x04,0xa0,0x80,0x00,0x05, ++0x96,0x23,0x00,0x04,0x27,0x82,0x90,0x00,0x01,0x02,0x10,0x21,0xa4,0x43,0x00,0x06, ++0x27,0x82,0x90,0x04,0x92,0x26,0x00,0x01,0x01,0x02,0x10,0x21,0x8c,0x45,0x00,0x18, ++0x27,0x83,0x90,0x20,0x01,0x03,0x18,0x21,0xa0,0x60,0x00,0x00,0xa0,0x86,0x00,0x07, ++0x94,0xa2,0x00,0x10,0x24,0x03,0x00,0x04,0x30,0x42,0x00,0x0f,0x10,0x43,0x00,0x36, ++0x24,0xa5,0x00,0x10,0x94,0xa3,0x00,0x16,0x27,0x87,0x90,0x18,0x01,0x07,0x10,0x21, ++0xa4,0x43,0x00,0x02,0x94,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x24,0x02,0x72,0x20,0x21,0x94,0xa2,0x00,0x00,0x24,0x03,0x00,0xa4, ++0x30,0x42,0x00,0xff,0x10,0x43,0x00,0x1f,0x00,0x00,0x00,0x00,0x94,0xa2,0x00,0x00, ++0x24,0x03,0x00,0x88,0x30,0x42,0x00,0x88,0x10,0x43,0x00,0x14,0x02,0x72,0x18,0x21, ++0x27,0x84,0x90,0x20,0x00,0x03,0x18,0x80,0x00,0x64,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x3c,0x04,0x00,0x80,0x00,0x44,0x10,0x25,0xac,0x62,0x00,0x00,0x02,0x72,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21,0xa0,0x54,0x00,0x00,0x8f,0xbf,0x00,0x30, ++0x7b,0xb6,0x01,0x7c,0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x94,0xa2,0x00,0x18, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x60,0x10,0x40,0xff,0xe9,0x02,0x72,0x18,0x21, ++0x02,0x72,0x20,0x21,0x27,0x82,0x90,0x20,0x00,0x04,0x20,0x80,0x00,0x82,0x20,0x21, ++0x8c,0x83,0x00,0x00,0x3c,0x02,0xff,0x7f,0x34,0x42,0xff,0xff,0x00,0x62,0x18,0x24, ++0x08,0x00,0x1a,0x37,0xac,0x83,0x00,0x00,0x27,0x87,0x90,0x18,0x01,0x07,0x10,0x21, ++0x08,0x00,0x1a,0x21,0xa4,0x40,0x00,0x02,0x11,0x42,0x00,0x07,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x02,0x14,0x40,0xff,0xa7,0x00,0xa0,0x20,0x21,0x96,0x22,0x00,0x04, ++0x08,0x00,0x19,0xff,0x24,0x42,0x00,0x0c,0x96,0x22,0x00,0x04,0x08,0x00,0x19,0xff, ++0x24,0x42,0x00,0x08,0x16,0xe6,0xff,0x96,0x3c,0x02,0xff,0xfb,0x8d,0x63,0x00,0x18, ++0x34,0x42,0xff,0xff,0x02,0x02,0x10,0x24,0xac,0x62,0x00,0x08,0x08,0x00,0x19,0xf8, ++0x00,0x00,0x30,0x21,0x16,0xe6,0xff,0x4e,0x00,0x60,0x28,0x21,0x3c,0x02,0xfb,0xff, ++0x34,0x42,0xff,0xff,0x02,0x02,0x10,0x24,0xac,0xe2,0x00,0x08,0x08,0x00,0x19,0xb7, ++0x00,0x00,0x30,0x21,0x93,0x87,0xbb,0x14,0x00,0x10,0x1e,0x42,0x00,0x10,0x26,0x82, ++0x27,0x82,0x90,0x08,0x2c,0xe5,0x00,0x0c,0x01,0x22,0x48,0x21,0x30,0x63,0x00,0x01, ++0x30,0x86,0x00,0x01,0x14,0xa0,0x00,0x06,0x00,0xe0,0x40,0x21,0x00,0x03,0x10,0x40, ++0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0xe2,0x10,0x21,0x24,0x48,0x00,0x04, ++0x02,0x72,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x84,0x90,0x10,0x27,0x83,0x90,0x08, ++0x00,0x44,0x20,0x21,0x00,0x43,0x10,0x21,0xa1,0x28,0x00,0x07,0xa0,0x40,0x00,0x06, ++0xa0,0x80,0x00,0x02,0x08,0x00,0x19,0xc7,0xa0,0x80,0x00,0x01,0x24,0x02,0x00,0x01, ++0xa6,0x22,0x00,0x02,0x0c,0x00,0x01,0xc2,0x00,0xe0,0x20,0x21,0x08,0x00,0x1a,0x3b, ++0x00,0x00,0x00,0x00,0x30,0xa7,0xff,0xff,0x00,0x07,0x18,0xc0,0x00,0x67,0x18,0x21, ++0x3c,0x06,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x6a,0x44,0x27,0x85,0x90,0x10, ++0x00,0x03,0x18,0x80,0x34,0xc6,0x00,0x20,0x00,0x65,0x18,0x21,0xac,0xc2,0x00,0x00, ++0x80,0x62,0x00,0x07,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x29,0x00,0x80,0x28,0x21, ++0x90,0x82,0x00,0x16,0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02,0x30,0x43,0x00,0x01, ++0x14,0x60,0x00,0x02,0xa0,0x82,0x00,0x16,0xa0,0x80,0x00,0x17,0x90,0xa2,0x00,0x04, ++0x3c,0x03,0xb0,0x03,0x27,0x86,0x90,0x00,0x14,0x40,0x00,0x06,0x34,0x63,0x00,0x20, ++0x24,0x02,0x00,0x01,0xa0,0xa2,0x00,0x04,0xa4,0xa7,0x00,0x02,0x03,0xe0,0x00,0x08, ++0xa4,0xa7,0x00,0x00,0x94,0xa4,0x00,0x02,0x3c,0x02,0x80,0x01,0x24,0x42,0x82,0x6c, ++0xac,0x62,0x00,0x00,0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80, ++0x00,0x66,0x18,0x21,0x94,0x62,0x00,0x04,0xa4,0x67,0x00,0x02,0x3c,0x03,0xb0,0x08, ++0x00,0x02,0x20,0xc0,0x00,0x82,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21, ++0x00,0x83,0x20,0x21,0xa4,0x47,0x00,0x00,0xac,0x87,0x00,0x00,0x90,0xa2,0x00,0x04, ++0xa4,0xa7,0x00,0x02,0x24,0x42,0x00,0x01,0x03,0xe0,0x00,0x08,0xa0,0xa2,0x00,0x04, ++0x90,0x82,0x00,0x16,0x24,0x85,0x00,0x06,0x34,0x42,0x00,0x01,0x30,0x43,0x00,0x02, ++0x14,0x60,0xff,0xda,0xa0,0x82,0x00,0x16,0x24,0x02,0x00,0x01,0x08,0x00,0x1a,0xa7, ++0xa0,0x82,0x00,0x17,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x00,0x80,0x38,0x21, ++0x84,0x84,0x00,0x02,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x3c,0x0a,0xb0,0x06, ++0x34,0x63,0x00,0x20,0x24,0x42,0x6b,0x44,0x3c,0x0b,0xb0,0x08,0x27,0x89,0x90,0x00, ++0x34,0x0c,0xff,0xff,0x35,0x4a,0x80,0x20,0x10,0x80,0x00,0x30,0xac,0x62,0x00,0x00, ++0x97,0x82,0x8f,0xf0,0x94,0xe6,0x02,0xba,0x00,0x02,0x18,0xc0,0x00,0x6b,0x28,0x21, ++0xac,0xa6,0x00,0x00,0x8c,0xe4,0x02,0xb8,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80, ++0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x21, ++0x94,0x48,0x00,0x04,0x00,0x69,0x18,0x21,0xa4,0x66,0x00,0x00,0x00,0x08,0x28,0xc0, ++0x00,0xab,0x10,0x21,0xac,0x4c,0x00,0x00,0x8c,0xe4,0x02,0xb8,0x27,0x82,0x90,0x04, ++0x00,0xa8,0x28,0x21,0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80, ++0x00,0x62,0x10,0x21,0x8c,0x46,0x00,0x18,0x27,0x84,0x90,0x10,0x00,0x64,0x18,0x21, ++0x8c,0xc2,0x00,0x00,0x80,0x67,0x00,0x06,0x00,0x05,0x28,0x80,0x30,0x42,0xff,0xff, ++0x00,0x47,0x10,0x21,0x30,0x43,0x00,0xff,0x00,0x03,0x18,0x2b,0x00,0x02,0x12,0x02, ++0x00,0x43,0x10,0x21,0x3c,0x04,0x00,0x04,0x00,0xa9,0x28,0x21,0x00,0x44,0x10,0x25, ++0xa4,0xac,0x00,0x00,0xad,0x42,0x00,0x00,0xa7,0x88,0x8f,0xf0,0x8f,0xbf,0x00,0x10, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x84,0xe3,0x00,0x06, ++0x27,0x82,0xb4,0x00,0x94,0xe5,0x02,0xba,0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21, ++0x8c,0x64,0x00,0x00,0x0c,0x00,0x1a,0x91,0x00,0x00,0x00,0x00,0x08,0x00,0x1b,0x0b, ++0x00,0x00,0x00,0x00,0x94,0x88,0x00,0x00,0x00,0x80,0x58,0x21,0x27,0x8a,0x90,0x00, ++0x00,0x08,0x18,0xc0,0x00,0x68,0x18,0x21,0x3c,0x04,0xb0,0x03,0x00,0x03,0x18,0x80, ++0x3c,0x02,0x80,0x00,0x00,0x6a,0x18,0x21,0x34,0x84,0x00,0x20,0x24,0x42,0x6c,0x64, ++0x30,0xa5,0xff,0xff,0xac,0x82,0x00,0x00,0x94,0x67,0x00,0x02,0x11,0x05,0x00,0x35, ++0x24,0x04,0x00,0x01,0x91,0x66,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x86,0x10,0x2a, ++0x10,0x40,0x00,0x10,0x00,0xc0,0x48,0x21,0x3c,0x0d,0xb0,0x03,0x01,0x40,0x60,0x21, ++0x35,0xad,0x00,0x20,0x10,0xe5,0x00,0x0d,0x24,0x84,0x00,0x01,0x00,0x07,0x10,0xc0, ++0x00,0x47,0x10,0x21,0x00,0x02,0x10,0x80,0x01,0x20,0x30,0x21,0x00,0x4a,0x10,0x21, ++0x00,0x86,0x18,0x2a,0x00,0xe0,0x40,0x21,0x94,0x47,0x00,0x02,0x14,0x60,0xff,0xf5, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x10,0x21,0x00,0x08,0x20,0xc0, ++0x00,0x88,0x20,0x21,0x24,0xc2,0xff,0xff,0x00,0x04,0x20,0x80,0xa1,0x62,0x00,0x04, ++0x00,0x8c,0x20,0x21,0x94,0x83,0x00,0x04,0x00,0x07,0x10,0xc0,0x00,0x47,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x4c,0x10,0x21,0x00,0x03,0x28,0xc0,0x94,0x46,0x00,0x02, ++0x00,0xa3,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x6c,0x18,0x21,0xa4,0x66,0x00,0x00, ++0xa4,0x86,0x00,0x02,0x95,0x64,0x00,0x02,0x3c,0x03,0xb0,0x08,0x3c,0x02,0x80,0x01, ++0x00,0xa3,0x28,0x21,0x24,0x42,0x82,0x6c,0xad,0xa2,0x00,0x00,0x10,0x87,0x00,0x03, ++0xac,0xa6,0x00,0x00,0x03,0xe0,0x00,0x08,0x24,0x02,0x00,0x01,0x08,0x00,0x1b,0x59, ++0xa5,0x68,0x00,0x02,0x91,0x62,0x00,0x04,0xa5,0x67,0x00,0x00,0x24,0x42,0xff,0xff, ++0x30,0x43,0x00,0xff,0x14,0x60,0xff,0xf7,0xa1,0x62,0x00,0x04,0x24,0x02,0xff,0xff, ++0x08,0x00,0x1b,0x59,0xa5,0x62,0x00,0x02,0x00,0x05,0x40,0xc0,0x01,0x05,0x30,0x21, ++0x27,0xbd,0xff,0xd8,0x00,0x06,0x30,0x80,0x27,0x82,0x90,0x04,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb0,0x00,0x10, ++0x00,0xc2,0x10,0x21,0x8c,0x47,0x00,0x18,0x00,0xa0,0x90,0x21,0x3c,0x02,0x80,0x00, ++0x3c,0x05,0xb0,0x03,0x34,0xa5,0x00,0x20,0x24,0x42,0x6d,0x98,0xac,0xa2,0x00,0x00, ++0x27,0x83,0x90,0x10,0x00,0xc3,0x30,0x21,0x8c,0xe2,0x00,0x00,0x80,0xc5,0x00,0x06, ++0x00,0x80,0x88,0x21,0x30,0x42,0xff,0xff,0x00,0x45,0x10,0x21,0x30,0x43,0x00,0xff, ++0x10,0x60,0x00,0x02,0x00,0x02,0x12,0x02,0x24,0x42,0x00,0x01,0x30,0x53,0x00,0xff, ++0x01,0x12,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x10,0x00,0x43,0x10,0x21, ++0x80,0x44,0x00,0x07,0x00,0x00,0x00,0x00,0x10,0x80,0x00,0x4b,0x26,0x24,0x00,0x06, ++0x32,0x50,0xff,0xff,0x02,0x20,0x20,0x21,0x0c,0x00,0x1b,0x19,0x02,0x00,0x28,0x21, ++0x92,0x22,0x00,0x10,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x2e,0x3c,0x03,0xb0,0x08, ++0x3c,0x09,0x80,0x01,0x27,0x88,0x90,0x00,0xa6,0x32,0x00,0x0c,0x00,0x10,0x20,0xc0, ++0x00,0x90,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x88,0x20,0x21,0x94,0x82,0x00,0x04, ++0x3c,0x03,0xb0,0x08,0x3c,0x07,0xb0,0x03,0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x48,0x10,0x21,0x00,0xa3,0x28,0x21,0x25,0x26,0x82,0x6c, ++0x34,0x03,0xff,0xff,0x34,0xe7,0x00,0x20,0xac,0xe6,0x00,0x00,0xa4,0x83,0x00,0x02, ++0xa4,0x43,0x00,0x00,0xac,0xa3,0x00,0x00,0x92,0x22,0x00,0x10,0x92,0x23,0x00,0x0a, ++0xa6,0x32,0x00,0x0e,0x02,0x62,0x10,0x21,0x14,0x60,0x00,0x05,0xa2,0x22,0x00,0x10, ++0x92,0x22,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfe,0xa2,0x22,0x00,0x16, ++0x92,0x22,0x00,0x04,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00, ++0x92,0x22,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfd,0xa2,0x22,0x00,0x16, ++0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x28,0x96,0x22,0x00,0x0e,0x27,0x88,0x90,0x00,0x00,0x02,0x20,0xc0, ++0x00,0x82,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x88,0x20,0x21,0x94,0x82,0x00,0x04, ++0x3c,0x06,0xb0,0x03,0x3c,0x09,0x80,0x01,0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0xa3,0x28,0x21,0x00,0x48,0x10,0x21,0x34,0xc6,0x00,0x20, ++0x25,0x23,0x82,0x6c,0xac,0xc3,0x00,0x00,0xa4,0x50,0x00,0x00,0xac,0xb0,0x00,0x00, ++0x08,0x00,0x1b,0x97,0xa4,0x90,0x00,0x02,0x08,0x00,0x1b,0x8e,0x32,0x50,0xff,0xff, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x6f,0x60,0x34,0x63,0x00,0x20, ++0xac,0x62,0x00,0x00,0x90,0x82,0x00,0x04,0x97,0xaa,0x00,0x12,0x00,0x80,0x60,0x21, ++0x30,0xa8,0xff,0xff,0x00,0x4a,0x20,0x23,0x34,0x09,0xff,0xff,0x30,0xcf,0xff,0xff, ++0x30,0xee,0xff,0xff,0x11,0x09,0x00,0x73,0xa1,0x84,0x00,0x04,0x00,0x0e,0xc0,0xc0, ++0x00,0x08,0x10,0xc0,0x00,0x48,0x10,0x21,0x03,0x0e,0x20,0x21,0x27,0x8d,0x90,0x00, ++0x00,0x04,0x20,0x80,0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21,0x00,0x8d,0x20,0x21, ++0x94,0x86,0x00,0x02,0x94,0x43,0x00,0x04,0x3c,0x19,0x80,0x01,0xa4,0x46,0x00,0x02, ++0x00,0x03,0x28,0xc0,0x00,0xa3,0x18,0x21,0x94,0x87,0x00,0x02,0x3c,0x02,0xb0,0x08, ++0x00,0x03,0x18,0x80,0x00,0xa2,0x28,0x21,0x00,0x6d,0x18,0x21,0x27,0x22,0x82,0x6c, ++0x3c,0x01,0xb0,0x03,0xac,0x22,0x00,0x20,0xa4,0x66,0x00,0x00,0x10,0xe9,0x00,0x57, ++0xac,0xa6,0x00,0x00,0x01,0xe0,0x30,0x21,0x11,0x40,0x00,0x1d,0x00,0x00,0x48,0x21, ++0x01,0x40,0x38,0x21,0x27,0x8b,0x90,0x04,0x27,0x8a,0x90,0x10,0x00,0x06,0x40,0xc0, ++0x01,0x06,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x6b,0x10,0x21,0x8c,0x44,0x00,0x18, ++0x00,0x6a,0x18,0x21,0x80,0x65,0x00,0x06,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0xff,0xff,0x00,0x45,0x10,0x21,0x30,0x44,0x00,0xff,0x00,0x02,0x12,0x02, ++0x01,0x22,0x18,0x21,0x24,0x62,0x00,0x01,0x14,0x80,0x00,0x02,0x30,0x49,0x00,0xff, ++0x30,0x69,0x00,0xff,0x01,0x06,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21, ++0x24,0xe7,0xff,0xff,0x94,0x46,0x00,0x02,0x14,0xe0,0xff,0xe9,0x00,0x06,0x40,0xc0, ++0x91,0x82,0x00,0x10,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x20,0x3c,0x06,0xb0,0x03, ++0xa5,0x8f,0x00,0x0c,0x03,0x0e,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x8d,0x20,0x21, ++0x94,0x82,0x00,0x04,0x3c,0x03,0xb0,0x08,0x3c,0x07,0xb0,0x03,0x00,0x02,0x28,0xc0, ++0x00,0xa2,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21,0x00,0xa3,0x28,0x21, ++0x27,0x26,0x82,0x6c,0x34,0x03,0xff,0xff,0x34,0xe7,0x00,0x20,0xac,0xe6,0x00,0x00, ++0xa4,0x83,0x00,0x02,0xa4,0x43,0x00,0x00,0xac,0xa3,0x00,0x00,0x91,0x82,0x00,0x10, ++0x91,0x83,0x00,0x04,0xa5,0x8e,0x00,0x0e,0x01,0x22,0x10,0x21,0x14,0x60,0x00,0x05, ++0xa1,0x82,0x00,0x10,0x91,0x82,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfd, ++0xa1,0x82,0x00,0x16,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x95,0x82,0x00,0x0e, ++0x3c,0x03,0xb0,0x08,0x00,0x02,0x20,0xc0,0x00,0x82,0x20,0x21,0x00,0x04,0x20,0x80, ++0x00,0x8d,0x20,0x21,0x94,0x82,0x00,0x04,0x34,0xc6,0x00,0x20,0x27,0x27,0x82,0x6c, ++0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0xa3,0x28,0x21, ++0x00,0x4d,0x10,0x21,0xac,0xc7,0x00,0x00,0xa4,0x8f,0x00,0x02,0xa4,0x4f,0x00,0x00, ++0xac,0xaf,0x00,0x00,0x08,0x00,0x1c,0x26,0x03,0x0e,0x20,0x21,0x08,0x00,0x1c,0x01, ++0xa5,0x88,0x00,0x02,0x00,0x0e,0xc0,0xc0,0x03,0x0e,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x8d,0x90,0x00,0x00,0x4d,0x10,0x21,0x94,0x43,0x00,0x02,0x30,0x84,0x00,0xff, ++0x14,0x80,0x00,0x05,0xa5,0x83,0x00,0x00,0x24,0x02,0xff,0xff,0x3c,0x19,0x80,0x01, ++0x08,0x00,0x1c,0x01,0xa5,0x82,0x00,0x02,0x08,0x00,0x1c,0x01,0x3c,0x19,0x80,0x01, ++0x3c,0x08,0xb0,0x03,0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0x78,0x35,0x08,0x00,0x20, ++0x24,0x42,0x71,0xa0,0xaf,0xb2,0x00,0x68,0xaf,0xb1,0x00,0x64,0xaf,0xb0,0x00,0x60, ++0xad,0x02,0x00,0x00,0xaf,0xbf,0x00,0x84,0xaf,0xbe,0x00,0x80,0xaf,0xb7,0x00,0x7c, ++0xaf,0xb6,0x00,0x78,0xaf,0xb5,0x00,0x74,0xaf,0xb4,0x00,0x70,0xaf,0xb3,0x00,0x6c, ++0xaf,0xa4,0x00,0x88,0x90,0x83,0x00,0x0a,0x27,0x82,0xb4,0x00,0xaf,0xa6,0x00,0x90, ++0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x8c,0x63,0x00,0x00,0xaf,0xa7,0x00,0x94, ++0x27,0x86,0x90,0x04,0xaf,0xa3,0x00,0x1c,0x94,0x63,0x00,0x14,0x30,0xb1,0xff,0xff, ++0x24,0x08,0x00,0x01,0x00,0x03,0x20,0xc0,0xaf,0xa3,0x00,0x18,0x00,0x83,0x18,0x21, ++0xaf,0xa4,0x00,0x54,0x00,0x03,0x18,0x80,0x27,0x84,0x90,0x10,0x00,0x64,0x20,0x21, ++0x80,0x82,0x00,0x06,0x00,0x66,0x18,0x21,0x8c,0x66,0x00,0x18,0x24,0x42,0x00,0x02, ++0x00,0x02,0x1f,0xc2,0x8c,0xc4,0x00,0x08,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x00,0x02,0x10,0x40,0x00,0x04,0x2f,0xc2,0x00,0x04,0x1c,0x82,0x00,0xc2,0x38,0x21, ++0x00,0x04,0x24,0x42,0x8f,0xa2,0x00,0x1c,0x30,0x63,0x00,0x01,0x30,0x84,0x00,0x01, ++0xaf,0xa5,0x00,0x3c,0xaf,0xa3,0x00,0x34,0xaf,0xa4,0x00,0x38,0xaf,0xa0,0x00,0x40, ++0xaf,0xa0,0x00,0x44,0xaf,0xa0,0x00,0x50,0xaf,0xa8,0x00,0x20,0x80,0x42,0x00,0x12, ++0x8f,0xb2,0x00,0x18,0xaf,0xa2,0x00,0x28,0x8c,0xd0,0x00,0x0c,0x14,0xa0,0x01,0xe4, ++0x00,0x60,0x30,0x21,0x00,0x10,0x10,0x82,0x30,0x45,0x00,0x07,0x10,0xa0,0x00,0x11, ++0xaf,0xa0,0x00,0x30,0x8f,0xa4,0x00,0x98,0x27,0x82,0x80,0x1c,0x00,0x04,0x18,0x40, ++0x00,0x62,0x18,0x21,0x24,0xa2,0x00,0x06,0x8f,0xa5,0x00,0x20,0x94,0x64,0x00,0x00, ++0x00,0x45,0x10,0x04,0x00,0x44,0x00,0x1a,0x14,0x80,0x00,0x02,0x00,0x00,0x00,0x00, ++0x00,0x07,0x00,0x0d,0x00,0x00,0x10,0x12,0x24,0x42,0x00,0x20,0x30,0x42,0xff,0xfc, ++0xaf,0xa2,0x00,0x30,0x8f,0xa3,0x00,0x18,0x8f,0xa4,0x00,0x28,0x34,0x02,0xff,0xff, ++0xaf,0xa0,0x00,0x2c,0xaf,0xa2,0x00,0x48,0xaf,0xa3,0x00,0x4c,0x00,0x60,0xf0,0x21, ++0x00,0x00,0xb8,0x21,0x18,0x80,0x00,0x48,0xaf,0xa0,0x00,0x24,0x00,0x11,0x89,0x02, ++0xaf,0xb1,0x00,0x58,0x00,0x80,0xa8,0x21,0x00,0x12,0x10,0xc0,0x00,0x52,0x18,0x21, ++0x00,0x03,0x80,0x80,0x27,0x85,0x90,0x00,0x02,0x40,0x20,0x21,0x00,0x40,0xa0,0x21, ++0x02,0x05,0x10,0x21,0x94,0x56,0x00,0x02,0x0c,0x00,0x12,0x8b,0x00,0x00,0x28,0x21, ++0x90,0x42,0x00,0x00,0x24,0x03,0x00,0x08,0x30,0x42,0x00,0x0c,0x10,0x43,0x01,0x9e, ++0x24,0x04,0x00,0x01,0x24,0x02,0x00,0x01,0x10,0x82,0x01,0x7c,0x3c,0x02,0xb0,0x03, ++0x8f,0xa6,0x00,0x88,0x34,0x42,0x01,0x04,0x84,0xc5,0x00,0x0c,0x02,0x92,0x18,0x21, ++0x94,0x46,0x00,0x00,0x00,0x05,0x20,0xc0,0x00,0x85,0x20,0x21,0x00,0x03,0x18,0x80, ++0x27,0x82,0x90,0x10,0x27,0x85,0x90,0x08,0x00,0x65,0x28,0x21,0x00,0x62,0x18,0x21, ++0x80,0x71,0x00,0x05,0x80,0x73,0x00,0x04,0x8f,0xa3,0x00,0x88,0x30,0xd0,0xff,0xff, ++0x00,0x10,0x3a,0x03,0x32,0x08,0x00,0xff,0x27,0x82,0x90,0x20,0x00,0x04,0x20,0x80, ++0x80,0xa6,0x00,0x06,0x00,0x82,0x20,0x21,0xa4,0x67,0x00,0x44,0xa4,0x68,0x00,0x46, ++0x8c,0x84,0x00,0x00,0x38,0xc6,0x00,0x00,0x01,0x00,0x80,0x21,0x00,0x04,0x15,0x02, ++0x30,0x42,0x00,0x01,0x10,0x40,0x00,0x03,0x00,0xe6,0x80,0x0a,0x00,0x04,0x14,0x02, ++0x30,0x50,0x00,0x0f,0x12,0x20,0x01,0x50,0x02,0x40,0x20,0x21,0x02,0x71,0x10,0x21, ++0x00,0x50,0x10,0x2a,0x14,0x40,0x00,0xed,0x02,0x92,0x10,0x21,0x93,0x82,0x8b,0x71, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0xe0,0x02,0x92,0x28,0x21, ++0x26,0xe2,0x00,0x01,0x30,0x57,0xff,0xff,0x02,0x40,0xf0,0x21,0x26,0xb5,0xff,0xff, ++0x16,0xa0,0xff,0xbd,0x02,0xc0,0x90,0x21,0x16,0xe0,0x00,0xd0,0x00,0x00,0x00,0x00, ++0x8f,0xa3,0x00,0x98,0x00,0x00,0x00,0x00,0x2c,0x62,0x00,0x10,0x10,0x40,0x00,0x2e, ++0x00,0x00,0x00,0x00,0x8f,0xa4,0x00,0x24,0x00,0x00,0x00,0x00,0x18,0x80,0x00,0x2a, ++0x24,0x03,0x00,0x01,0x8f,0xa5,0x00,0x1c,0x27,0x84,0x90,0x04,0x94,0xb2,0x00,0x14, ++0xa0,0xa3,0x00,0x12,0x8f,0xa6,0x00,0x3c,0x00,0x12,0x10,0xc0,0x00,0x52,0x10,0x21, ++0x00,0x02,0x80,0x80,0x27,0x82,0x90,0x10,0x02,0x02,0x10,0x21,0x80,0x43,0x00,0x06, ++0x02,0x04,0x20,0x21,0x8c,0x85,0x00,0x18,0x24,0x63,0x00,0x02,0x00,0x03,0x17,0xc2, ++0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x43,0x00,0x03,0x18,0x40,0x14,0xc0,0x00,0x0e, ++0x00,0xa3,0x38,0x21,0x27,0x82,0x90,0x00,0x02,0x02,0x10,0x21,0x94,0x43,0x00,0x06, ++0x8f,0xa8,0x00,0x1c,0x24,0x02,0x00,0x01,0xa5,0x03,0x00,0x1a,0x7b,0xbe,0x04,0x3c, ++0x7b,0xb6,0x03,0xfc,0x7b,0xb4,0x03,0xbc,0x7b,0xb2,0x03,0x7c,0x7b,0xb0,0x03,0x3c, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x88,0x8f,0xa4,0x00,0x98,0x8f,0xa5,0x00,0x38, ++0x8f,0xa6,0x00,0x34,0xaf,0xa0,0x00,0x10,0x0c,0x00,0x09,0x0a,0xaf,0xa0,0x00,0x14, ++0x08,0x00,0x1d,0x2d,0x00,0x00,0x00,0x00,0x8f,0xa3,0x00,0x44,0x93,0x82,0x81,0x58, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x61,0x30,0x69,0x00,0x03,0x8f,0xa4,0x00,0x24, ++0x8f,0xa5,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x85,0x10,0x2a,0x10,0x40,0x00,0x8f, ++0x00,0x00,0x00,0x00,0x8f,0xa6,0x00,0x1c,0x00,0x00,0x00,0x00,0x90,0xc4,0x00,0x04, ++0x00,0x00,0x00,0x00,0x30,0x83,0x00,0xff,0x00,0xa3,0x10,0x2a,0x10,0x40,0x00,0x87, ++0x00,0x00,0x00,0x00,0x8f,0xa8,0x00,0x24,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x83, ++0x00,0x65,0x10,0x23,0x00,0xa8,0x18,0x23,0x00,0x62,0x10,0x2a,0x14,0x40,0x00,0x7d, ++0x30,0x63,0x00,0xff,0x00,0x85,0x10,0x23,0x30,0x42,0x00,0xff,0xaf,0xa2,0x00,0x50, ++0x8f,0xa2,0x00,0x50,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x73,0x00,0x00,0xa8,0x21, ++0x27,0x8c,0x90,0x00,0x3c,0x0b,0x80,0xff,0x24,0x10,0x00,0x04,0x27,0x91,0x90,0x04, ++0x35,0x6b,0xff,0xff,0x3c,0x0d,0x7f,0x00,0x27,0x8e,0x90,0x10,0x01,0x80,0x78,0x21, ++0x00,0x12,0x30,0xc0,0x00,0xd2,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x4c,0x10,0x21, ++0x94,0x42,0x00,0x06,0x8f,0xa3,0x00,0x2c,0x8f,0xa4,0x00,0x30,0xaf,0xa2,0x00,0x44, ++0x8f,0xa5,0x00,0x44,0x30,0x49,0x00,0x03,0x02,0x09,0x10,0x23,0x30,0x42,0x00,0x03, ++0x00,0xa2,0x10,0x21,0x8f,0xa8,0x00,0x30,0x24,0x42,0x00,0x04,0x30,0x42,0xff,0xff, ++0x00,0x64,0x38,0x21,0x01,0x02,0x28,0x23,0x00,0x62,0x18,0x21,0x00,0x48,0x10,0x2b, ++0x10,0x40,0x00,0x52,0x00,0x00,0x20,0x21,0x30,0xe7,0xff,0xff,0x30,0xa4,0xff,0xff, ++0xaf,0xa7,0x00,0x2c,0x00,0xd2,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x51,0x18,0x21, ++0x8c,0x65,0x00,0x18,0x00,0x04,0x25,0x40,0x00,0x8d,0x20,0x24,0x8c,0xa8,0x00,0x04, ++0x00,0x4e,0x18,0x21,0x00,0x4f,0x50,0x21,0x01,0x0b,0x40,0x24,0x01,0x04,0x40,0x25, ++0xac,0xa8,0x00,0x04,0x8f,0xa4,0x00,0x98,0x8f,0xa2,0x00,0x50,0x26,0xb5,0x00,0x01, ++0xa0,0x64,0x00,0x00,0x8c,0xa4,0x00,0x08,0x00,0x00,0x00,0x00,0x04,0x81,0x00,0x0c, ++0x02,0xa2,0x30,0x2a,0x80,0x62,0x00,0x06,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x02, ++0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43,0x00,0x02,0x10,0x40, ++0x00,0xa2,0x38,0x21,0x8f,0xa5,0x00,0x40,0x00,0x00,0x00,0x00,0xa4,0xe5,0x00,0x00, ++0x95,0x52,0x00,0x02,0x14,0xc0,0xff,0xc7,0x00,0x12,0x30,0xc0,0x8f,0xa4,0x00,0x24, ++0x8f,0xa5,0x00,0x50,0x8f,0xa6,0x00,0x1c,0x8f,0xa3,0x00,0x2c,0x00,0x85,0x80,0x21, ++0xa0,0xd0,0x00,0x12,0x00,0x09,0x10,0x23,0x30,0x42,0x00,0x03,0x8f,0xa8,0x00,0x88, ++0x00,0x62,0x10,0x23,0xa4,0xc2,0x00,0x1a,0x85,0x03,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x04, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x83,0x00,0x04, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x10,0x14,0x60,0xff,0x74,0x02,0x00,0x10,0x21, ++0x8f,0xa3,0x00,0x54,0x8f,0xa4,0x00,0x18,0x8f,0xa5,0x00,0x24,0x00,0x64,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x90,0x18,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x00, ++0x10,0xa0,0x00,0x03,0x00,0x00,0x30,0x21,0x08,0x00,0x1d,0x33,0x02,0x00,0x10,0x21, ++0x93,0x82,0x80,0x10,0x00,0x00,0x28,0x21,0x00,0x00,0x38,0x21,0x0c,0x00,0x21,0x9a, ++0xaf,0xa2,0x00,0x10,0x08,0x00,0x1d,0x33,0x02,0x00,0x10,0x21,0x30,0x63,0xff,0xff, ++0x08,0x00,0x1d,0x85,0xaf,0xa3,0x00,0x2c,0x8f,0xa8,0x00,0x44,0x08,0x00,0x1d,0xa7, ++0x31,0x09,0x00,0x03,0x08,0x00,0x1d,0x60,0xaf,0xa3,0x00,0x50,0x8f,0xa6,0x00,0x44, ++0xaf,0xa0,0x00,0x50,0x08,0x00,0x1d,0xa7,0x30,0xc9,0x00,0x03,0x8f,0xa5,0x00,0x48, ++0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x1c,0x03,0xc0,0x38,0x21,0x0c,0x00,0x1b,0xd8, ++0xaf,0xb7,0x00,0x10,0x08,0x00,0x1d,0x10,0x00,0x00,0x00,0x00,0x00,0x05,0x28,0x80, ++0x27,0x82,0x90,0x00,0x00,0xa2,0x28,0x21,0x00,0x00,0x20,0x21,0x0c,0x00,0x01,0x49, ++0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0x09,0x26,0xe2,0x00,0x01,0x00,0x02,0x80,0x80, ++0x27,0x83,0x90,0x10,0x8f,0xa4,0x00,0x1c,0x02,0x03,0x18,0x21,0x26,0x31,0x00,0x01, ++0x02,0x40,0x28,0x21,0x0c,0x00,0x1e,0xea,0xa0,0x71,0x00,0x05,0x14,0x40,0xff,0x13, ++0x00,0x00,0x00,0x00,0x16,0xe0,0x00,0x4d,0x03,0xc0,0x38,0x21,0x8f,0xa4,0x00,0x24, ++0x8f,0xa5,0x00,0x20,0x24,0x02,0x00,0x01,0x24,0x84,0x00,0x01,0xaf,0xb2,0x00,0x48, ++0xaf,0xb6,0x00,0x4c,0x02,0xc0,0xf0,0x21,0x10,0xa2,0x00,0x41,0xaf,0xa4,0x00,0x24, ++0x27,0x82,0x90,0x00,0x02,0x02,0x10,0x21,0x94,0x42,0x00,0x06,0x8f,0xa4,0x00,0x30, ++0xaf,0xa0,0x00,0x20,0xaf,0xa2,0x00,0x44,0x30,0x49,0x00,0x03,0x8f,0xa8,0x00,0x44, ++0x00,0x09,0x10,0x23,0x30,0x42,0x00,0x03,0x01,0x02,0x10,0x21,0x24,0x42,0x00,0x04, ++0x30,0x42,0xff,0xff,0x00,0x44,0x18,0x2b,0x10,0x60,0x00,0x2b,0x00,0x00,0x00,0x00, ++0x8f,0xa5,0x00,0x2c,0x00,0x82,0x10,0x23,0x00,0xa4,0x18,0x21,0x30,0x63,0xff,0xff, ++0x30,0x44,0xff,0xff,0xaf,0xa3,0x00,0x2c,0x02,0x92,0x28,0x21,0x00,0x05,0x28,0x80, ++0x27,0x82,0x90,0x04,0x00,0xa2,0x10,0x21,0x8c,0x46,0x00,0x18,0x3c,0x03,0x80,0xff, ++0x3c,0x02,0x7f,0x00,0x8c,0xc8,0x00,0x04,0x00,0x04,0x25,0x40,0x34,0x63,0xff,0xff, ++0x00,0x82,0x20,0x24,0x01,0x03,0x40,0x24,0x01,0x04,0x40,0x25,0xac,0xc8,0x00,0x04, ++0x8f,0xa8,0x00,0x98,0x27,0x82,0x90,0x10,0x00,0xa2,0x10,0x21,0xa0,0x48,0x00,0x00, ++0x8c,0xc4,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x27,0xc2,0x10,0x80,0xfe,0xdb, ++0xaf,0xa4,0x00,0x3c,0x80,0x42,0x00,0x06,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x02, ++0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43,0x00,0x02,0x10,0x40, ++0x00,0xc2,0x38,0x21,0x8f,0xa2,0x00,0x40,0x00,0x00,0x00,0x00,0xa4,0xe2,0x00,0x00, ++0x08,0x00,0x1d,0x0c,0x26,0xb5,0xff,0xff,0x8f,0xa6,0x00,0x2c,0x00,0x00,0x20,0x21, ++0x00,0xc2,0x10,0x21,0x30,0x42,0xff,0xff,0x08,0x00,0x1e,0x1a,0xaf,0xa2,0x00,0x2c, ++0x8f,0xa6,0x00,0x1c,0x08,0x00,0x1e,0x04,0xa4,0xd2,0x00,0x14,0x8f,0xa5,0x00,0x48, ++0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x1c,0x0c,0x00,0x1b,0xd8,0xaf,0xb7,0x00,0x10, ++0x08,0x00,0x1d,0xfb,0x00,0x00,0xb8,0x21,0x0c,0x00,0x12,0x8b,0x00,0x00,0x28,0x21, ++0x00,0x40,0x18,0x21,0x94,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x42,0x08,0x00, ++0xa4,0x62,0x00,0x00,0x08,0x00,0x1d,0x00,0x02,0x71,0x10,0x21,0x02,0x92,0x18,0x21, ++0x00,0x03,0x80,0x80,0x27,0x82,0x90,0x04,0x02,0x02,0x10,0x21,0x8c,0x44,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x83,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x10, ++0x10,0x60,0x00,0x09,0x24,0x06,0x00,0x01,0x93,0x82,0x8b,0x71,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x01,0x10,0x40,0xfe,0xa2,0x3c,0x04,0x00,0x80,0x27,0x85,0x90,0x00, ++0x08,0x00,0x1d,0xeb,0x02,0x05,0x28,0x21,0x27,0x83,0x90,0x18,0x27,0x82,0x90,0x10, ++0x02,0x03,0x18,0x21,0x02,0x02,0x10,0x21,0x90,0x64,0x00,0x00,0x90,0x45,0x00,0x05, ++0x93,0x83,0x80,0x10,0x00,0x00,0x38,0x21,0x0c,0x00,0x21,0x9a,0xaf,0xa3,0x00,0x10, ++0x08,0x00,0x1e,0x62,0x00,0x00,0x00,0x00,0x27,0x82,0x90,0x18,0x02,0x02,0x10,0x21, ++0x94,0x43,0x00,0x02,0x8f,0xa6,0x00,0x58,0x00,0x03,0x19,0x02,0x00,0x66,0x18,0x23, ++0x30,0x63,0x0f,0xff,0x28,0x62,0x00,0x20,0x10,0x40,0x00,0x06,0x28,0x62,0x00,0x40, ++0x8f,0xa8,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x68,0x10,0x06,0x08,0x00,0x1c,0xd9, ++0x30,0x44,0x00,0x01,0x10,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x8f,0xa4,0x00,0x94, ++0x08,0x00,0x1e,0x83,0x00,0x64,0x10,0x06,0x08,0x00,0x1c,0xd9,0x00,0x00,0x20,0x21, ++0x8f,0xa4,0x00,0x98,0x8f,0xa5,0x00,0x38,0xaf,0xa0,0x00,0x10,0x0c,0x00,0x09,0x0a, ++0xaf,0xa8,0x00,0x14,0x30,0x42,0xff,0xff,0x08,0x00,0x1c,0xa9,0xaf,0xa2,0x00,0x40, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x00,0x27,0xbd,0xff,0xe0,0x34,0x42,0x00,0x20, ++0x24,0x63,0x7a,0x50,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x18, ++0xac,0x43,0x00,0x00,0x90,0x82,0x00,0x0a,0x00,0x80,0x80,0x21,0x14,0x40,0x00,0x45, ++0x00,0x00,0x88,0x21,0x92,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x3c, ++0x00,0x00,0x00,0x00,0x12,0x20,0x00,0x18,0x00,0x00,0x00,0x00,0x92,0x02,0x00,0x16, ++0x92,0x05,0x00,0x0a,0x30,0x42,0x00,0xfc,0x10,0xa0,0x00,0x03,0xa2,0x02,0x00,0x16, ++0x34,0x42,0x00,0x01,0xa2,0x02,0x00,0x16,0x92,0x04,0x00,0x04,0x00,0x00,0x00,0x00, ++0x30,0x83,0x00,0xff,0x10,0x60,0x00,0x05,0x00,0x00,0x00,0x00,0x92,0x02,0x00,0x16, ++0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02,0xa2,0x02,0x00,0x16,0x10,0x60,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x14,0xa0,0x00,0x08,0x00,0x00,0x00,0x00,0x96,0x02,0x00,0x00, ++0xa2,0x00,0x00,0x17,0xa6,0x02,0x00,0x14,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x14,0x80,0x00,0x05,0x24,0x02,0x00,0x01, ++0x96,0x03,0x00,0x06,0xa2,0x02,0x00,0x17,0x08,0x00,0x1e,0xbe,0xa6,0x03,0x00,0x14, ++0x96,0x04,0x00,0x00,0x96,0x05,0x00,0x06,0x27,0x86,0x90,0x00,0x00,0x04,0x10,0xc0, ++0x00,0x05,0x18,0xc0,0x00,0x44,0x10,0x21,0x00,0x65,0x18,0x21,0x00,0x02,0x10,0x80, ++0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21,0x00,0x46,0x10,0x21,0x8c,0x65,0x00,0x08, ++0x8c,0x44,0x00,0x08,0x0c,0x00,0x12,0x7c,0x00,0x00,0x00,0x00,0x30,0x43,0x00,0xff, ++0x10,0x60,0x00,0x04,0xa2,0x02,0x00,0x17,0x96,0x02,0x00,0x06,0x08,0x00,0x1e,0xbe, ++0xa6,0x02,0x00,0x14,0x96,0x02,0x00,0x00,0x08,0x00,0x1e,0xbe,0xa6,0x02,0x00,0x14, ++0x96,0x05,0x00,0x00,0x0c,0x00,0x1e,0xea,0x02,0x00,0x20,0x21,0x08,0x00,0x1e,0xa5, ++0x02,0x22,0x88,0x21,0x94,0x85,0x00,0x06,0x0c,0x00,0x1e,0xea,0x00,0x00,0x00,0x00, ++0x08,0x00,0x1e,0xa1,0x00,0x40,0x88,0x21,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x7b,0xa8,0x27,0xbd,0xff,0xf0,0xac,0x62,0x00,0x00, ++0x00,0x00,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x10,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x7b,0xcc,0xac,0x62,0x00,0x00, ++0x90,0x89,0x00,0x0a,0x00,0x80,0x30,0x21,0x11,0x20,0x00,0x05,0x00,0xa0,0x50,0x21, ++0x90,0x82,0x00,0x17,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x1b,0x00,0x00,0x00,0x00, ++0x90,0xc7,0x00,0x04,0x00,0x00,0x00,0x00,0x10,0xe0,0x00,0x1b,0x00,0x00,0x00,0x00, ++0x94,0xc8,0x00,0x00,0x27,0x83,0x90,0x00,0x93,0x85,0x8b,0x70,0x00,0x08,0x10,0xc0, ++0x00,0x48,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x08, ++0x00,0xe5,0x28,0x2b,0x10,0xa0,0x00,0x06,0x01,0x44,0x18,0x23,0x8f,0x82,0x8b,0x88, ++0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x05,0x00,0x00,0x00,0x00, ++0x24,0x03,0x00,0x10,0xa4,0xc8,0x00,0x14,0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21, ++0x11,0x20,0x00,0x05,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x06,0x24,0x03,0x00,0x08, ++0x08,0x00,0x1f,0x16,0xa4,0xc2,0x00,0x14,0x08,0x00,0x1f,0x16,0x00,0x00,0x18,0x21, ++0x27,0xbd,0xff,0xc8,0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28,0xaf,0xb3,0x00,0x24, ++0xaf,0xb0,0x00,0x18,0xaf,0xbf,0x00,0x30,0xaf,0xb2,0x00,0x20,0xaf,0xb1,0x00,0x1c, ++0x94,0x91,0x00,0x06,0x00,0x80,0xa0,0x21,0x3c,0x02,0x80,0x00,0x3c,0x04,0xb0,0x03, ++0x00,0x11,0xa8,0xc0,0x34,0x84,0x00,0x20,0x24,0x42,0x7c,0x80,0x02,0xb1,0x48,0x21, ++0xac,0x82,0x00,0x00,0x00,0x09,0x48,0x80,0x24,0x03,0x00,0x01,0x27,0x82,0x90,0x10, ++0xa2,0x83,0x00,0x12,0x01,0x22,0x10,0x21,0x27,0x84,0x90,0x04,0x01,0x24,0x20,0x21, ++0x80,0x48,0x00,0x06,0x8c,0x8a,0x00,0x18,0x27,0x83,0x90,0x20,0x01,0x23,0x48,0x21, ++0x8d,0x24,0x00,0x00,0x25,0x08,0x00,0x02,0x8d,0x42,0x00,0x00,0x8d,0x49,0x00,0x04, ++0x00,0x08,0x17,0xc2,0x8d,0x43,0x00,0x08,0x01,0x02,0x40,0x21,0x00,0x04,0x25,0xc2, ++0x00,0x08,0x40,0x43,0x30,0x84,0x00,0x01,0x00,0x03,0x1f,0xc2,0x00,0x08,0x40,0x40, ++0x00,0xe0,0x80,0x21,0x00,0x64,0x18,0x24,0x00,0x09,0x49,0x42,0x01,0x48,0x10,0x21, ++0x00,0xa0,0x98,0x21,0x00,0xa0,0x20,0x21,0x00,0x40,0x38,0x21,0x02,0x00,0x28,0x21, ++0x14,0x60,0x00,0x19,0x31,0x29,0x00,0x01,0x94,0x42,0x00,0x00,0x02,0xb1,0x88,0x21, ++0x02,0x00,0x28,0x21,0x00,0x11,0x88,0x80,0x27,0x90,0x90,0x00,0x02,0x30,0x80,0x21, ++0x96,0x03,0x00,0x06,0x30,0x52,0xff,0xff,0x02,0x60,0x20,0x21,0x00,0x60,0x30,0x21, ++0xa6,0x83,0x00,0x1a,0x27,0x82,0x90,0x08,0x0c,0x00,0x08,0xe3,0x02,0x22,0x88,0x21, ++0x00,0x52,0x10,0x21,0x96,0x03,0x00,0x06,0xa6,0x22,0x00,0x04,0x8f,0xbf,0x00,0x30, ++0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x00,0x60,0x10,0x21, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0xaf,0xa9,0x00,0x10,0x0c,0x00,0x09,0x0a, ++0xaf,0xa0,0x00,0x14,0x08,0x00,0x1f,0x54,0x02,0xb1,0x88,0x21,0x27,0xbd,0xff,0xc0, ++0xaf,0xbe,0x00,0x38,0xaf,0xb7,0x00,0x34,0xaf,0xb6,0x00,0x30,0xaf,0xb5,0x00,0x2c, ++0xaf,0xb3,0x00,0x24,0xaf,0xb1,0x00,0x1c,0xaf,0xbf,0x00,0x3c,0xaf,0xb4,0x00,0x28, ++0xaf,0xb2,0x00,0x20,0xaf,0xb0,0x00,0x18,0x94,0x90,0x00,0x00,0x3c,0x08,0xb0,0x03, ++0x35,0x08,0x00,0x20,0x00,0x10,0x10,0xc0,0x00,0x50,0x18,0x21,0x00,0x40,0x88,0x21, ++0x3c,0x02,0x80,0x00,0x00,0x03,0x48,0x80,0x24,0x42,0x7d,0xbc,0x00,0x80,0x98,0x21, ++0x27,0x84,0x90,0x10,0x01,0x24,0x20,0x21,0x93,0xb7,0x00,0x53,0xad,0x02,0x00,0x00, ++0x80,0x83,0x00,0x06,0x27,0x82,0x90,0x04,0x01,0x22,0x10,0x21,0x8c,0x44,0x00,0x18, ++0x24,0x63,0x00,0x02,0x00,0x03,0x17,0xc2,0x8c,0x88,0x00,0x08,0x00,0x62,0x18,0x21, ++0x00,0x03,0x18,0x43,0x00,0x03,0x18,0x40,0xaf,0xa7,0x00,0x4c,0x2c,0xa2,0x00,0x10, ++0x00,0xa0,0xa8,0x21,0x00,0x83,0x50,0x21,0x00,0x08,0x47,0xc2,0x00,0xc0,0x58,0x21, ++0x00,0x00,0xb0,0x21,0x8c,0x92,0x00,0x0c,0x14,0x40,0x00,0x13,0x00,0x00,0xf0,0x21, ++0x92,0x67,0x00,0x04,0x24,0x14,0x00,0x01,0x12,0x87,0x00,0x10,0x02,0x30,0x10,0x21, ++0x27,0x83,0x90,0x18,0x01,0x23,0x18,0x21,0x80,0x64,0x00,0x00,0x27,0x83,0xb5,0x70, ++0x00,0x04,0x11,0x00,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x04,0x00,0x00,0x00,0x00, ++0x10,0x80,0x00,0x23,0x00,0x00,0x00,0x00,0x02,0x30,0x10,0x21,0x00,0x02,0x80,0x80, ++0x24,0x04,0x00,0x01,0x27,0x83,0x90,0x20,0xa2,0x64,0x00,0x12,0x02,0x03,0x18,0x21, ++0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15,0xc2,0x30,0x42,0x00,0x01, ++0x01,0x02,0x10,0x24,0x14,0x40,0x00,0x0e,0x02,0xa0,0x20,0x21,0x27,0x82,0x90,0x00, ++0x02,0x02,0x10,0x21,0x94,0x43,0x00,0x06,0x00,0x00,0x00,0x00,0xa6,0x63,0x00,0x1a, ++0x94,0x42,0x00,0x06,0x7b,0xbe,0x01,0xfc,0x7b,0xb6,0x01,0xbc,0x7b,0xb4,0x01,0x7c, ++0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40, ++0x8f,0xa5,0x00,0x4c,0x01,0x60,0x30,0x21,0x01,0x40,0x38,0x21,0xaf,0xa0,0x00,0x10, ++0x0c,0x00,0x09,0x0a,0xaf,0xa0,0x00,0x14,0x08,0x00,0x1f,0xbb,0x00,0x00,0x00,0x00, ++0x27,0x83,0x90,0x20,0x01,0x23,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x02,0x15,0xc2,0x30,0x42,0x00,0x01,0x01,0x02,0x10,0x24,0x14,0x40,0x00,0xaf, ++0x00,0xa0,0x20,0x21,0x32,0x4f,0x00,0x03,0x00,0x12,0x10,0x82,0x25,0xe3,0x00,0x0d, ++0x30,0x45,0x00,0x07,0x00,0x74,0x78,0x04,0x10,0xa0,0x00,0x0e,0x00,0x00,0x90,0x21, ++0x27,0x82,0x80,0x1c,0x00,0x15,0x18,0x40,0x00,0x62,0x18,0x21,0x94,0x64,0x00,0x00, ++0x24,0xa2,0x00,0x06,0x00,0x54,0x10,0x04,0x00,0x44,0x00,0x1a,0x14,0x80,0x00,0x02, ++0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d,0x00,0x00,0x10,0x12,0x24,0x42,0x00,0x20, ++0x30,0x52,0xff,0xfc,0x02,0x30,0x10,0x21,0x27,0x83,0x90,0x10,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x03,0x00,0x00,0x00,0x00,0x30,0x83,0x00,0xff, ++0x2c,0x62,0x00,0x0c,0x14,0x40,0x00,0x04,0x2c,0x62,0x00,0x19,0x30,0x82,0x00,0x0f, ++0x24,0x43,0x00,0x0c,0x2c,0x62,0x00,0x19,0x10,0x40,0x00,0x19,0x24,0x0e,0x00,0x20, ++0x24,0x62,0xff,0xe9,0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x15,0x24,0x0e,0x00,0x10, ++0x24,0x62,0xff,0xeb,0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x11,0x24,0x0e,0x00,0x08, ++0x24,0x02,0x00,0x14,0x10,0x62,0x00,0x0e,0x24,0x0e,0x00,0x02,0x24,0x62,0xff,0xef, ++0x2c,0x42,0x00,0x03,0x14,0x40,0x00,0x0a,0x24,0x0e,0x00,0x10,0x24,0x62,0xff,0xf1, ++0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x06,0x24,0x0e,0x00,0x08,0x24,0x62,0xff,0xf3, ++0x2c,0x42,0x00,0x02,0x24,0x0e,0x00,0x04,0x24,0x03,0x00,0x02,0x00,0x62,0x70,0x0a, ++0x30,0xe2,0x00,0xff,0x00,0x00,0x48,0x21,0x00,0x00,0x68,0x21,0x10,0x40,0x00,0x6d, ++0x00,0x00,0x58,0x21,0x3c,0x14,0x80,0xff,0x27,0x99,0x90,0x00,0x01,0xf2,0xc0,0x23, ++0x36,0x94,0xff,0xff,0x01,0xc9,0x10,0x2a,0x14,0x40,0x00,0x64,0x24,0x03,0x00,0x04, ++0x00,0x10,0x28,0xc0,0x00,0xb0,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x59,0x10,0x21, ++0x94,0x56,0x00,0x06,0x00,0x00,0x00,0x00,0x32,0xcc,0x00,0x03,0x00,0x6c,0x10,0x23, ++0x30,0x42,0x00,0x03,0x02,0xc2,0x10,0x21,0x24,0x42,0x00,0x04,0x30,0x51,0xff,0xff, ++0x02,0x32,0x18,0x2b,0x10,0x60,0x00,0x4d,0x01,0xf1,0x10,0x23,0x02,0x51,0x10,0x23, ++0x01,0x78,0x18,0x2b,0x10,0x60,0x00,0x34,0x30,0x44,0xff,0xff,0x29,0x22,0x00,0x40, ++0x10,0x40,0x00,0x31,0x01,0x72,0x18,0x21,0x25,0x22,0x00,0x01,0x00,0x02,0x16,0x00, ++0x00,0x02,0x4e,0x03,0x00,0xb0,0x10,0x21,0x00,0x02,0x30,0x80,0x27,0x82,0x90,0x04, ++0x30,0x6b,0xff,0xff,0x00,0xc2,0x18,0x21,0x8c,0x67,0x00,0x18,0x00,0x04,0x25,0x40, ++0x3c,0x03,0x7f,0x00,0x8c,0xe2,0x00,0x04,0x00,0x83,0x20,0x24,0x27,0x83,0x90,0x10, ++0x00,0x54,0x10,0x24,0x00,0xc3,0x28,0x21,0x00,0x44,0x10,0x25,0xac,0xe2,0x00,0x04, ++0x16,0xe0,0x00,0x02,0xa0,0xb5,0x00,0x00,0xa0,0xb5,0x00,0x03,0x27,0x84,0x90,0x20, ++0x00,0xc4,0x18,0x21,0x8c,0x62,0x00,0x00,0x8c,0xe8,0x00,0x08,0x00,0x02,0x15,0xc2, ++0x00,0x08,0x47,0xc2,0x30,0x42,0x00,0x01,0x01,0x02,0x10,0x24,0x10,0x40,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x80,0xa2,0x00,0x06,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x02, ++0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43,0x00,0x02,0x10,0x40, ++0x00,0xe2,0x50,0x21,0xa5,0x5e,0x00,0x00,0x92,0x62,0x00,0x04,0x25,0xad,0x00,0x01, ++0x27,0x84,0x90,0x00,0x00,0xc4,0x18,0x21,0x01,0xa2,0x10,0x2a,0x94,0x70,0x00,0x02, ++0x14,0x40,0xff,0xb8,0x00,0x00,0x00,0x00,0x96,0x63,0x00,0x14,0x00,0x0c,0x10,0x23, ++0xa2,0x69,0x00,0x12,0x30,0x42,0x00,0x03,0x01,0x62,0x10,0x23,0x00,0x03,0x80,0xc0, ++0x8f,0xa5,0x00,0x4c,0x30,0x4b,0xff,0xff,0x02,0x03,0x80,0x21,0x27,0x82,0x90,0x08, ++0x00,0x10,0x80,0x80,0xa6,0x6b,0x00,0x1a,0x02,0xa0,0x20,0x21,0x01,0x60,0x30,0x21, ++0x01,0x60,0x88,0x21,0x0c,0x00,0x08,0xe3,0x02,0x02,0x80,0x21,0x00,0x5e,0x10,0x21, ++0xa6,0x02,0x00,0x04,0x08,0x00,0x1f,0xc1,0x02,0x20,0x10,0x21,0x01,0x62,0x10,0x2b, ++0x10,0x40,0xff,0xe9,0x00,0x00,0x20,0x21,0x29,0x22,0x00,0x40,0x10,0x40,0xff,0xe6, ++0x01,0x71,0x18,0x21,0x08,0x00,0x20,0x37,0x25,0x22,0x00,0x01,0x08,0x00,0x20,0x66, ++0x32,0xcc,0x00,0x03,0x08,0x00,0x20,0x66,0x00,0x00,0x60,0x21,0x8f,0xa5,0x00,0x4c, ++0x01,0x40,0x38,0x21,0xaf,0xa0,0x00,0x10,0x0c,0x00,0x09,0x0a,0xaf,0xb4,0x00,0x14, ++0x92,0x67,0x00,0x04,0x08,0x00,0x1f,0xd9,0x30,0x5e,0xff,0xff,0x30,0x84,0xff,0xff, ++0x00,0x04,0x30,0xc0,0x00,0xc4,0x20,0x21,0x00,0x04,0x20,0x80,0x27,0x82,0x90,0x00, ++0x3c,0x03,0xb0,0x08,0x30,0xa5,0xff,0xff,0x00,0x82,0x20,0x21,0x00,0xc3,0x30,0x21, ++0xac,0xc5,0x00,0x00,0x03,0xe0,0x00,0x08,0xa4,0x85,0x00,0x00,0x30,0x84,0xff,0xff, ++0x00,0x04,0x30,0xc0,0x00,0xc4,0x30,0x21,0x27,0x88,0x90,0x00,0x00,0x06,0x30,0x80, ++0x00,0xc8,0x30,0x21,0x94,0xc3,0x00,0x04,0x3c,0x02,0xb0,0x08,0x3c,0x07,0xb0,0x03, ++0x00,0x03,0x20,0xc0,0x00,0x83,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x82,0x20,0x21, ++0x3c,0x02,0x80,0x01,0x30,0xa5,0xff,0xff,0x00,0x68,0x18,0x21,0x34,0xe7,0x00,0x20, ++0x24,0x42,0x82,0x6c,0xac,0xe2,0x00,0x00,0xa4,0xc5,0x00,0x02,0xa4,0x65,0x00,0x00, ++0x03,0xe0,0x00,0x08,0xac,0x85,0x00,0x00,0x30,0x84,0xff,0xff,0x00,0x04,0x10,0xc0, ++0x00,0x44,0x10,0x21,0x27,0x89,0x90,0x00,0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x21, ++0x97,0x83,0x8f,0xf0,0x94,0x4a,0x00,0x04,0x3c,0x02,0xb0,0x08,0x00,0x03,0x38,0xc0, ++0x00,0x0a,0x40,0xc0,0x00,0xe3,0x18,0x21,0x01,0x0a,0x28,0x21,0x00,0xe2,0x38,0x21, ++0x01,0x02,0x40,0x21,0x00,0x03,0x18,0x80,0x00,0x05,0x28,0x80,0x3c,0x06,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x00,0xa9,0x28,0x21,0x00,0x69,0x18,0x21,0x34,0xc6,0x00,0x20, ++0x34,0x09,0xff,0xff,0x24,0x42,0x82,0xc8,0xac,0xc2,0x00,0x00,0xa4,0x64,0x00,0x00, ++0xac,0xe4,0x00,0x00,0xa4,0xa9,0x00,0x00,0xad,0x09,0x00,0x00,0xa7,0x8a,0x8f,0xf0, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01, ++0x34,0x63,0x00,0x20,0x24,0x42,0x83,0x48,0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00, ++0x34,0x84,0x01,0x10,0x8c,0x82,0x00,0x00,0x97,0x83,0x81,0x60,0x30,0x42,0xff,0xff, ++0x10,0x62,0x00,0x16,0x24,0x0a,0x00,0x01,0xa7,0x82,0x81,0x60,0xaf,0x80,0xb4,0x50, ++0x00,0x40,0x28,0x21,0x24,0x06,0x00,0x01,0x27,0x84,0xb4,0x54,0x25,0x43,0xff,0xff, ++0x00,0x66,0x10,0x04,0x00,0xa2,0x10,0x24,0x14,0x40,0x00,0x07,0x00,0x00,0x00,0x00, ++0x8c,0x83,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x66,0x10,0x04,0x00,0xa2,0x10,0x24, ++0x38,0x42,0x00,0x00,0x01,0x42,0x18,0x0a,0x25,0x4a,0x00,0x01,0x2d,0x42,0x00,0x14, ++0xac,0x83,0x00,0x00,0x14,0x40,0xff,0xf1,0x24,0x84,0x00,0x04,0x3c,0x0b,0xb0,0x03, ++0x00,0x00,0x50,0x21,0x3c,0x0c,0x80,0x00,0x27,0x89,0xb4,0xa0,0x35,0x6b,0x01,0x20, ++0x8d,0x68,0x00,0x00,0x8d,0x23,0x00,0x04,0x01,0x0c,0x10,0x24,0x00,0x02,0x17,0xc2, ++0x11,0x03,0x00,0x37,0xa1,0x22,0x00,0xdc,0xa1,0x20,0x00,0xd5,0xa1,0x20,0x00,0xd6, ++0x01,0x20,0x30,0x21,0x00,0x00,0x38,0x21,0x00,0x00,0x28,0x21,0x01,0x20,0x20,0x21, ++0x00,0xa8,0x10,0x06,0x30,0x42,0x00,0x01,0x10,0xe0,0x00,0x10,0xa0,0x82,0x00,0x0a, ++0x90,0x82,0x00,0x07,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x31,0x24,0xa2,0xff,0xff, ++0xa0,0x82,0x00,0x08,0x90,0x82,0x00,0x0a,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x09, ++0x00,0x00,0x00,0x00,0x90,0x83,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0x40, ++0x00,0x43,0x10,0x21,0x00,0x46,0x10,0x21,0xa0,0x45,0x00,0x09,0x90,0x82,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x07,0x00,0x00,0x00,0x00,0x14,0xe0,0x00,0x04, ++0x00,0x00,0x00,0x00,0xa0,0xc5,0x00,0xd5,0x24,0x07,0x00,0x01,0xa0,0x85,0x00,0x08, ++0xa0,0xc5,0x00,0xd6,0x24,0xa5,0x00,0x01,0x2c,0xa2,0x00,0x1c,0x14,0x40,0xff,0xe0, ++0x24,0x84,0x00,0x03,0x90,0xc4,0x00,0xd5,0x00,0x00,0x28,0x21,0x00,0xa4,0x10,0x2b, ++0x10,0x40,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0xc0,0x18,0x21,0xa0,0x64,0x00,0x08, ++0x90,0xc2,0x00,0xd5,0x24,0xa5,0x00,0x01,0xa0,0x62,0x00,0x09,0x90,0xc4,0x00,0xd5, ++0x00,0x00,0x00,0x00,0x00,0xa4,0x10,0x2b,0x14,0x40,0xff,0xf8,0x24,0x63,0x00,0x03, ++0x25,0x4a,0x00,0x01,0x2d,0x42,0x00,0x08,0xad,0x28,0x00,0x04,0x25,0x6b,0x00,0x04, ++0x14,0x40,0xff,0xbf,0x25,0x29,0x00,0xec,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x90,0x82,0x00,0x05,0x08,0x00,0x21,0x0d,0xa0,0x82,0x00,0x08,0x97,0x85,0x8b,0x7a, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x63,0x00,0x20, ++0x24,0x42,0x84,0xfc,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x62,0x00,0x00, ++0x30,0x90,0x00,0xff,0x00,0x05,0x28,0x42,0x00,0x00,0x48,0x21,0x27,0x8f,0xb4,0xa4, ++0x00,0x00,0x50,0x21,0x00,0x00,0x58,0x21,0x27,0x98,0xb5,0x84,0x27,0x99,0xb5,0x80, ++0x27,0x8e,0xb5,0x7e,0x27,0x8c,0xb4,0xa8,0x27,0x8d,0xb5,0x00,0x27,0x88,0xb5,0x78, ++0x00,0x0a,0x18,0x80,0x01,0x6f,0x10,0x21,0xac,0x40,0x00,0x00,0xac,0x45,0x00,0x58, ++0x00,0x6e,0x20,0x21,0x00,0x78,0x10,0x21,0xa1,0x00,0xff,0xfc,0xad,0x00,0x00,0x00, ++0xa1,0x00,0x00,0x04,0xa1,0x00,0x00,0x05,0xad,0x00,0xff,0xf8,0x00,0x79,0x18,0x21, ++0x24,0x06,0x00,0x01,0x24,0xc6,0xff,0xff,0xa0,0x80,0x00,0x00,0xa4,0x60,0x00,0x00, ++0xac,0x40,0x00,0x00,0x24,0x63,0x00,0x02,0x24,0x42,0x00,0x04,0x04,0xc1,0xff,0xf9, ++0x24,0x84,0x00,0x01,0x00,0x0a,0x10,0x80,0x00,0x4d,0x20,0x21,0x00,0x00,0x30,0x21, ++0x00,0x4c,0x18,0x21,0x27,0x87,0x81,0x64,0x8c,0xe2,0x00,0x00,0x24,0xe7,0x00,0x04, ++0xac,0x82,0x00,0x00,0xa0,0x66,0x00,0x00,0xa0,0x66,0x00,0x01,0x24,0xc6,0x00,0x01, ++0x28,0xc2,0x00,0x1c,0xa0,0x60,0x00,0x02,0x24,0x84,0x00,0x04,0x14,0x40,0xff,0xf6, ++0x24,0x63,0x00,0x03,0x25,0x29,0x00,0x01,0x29,0x22,0x00,0x08,0x25,0x4a,0x00,0x3b, ++0x25,0x08,0x00,0xec,0x14,0x40,0xff,0xd6,0x25,0x6b,0x00,0xec,0xa7,0x80,0x81,0x60, ++0x00,0x00,0x48,0x21,0x27,0x83,0xb4,0x50,0xac,0x69,0x00,0x00,0x25,0x29,0x00,0x01, ++0x29,0x22,0x00,0x0c,0x14,0x40,0xff,0xfc,0x24,0x63,0x00,0x04,0x0c,0x00,0x20,0xd2, ++0x00,0x00,0x00,0x00,0x2e,0x04,0x00,0x14,0x27,0x83,0xb4,0xa0,0x24,0x09,0x00,0x07, ++0x10,0x80,0x00,0x0a,0x00,0x00,0x00,0x00,0x90,0x62,0x00,0xd5,0x25,0x29,0xff,0xff, ++0xa0,0x62,0x00,0x00,0x05,0x21,0xff,0xfa,0x24,0x63,0x00,0xec,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x90,0x62,0x00,0xd6, ++0x08,0x00,0x21,0x90,0x25,0x29,0xff,0xff,0x30,0x84,0x00,0xff,0x00,0x04,0x11,0x00, ++0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80, ++0x27,0x83,0xb4,0xa0,0x00,0x43,0x60,0x21,0x3c,0x04,0xb0,0x03,0x3c,0x02,0x80,0x01, ++0x34,0x84,0x00,0x20,0x24,0x42,0x86,0x68,0x30,0xc6,0x00,0xff,0x93,0xaa,0x00,0x13, ++0x30,0xa5,0x00,0xff,0x30,0xe7,0x00,0xff,0xac,0x82,0x00,0x00,0x10,0xc0,0x00,0xe8, ++0x25,0x8f,0x00,0xd0,0x91,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x42,0xff,0xfc, ++0x2c,0x43,0x00,0x18,0x10,0x60,0x00,0xc7,0x3c,0x03,0x80,0x01,0x00,0x02,0x10,0x80, ++0x24,0x63,0x02,0x90,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x30,0x14,0x40,0x00,0x1c, ++0x00,0x00,0x00,0x00,0x10,0xa0,0x00,0x17,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0x00,0x11,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x06,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x00,0x00,0x00,0x00,0x24,0x42,0xff,0xe0,0x03,0xe0,0x00,0x08, ++0xad,0x82,0x00,0xd0,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb,0x24,0x42,0xff,0xe8, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb, ++0x24,0x42,0x00,0x01,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb,0x24,0x42,0x00,0x02, ++0x10,0xa0,0xff,0xf9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xe9,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0xe6,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x21,0xcb,0x24,0x42,0xff,0xd0,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb, ++0x24,0x42,0xff,0xfc,0x10,0xa0,0xff,0xeb,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xe5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xe0, ++0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xdb,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x21,0xcb,0x24,0x42,0xff,0xf8,0x2d,0x42,0x00,0x19,0x14,0x40,0xff,0xc5, ++0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xdb,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xd5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xd0, ++0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0xf1,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x21,0xcb,0x24,0x42,0xff,0xf0,0x2d,0x42,0x00,0x1b,0x10,0x40,0xff,0xf1, ++0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xcb,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xc5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x14,0xa2,0xff,0xb5, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb,0x24,0x42,0xff,0xf4, ++0x2d,0x42,0x00,0x1e,0x10,0x40,0xff,0xe3,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xbd, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xb5,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0xd6,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xc6,0x24,0x02,0x00,0x03, ++0x2d,0x42,0x00,0x23,0x10,0x40,0xff,0xd7,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xae, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xa9,0x24,0x02,0x00,0x02, ++0x14,0xa2,0xff,0xb7,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0x03,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x25,0x10,0x40,0xff,0xcb,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xd8, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x16,0x14,0x40,0x00,0x0e,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xa0,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x9a, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x95,0x24,0x02,0x00,0x03, ++0x14,0xa2,0xff,0xb6,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x21,0xcb, ++0x24,0x42,0xff,0xfa,0x10,0xa0,0xff,0x93,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0x8d,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x88, ++0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xf3,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x17, ++0x14,0x40,0xff,0xac,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0x34,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x19,0x10,0x40,0xff,0xe2,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0x81, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x7b,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x76,0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0x97, ++0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xc8,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0x51, ++0x2d,0x42,0x00,0x1b,0x2d,0x42,0x00,0x1e,0x10,0x40,0xff,0xde,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x70,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x6a, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x65,0x24,0x02,0x00,0x03, ++0x10,0xa2,0xff,0x96,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xc8,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x23,0x14,0x40,0xff,0xf2,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xf9, ++0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xf7,0x2d,0x42,0x00,0x25,0x08,0x00,0x22,0x2d, ++0x2d,0x42,0x00,0x27,0x10,0xa0,0xff,0x5b,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0x55,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x50, ++0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0x71,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xe6, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x27,0x14,0x40,0xff,0xad,0x00,0x00,0x00,0x00, ++0x08,0x00,0x22,0x79,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2a,0x14,0x40,0xff,0xd8, ++0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xe9,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2c, ++0x14,0x40,0xff,0x78,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xbd,0x00,0x00,0x00,0x00, ++0x91,0x86,0x00,0x00,0x91,0x83,0x00,0xd4,0x25,0x8d,0x00,0x5c,0x30,0xc4,0x00,0xff, ++0x00,0x04,0x10,0x40,0x00,0x44,0x10,0x21,0x00,0x04,0x48,0x80,0x01,0x82,0x58,0x21, ++0x01,0x89,0x40,0x21,0x25,0x78,0x00,0x08,0x10,0x60,0x00,0x37,0x25,0x0e,0x00,0x60, ++0x2c,0xa2,0x00,0x03,0x14,0x40,0x00,0x25,0x00,0x00,0x00,0x00,0x91,0x82,0x00,0xdd, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x1e,0x00,0x00,0x00,0x00,0x27,0x87,0x81,0x64, ++0x01,0x27,0x10,0x21,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0xad,0x03,0x00,0x60, ++0x91,0x62,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x40,0x30,0x21,0xa1,0x82,0x00,0x00, ++0x30,0xc2,0x00,0xff,0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x03,0x18,0x42,0xad,0xa3,0x00,0x00,0x91,0x84,0x00,0x00, ++0x8d,0xc5,0x00,0x00,0x00,0x04,0x20,0x80,0x00,0x87,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x00,0x05,0x28,0x40,0x00,0x8c,0x20,0x21,0x00,0x03,0x18,0x80,0x00,0xa3,0x10,0x2b, ++0x00,0x62,0x28,0x0a,0xac,0x85,0x00,0x60,0x03,0xe0,0x00,0x08,0xa1,0x80,0x00,0xd4, ++0x27,0x87,0x81,0x64,0x08,0x00,0x22,0xb0,0xa1,0x80,0x00,0xdd,0x27,0x82,0x81,0xd4, ++0x8d,0x83,0x00,0xd8,0x00,0x82,0x10,0x21,0x90,0x44,0x00,0x00,0x24,0x63,0x00,0x01, ++0x00,0x64,0x20,0x2b,0x14,0x80,0xff,0x02,0xad,0x83,0x00,0xd8,0x8d,0x02,0x00,0x60, ++0xa1,0x80,0x00,0xd4,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x03,0xe0,0x00,0x08,0xad,0x82,0x00,0x5c,0x10,0xe0,0x00,0x1d,0x24,0x83,0xff,0xfc, ++0x2c,0x62,0x00,0x18,0x10,0x40,0x01,0x10,0x00,0x03,0x10,0x80,0x3c,0x03,0x80,0x01, ++0x24,0x63,0x02,0xf0,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x30,0x14,0x40,0x00,0x65, ++0x00,0x00,0x00,0x00,0x10,0xa0,0x00,0x60,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0x00,0x5a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x08, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x51,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x00,0x00,0x00,0x00,0x24,0x42,0xff,0xe0,0xad,0x82,0x00,0xd0, ++0x8d,0xe3,0x00,0x00,0x8d,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21, ++0xad,0xa2,0x00,0x00,0xad,0xe0,0x00,0x00,0x8d,0xa3,0x00,0x00,0x8d,0xc4,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x83,0x10,0x2a,0x10,0x40,0x00,0x22,0x00,0x00,0x00,0x00, ++0x93,0x05,0x00,0x01,0x91,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x45,0x00,0x05, ++0x24,0x02,0x00,0x01,0xa1,0x85,0x00,0x00,0xa1,0x82,0x00,0xd4,0x03,0xe0,0x00,0x08, ++0xad,0x80,0x00,0xd8,0x91,0x82,0x00,0xdd,0x24,0x03,0x00,0x01,0x10,0x43,0x00,0x05, ++0x00,0x00,0x00,0x00,0xa1,0x83,0x00,0xd4,0xad,0x80,0x00,0xd8,0x03,0xe0,0x00,0x08, ++0xa1,0x83,0x00,0xdd,0x00,0x04,0x17,0xc2,0x00,0x82,0x10,0x21,0x00,0x02,0x10,0x43, ++0xad,0xa2,0x00,0x00,0x91,0x83,0x00,0x00,0x27,0x82,0x81,0x64,0x8d,0xc5,0x00,0x00, ++0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x8c,0x64,0x00,0x00,0x00,0x05,0x28,0x40, ++0x00,0x04,0x18,0x80,0x00,0xa3,0x10,0x2b,0x00,0x62,0x28,0x0a,0x08,0x00,0x22,0xc2, ++0xad,0xc5,0x00,0x00,0x97,0x82,0x8b,0x7c,0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x2a, ++0x10,0x40,0xfe,0xab,0x00,0x00,0x00,0x00,0x91,0x82,0x00,0xdd,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x15,0x00,0x00,0x00,0x00,0x91,0x83,0x00,0x00,0x27,0x82,0x81,0x64, ++0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x6c,0x18,0x21, ++0xac,0x64,0x00,0x60,0x93,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x10,0x80, ++0x01,0x82,0x10,0x21,0x24,0x4e,0x00,0x60,0xa1,0x85,0x00,0x00,0x8d,0xc2,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x03,0xe0,0x00,0x08,0xad,0xa2,0x00,0x00,0x08,0x00,0x23,0x37,0xa1,0x80,0x00,0xdd, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xe8,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x22,0xf3,0x24,0x42,0x00,0x01,0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3, ++0x24,0x42,0x00,0x02,0x10,0xa0,0xff,0xf9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0x00,0x0a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xa0, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0x9d,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xd0,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xfc,0x10,0xa0,0xff,0xeb,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xe5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x93,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xdd,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xf8,0x2d,0x42,0x00,0x19, ++0x14,0x40,0xff,0x7c,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xdb,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xd5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x83,0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0xf1,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xf0,0x2d,0x42,0x00,0x1b, ++0x10,0x40,0xff,0xf1,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xcb,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xc5,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x14,0xa2,0xff,0x6c,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x22,0xf3, ++0x24,0x42,0xff,0xf4,0x2d,0x42,0x00,0x1e,0x10,0x40,0xff,0xe3,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xbd,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x68, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xd6,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0xee, ++0x24,0x02,0x00,0x03,0x2d,0x42,0x00,0x23,0x10,0x40,0xff,0xd7,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xae,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x5c, ++0x24,0x02,0x00,0x02,0x14,0xa2,0xff,0xb7,0x00,0x00,0x00,0x00,0x08,0x00,0x23,0x74, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x25,0x10,0x40,0xff,0xcb,0x00,0x00,0x00,0x00, ++0x08,0x00,0x23,0x49,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x16,0x14,0x40,0x00,0x0e, ++0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xa0,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0x9a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x48, ++0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xb6,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x22,0xf3,0x24,0x42,0xff,0xfa,0x10,0xa0,0xff,0x93,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x8d,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x3b,0x00,0x00,0x00,0x00,0x08,0x00,0x23,0x64,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x17,0x14,0x40,0xff,0xac,0x00,0x00,0x00,0x00,0x08,0x00,0x23,0xa5, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x19,0x10,0x40,0xff,0xe2,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x81,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x7b, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x29,0x24,0x02,0x00,0x03, ++0x10,0xa2,0xff,0x97,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0xf0,0x00,0x00,0x00,0x00, ++0x08,0x00,0x23,0xc2,0x2d,0x42,0x00,0x1b,0x2d,0x42,0x00,0x1e,0x10,0x40,0xff,0xde, ++0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0x70,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0x6a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x18, ++0x24,0x02,0x00,0x03,0x10,0xa2,0xff,0x96,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0xf0, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x23,0x14,0x40,0xff,0xf2,0x00,0x00,0x00,0x00, ++0x08,0x00,0x23,0x6a,0x00,0x00,0x00,0x00,0x08,0x00,0x23,0x68,0x2d,0x42,0x00,0x25, ++0x08,0x00,0x23,0x9e,0x2d,0x42,0x00,0x27,0x10,0xa0,0xff,0x5b,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x55,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x03,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0x71,0x00,0x00,0x00,0x00, ++0x08,0x00,0x23,0x57,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x27,0x14,0x40,0xff,0xad, ++0x00,0x00,0x00,0x00,0x08,0x00,0x23,0xea,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2a, ++0x14,0x40,0xff,0xd8,0x00,0x00,0x00,0x00,0x08,0x00,0x23,0x5a,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x2c,0x14,0x40,0xff,0x78,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0xe5, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe8,0x3c,0x02,0xb0,0x03,0xaf,0xbf,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0x34,0x42,0x01,0x18,0x3c,0x03,0xb0,0x03,0x8c,0x50,0x00,0x00, ++0x34,0x63,0x01,0x2c,0x90,0x62,0x00,0x00,0x32,0x05,0x00,0x01,0xa3,0x82,0x80,0x10, ++0x14,0xa0,0x00,0x14,0x30,0x44,0x00,0xff,0x32,0x02,0x01,0x00,0x14,0x40,0x00,0x09, ++0x00,0x00,0x00,0x00,0x32,0x02,0x08,0x00,0x10,0x40,0x00,0x02,0x24,0x02,0x00,0x01, ++0xa3,0x82,0xbc,0x18,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x0c,0x00,0x05,0x37,0x00,0x00,0x00,0x00,0x26,0x02,0xff,0x00, ++0xa3,0x80,0xbc,0x18,0x3c,0x01,0xb0,0x03,0xac,0x22,0x01,0x18,0x08,0x00,0x24,0x16, ++0x32,0x02,0x08,0x00,0x0c,0x00,0x21,0x3f,0x00,0x00,0x00,0x00,0x26,0x02,0xff,0xff, ++0x3c,0x01,0xb0,0x03,0xac,0x22,0x01,0x18,0x08,0x00,0x24,0x13,0x32,0x02,0x01,0x00, ++0x27,0xbd,0xff,0xe0,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0,0xaf,0xbf,0x00,0x18, ++0x8c,0x43,0x00,0x00,0x3c,0x02,0x00,0x40,0x24,0x07,0x0f,0xff,0x00,0x03,0x33,0x02, ++0x00,0x03,0x2d,0x02,0x00,0x03,0x43,0x02,0x30,0x69,0x0f,0xff,0x00,0x62,0x18,0x24, ++0x30,0xa5,0x00,0x03,0x30,0xc6,0x00,0xff,0x10,0x60,0x00,0x08,0x31,0x08,0x00,0xff, ++0x01,0x00,0x30,0x21,0x0c,0x00,0x24,0xdf,0xaf,0xa9,0x00,0x10,0x8f,0xbf,0x00,0x18, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x25,0x31, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0xd4,0x08,0x00,0x24,0x3f, ++0xac,0x62,0x00,0x00,0x27,0xbd,0xff,0xc0,0x3c,0x02,0xb0,0x03,0xaf,0xbe,0x00,0x38, ++0xaf,0xb5,0x00,0x2c,0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18,0xaf,0xbf,0x00,0x3c, ++0xaf,0xb7,0x00,0x34,0xaf,0xb6,0x00,0x30,0xaf,0xb4,0x00,0x28,0xaf,0xb3,0x00,0x24, ++0xaf,0xb2,0x00,0x20,0x34,0x42,0x00,0x3f,0x90,0x43,0x00,0x00,0x00,0x80,0x80,0x21, ++0x00,0x00,0xf0,0x21,0x00,0x00,0x88,0x21,0x10,0x60,0x00,0x76,0x00,0x00,0xa8,0x21, ++0x3c,0x01,0xb0,0x03,0xa0,0x20,0x00,0x3f,0x00,0x10,0x12,0x02,0x24,0x04,0x06,0x14, ++0x0c,0x00,0x06,0xd1,0x30,0x54,0x00,0x0f,0x24,0x04,0x06,0x14,0x0c,0x00,0x06,0xd1, ++0xaf,0xa2,0x00,0x10,0x3c,0x03,0x00,0xff,0x34,0x63,0xff,0xff,0x32,0x10,0x00,0x7f, ++0x00,0x43,0x10,0x24,0x00,0x10,0x86,0x00,0x02,0x02,0x80,0x25,0x02,0x00,0x28,0x21, ++0x24,0x04,0x06,0x14,0x3c,0x13,0xbf,0xff,0x0c,0x00,0x06,0xbf,0x3c,0x16,0xb0,0x03, ++0x00,0x00,0x90,0x21,0x3c,0x17,0x40,0x00,0x36,0x73,0xff,0xff,0x36,0xd6,0x00,0x3e, ++0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0x00,0x00,0x57,0x10,0x25,0x00,0x40,0x28,0x21, ++0x0c,0x00,0x06,0xbf,0x24,0x04,0x04,0x00,0x00,0x00,0x80,0x21,0x0c,0x00,0x25,0xf9, ++0x00,0x00,0x00,0x00,0x26,0x03,0x00,0x01,0x10,0x40,0x00,0x46,0x30,0x70,0x00,0xff, ++0x12,0x00,0xff,0xfa,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0x00, ++0x00,0x53,0x10,0x24,0x00,0x40,0x28,0x21,0x0c,0x00,0x06,0xbf,0x24,0x04,0x04,0x00, ++0x24,0x02,0x00,0x01,0x12,0x82,0x00,0x37,0x00,0x00,0x00,0x00,0x12,0x80,0x00,0x35, ++0x00,0x00,0x00,0x00,0x32,0x31,0x00,0x7f,0x12,0x20,0x00,0x04,0x24,0x03,0x00,0x04, ++0x27,0xc2,0x00,0x01,0x30,0x5e,0x00,0xff,0x02,0xb1,0xa8,0x21,0x12,0x43,0x00,0x2a, ++0x3c,0x03,0xb0,0x03,0x02,0x43,0x10,0x21,0xa0,0x51,0x00,0x34,0x26,0x42,0x00,0x01, ++0x30,0x52,0x00,0xff,0x2e,0x43,0x00,0x05,0x14,0x60,0xff,0xd9,0x00,0x00,0x00,0x00, ++0x8f,0xa5,0x00,0x10,0x0c,0x00,0x06,0xbf,0x24,0x04,0x06,0x14,0x12,0xa0,0x00,0x0e, ++0x3c,0x02,0xb0,0x03,0x13,0xc0,0x00,0x0d,0x34,0x42,0x00,0x3c,0x00,0x15,0x10,0x40, ++0x00,0x55,0x10,0x21,0x00,0x02,0x10,0xc0,0x00,0x55,0x10,0x21,0x00,0x02,0xa8,0x80, ++0x02,0xbe,0x00,0x1b,0x17,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d, ++0x00,0x00,0xa8,0x12,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x3c,0x3c,0x03,0xb0,0x03, ++0x3c,0x04,0xb0,0x03,0xa4,0x55,0x00,0x00,0x34,0x63,0x00,0x1c,0x34,0x84,0x00,0x1d, ++0x24,0x02,0x00,0x01,0xa0,0x60,0x00,0x00,0xa0,0x82,0x00,0x00,0x7b,0xbe,0x01,0xfc, ++0x7b,0xb6,0x01,0xbc,0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40,0xa2,0xd1,0x00,0x00,0x08,0x00,0x24,0x98, ++0x26,0x42,0x00,0x01,0x0c,0x00,0x06,0xd1,0x24,0x04,0x04,0xfc,0x08,0x00,0x24,0x8d, ++0x00,0x40,0x88,0x21,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x3c,0x3c,0x04,0xb0,0x03, ++0x3c,0x05,0xb0,0x03,0xa4,0x60,0x00,0x00,0x34,0x84,0x00,0x1c,0x34,0xa5,0x00,0x1d, ++0x24,0x02,0x00,0x02,0x24,0x03,0x00,0x01,0xa0,0x82,0x00,0x00,0x08,0x00,0x24,0xb7, ++0xa0,0xa3,0x00,0x00,0x0c,0x00,0x17,0x99,0x00,0x00,0x00,0x00,0x10,0x40,0xff,0x8b, ++0x00,0x10,0x12,0x02,0x3c,0x02,0xb0,0x03,0x3c,0x04,0xb0,0x03,0x34,0x42,0x00,0x3c, ++0x34,0x84,0x00,0x14,0x24,0x03,0x00,0x01,0xa4,0x40,0x00,0x00,0x3c,0x01,0xb0,0x03, ++0xa0,0x23,0x00,0x3f,0x08,0x00,0x24,0xb7,0xac,0x90,0x00,0x00,0x27,0xbd,0xff,0xd8, ++0xaf,0xb0,0x00,0x10,0x30,0xd0,0x00,0xff,0x2e,0x02,0x00,0x2e,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c,0x30,0xb1,0x00,0xff, ++0x14,0x40,0x00,0x06,0x00,0x80,0x90,0x21,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x2e,0x13,0x00,0x10, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x13,0xa4,0x24,0x06,0x01,0x07,0x12,0x60,0x00,0x38, ++0x02,0x00,0x30,0x21,0x8f,0xa2,0x00,0x38,0x30,0xc3,0x00,0x3f,0x3c,0x04,0xb0,0x09, ++0x00,0x02,0x14,0x00,0x00,0x43,0x30,0x25,0x34,0x84,0x01,0x60,0x90,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfd,0x24,0x02,0x00,0x01,0x12,0x22,0x00,0x2a, ++0x2a,0x22,0x00,0x02,0x14,0x40,0x00,0x24,0x24,0x02,0x00,0x02,0x12,0x22,0x00,0x20, ++0x24,0x02,0x00,0x03,0x12,0x22,0x00,0x19,0x00,0x00,0x00,0x00,0x16,0x60,0xff,0xe2, ++0x24,0x02,0x00,0x01,0x12,0x22,0x00,0x13,0x2a,0x22,0x00,0x02,0x14,0x40,0x00,0x0d, ++0x24,0x02,0x00,0x02,0x12,0x22,0x00,0x09,0x24,0x02,0x00,0x03,0x16,0x22,0xff,0xda, ++0x00,0x00,0x00,0x00,0x24,0x04,0x08,0x4c,0x24,0x05,0xff,0xff,0x0c,0x00,0x13,0x5f, ++0x3c,0x06,0x0c,0xb8,0x08,0x00,0x24,0xea,0x00,0x00,0x00,0x00,0x08,0x00,0x25,0x12, ++0x24,0x04,0x08,0x48,0x16,0x20,0xff,0xd0,0x00,0x00,0x00,0x00,0x08,0x00,0x25,0x12, ++0x24,0x04,0x08,0x40,0x08,0x00,0x25,0x12,0x24,0x04,0x08,0x44,0x24,0x04,0x08,0x4c, ++0x0c,0x00,0x13,0x5f,0x24,0x05,0xff,0xff,0x08,0x00,0x25,0x07,0x00,0x00,0x00,0x00, ++0x08,0x00,0x25,0x20,0x24,0x04,0x08,0x48,0x16,0x20,0xff,0xe0,0x00,0x00,0x00,0x00, ++0x08,0x00,0x25,0x20,0x24,0x04,0x08,0x40,0x08,0x00,0x25,0x20,0x24,0x04,0x08,0x44, ++0x02,0x40,0x20,0x21,0x0c,0x00,0x25,0x71,0x02,0x20,0x28,0x21,0x08,0x00,0x24,0xf5, ++0x00,0x40,0x30,0x21,0x27,0xbd,0xff,0xd8,0x2c,0xc2,0x00,0x2e,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c, ++0x00,0xc0,0x80,0x21,0x30,0xb1,0x00,0xff,0x00,0x80,0x90,0x21,0x14,0x40,0x00,0x07, ++0x00,0x00,0x18,0x21,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x2e,0x13,0x00,0x10, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x13,0xa4,0x24,0x06,0x01,0x07,0x12,0x60,0x00,0x24, ++0x02,0x00,0x30,0x21,0x3c,0x03,0xb0,0x09,0x34,0x63,0x01,0x60,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfd,0x30,0xc5,0x00,0x3f,0x0c,0x00,0x25,0xae, ++0x02,0x20,0x20,0x21,0x16,0x60,0x00,0x0a,0x00,0x40,0x80,0x21,0x24,0x02,0x00,0x01, ++0x12,0x22,0x00,0x15,0x2a,0x22,0x00,0x02,0x14,0x40,0x00,0x0f,0x24,0x02,0x00,0x02, ++0x12,0x22,0x00,0x0b,0x24,0x02,0x00,0x03,0x12,0x22,0x00,0x03,0x00,0x00,0x00,0x00, ++0x08,0x00,0x25,0x3d,0x02,0x00,0x18,0x21,0x24,0x04,0x08,0x4c,0x24,0x05,0xff,0xff, ++0x0c,0x00,0x13,0x5f,0x3c,0x06,0x0c,0xb8,0x08,0x00,0x25,0x3d,0x02,0x00,0x18,0x21, ++0x08,0x00,0x25,0x5f,0x24,0x04,0x08,0x48,0x16,0x20,0xff,0xf5,0x00,0x00,0x00,0x00, ++0x08,0x00,0x25,0x5f,0x24,0x04,0x08,0x40,0x08,0x00,0x25,0x5f,0x24,0x04,0x08,0x44, ++0x02,0x40,0x20,0x21,0x0c,0x00,0x25,0x71,0x02,0x20,0x28,0x21,0x08,0x00,0x25,0x49, ++0x00,0x40,0x30,0x21,0x27,0xbd,0xff,0xe8,0x2c,0xc2,0x00,0x1f,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x14,0x00,0xc0,0x80,0x21,0x14,0x40,0x00,0x1d,0x30,0xa5,0x00,0xff, ++0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x18,0x28,0xa2,0x00,0x02,0x14,0x40,0x00,0x12, ++0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x0e,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x07, ++0x24,0x04,0x08,0x4c,0x26,0x10,0xff,0xe2,0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x24,0x05,0xff,0xff, ++0x0c,0x00,0x13,0x5f,0x3c,0x06,0x0d,0xf8,0x08,0x00,0x25,0x82,0x26,0x10,0xff,0xe2, ++0x08,0x00,0x25,0x87,0x24,0x04,0x08,0x48,0x14,0xa0,0xff,0xf2,0x24,0x04,0x08,0x40, ++0x08,0x00,0x25,0x88,0x24,0x05,0xff,0xff,0x08,0x00,0x25,0x87,0x24,0x04,0x08,0x44, ++0x2c,0xc2,0x00,0x10,0x14,0x40,0xff,0xec,0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x14, ++0x28,0xa2,0x00,0x02,0x14,0x40,0x00,0x0e,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x0a, ++0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x03,0x24,0x04,0x08,0x4c,0x08,0x00,0x25,0x82, ++0x26,0x10,0xff,0xf1,0x24,0x05,0xff,0xff,0x0c,0x00,0x13,0x5f,0x3c,0x06,0x0d,0xb8, ++0x08,0x00,0x25,0x82,0x26,0x10,0xff,0xf1,0x08,0x00,0x25,0xa1,0x24,0x04,0x08,0x48, ++0x14,0xa0,0xff,0xf6,0x24,0x04,0x08,0x40,0x08,0x00,0x25,0xa2,0x24,0x05,0xff,0xff, ++0x08,0x00,0x25,0xa1,0x24,0x04,0x08,0x44,0x27,0xbd,0xff,0xe8,0x30,0x84,0x00,0xff, ++0x24,0x02,0x00,0x01,0x10,0x82,0x00,0x39,0xaf,0xbf,0x00,0x10,0x28,0x82,0x00,0x02, ++0x14,0x40,0x00,0x27,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0x82,0x00,0x17, ++0x00,0xa0,0x30,0x21,0x24,0x02,0x00,0x03,0x10,0x82,0x00,0x05,0x24,0x04,0x08,0x3c, ++0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x0c,0x00,0x13,0x5f,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x3c,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x13,0x5f,0x00,0x00,0x30,0x21,0x24,0x04,0x08,0x3c,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x01,0x24,0x04,0x08,0xac,0x0c,0x00,0x13,0x41, ++0x24,0x05,0x0f,0xff,0x08,0x00,0x25,0xbc,0x00,0x00,0x00,0x00,0x24,0x04,0x08,0x34, ++0x0c,0x00,0x13,0x5f,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x34,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x13,0x5f,0x00,0x00,0x30,0x21,0x24,0x04,0x08,0x34,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x01,0x08,0x00,0x25,0xcb,0x24,0x04,0x08,0xa8, ++0x14,0x80,0xff,0xdf,0x00,0xa0,0x30,0x21,0x24,0x04,0x08,0x24,0x0c,0x00,0x13,0x5f, ++0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x24,0x3c,0x05,0x80,0x00,0x0c,0x00,0x13,0x5f, ++0x00,0x00,0x30,0x21,0x24,0x04,0x08,0x24,0x3c,0x05,0x80,0x00,0x0c,0x00,0x13,0x5f, ++0x24,0x06,0x00,0x01,0x08,0x00,0x25,0xcb,0x24,0x04,0x08,0xa0,0x00,0xa0,0x30,0x21, ++0x24,0x04,0x08,0x2c,0x0c,0x00,0x13,0x5f,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x2c, ++0x3c,0x05,0x80,0x00,0x0c,0x00,0x13,0x5f,0x00,0x00,0x30,0x21,0x24,0x04,0x08,0x2c, ++0x3c,0x05,0x80,0x00,0x0c,0x00,0x13,0x5f,0x24,0x06,0x00,0x01,0x08,0x00,0x25,0xcb, ++0x24,0x04,0x08,0xa4,0x3c,0x05,0x00,0x14,0x3c,0x02,0xb0,0x05,0x34,0x42,0x04,0x20, ++0x3c,0x06,0xc0,0x00,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0x34,0xa5,0x17,0x09, ++0xac,0x45,0x00,0x00,0x34,0xc6,0x05,0x07,0x34,0x63,0x04,0x24,0x34,0x84,0x02,0x28, ++0x3c,0x07,0xb0,0x05,0x24,0x02,0x00,0x20,0xac,0x66,0x00,0x00,0x34,0xe7,0x04,0x50, ++0xa0,0x82,0x00,0x00,0x90,0xe2,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x03, ++0x10,0x40,0xff,0xfc,0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x93,0x85,0x81,0xf1,0x24,0x02,0x00,0x01,0x14,0xa2,0x00,0x53,0x00,0x80,0x40,0x21, ++0x8c,0x89,0x00,0x04,0x3c,0x02,0xb0,0x01,0x01,0x22,0x30,0x21,0x8c,0xc3,0x00,0x04, ++0x3c,0x02,0x01,0x00,0x00,0x62,0x10,0x24,0x10,0x40,0x00,0x4b,0x30,0x62,0x00,0x08, ++0x10,0x45,0x00,0x59,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x38,0x24,0x03,0x00,0xb4, ++0x30,0x44,0x00,0xff,0x10,0x83,0x00,0x61,0x24,0x02,0x00,0xc4,0x10,0x82,0x00,0x54, ++0x24,0x02,0x00,0x94,0x10,0x82,0x00,0x45,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x38, ++0x00,0x00,0x00,0x00,0x30,0x47,0xff,0xff,0x30,0xe3,0x40,0xff,0x24,0x02,0x40,0x88, ++0x14,0x62,0x00,0x39,0x30,0xe3,0x03,0x00,0x24,0x02,0x03,0x00,0x10,0x62,0x00,0x38, ++0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x56,0x00,0x00,0x00,0x00,0x30,0x47,0xff,0xff, ++0x30,0xe2,0x00,0x80,0x14,0x40,0x00,0x30,0x3c,0x02,0xb0,0x01,0x01,0x22,0x30,0x21, ++0x94,0xc3,0x00,0x60,0x24,0x02,0x00,0x08,0x14,0x43,0x00,0x3b,0x00,0x00,0x00,0x00, ++0x90,0xc2,0x00,0x62,0x24,0x03,0x00,0x04,0x00,0x02,0x39,0x02,0x10,0xe3,0x00,0x15, ++0x24,0x02,0x00,0x06,0x14,0xe2,0x00,0x34,0x00,0x00,0x00,0x00,0x8d,0x05,0x01,0xac, ++0x94,0xc4,0x00,0x66,0x27,0x82,0x89,0x68,0x00,0x05,0x28,0x80,0x30,0x87,0xff,0xff, ++0x00,0xa2,0x28,0x21,0x00,0x07,0x1a,0x00,0x8c,0xa4,0x00,0x00,0x00,0x07,0x12,0x02, ++0x00,0x43,0x10,0x25,0x24,0x42,0x00,0x5e,0x24,0x03,0xc0,0x00,0x30,0x47,0xff,0xff, ++0x00,0x83,0x20,0x24,0x00,0x87,0x20,0x25,0xac,0xa4,0x00,0x00,0x08,0x00,0x26,0x76, ++0xad,0x07,0x00,0x10,0x8d,0x05,0x01,0xac,0x94,0xc4,0x00,0x64,0x27,0x82,0x89,0x68, ++0x00,0x05,0x28,0x80,0x30,0x87,0xff,0xff,0x00,0xa2,0x28,0x21,0x00,0x07,0x1a,0x00, ++0x8c,0xa4,0x00,0x00,0x00,0x07,0x12,0x02,0x00,0x43,0x10,0x25,0x24,0x42,0x00,0x36, ++0x3c,0x03,0xff,0xff,0x30,0x47,0xff,0xff,0x00,0x83,0x20,0x24,0x00,0x87,0x20,0x25, ++0xac,0xa4,0x00,0x00,0xad,0x07,0x00,0x10,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x94,0xc2,0x00,0x50,0x08,0x00,0x26,0x34,0x30,0x47,0xff,0xff,0x8d,0x04,0x01,0xac, ++0x27,0x83,0x89,0x68,0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00, ++0x3c,0x03,0xff,0xff,0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x2e,0xac,0x82,0x00,0x00, ++0x24,0x03,0x00,0x2e,0xad,0x03,0x00,0x10,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x8d,0x04,0x01,0xac,0x27,0x83,0x89,0x68,0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21, ++0x8c,0x82,0x00,0x00,0x3c,0x03,0xff,0xff,0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x0e, ++0x24,0x03,0x00,0x0e,0x08,0x00,0x26,0x75,0xac,0x82,0x00,0x00,0x8d,0x04,0x01,0xac, ++0x27,0x83,0x89,0x68,0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00, ++0x3c,0x03,0xff,0xff,0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x14,0x24,0x03,0x00,0x14, ++0x08,0x00,0x26,0x75,0xac,0x82,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x30,0xc6,0x00,0xff,0x00,0x06,0x48,0x40,0x01,0x26,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x8b,0xbc,0x30,0x27,0x83,0xbc,0x36,0x00,0x4b,0x40,0x21,0x00,0x43,0x10,0x21, ++0x94,0x47,0x00,0x00,0x30,0xa2,0x3f,0xff,0x10,0xe2,0x00,0x29,0x30,0x8a,0xff,0xff, ++0x95,0x02,0x00,0x02,0x24,0x03,0x00,0x01,0x00,0x02,0x11,0x82,0x30,0x42,0x00,0x01, ++0x10,0x43,0x00,0x18,0x00,0x00,0x00,0x00,0x01,0x26,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x4b,0x30,0x21,0x94,0xc4,0x00,0x02,0x27,0x83,0xbc,0x36,0x27,0x85,0xbc,0x34, ++0x00,0x45,0x28,0x21,0x30,0x84,0xff,0xdf,0x00,0x43,0x10,0x21,0xa4,0xc4,0x00,0x02, ++0xa4,0x40,0x00,0x00,0xa4,0xa0,0x00,0x00,0x94,0xc3,0x00,0x02,0x3c,0x04,0xb0,0x01, ++0x01,0x44,0x20,0x21,0x30,0x63,0xff,0xbf,0xa4,0xc3,0x00,0x02,0xa0,0xc0,0x00,0x00, ++0x8c,0x82,0x00,0x04,0x24,0x03,0xf0,0xff,0x00,0x43,0x10,0x24,0x03,0xe0,0x00,0x08, ++0xac,0x82,0x00,0x04,0x24,0x02,0xc0,0x00,0x91,0x04,0x00,0x01,0x00,0xa2,0x10,0x24, ++0x00,0x47,0x28,0x25,0x3c,0x03,0xb0,0x01,0x24,0x02,0x00,0x02,0x14,0x82,0xff,0xe2, ++0x01,0x43,0x18,0x21,0xac,0x65,0x00,0x00,0x08,0x00,0x26,0xa3,0x01,0x26,0x10,0x21, ++0x08,0x00,0x26,0xa3,0x01,0x26,0x10,0x21,0x93,0x83,0x81,0xf1,0x24,0x02,0x00,0x01, ++0x14,0x62,0x00,0x0d,0x3c,0x02,0xb0,0x01,0x8c,0x84,0x00,0x04,0x3c,0x06,0xb0,0x09, ++0x00,0x82,0x20,0x21,0x8c,0x85,0x00,0x08,0x8c,0x83,0x00,0x04,0x3c,0x02,0x01,0x00, ++0x34,0xc6,0x01,0x00,0x00,0x62,0x18,0x24,0x14,0x60,0x00,0x05,0x30,0xa5,0x20,0x00, ++0x24,0x02,0x00,0x06,0xa0,0xc2,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x09,0x10,0xa0,0xff,0xfc,0x34,0x63,0x01,0x00,0x24,0x02,0x00,0x0e, ++0x08,0x00,0x26,0xd6,0xa0,0x62,0x00,0x00,0x3c,0x02,0xb0,0x01,0x30,0xa5,0xff,0xff, ++0x00,0xa2,0x28,0x21,0x8c,0xa3,0x00,0x00,0x3c,0x02,0x10,0x00,0x00,0x80,0x30,0x21, ++0x00,0x62,0x18,0x24,0x8c,0xa2,0x00,0x04,0x10,0x60,0x00,0x04,0x00,0x00,0x00,0x00, ++0x30,0x42,0x80,0x00,0x10,0x40,0x00,0x13,0x00,0x00,0x00,0x00,0x8c,0xc2,0x01,0xa8, ++0x00,0x00,0x00,0x00,0x24,0x44,0x00,0x01,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40, ++0x00,0x83,0x10,0x0a,0x93,0x83,0x81,0xf0,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80, ++0x00,0x82,0x20,0x23,0x24,0x63,0xff,0xff,0xac,0xc4,0x01,0xa8,0xa3,0x83,0x81,0xf0, ++0x8c,0xc4,0x01,0xac,0x8c,0xc2,0x01,0xa8,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x26, ++0x00,0x02,0x10,0x2b,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x34,0x63,0x00,0x73,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0xa3,0x80,0x81,0xf1,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0xa3,0x82,0x81,0xf1,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x04,0x3c,0x05,0xb0,0x01,0x00,0x80,0x50,0x21, ++0x00,0x45,0x10,0x21,0x8c,0x43,0x00,0x04,0x24,0x02,0x00,0x05,0x00,0x03,0x1a,0x02, ++0x30,0x69,0x00,0x0f,0x11,0x22,0x00,0x0b,0x24,0x02,0x00,0x07,0x11,0x22,0x00,0x09, ++0x24,0x02,0x00,0x0a,0x11,0x22,0x00,0x07,0x24,0x02,0x00,0x0b,0x11,0x22,0x00,0x05, ++0x24,0x02,0x00,0x01,0x93,0x83,0x81,0xf0,0x3c,0x04,0xb0,0x06,0x10,0x62,0x00,0x03, ++0x34,0x84,0x80,0x18,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x17,0x02,0x14,0x40,0xff,0xfa,0x00,0x00,0x00,0x00, ++0x8d,0x43,0x01,0xa8,0x27,0x82,0x89,0x68,0x00,0x03,0x18,0x80,0x00,0x6a,0x20,0x21, ++0x8c,0x87,0x00,0xa8,0x00,0x62,0x18,0x21,0x8c,0x68,0x00,0x00,0x00,0xe5,0x28,0x21, ++0x8c,0xa9,0x00,0x00,0x3c,0x02,0xff,0xff,0x27,0x83,0x8a,0x68,0x01,0x22,0x10,0x24, ++0x00,0x48,0x10,0x25,0xac,0xa2,0x00,0x00,0x8d,0x44,0x01,0xa8,0x00,0x07,0x30,0xc2, ++0x3c,0x02,0x00,0x80,0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x00,0x06,0x32,0x00, ++0x8c,0xa9,0x00,0x04,0x00,0xc2,0x30,0x25,0x8c,0x82,0x00,0x00,0x3c,0x03,0x80,0x00, ++0x01,0x22,0x10,0x25,0x00,0x43,0x10,0x25,0xac,0xa2,0x00,0x04,0xaf,0x87,0xbc,0x20, ++0x8c,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x82,0xbc,0x28,0x8c,0xa3,0x00,0x04, ++0x3c,0x01,0xb0,0x07,0xac,0x26,0x80,0x18,0x8d,0x42,0x01,0xa8,0xaf,0x83,0xbc,0x24, ++0x93,0x85,0x81,0xf0,0x24,0x44,0x00,0x01,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40, ++0x00,0x83,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x24,0xa5,0xff,0xff, ++0x00,0x82,0x20,0x23,0xad,0x44,0x01,0xa8,0xa3,0x85,0x81,0xf0,0x08,0x00,0x27,0x21, ++0x00,0x00,0x00,0x00,0x3c,0x05,0xb0,0x03,0x3c,0x02,0x80,0x01,0x34,0xa5,0x00,0x20, ++0x24,0x42,0x9d,0x64,0xac,0xa2,0x00,0x00,0x24,0x02,0x00,0x02,0x24,0x03,0x00,0x20, ++0xac,0x82,0x00,0x64,0x3c,0x02,0x80,0x01,0xac,0x83,0x00,0x60,0xac,0x80,0x00,0x00, ++0xac,0x80,0x00,0x04,0xac,0x80,0x00,0x08,0xac,0x80,0x00,0x4c,0xac,0x80,0x00,0x50, ++0xac,0x80,0x00,0x54,0xac,0x80,0x00,0x0c,0xac,0x80,0x00,0x58,0xa0,0x80,0x00,0x5c, ++0x24,0x42,0x9e,0x28,0x24,0x83,0x00,0x68,0x24,0x05,0x00,0x0f,0x24,0xa5,0xff,0xff, ++0xac,0x62,0x00,0x00,0x04,0xa1,0xff,0xfd,0x24,0x63,0x00,0x04,0x3c,0x02,0x80,0x01, ++0x24,0x42,0x9f,0x10,0xac,0x82,0x00,0x78,0x3c,0x03,0x80,0x01,0x3c,0x02,0x80,0x01, ++0x24,0x63,0xa0,0x9c,0x24,0x42,0xa0,0x08,0xac,0x83,0x00,0x88,0xac,0x82,0x00,0x98, ++0x3c,0x03,0x80,0x01,0x3c,0x02,0x80,0x01,0x24,0x63,0xa1,0x44,0x24,0x42,0xa2,0x5c, ++0xac,0x83,0x00,0xa0,0xac,0x82,0x00,0xa4,0xa0,0x80,0x01,0xba,0xac,0x80,0x01,0xa8, ++0xac,0x80,0x01,0xac,0xac,0x80,0x01,0xb0,0xac,0x80,0x01,0xb4,0xa0,0x80,0x01,0xb8, ++0x03,0xe0,0x00,0x08,0xa0,0x80,0x01,0xb9,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01, ++0x34,0x63,0x00,0x20,0x24,0x42,0x9e,0x28,0x03,0xe0,0x00,0x08,0xac,0x62,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x34,0x42,0x00,0x20,0x24,0x63,0x9e,0x40, ++0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x11, ++0x00,0x80,0x28,0x21,0x8c,0x82,0x00,0x14,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0d, ++0x00,0x00,0x00,0x00,0x8c,0x84,0x00,0x10,0x8c,0xa3,0x00,0x14,0x8c,0xa2,0x00,0x04, ++0x00,0x83,0x20,0x21,0x00,0x44,0x10,0x21,0x30,0x43,0x00,0xff,0x00,0x03,0x18,0x2b, ++0x00,0x02,0x12,0x02,0x00,0x43,0x10,0x21,0x00,0x02,0x12,0x00,0x30,0x42,0x3f,0xff, ++0xac,0xa2,0x00,0x04,0xac,0xa0,0x00,0x00,0xac,0xa0,0x00,0x4c,0xac,0xa0,0x00,0x50, ++0xac,0xa0,0x00,0x54,0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x0c,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20,0x24,0x42,0x9e,0xbc,0xac,0x62,0x00,0x00, ++0x8c,0x86,0x00,0x04,0x3c,0x02,0xb0,0x01,0x24,0x03,0x00,0x01,0x00,0xc2,0x10,0x21, ++0x8c,0x45,0x00,0x00,0xac,0x83,0x00,0x4c,0x00,0x05,0x14,0x02,0x30,0xa3,0x3f,0xff, ++0x30,0x42,0x00,0xff,0xac,0x83,0x00,0x10,0xac,0x82,0x00,0x14,0x8c,0x83,0x00,0x14, ++0xac,0x85,0x00,0x40,0x00,0xc3,0x30,0x21,0x03,0xe0,0x00,0x08,0xac,0x86,0x00,0x08, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20, ++0x24,0x63,0x9f,0x10,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00, ++0x8c,0x82,0x00,0x4c,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0a,0x00,0x80,0x80,0x21, ++0xae,0x00,0x00,0x00,0xae,0x00,0x00,0x4c,0xae,0x00,0x00,0x50,0xae,0x00,0x00,0x54, ++0xae,0x00,0x00,0x0c,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x0c,0x00,0x27,0xaf,0x00,0x00,0x00,0x00,0x08,0x00,0x27,0xd1, ++0xae,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8, ++0x34,0x42,0x00,0x20,0x24,0x63,0x9f,0x74,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14, ++0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x4c,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x16, ++0x00,0x80,0x80,0x21,0x8e,0x03,0x00,0x08,0x3c,0x02,0xb0,0x01,0x8e,0x04,0x00,0x44, ++0x00,0x62,0x18,0x21,0x90,0x65,0x00,0x00,0x24,0x02,0x00,0x01,0xae,0x02,0x00,0x50, ++0x30,0xa3,0x00,0xff,0x00,0x03,0x10,0x82,0x00,0x04,0x23,0x02,0x30,0x84,0x00,0x0f, ++0x30,0x42,0x00,0x03,0x00,0x03,0x19,0x02,0xae,0x04,0x00,0x34,0xae,0x02,0x00,0x2c, ++0xae,0x03,0x00,0x30,0xa2,0x05,0x00,0x48,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x27,0xaf,0x00,0x00,0x00,0x00, ++0x08,0x00,0x27,0xe9,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01, ++0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xa0,0x08,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x50,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x16,0x00,0x80,0x80,0x21,0x92,0x03,0x00,0x44,0x8e,0x02,0x00,0x40, ++0x83,0x85,0x8b,0xd4,0x92,0x04,0x00,0x41,0x30,0x63,0x00,0x01,0x00,0x02,0x16,0x02, ++0xae,0x04,0x00,0x14,0x00,0x00,0x30,0x21,0xae,0x02,0x00,0x18,0x10,0xa0,0x00,0x04, ++0xae,0x03,0x00,0x3c,0x10,0x60,0x00,0x03,0x24,0x02,0x00,0x01,0x24,0x06,0x00,0x01, ++0x24,0x02,0x00,0x01,0xa3,0x86,0x8b,0xd4,0x8f,0xbf,0x00,0x14,0xae,0x02,0x00,0x54, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x27,0xdd, ++0x00,0x00,0x00,0x00,0x08,0x00,0x28,0x0e,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xa0,0x9c, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x50, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x1b,0x00,0x80,0x80,0x21,0x3c,0x02,0xb0,0x03, ++0x8c,0x42,0x00,0x00,0x92,0x04,0x00,0x44,0x8e,0x03,0x00,0x40,0x83,0x86,0x8b,0xd4, ++0x92,0x05,0x00,0x41,0x30,0x42,0x08,0x00,0x30,0x84,0x00,0x01,0x00,0x02,0x12,0xc2, ++0x00,0x03,0x1e,0x02,0x00,0x82,0x20,0x25,0xae,0x05,0x00,0x14,0x00,0x00,0x38,0x21, ++0xae,0x03,0x00,0x18,0x10,0xc0,0x00,0x04,0xae,0x04,0x00,0x3c,0x10,0x80,0x00,0x03, ++0x24,0x02,0x00,0x01,0x24,0x07,0x00,0x01,0x24,0x02,0x00,0x01,0xa3,0x87,0x8b,0xd4, ++0x8f,0xbf,0x00,0x14,0xae,0x02,0x00,0x54,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x0c,0x00,0x27,0xdd,0x00,0x00,0x00,0x00,0x08,0x00,0x28,0x33, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8, ++0x34,0x42,0x00,0x20,0x24,0x63,0xa1,0x44,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14, ++0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x54,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x37, ++0x00,0x80,0x80,0x21,0x8e,0x04,0x00,0x04,0x8e,0x03,0x00,0x44,0x3c,0x02,0x80,0x00, ++0x3c,0x05,0xb0,0x01,0x34,0x42,0x00,0x10,0x00,0x85,0x20,0x21,0x00,0x62,0x18,0x25, ++0xac,0x83,0x00,0x04,0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac,0x02,0x00,0x20,0x21, ++0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x00,0x00,0x03,0x18,0x80,0x27,0x82,0x89,0x68, ++0x00,0x62,0x18,0x21,0xac,0x66,0x00,0x00,0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac, ++0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x04,0x00,0x03,0x18,0x80,0x27,0x82,0x8a,0x68, ++0x00,0x62,0x18,0x21,0x0c,0x00,0x26,0x10,0xac,0x66,0x00,0x00,0x8e,0x03,0x01,0xac, ++0x8e,0x07,0x00,0x04,0x3c,0x06,0xb0,0x03,0x24,0x65,0x00,0x01,0x28,0xa4,0x00,0x00, ++0x24,0x62,0x00,0x40,0x00,0xa4,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80, ++0x00,0x03,0x18,0x80,0x00,0xa2,0x28,0x23,0x00,0x70,0x18,0x21,0xae,0x05,0x01,0xac, ++0xac,0x67,0x00,0xa8,0x34,0xc6,0x00,0x30,0x8c,0xc3,0x00,0x00,0x93,0x82,0x81,0xf0, ++0x02,0x00,0x20,0x21,0x24,0x63,0x00,0x01,0x24,0x42,0x00,0x01,0xac,0xc3,0x00,0x00, ++0xa3,0x82,0x81,0xf0,0x0c,0x00,0x27,0x90,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x28,0x27, ++0x00,0x00,0x00,0x00,0x08,0x00,0x28,0x5d,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xa2,0x5c, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x54, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x37,0x00,0x80,0x80,0x21,0x8e,0x04,0x00,0x04, ++0x8e,0x03,0x00,0x44,0x3c,0x02,0x80,0x00,0x3c,0x05,0xb0,0x01,0x34,0x42,0x00,0x10, ++0x00,0x85,0x20,0x21,0x00,0x62,0x18,0x25,0xac,0x83,0x00,0x04,0x8e,0x02,0x00,0x04, ++0x8e,0x03,0x01,0xac,0x02,0x00,0x20,0x21,0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x00, ++0x00,0x03,0x18,0x80,0x27,0x82,0x89,0x68,0x00,0x62,0x18,0x21,0xac,0x66,0x00,0x00, ++0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac,0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x04, ++0x00,0x03,0x18,0x80,0x27,0x82,0x8a,0x68,0x00,0x62,0x18,0x21,0x0c,0x00,0x26,0x10, ++0xac,0x66,0x00,0x00,0x8e,0x03,0x01,0xac,0x8e,0x07,0x00,0x04,0x3c,0x06,0xb0,0x03, ++0x24,0x65,0x00,0x01,0x28,0xa4,0x00,0x00,0x24,0x62,0x00,0x40,0x00,0xa4,0x10,0x0a, ++0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x03,0x18,0x80,0x00,0xa2,0x28,0x23, ++0x00,0x70,0x18,0x21,0xae,0x05,0x01,0xac,0xac,0x67,0x00,0xa8,0x34,0xc6,0x00,0x30, ++0x8c,0xc3,0x00,0x00,0x93,0x82,0x81,0xf0,0x02,0x00,0x20,0x21,0x24,0x63,0x00,0x01, ++0x24,0x42,0x00,0x01,0xac,0xc3,0x00,0x00,0xa3,0x82,0x81,0xf0,0x0c,0x00,0x27,0x90, ++0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x0c,0x00,0x28,0x27,0x00,0x00,0x00,0x00,0x08,0x00,0x28,0xa3, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x34,0x42,0x00,0x20, ++0x24,0x63,0xa3,0x74,0x27,0xbd,0xff,0xe0,0xac,0x43,0x00,0x00,0x3c,0x02,0x80,0x01, ++0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x1c, ++0x00,0x80,0x80,0x21,0x24,0x52,0x9e,0x28,0x00,0x00,0x88,0x21,0x3c,0x03,0xb0,0x09, ++0x34,0x63,0x00,0x06,0x8e,0x06,0x00,0x04,0x90,0x62,0x00,0x00,0x00,0x06,0x22,0x02, ++0x00,0x44,0x10,0x23,0x24,0x44,0x00,0x40,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x7f, ++0x00,0x83,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x24,0x84,0xff,0xff, ++0x10,0x44,0x00,0x68,0x00,0x00,0x28,0x21,0x3c,0x02,0xb0,0x01,0x00,0xc2,0x10,0x21, ++0x8c,0x44,0x00,0x04,0x3c,0x03,0x7c,0x00,0x34,0x63,0x00,0xf0,0x00,0x83,0x18,0x24, ++0xae,0x04,0x00,0x44,0x8c,0x44,0x00,0x00,0x10,0x60,0x00,0x69,0x00,0x00,0x38,0x21, ++0x3c,0x09,0xb0,0x03,0x3c,0x06,0x7c,0x00,0x35,0x29,0x00,0x99,0x3c,0x0a,0xb0,0x01, ++0x24,0x08,0x00,0x40,0x34,0xc6,0x00,0xf0,0x3c,0x0b,0xff,0xff,0x3c,0x0c,0x28,0x38, ++0x16,0x20,0x00,0x06,0x24,0xa5,0x00,0x01,0x93,0x82,0x81,0xf6,0x24,0x11,0x00,0x01, ++0x24,0x42,0x00,0x01,0xa1,0x22,0x00,0x00,0xa3,0x82,0x81,0xf6,0x8e,0x02,0x00,0x04, ++0x24,0x07,0x00,0x01,0x24,0x42,0x01,0x00,0x30,0x42,0x3f,0xff,0xae,0x02,0x00,0x04, ++0x00,0x4a,0x10,0x21,0x8c,0x43,0x00,0x04,0x00,0x00,0x00,0x00,0xae,0x03,0x00,0x44, ++0x8c,0x44,0x00,0x00,0x10,0xa8,0x00,0x2d,0x00,0x66,0x18,0x24,0x14,0x60,0xff,0xec, ++0x00,0x8b,0x10,0x24,0x14,0x4c,0xff,0xea,0x24,0x02,0x00,0x01,0x10,0xe2,0x00,0x2f, ++0x3c,0x03,0xb0,0x09,0x8e,0x02,0x00,0x44,0x8e,0x04,0x00,0x60,0x00,0x02,0x1e,0x42, ++0x00,0x02,0x12,0x02,0x30,0x42,0x00,0x0f,0x30,0x63,0x00,0x01,0xae,0x02,0x00,0x00, ++0x10,0x44,0x00,0x1a,0xae,0x03,0x00,0x58,0x8e,0x02,0x00,0x64,0x8e,0x04,0x00,0x58, ++0x00,0x00,0x00,0x00,0x10,0x82,0x00,0x05,0x00,0x00,0x00,0x00,0xae,0x00,0x00,0x4c, ++0xae,0x00,0x00,0x50,0xae,0x00,0x00,0x54,0xae,0x00,0x00,0x0c,0x8e,0x03,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x03,0x10,0x80,0x00,0x50,0x10,0x21,0x8c,0x42,0x00,0x68, ++0x00,0x00,0x00,0x00,0x10,0x52,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x40,0xf8,0x09, ++0x02,0x00,0x20,0x21,0x8e,0x04,0x00,0x58,0x8e,0x03,0x00,0x00,0x00,0x00,0x00,0x00, ++0xae,0x03,0x00,0x60,0x08,0x00,0x28,0xeb,0xae,0x04,0x00,0x64,0x8e,0x02,0x00,0x64, ++0x00,0x00,0x00,0x00,0x14,0x62,0xff,0xe5,0x00,0x00,0x00,0x00,0x7a,0x02,0x0d,0x7c, ++0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x00,0x43,0x10,0x26, ++0x00,0x02,0x10,0x2b,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x34,0x63,0x00,0x06, ++0x8e,0x04,0x00,0x04,0x90,0x62,0x00,0x00,0x00,0x04,0x22,0x02,0x00,0x44,0x10,0x23, ++0x24,0x44,0x00,0x40,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x7f,0x00,0x83,0x10,0x0a, ++0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x82,0x20,0x23,0x14,0x87,0xff,0xc5, ++0x00,0x00,0x00,0x00,0x8e,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x62,0x00,0x03, ++0x14,0x40,0x00,0x05,0x24,0x02,0x00,0x0d,0x10,0x62,0x00,0x03,0x24,0x02,0x00,0x01, ++0x08,0x00,0x29,0x4b,0xa2,0x02,0x00,0x5c,0x08,0x00,0x29,0x4b,0xa2,0x00,0x00,0x5c, ++0x3c,0x02,0xff,0xff,0x00,0x82,0x10,0x24,0x3c,0x03,0x28,0x38,0x14,0x43,0xff,0x94, ++0x24,0x02,0x00,0x01,0x08,0x00,0x29,0x23,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x01,0x34,0x42,0x00,0x20,0x24,0x63,0xa5,0xcc,0xac,0x43,0x00,0x00, ++0x8c,0x83,0x01,0xa8,0x8c,0x82,0x01,0xac,0x00,0x80,0x40,0x21,0x10,0x62,0x00,0x20, ++0x00,0x00,0x20,0x21,0x93,0x82,0x81,0xf1,0x00,0x03,0x28,0x80,0x3c,0x07,0xb0,0x06, ++0x00,0xa8,0x18,0x21,0x24,0x04,0x00,0x01,0x8c,0x66,0x00,0xa8,0x10,0x44,0x00,0x1c, ++0x34,0xe7,0x80,0x18,0x3c,0x05,0xb0,0x01,0xaf,0x86,0xbc,0x20,0x00,0xc5,0x28,0x21, ++0x8c,0xa3,0x00,0x00,0x00,0x06,0x20,0xc2,0x3c,0x02,0x00,0x80,0x00,0x04,0x22,0x00, ++0x00,0x82,0x20,0x25,0xaf,0x83,0xbc,0x28,0x8c,0xa2,0x00,0x04,0xac,0xe4,0x00,0x00, ++0x8d,0x03,0x01,0xa8,0xaf,0x82,0xbc,0x24,0x24,0x64,0x00,0x01,0x04,0x80,0x00,0x0a, ++0x00,0x80,0x10,0x21,0x00,0x02,0x11,0x83,0x8d,0x03,0x01,0xac,0x00,0x02,0x11,0x80, ++0x00,0x82,0x10,0x23,0x00,0x43,0x18,0x26,0xad,0x02,0x01,0xa8,0x00,0x03,0x20,0x2b, ++0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x08,0x00,0x29,0x95,0x24,0x62,0x00,0x40, ++0x27,0x82,0x89,0x68,0x00,0x06,0x20,0xc2,0x00,0x04,0x22,0x00,0x00,0xa2,0x48,0x21, ++0x3c,0x02,0x00,0x80,0x00,0x82,0x58,0x25,0x93,0x82,0x81,0xf0,0x3c,0x0a,0xb0,0x06, ++0x3c,0x03,0xb0,0x01,0x2c,0x42,0x00,0x02,0x00,0xc3,0x38,0x21,0x35,0x4a,0x80,0x18, ++0x14,0x40,0xff,0xef,0x00,0x00,0x20,0x21,0x8c,0xe5,0x00,0x00,0x8d,0x23,0x00,0x00, ++0x24,0x02,0xc0,0x00,0x00,0xa2,0x10,0x24,0x00,0x43,0x10,0x25,0xac,0xe2,0x00,0x00, ++0x8d,0x04,0x01,0xa8,0x27,0x83,0x8a,0x68,0x8c,0xe5,0x00,0x04,0x00,0x04,0x20,0x80, ++0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00,0x3c,0x03,0x80,0x00,0x00,0xa2,0x10,0x25, ++0x00,0x43,0x10,0x25,0xac,0xe2,0x00,0x04,0xaf,0x86,0xbc,0x20,0x8c,0xe2,0x00,0x00, ++0x93,0x85,0x81,0xf0,0xaf,0x82,0xbc,0x28,0x8c,0xe3,0x00,0x04,0xad,0x4b,0x00,0x00, ++0x8d,0x02,0x01,0xa8,0xaf,0x83,0xbc,0x24,0x24,0xa5,0xff,0xff,0x24,0x44,0x00,0x01, ++0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40,0x00,0x83,0x10,0x0a,0x00,0x02,0x11,0x83, ++0x00,0x02,0x11,0x80,0x00,0x82,0x20,0x23,0xad,0x04,0x01,0xa8,0xa3,0x85,0x81,0xf0, ++0x79,0x02,0x0d,0x7c,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x26,0x08,0x00,0x29,0x9c, ++0x00,0x02,0x20,0x2b,0x3c,0x04,0xb0,0x03,0x3c,0x06,0xb0,0x07,0x3c,0x02,0x80,0x01, ++0x34,0xc6,0x00,0x18,0x34,0x84,0x00,0x20,0x24,0x42,0xa7,0x54,0x24,0x03,0xff,0x83, ++0xac,0x82,0x00,0x00,0xa0,0xc3,0x00,0x00,0x90,0xc4,0x00,0x00,0x27,0xbd,0xff,0xf8, ++0x3c,0x03,0xb0,0x07,0x24,0x02,0xff,0x82,0xa3,0xa4,0x00,0x00,0xa0,0x62,0x00,0x00, ++0x90,0x64,0x00,0x00,0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x08,0xa3,0xa4,0x00,0x01, ++0xa0,0x40,0x00,0x00,0x90,0x43,0x00,0x00,0x24,0x02,0x00,0x03,0x3c,0x05,0xb0,0x07, ++0xa3,0xa3,0x00,0x00,0xa0,0xc2,0x00,0x00,0x90,0xc4,0x00,0x00,0x34,0xa5,0x00,0x10, ++0x24,0x02,0x00,0x06,0x3c,0x03,0xb0,0x07,0xa3,0xa4,0x00,0x00,0x34,0x63,0x00,0x38, ++0xa0,0xa2,0x00,0x00,0x90,0x64,0x00,0x00,0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x20, ++0xa3,0xa4,0x00,0x00,0xa0,0xa0,0x00,0x00,0x90,0xa3,0x00,0x00,0xaf,0x82,0xbf,0x30, ++0xa3,0xa3,0x00,0x00,0xa0,0x40,0x00,0x00,0x90,0x43,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x08,}; ++ ++static u8 rtl8192e_fwdata_array[] = { ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x08,0x00, ++0x02,0xe9,0x01,0x74,0x02,0xab,0x01,0xc7,0x01,0x55,0x00,0xe4,0x00,0xab,0x00,0x72, ++0x00,0x55,0x00,0x4c,0x00,0x4c,0x00,0x4c,0x00,0x4c,0x00,0x4c,0x02,0x76,0x01,0x3b, ++0x00,0xd2,0x00,0x9e,0x00,0x69,0x00,0x4f,0x00,0x46,0x00,0x3f,0x01,0x3b,0x00,0x9e, ++0x00,0x69,0x00,0x4f,0x00,0x35,0x00,0x27,0x00,0x23,0x00,0x20,0x01,0x2f,0x00,0x98, ++0x00,0x65,0x00,0x4c,0x00,0x33,0x00,0x26,0x00,0x22,0x00,0x1e,0x00,0x98,0x00,0x4c, ++0x00,0x33,0x00,0x26,0x00,0x19,0x00,0x13,0x00,0x11,0x00,0x0f,0x02,0x39,0x01,0x1c, ++0x00,0xbd,0x00,0x8e,0x00,0x5f,0x00,0x47,0x00,0x3f,0x00,0x39,0x01,0x1c,0x00,0x8e, ++0x00,0x5f,0x00,0x47,0x00,0x2f,0x00,0x23,0x00,0x20,0x00,0x1c,0x01,0x11,0x00,0x89, ++0x00,0x5b,0x00,0x44,0x00,0x2e,0x00,0x22,0x00,0x1e,0x00,0x1b,0x00,0x89,0x00,0x44, ++0x00,0x2e,0x00,0x22,0x00,0x17,0x00,0x11,0x00,0x0f,0x00,0x0e,0x02,0xab,0x02,0xab, ++0x02,0x66,0x02,0x66,0x07,0x06,0x06,0x06,0x05,0x06,0x07,0x08,0x04,0x06,0x07,0x08, ++0x09,0x0a,0x0b,0x0b,0x49,0x6e,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x4c, ++0x42,0x4d,0x4f,0x44,0x00,0x00,0x00,0x00,0x54,0x4c,0x42,0x4c,0x5f,0x64,0x61,0x74, ++0x61,0x00,0x54,0x4c,0x42,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x64,0x45,0x4c, ++0x5f,0x64,0x61,0x74,0x61,0x00,0x41,0x64,0x45,0x53,0x00,0x00,0x00,0x00,0x00,0x00, ++0x45,0x78,0x63,0x43,0x6f,0x64,0x65,0x36,0x00,0x00,0x45,0x78,0x63,0x43,0x6f,0x64, ++0x65,0x37,0x00,0x00,0x53,0x79,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x70, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x49,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x43,0x70,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0x76,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x0b,0x63, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x2c, ++0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x60, ++0x00,0x00,0x00,0x90,0x00,0x00,0x00,0xc0,0x00,0x00,0x01,0x20,0x00,0x00,0x01,0x80, ++0x00,0x00,0x01,0xb0,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x9c, ++0x00,0x00,0x00,0xd0,0x00,0x00,0x01,0x38,0x00,0x00,0x01,0xa0,0x00,0x00,0x01,0xd4, ++0x00,0x00,0x02,0x08,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0xd0,0x00,0x00,0x01,0x38, ++0x00,0x00,0x01,0xa0,0x00,0x00,0x02,0x6f,0x00,0x00,0x03,0x40,0x00,0x00,0x03,0xa8, ++0x00,0x00,0x04,0x10,0x01,0x01,0x01,0x02,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04, ++0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x07,0x6c,0x80,0x00,0x07,0x80, ++0x80,0x00,0x07,0x80,0x80,0x00,0x07,0x70,0x80,0x00,0x07,0x70,0x80,0x00,0x07,0x94, ++0x80,0x00,0x56,0xb0,0x80,0x00,0x57,0x08,0x80,0x00,0x57,0x30,0x80,0x00,0x58,0x28, ++0x80,0x00,0x58,0xe0,0x80,0x00,0x59,0x88,0x80,0x00,0x59,0xfc,0x80,0x00,0x5b,0x08, ++0x80,0x00,0x5b,0x40,0x80,0x00,0x5b,0x54,0x80,0x00,0x5b,0x68,0x80,0x00,0x5c,0x50, ++0x80,0x00,0x5c,0x90,0x80,0x00,0x5d,0x44,0x80,0x00,0x5d,0x6c,0x80,0x00,0x56,0x70, ++0x80,0x00,0x5d,0xbc,0x80,0x00,0x64,0x48,0x80,0x00,0x64,0xc0,0x80,0x00,0x64,0xcc, ++0x80,0x00,0x64,0xd8,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60, ++0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60, ++0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60,0x80,0x00,0x64,0x60, ++0x80,0x00,0x64,0x60,0x80,0x00,0x64,0xe4,0x80,0x00,0x64,0xf0,0x80,0x00,0x64,0xfc, ++0x80,0x00,0x87,0xa4,0x80,0x00,0x87,0xa4,0x80,0x00,0x87,0xa4,0x80,0x00,0x87,0xd8, ++0x80,0x00,0x88,0x18,0x80,0x00,0x88,0x50,0x80,0x00,0x88,0x80,0x80,0x00,0x88,0xb0, ++0x80,0x00,0x88,0xc4,0x80,0x00,0x89,0x2c,0x80,0x00,0x89,0x40,0x80,0x00,0x89,0x7c, ++0x80,0x00,0x89,0x84,0x80,0x00,0x89,0xc0,0x80,0x00,0x89,0xd4,0x80,0x00,0x89,0xdc, ++0x80,0x00,0x89,0xe4,0x80,0x00,0x89,0xe4,0x80,0x00,0x89,0xe4,0x80,0x00,0x89,0xe4, ++0x80,0x00,0x8a,0x14,0x80,0x00,0x8a,0x28,0x80,0x00,0x8a,0x3c,0x80,0x00,0x86,0xe8, ++0x80,0x00,0x8d,0x68,0x80,0x00,0x8d,0x68,0x80,0x00,0x8d,0x68,0x80,0x00,0x8d,0x9c, ++0x80,0x00,0x8d,0xdc,0x80,0x00,0x8e,0x14,0x80,0x00,0x8e,0x44,0x80,0x00,0x8e,0x74, ++0x80,0x00,0x8e,0x88,0x80,0x00,0x8e,0xf0,0x80,0x00,0x8f,0x04,0x80,0x00,0x8f,0x40, ++0x80,0x00,0x8f,0x48,0x80,0x00,0x8f,0x84,0x80,0x00,0x8f,0x98,0x80,0x00,0x8f,0xa0, ++0x80,0x00,0x8f,0xa8,0x80,0x00,0x8f,0xa8,0x80,0x00,0x8f,0xa8,0x80,0x00,0x8f,0xa8, ++0x80,0x00,0x8f,0xd8,0x80,0x00,0x8f,0xec,0x80,0x00,0x90,0x00,0x80,0x00,0x8b,0x88, ++}; ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_phy.c +@@ -0,0 +1,3352 @@ ++#include "r8192E.h" ++#include "r8192E_hw.h" ++#include "r819xE_phyreg.h" ++#include "r8190_rtl8256.h" ++#include "r819xE_phy.h" ++#include "r8192E_dm.h" ++#ifdef ENABLE_DOT11D ++#include "dot11d.h" ++#endif ++static u32 RF_CHANNEL_TABLE_ZEBRA[] = { ++ 0, ++ 0x085c, //2412 1 ++ 0x08dc, //2417 2 ++ 0x095c, //2422 3 ++ 0x09dc, //2427 4 ++ 0x0a5c, //2432 5 ++ 0x0adc, //2437 6 ++ 0x0b5c, //2442 7 ++ 0x0bdc, //2447 8 ++ 0x0c5c, //2452 9 ++ 0x0cdc, //2457 10 ++ 0x0d5c, //2462 11 ++ 0x0ddc, //2467 12 ++ 0x0e5c, //2472 13 ++ 0x0f72, //2484 ++}; ++#ifdef RTL8190P ++u32 Rtl8190PciMACPHY_Array[] = { ++0x03c,0xffff0000,0x00000f0f, ++0x340,0xffffffff,0x161a1a1a, ++0x344,0xffffffff,0x12121416, ++0x348,0x0000ffff,0x00001818, ++0x12c,0xffffffff,0x04000802, ++0x318,0x00000fff,0x00000800, ++}; ++u32 Rtl8190PciMACPHY_Array_PG[] = { ++0x03c,0xffff0000,0x00000f0f, ++0x340,0xffffffff,0x0a0c0d0f, ++0x344,0xffffffff,0x06070809, ++0x344,0xffffffff,0x06070809, ++0x348,0x0000ffff,0x00000000, ++0x12c,0xffffffff,0x04000802, ++0x318,0x00000fff,0x00000800, ++}; ++ ++u32 Rtl8190PciAGCTAB_Array[AGCTAB_ArrayLength] = { ++0xc78,0x7d000001, ++0xc78,0x7d010001, ++0xc78,0x7d020001, ++0xc78,0x7d030001, ++0xc78,0x7c040001, ++0xc78,0x7b050001, ++0xc78,0x7a060001, ++0xc78,0x79070001, ++0xc78,0x78080001, ++0xc78,0x77090001, ++0xc78,0x760a0001, ++0xc78,0x750b0001, ++0xc78,0x740c0001, ++0xc78,0x730d0001, ++0xc78,0x720e0001, ++0xc78,0x710f0001, ++0xc78,0x70100001, ++0xc78,0x6f110001, ++0xc78,0x6e120001, ++0xc78,0x6d130001, ++0xc78,0x6c140001, ++0xc78,0x6b150001, ++0xc78,0x6a160001, ++0xc78,0x69170001, ++0xc78,0x68180001, ++0xc78,0x67190001, ++0xc78,0x661a0001, ++0xc78,0x651b0001, ++0xc78,0x641c0001, ++0xc78,0x491d0001, ++0xc78,0x481e0001, ++0xc78,0x471f0001, ++0xc78,0x46200001, ++0xc78,0x45210001, ++0xc78,0x44220001, ++0xc78,0x43230001, ++0xc78,0x28240001, ++0xc78,0x27250001, ++0xc78,0x26260001, ++0xc78,0x25270001, ++0xc78,0x24280001, ++0xc78,0x23290001, ++0xc78,0x222a0001, ++0xc78,0x212b0001, ++0xc78,0x202c0001, ++0xc78,0x0a2d0001, ++0xc78,0x082e0001, ++0xc78,0x062f0001, ++0xc78,0x05300001, ++0xc78,0x04310001, ++0xc78,0x03320001, ++0xc78,0x02330001, ++0xc78,0x01340001, ++0xc78,0x00350001, ++0xc78,0x00360001, ++0xc78,0x00370001, ++0xc78,0x00380001, ++0xc78,0x00390001, ++0xc78,0x003a0001, ++0xc78,0x003b0001, ++0xc78,0x003c0001, ++0xc78,0x003d0001, ++0xc78,0x003e0001, ++0xc78,0x003f0001, ++0xc78,0x7d400001, ++0xc78,0x7d410001, ++0xc78,0x7d420001, ++0xc78,0x7d430001, ++0xc78,0x7c440001, ++0xc78,0x7b450001, ++0xc78,0x7a460001, ++0xc78,0x79470001, ++0xc78,0x78480001, ++0xc78,0x77490001, ++0xc78,0x764a0001, ++0xc78,0x754b0001, ++0xc78,0x744c0001, ++0xc78,0x734d0001, ++0xc78,0x724e0001, ++0xc78,0x714f0001, ++0xc78,0x70500001, ++0xc78,0x6f510001, ++0xc78,0x6e520001, ++0xc78,0x6d530001, ++0xc78,0x6c540001, ++0xc78,0x6b550001, ++0xc78,0x6a560001, ++0xc78,0x69570001, ++0xc78,0x68580001, ++0xc78,0x67590001, ++0xc78,0x665a0001, ++0xc78,0x655b0001, ++0xc78,0x645c0001, ++0xc78,0x495d0001, ++0xc78,0x485e0001, ++0xc78,0x475f0001, ++0xc78,0x46600001, ++0xc78,0x45610001, ++0xc78,0x44620001, ++0xc78,0x43630001, ++0xc78,0x28640001, ++0xc78,0x27650001, ++0xc78,0x26660001, ++0xc78,0x25670001, ++0xc78,0x24680001, ++0xc78,0x23690001, ++0xc78,0x226a0001, ++0xc78,0x216b0001, ++0xc78,0x206c0001, ++0xc78,0x0a6d0001, ++0xc78,0x086e0001, ++0xc78,0x066f0001, ++0xc78,0x05700001, ++0xc78,0x04710001, ++0xc78,0x03720001, ++0xc78,0x02730001, ++0xc78,0x01740001, ++0xc78,0x00750001, ++0xc78,0x00760001, ++0xc78,0x00770001, ++0xc78,0x00780001, ++0xc78,0x00790001, ++0xc78,0x007a0001, ++0xc78,0x007b0001, ++0xc78,0x007c0001, ++0xc78,0x007d0001, ++0xc78,0x007e0001, ++0xc78,0x007f0001, ++0xc78,0x3600001e, ++0xc78,0x3601001e, ++0xc78,0x3602001e, ++0xc78,0x3603001e, ++0xc78,0x3604001e, ++0xc78,0x3605001e, ++0xc78,0x3a06001e, ++0xc78,0x3c07001e, ++0xc78,0x3e08001e, ++0xc78,0x4209001e, ++0xc78,0x430a001e, ++0xc78,0x450b001e, ++0xc78,0x470c001e, ++0xc78,0x480d001e, ++0xc78,0x490e001e, ++0xc78,0x4b0f001e, ++0xc78,0x4c10001e, ++0xc78,0x4d11001e, ++0xc78,0x4d12001e, ++0xc78,0x4e13001e, ++0xc78,0x4f14001e, ++0xc78,0x5015001e, ++0xc78,0x5116001e, ++0xc78,0x5117001e, ++0xc78,0x5218001e, ++0xc78,0x5219001e, ++0xc78,0x531a001e, ++0xc78,0x541b001e, ++0xc78,0x541c001e, ++0xc78,0x551d001e, ++0xc78,0x561e001e, ++0xc78,0x561f001e, ++0xc78,0x5720001e, ++0xc78,0x5821001e, ++0xc78,0x5822001e, ++0xc78,0x5923001e, ++0xc78,0x5924001e, ++0xc78,0x5a25001e, ++0xc78,0x5b26001e, ++0xc78,0x5b27001e, ++0xc78,0x5c28001e, ++0xc78,0x5c29001e, ++0xc78,0x5d2a001e, ++0xc78,0x5d2b001e, ++0xc78,0x5e2c001e, ++0xc78,0x5e2d001e, ++0xc78,0x5f2e001e, ++0xc78,0x602f001e, ++0xc78,0x6030001e, ++0xc78,0x6131001e, ++0xc78,0x6132001e, ++0xc78,0x6233001e, ++0xc78,0x6234001e, ++0xc78,0x6335001e, ++0xc78,0x6336001e, ++0xc78,0x6437001e, ++0xc78,0x6538001e, ++0xc78,0x6639001e, ++0xc78,0x663a001e, ++0xc78,0x673b001e, ++0xc78,0x683c001e, ++0xc78,0x693d001e, ++0xc78,0x6a3e001e, ++0xc78,0x6b3f001e, ++}; ++ ++u32 Rtl8190PciPHY_REGArray[PHY_REGArrayLength] = { ++0x800,0x00050060, ++0x804,0x00000005, ++0x808,0x0000fc00, ++0x80c,0x0000001c, ++0x810,0x801010aa, ++0x814,0x000908c0, ++0x818,0x00000000, ++0x81c,0x00000000, ++0x820,0x00000004, ++0x824,0x00690000, ++0x828,0x00000004, ++0x82c,0x00e90000, ++0x830,0x00000004, ++0x834,0x00690000, ++0x838,0x00000004, ++0x83c,0x00e90000, ++0x840,0x00000000, ++0x844,0x00000000, ++0x848,0x00000000, ++0x84c,0x00000000, ++0x850,0x00000000, ++0x854,0x00000000, ++0x858,0x65a965a9, ++0x85c,0x65a965a9, ++0x860,0x001f0010, ++0x864,0x007f0010, ++0x868,0x001f0010, ++0x86c,0x007f0010, ++0x870,0x0f100f70, ++0x874,0x0f100f70, ++0x878,0x00000000, ++0x87c,0x00000000, ++0x880,0x5c385eb8, ++0x884,0x6357060d, ++0x888,0x0460c341, ++0x88c,0x0000ff00, ++0x890,0x00000000, ++0x894,0xfffffffe, ++0x898,0x4c42382f, ++0x89c,0x00656056, ++0x8b0,0x00000000, ++0x8e0,0x00000000, ++0x8e4,0x00000000, ++0x900,0x00000000, ++0x904,0x00000023, ++0x908,0x00000000, ++0x90c,0x35541545, ++0xa00,0x00d0c7d8, ++0xa04,0xab1f0008, ++0xa08,0x80cd8300, ++0xa0c,0x2e62740f, ++0xa10,0x95009b78, ++0xa14,0x11145008, ++0xa18,0x00881117, ++0xa1c,0x89140fa0, ++0xa20,0x1a1b0000, ++0xa24,0x090e1317, ++0xa28,0x00000204, ++0xa2c,0x00000000, ++0xc00,0x00000040, ++0xc04,0x0000500f, ++0xc08,0x000000e4, ++0xc0c,0x6c6c6c6c, ++0xc10,0x08000000, ++0xc14,0x40000100, ++0xc18,0x08000000, ++0xc1c,0x40000100, ++0xc20,0x08000000, ++0xc24,0x40000100, ++0xc28,0x08000000, ++0xc2c,0x40000100, ++0xc30,0x6de9ac44, ++0xc34,0x164052cd, ++0xc38,0x00070a14, ++0xc3c,0x0a969764, ++0xc40,0x1f7c403f, ++0xc44,0x000100b7, ++0xc48,0xec020000, ++0xc4c,0x00000300, ++0xc50,0x69543420, ++0xc54,0x433c0094, ++0xc58,0x69543420, ++0xc5c,0x433c0094, ++0xc60,0x69543420, ++0xc64,0x433c0094, ++0xc68,0x69543420, ++0xc6c,0x433c0094, ++0xc70,0x2c7f000d, ++0xc74,0x0186175b, ++0xc78,0x0000001f, ++0xc7c,0x00b91612, ++0xc80,0x40000100, ++0xc84,0x00000000, ++0xc88,0x40000100, ++0xc8c,0x08000000, ++0xc90,0x40000100, ++0xc94,0x00000000, ++0xc98,0x40000100, ++0xc9c,0x00000000, ++0xca0,0x00492492, ++0xca4,0x00000000, ++0xca8,0x00000000, ++0xcac,0x00000000, ++0xcb0,0x00000000, ++0xcb4,0x00000000, ++0xcb8,0x00000000, ++0xcbc,0x00492492, ++0xcc0,0x00000000, ++0xcc4,0x00000000, ++0xcc8,0x00000000, ++0xccc,0x00000000, ++0xcd0,0x00000000, ++0xcd4,0x00000000, ++0xcd8,0x64b22427, ++0xcdc,0x00766932, ++0xce0,0x00222222, ++0xd00,0x00000740, ++0xd04,0x0000040f, ++0xd08,0x0000803f, ++0xd0c,0x00000001, ++0xd10,0xa0633333, ++0xd14,0x33333c63, ++0xd18,0x6a8f5b6b, ++0xd1c,0x00000000, ++0xd20,0x00000000, ++0xd24,0x00000000, ++0xd28,0x00000000, ++0xd2c,0xcc979975, ++0xd30,0x00000000, ++0xd34,0x00000000, ++0xd38,0x00000000, ++0xd3c,0x00027293, ++0xd40,0x00000000, ++0xd44,0x00000000, ++0xd48,0x00000000, ++0xd4c,0x00000000, ++0xd50,0x6437140a, ++0xd54,0x024dbd02, ++0xd58,0x00000000, ++0xd5c,0x14032064, ++}; ++u32 Rtl8190PciPHY_REG_1T2RArray[PHY_REG_1T2RArrayLength] = { ++0x800,0x00050060, ++0x804,0x00000004, ++0x808,0x0000fc00, ++0x80c,0x0000001c, ++0x810,0x801010aa, ++0x814,0x000908c0, ++0x818,0x00000000, ++0x81c,0x00000000, ++0x820,0x00000004, ++0x824,0x00690000, ++0x828,0x00000004, ++0x82c,0x00e90000, ++0x830,0x00000004, ++0x834,0x00690000, ++0x838,0x00000004, ++0x83c,0x00e90000, ++0x840,0x00000000, ++0x844,0x00000000, ++0x848,0x00000000, ++0x84c,0x00000000, ++0x850,0x00000000, ++0x854,0x00000000, ++0x858,0x65a965a9, ++0x85c,0x65a965a9, ++0x860,0x001f0000, ++0x864,0x007f0000, ++0x868,0x001f0010, ++0x86c,0x007f0010, ++0x870,0x0f100f70, ++0x874,0x0f100f70, ++0x878,0x00000000, ++0x87c,0x00000000, ++0x880,0x5c385898, ++0x884,0x6357060d, ++0x888,0x0460c341, ++0x88c,0x0000fc00, ++0x890,0x00000000, ++0x894,0xfffffffe, ++0x898,0x4c42382f, ++0x89c,0x00656056, ++0x8b0,0x00000000, ++0x8e0,0x00000000, ++0x8e4,0x00000000, ++0x900,0x00000000, ++0x904,0x00000023, ++0x908,0x00000000, ++0x90c,0x34441444, ++0xa00,0x00d0c7d8, ++0xa04,0x2b1f0008, ++0xa08,0x80cd8300, ++0xa0c,0x2e62740f, ++0xa10,0x95009b78, ++0xa14,0x11145008, ++0xa18,0x00881117, ++0xa1c,0x89140fa0, ++0xa20,0x1a1b0000, ++0xa24,0x090e1317, ++0xa28,0x00000204, ++0xa2c,0x00000000, ++0xc00,0x00000040, ++0xc04,0x0000500c, ++0xc08,0x000000e4, ++0xc0c,0x6c6c6c6c, ++0xc10,0x08000000, ++0xc14,0x40000100, ++0xc18,0x08000000, ++0xc1c,0x40000100, ++0xc20,0x08000000, ++0xc24,0x40000100, ++0xc28,0x08000000, ++0xc2c,0x40000100, ++0xc30,0x6de9ac44, ++0xc34,0x164052cd, ++0xc38,0x00070a14, ++0xc3c,0x0a969764, ++0xc40,0x1f7c403f, ++0xc44,0x000100b7, ++0xc48,0xec020000, ++0xc4c,0x00000300, ++0xc50,0x69543420, ++0xc54,0x433c0094, ++0xc58,0x69543420, ++0xc5c,0x433c0094, ++0xc60,0x69543420, ++0xc64,0x433c0094, ++0xc68,0x69543420, ++0xc6c,0x433c0094, ++0xc70,0x2c7f000d, ++0xc74,0x0186175b, ++0xc78,0x0000001f, ++0xc7c,0x00b91612, ++0xc80,0x40000100, ++0xc84,0x00000000, ++0xc88,0x40000100, ++0xc8c,0x08000000, ++0xc90,0x40000100, ++0xc94,0x00000000, ++0xc98,0x40000100, ++0xc9c,0x00000000, ++0xca0,0x00492492, ++0xca4,0x00000000, ++0xca8,0x00000000, ++0xcac,0x00000000, ++0xcb0,0x00000000, ++0xcb4,0x00000000, ++0xcb8,0x00000000, ++0xcbc,0x00492492, ++0xcc0,0x00000000, ++0xcc4,0x00000000, ++0xcc8,0x00000000, ++0xccc,0x00000000, ++0xcd0,0x00000000, ++0xcd4,0x00000000, ++0xcd8,0x64b22427, ++0xcdc,0x00766932, ++0xce0,0x00222222, ++0xd00,0x00000740, ++0xd04,0x0000040c, ++0xd08,0x0000803f, ++0xd0c,0x00000001, ++0xd10,0xa0633333, ++0xd14,0x33333c63, ++0xd18,0x6a8f5b6b, ++0xd1c,0x00000000, ++0xd20,0x00000000, ++0xd24,0x00000000, ++0xd28,0x00000000, ++0xd2c,0xcc979975, ++0xd30,0x00000000, ++0xd34,0x00000000, ++0xd38,0x00000000, ++0xd3c,0x00027293, ++0xd40,0x00000000, ++0xd44,0x00000000, ++0xd48,0x00000000, ++0xd4c,0x00000000, ++0xd50,0x6437140a, ++0xd54,0x024dbd02, ++0xd58,0x00000000, ++0xd5c,0x14032064, ++}; ++ ++u32 Rtl8190PciRadioA_Array[RadioA_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x00000ee0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x009,0x000007f0, ++0x00a,0x000009d0, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x00f,0x00000990, ++0x012,0x00000806, ++0x014,0x000005ab, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000f80, ++0x01b,0x00000f5e, ++0x01c,0x00000008, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x01f,0x00000000, ++0x020,0x000001a5, ++0x01f,0x00000001, ++0x020,0x00000165, ++0x01f,0x00000002, ++0x020,0x000000c6, ++0x01f,0x00000003, ++0x020,0x00000086, ++0x01f,0x00000004, ++0x020,0x00000046, ++0x01f,0x00000005, ++0x020,0x000001e6, ++0x01f,0x00000006, ++0x020,0x000001a6, ++0x01f,0x00000007, ++0x020,0x00000166, ++0x01f,0x00000008, ++0x020,0x000000c7, ++0x01f,0x00000009, ++0x020,0x00000087, ++0x01f,0x0000000a, ++0x020,0x000000f7, ++0x01f,0x0000000b, ++0x020,0x000000d7, ++0x01f,0x0000000c, ++0x020,0x000000b7, ++0x01f,0x0000000d, ++0x020,0x00000097, ++0x01f,0x0000000e, ++0x020,0x00000077, ++0x01f,0x0000000f, ++0x020,0x00000057, ++0x01f,0x00000010, ++0x020,0x00000037, ++0x01f,0x00000011, ++0x020,0x000000fb, ++0x01f,0x00000012, ++0x020,0x000000db, ++0x01f,0x00000013, ++0x020,0x000000bb, ++0x01f,0x00000014, ++0x020,0x000000ff, ++0x01f,0x00000015, ++0x020,0x000000e3, ++0x01f,0x00000016, ++0x020,0x000000c3, ++0x01f,0x00000017, ++0x020,0x000000a3, ++0x01f,0x00000018, ++0x020,0x00000083, ++0x01f,0x00000019, ++0x020,0x00000063, ++0x01f,0x0000001a, ++0x020,0x00000043, ++0x01f,0x0000001b, ++0x020,0x00000023, ++0x01f,0x0000001c, ++0x020,0x00000003, ++0x01f,0x0000001d, ++0x020,0x000001e3, ++0x01f,0x0000001e, ++0x020,0x000001c3, ++0x01f,0x0000001f, ++0x020,0x000001a3, ++0x01f,0x00000020, ++0x020,0x00000183, ++0x01f,0x00000021, ++0x020,0x00000163, ++0x01f,0x00000022, ++0x020,0x00000143, ++0x01f,0x00000023, ++0x020,0x00000123, ++0x01f,0x00000024, ++0x020,0x00000103, ++0x023,0x00000203, ++0x024,0x00000200, ++0x00b,0x000001ba, ++0x02c,0x000003d7, ++0x02d,0x00000ff0, ++0x000,0x00000037, ++0x004,0x00000160, ++0x007,0x00000080, ++0x002,0x0000088d, ++0x0fe,0x00000000, ++0x0fe,0x00000000, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x000,0x000000bf, ++0x00d,0x0000001f, ++0x00d,0x00000c9f, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++u32 Rtl8190PciRadioB_Array[RadioB_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x000006e0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x000,0x000000b7, ++0x00a,0x00000850, ++0x000,0x000000bf, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000e00, ++0x01b,0x00000f5e, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x00b,0x000001ba, ++0x023,0x00000203, ++0x024,0x00000200, ++0x000,0x00000037, ++0x004,0x00000160, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x00d,0x00000ccc, ++0x000,0x000000bf, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++u32 Rtl8190PciRadioC_Array[RadioC_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x00000ee0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x009,0x000007f0, ++0x00a,0x000009d0, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x00f,0x00000990, ++0x012,0x00000806, ++0x014,0x000005ab, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000f80, ++0x01b,0x00000f5e, ++0x01c,0x00000008, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x01f,0x00000000, ++0x020,0x000001a5, ++0x01f,0x00000001, ++0x020,0x00000165, ++0x01f,0x00000002, ++0x020,0x000000c6, ++0x01f,0x00000003, ++0x020,0x00000086, ++0x01f,0x00000004, ++0x020,0x00000046, ++0x01f,0x00000005, ++0x020,0x000001e6, ++0x01f,0x00000006, ++0x020,0x000001a6, ++0x01f,0x00000007, ++0x020,0x00000166, ++0x01f,0x00000008, ++0x020,0x000000c7, ++0x01f,0x00000009, ++0x020,0x00000087, ++0x01f,0x0000000a, ++0x020,0x000000f7, ++0x01f,0x0000000b, ++0x020,0x000000d7, ++0x01f,0x0000000c, ++0x020,0x000000b7, ++0x01f,0x0000000d, ++0x020,0x00000097, ++0x01f,0x0000000e, ++0x020,0x00000077, ++0x01f,0x0000000f, ++0x020,0x00000057, ++0x01f,0x00000010, ++0x020,0x00000037, ++0x01f,0x00000011, ++0x020,0x000000fb, ++0x01f,0x00000012, ++0x020,0x000000db, ++0x01f,0x00000013, ++0x020,0x000000bb, ++0x01f,0x00000014, ++0x020,0x000000ff, ++0x01f,0x00000015, ++0x020,0x000000e3, ++0x01f,0x00000016, ++0x020,0x000000c3, ++0x01f,0x00000017, ++0x020,0x000000a3, ++0x01f,0x00000018, ++0x020,0x00000083, ++0x01f,0x00000019, ++0x020,0x00000063, ++0x01f,0x0000001a, ++0x020,0x00000043, ++0x01f,0x0000001b, ++0x020,0x00000023, ++0x01f,0x0000001c, ++0x020,0x00000003, ++0x01f,0x0000001d, ++0x020,0x000001e3, ++0x01f,0x0000001e, ++0x020,0x000001c3, ++0x01f,0x0000001f, ++0x020,0x000001a3, ++0x01f,0x00000020, ++0x020,0x00000183, ++0x01f,0x00000021, ++0x020,0x00000163, ++0x01f,0x00000022, ++0x020,0x00000143, ++0x01f,0x00000023, ++0x020,0x00000123, ++0x01f,0x00000024, ++0x020,0x00000103, ++0x023,0x00000203, ++0x024,0x00000200, ++0x00b,0x000001ba, ++0x02c,0x000003d7, ++0x02d,0x00000ff0, ++0x000,0x00000037, ++0x004,0x00000160, ++0x007,0x00000080, ++0x002,0x0000088d, ++0x0fe,0x00000000, ++0x0fe,0x00000000, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x000,0x000000bf, ++0x00d,0x0000001f, ++0x00d,0x00000c9f, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++u32 Rtl8190PciRadioD_Array[RadioD_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x000006e0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x000,0x000000b7, ++0x00a,0x00000850, ++0x000,0x000000bf, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000e00, ++0x01b,0x00000f5e, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x00b,0x000001ba, ++0x023,0x00000203, ++0x024,0x00000200, ++0x000,0x00000037, ++0x004,0x00000160, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x00d,0x00000ccc, ++0x000,0x000000bf, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++#endif ++#ifdef RTL8192E ++static u32 Rtl8192PciEMACPHY_Array[] = { ++0x03c,0xffff0000,0x00000f0f, ++0x340,0xffffffff,0x161a1a1a, ++0x344,0xffffffff,0x12121416, ++0x348,0x0000ffff,0x00001818, ++0x12c,0xffffffff,0x04000802, ++0x318,0x00000fff,0x00000100, ++}; ++static u32 Rtl8192PciEMACPHY_Array_PG[] = { ++0x03c,0xffff0000,0x00000f0f, ++0xe00,0xffffffff,0x06090909, ++0xe04,0xffffffff,0x00030306, ++0xe08,0x0000ff00,0x00000000, ++0xe10,0xffffffff,0x0a0c0d0f, ++0xe14,0xffffffff,0x06070809, ++0xe18,0xffffffff,0x0a0c0d0f, ++0xe1c,0xffffffff,0x06070809, ++0x12c,0xffffffff,0x04000802, ++0x318,0x00000fff,0x00000800, ++}; ++static u32 Rtl8192PciEAGCTAB_Array[AGCTAB_ArrayLength] = { ++0xc78,0x7d000001, ++0xc78,0x7d010001, ++0xc78,0x7d020001, ++0xc78,0x7d030001, ++0xc78,0x7d040001, ++0xc78,0x7d050001, ++0xc78,0x7c060001, ++0xc78,0x7b070001, ++0xc78,0x7a080001, ++0xc78,0x79090001, ++0xc78,0x780a0001, ++0xc78,0x770b0001, ++0xc78,0x760c0001, ++0xc78,0x750d0001, ++0xc78,0x740e0001, ++0xc78,0x730f0001, ++0xc78,0x72100001, ++0xc78,0x71110001, ++0xc78,0x70120001, ++0xc78,0x6f130001, ++0xc78,0x6e140001, ++0xc78,0x6d150001, ++0xc78,0x6c160001, ++0xc78,0x6b170001, ++0xc78,0x6a180001, ++0xc78,0x69190001, ++0xc78,0x681a0001, ++0xc78,0x671b0001, ++0xc78,0x661c0001, ++0xc78,0x651d0001, ++0xc78,0x641e0001, ++0xc78,0x491f0001, ++0xc78,0x48200001, ++0xc78,0x47210001, ++0xc78,0x46220001, ++0xc78,0x45230001, ++0xc78,0x44240001, ++0xc78,0x43250001, ++0xc78,0x28260001, ++0xc78,0x27270001, ++0xc78,0x26280001, ++0xc78,0x25290001, ++0xc78,0x242a0001, ++0xc78,0x232b0001, ++0xc78,0x222c0001, ++0xc78,0x212d0001, ++0xc78,0x202e0001, ++0xc78,0x0a2f0001, ++0xc78,0x08300001, ++0xc78,0x06310001, ++0xc78,0x05320001, ++0xc78,0x04330001, ++0xc78,0x03340001, ++0xc78,0x02350001, ++0xc78,0x01360001, ++0xc78,0x00370001, ++0xc78,0x00380001, ++0xc78,0x00390001, ++0xc78,0x003a0001, ++0xc78,0x003b0001, ++0xc78,0x003c0001, ++0xc78,0x003d0001, ++0xc78,0x003e0001, ++0xc78,0x003f0001, ++0xc78,0x7d400001, ++0xc78,0x7d410001, ++0xc78,0x7d420001, ++0xc78,0x7d430001, ++0xc78,0x7d440001, ++0xc78,0x7d450001, ++0xc78,0x7c460001, ++0xc78,0x7b470001, ++0xc78,0x7a480001, ++0xc78,0x79490001, ++0xc78,0x784a0001, ++0xc78,0x774b0001, ++0xc78,0x764c0001, ++0xc78,0x754d0001, ++0xc78,0x744e0001, ++0xc78,0x734f0001, ++0xc78,0x72500001, ++0xc78,0x71510001, ++0xc78,0x70520001, ++0xc78,0x6f530001, ++0xc78,0x6e540001, ++0xc78,0x6d550001, ++0xc78,0x6c560001, ++0xc78,0x6b570001, ++0xc78,0x6a580001, ++0xc78,0x69590001, ++0xc78,0x685a0001, ++0xc78,0x675b0001, ++0xc78,0x665c0001, ++0xc78,0x655d0001, ++0xc78,0x645e0001, ++0xc78,0x495f0001, ++0xc78,0x48600001, ++0xc78,0x47610001, ++0xc78,0x46620001, ++0xc78,0x45630001, ++0xc78,0x44640001, ++0xc78,0x43650001, ++0xc78,0x28660001, ++0xc78,0x27670001, ++0xc78,0x26680001, ++0xc78,0x25690001, ++0xc78,0x246a0001, ++0xc78,0x236b0001, ++0xc78,0x226c0001, ++0xc78,0x216d0001, ++0xc78,0x206e0001, ++0xc78,0x0a6f0001, ++0xc78,0x08700001, ++0xc78,0x06710001, ++0xc78,0x05720001, ++0xc78,0x04730001, ++0xc78,0x03740001, ++0xc78,0x02750001, ++0xc78,0x01760001, ++0xc78,0x00770001, ++0xc78,0x00780001, ++0xc78,0x00790001, ++0xc78,0x007a0001, ++0xc78,0x007b0001, ++0xc78,0x007c0001, ++0xc78,0x007d0001, ++0xc78,0x007e0001, ++0xc78,0x007f0001, ++0xc78,0x2e00001e, ++0xc78,0x2e01001e, ++0xc78,0x2e02001e, ++0xc78,0x2e03001e, ++0xc78,0x2e04001e, ++0xc78,0x2e05001e, ++0xc78,0x3006001e, ++0xc78,0x3407001e, ++0xc78,0x3908001e, ++0xc78,0x3c09001e, ++0xc78,0x3f0a001e, ++0xc78,0x420b001e, ++0xc78,0x440c001e, ++0xc78,0x450d001e, ++0xc78,0x460e001e, ++0xc78,0x460f001e, ++0xc78,0x4710001e, ++0xc78,0x4811001e, ++0xc78,0x4912001e, ++0xc78,0x4a13001e, ++0xc78,0x4b14001e, ++0xc78,0x4b15001e, ++0xc78,0x4c16001e, ++0xc78,0x4d17001e, ++0xc78,0x4e18001e, ++0xc78,0x4f19001e, ++0xc78,0x4f1a001e, ++0xc78,0x501b001e, ++0xc78,0x511c001e, ++0xc78,0x521d001e, ++0xc78,0x521e001e, ++0xc78,0x531f001e, ++0xc78,0x5320001e, ++0xc78,0x5421001e, ++0xc78,0x5522001e, ++0xc78,0x5523001e, ++0xc78,0x5624001e, ++0xc78,0x5725001e, ++0xc78,0x5726001e, ++0xc78,0x5827001e, ++0xc78,0x5828001e, ++0xc78,0x5929001e, ++0xc78,0x592a001e, ++0xc78,0x5a2b001e, ++0xc78,0x5b2c001e, ++0xc78,0x5c2d001e, ++0xc78,0x5c2e001e, ++0xc78,0x5d2f001e, ++0xc78,0x5e30001e, ++0xc78,0x5f31001e, ++0xc78,0x6032001e, ++0xc78,0x6033001e, ++0xc78,0x6134001e, ++0xc78,0x6235001e, ++0xc78,0x6336001e, ++0xc78,0x6437001e, ++0xc78,0x6438001e, ++0xc78,0x6539001e, ++0xc78,0x663a001e, ++0xc78,0x673b001e, ++0xc78,0x673c001e, ++0xc78,0x683d001e, ++0xc78,0x693e001e, ++0xc78,0x6a3f001e, ++}; ++static u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLength] = { ++0x0, }; ++static u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLength] = { ++0x800,0x00000000, ++0x804,0x00000001, ++0x808,0x0000fc00, ++0x80c,0x0000001c, ++0x810,0x801010aa, ++0x814,0x008514d0, ++0x818,0x00000040, ++0x81c,0x00000000, ++0x820,0x00000004, ++0x824,0x00690000, ++0x828,0x00000004, ++0x82c,0x00e90000, ++0x830,0x00000004, ++0x834,0x00690000, ++0x838,0x00000004, ++0x83c,0x00e90000, ++0x840,0x00000000, ++0x844,0x00000000, ++0x848,0x00000000, ++0x84c,0x00000000, ++0x850,0x00000000, ++0x854,0x00000000, ++0x858,0x65a965a9, ++0x85c,0x65a965a9, ++0x860,0x001f0010, ++0x864,0x007f0010, ++0x868,0x001f0010, ++0x86c,0x007f0010, ++0x870,0x0f100f70, ++0x874,0x0f100f70, ++0x878,0x00000000, ++0x87c,0x00000000, ++0x880,0x6870e36c, ++0x884,0xe3573600, ++0x888,0x4260c340, ++0x88c,0x0000ff00, ++0x890,0x00000000, ++0x894,0xfffffffe, ++0x898,0x4c42382f, ++0x89c,0x00656056, ++0x8b0,0x00000000, ++0x8e0,0x00000000, ++0x8e4,0x00000000, ++0x900,0x00000000, ++0x904,0x00000023, ++0x908,0x00000000, ++0x90c,0x31121311, ++0xa00,0x00d0c7d8, ++0xa04,0x811f0008, ++0xa08,0x80cd8300, ++0xa0c,0x2e62740f, ++0xa10,0x95009b78, ++0xa14,0x11145008, ++0xa18,0x00881117, ++0xa1c,0x89140fa0, ++0xa20,0x1a1b0000, ++0xa24,0x090e1317, ++0xa28,0x00000204, ++0xa2c,0x00000000, ++0xc00,0x00000040, ++0xc04,0x00005433, ++0xc08,0x000000e4, ++0xc0c,0x6c6c6c6c, ++0xc10,0x08800000, ++0xc14,0x40000100, ++0xc18,0x08000000, ++0xc1c,0x40000100, ++0xc20,0x08000000, ++0xc24,0x40000100, ++0xc28,0x08000000, ++0xc2c,0x40000100, ++0xc30,0x6de9ac44, ++0xc34,0x465c52cd, ++0xc38,0x497f5994, ++0xc3c,0x0a969764, ++0xc40,0x1f7c403f, ++0xc44,0x000100b7, ++0xc48,0xec020000, ++0xc4c,0x00000300, ++0xc50,0x69543420, ++0xc54,0x433c0094, ++0xc58,0x69543420, ++0xc5c,0x433c0094, ++0xc60,0x69543420, ++0xc64,0x433c0094, ++0xc68,0x69543420, ++0xc6c,0x433c0094, ++0xc70,0x2c7f000d, ++0xc74,0x0186175b, ++0xc78,0x0000001f, ++0xc7c,0x00b91612, ++0xc80,0x40000100, ++0xc84,0x20000000, ++0xc88,0x40000100, ++0xc8c,0x20200000, ++0xc90,0x40000100, ++0xc94,0x00000000, ++0xc98,0x40000100, ++0xc9c,0x00000000, ++0xca0,0x00492492, ++0xca4,0x00000000, ++0xca8,0x00000000, ++0xcac,0x00000000, ++0xcb0,0x00000000, ++0xcb4,0x00000000, ++0xcb8,0x00000000, ++0xcbc,0x00492492, ++0xcc0,0x00000000, ++0xcc4,0x00000000, ++0xcc8,0x00000000, ++0xccc,0x00000000, ++0xcd0,0x00000000, ++0xcd4,0x00000000, ++0xcd8,0x64b22427, ++0xcdc,0x00766932, ++0xce0,0x00222222, ++0xd00,0x00000750, ++0xd04,0x00000403, ++0xd08,0x0000907f, ++0xd0c,0x00000001, ++0xd10,0xa0633333, ++0xd14,0x33333c63, ++0xd18,0x6a8f5b6b, ++0xd1c,0x00000000, ++0xd20,0x00000000, ++0xd24,0x00000000, ++0xd28,0x00000000, ++0xd2c,0xcc979975, ++0xd30,0x00000000, ++0xd34,0x00000000, ++0xd38,0x00000000, ++0xd3c,0x00027293, ++0xd40,0x00000000, ++0xd44,0x00000000, ++0xd48,0x00000000, ++0xd4c,0x00000000, ++0xd50,0x6437140a, ++0xd54,0x024dbd02, ++0xd58,0x00000000, ++0xd5c,0x04032064, ++0xe00,0x161a1a1a, ++0xe04,0x12121416, ++0xe08,0x00001800, ++0xe0c,0x00000000, ++0xe10,0x161a1a1a, ++0xe14,0x12121416, ++0xe18,0x161a1a1a, ++0xe1c,0x12121416, ++}; ++static u32 Rtl8192PciERadioA_Array[RadioA_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x00000ee0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x009,0x000007f0, ++0x00a,0x000009d0, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x00f,0x00000990, ++0x012,0x00000806, ++0x014,0x000005ab, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000f80, ++0x01b,0x00000f5e, ++0x01c,0x00000008, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x01f,0x00000000, ++0x020,0x000001a5, ++0x01f,0x00000001, ++0x020,0x00000165, ++0x01f,0x00000002, ++0x020,0x000000c6, ++0x01f,0x00000003, ++0x020,0x00000086, ++0x01f,0x00000004, ++0x020,0x00000046, ++0x01f,0x00000005, ++0x020,0x000001e6, ++0x01f,0x00000006, ++0x020,0x000001a6, ++0x01f,0x00000007, ++0x020,0x00000166, ++0x01f,0x00000008, ++0x020,0x000000c7, ++0x01f,0x00000009, ++0x020,0x00000087, ++0x01f,0x0000000a, ++0x020,0x000000f7, ++0x01f,0x0000000b, ++0x020,0x000000d7, ++0x01f,0x0000000c, ++0x020,0x000000b7, ++0x01f,0x0000000d, ++0x020,0x00000097, ++0x01f,0x0000000e, ++0x020,0x00000077, ++0x01f,0x0000000f, ++0x020,0x00000057, ++0x01f,0x00000010, ++0x020,0x00000037, ++0x01f,0x00000011, ++0x020,0x000000fb, ++0x01f,0x00000012, ++0x020,0x000000db, ++0x01f,0x00000013, ++0x020,0x000000bb, ++0x01f,0x00000014, ++0x020,0x000000ff, ++0x01f,0x00000015, ++0x020,0x000000e3, ++0x01f,0x00000016, ++0x020,0x000000c3, ++0x01f,0x00000017, ++0x020,0x000000a3, ++0x01f,0x00000018, ++0x020,0x00000083, ++0x01f,0x00000019, ++0x020,0x00000063, ++0x01f,0x0000001a, ++0x020,0x00000043, ++0x01f,0x0000001b, ++0x020,0x00000023, ++0x01f,0x0000001c, ++0x020,0x00000003, ++0x01f,0x0000001d, ++0x020,0x000001e3, ++0x01f,0x0000001e, ++0x020,0x000001c3, ++0x01f,0x0000001f, ++0x020,0x000001a3, ++0x01f,0x00000020, ++0x020,0x00000183, ++0x01f,0x00000021, ++0x020,0x00000163, ++0x01f,0x00000022, ++0x020,0x00000143, ++0x01f,0x00000023, ++0x020,0x00000123, ++0x01f,0x00000024, ++0x020,0x00000103, ++0x023,0x00000203, ++0x024,0x00000100, ++0x00b,0x000001ba, ++0x02c,0x000003d7, ++0x02d,0x00000ff0, ++0x000,0x00000037, ++0x004,0x00000160, ++0x007,0x00000080, ++0x002,0x0000088d, ++0x0fe,0x00000000, ++0x0fe,0x00000000, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x000,0x000000bf, ++0x00d,0x0000001f, ++0x00d,0x00000c9f, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++static u32 Rtl8192PciERadioB_Array[RadioB_ArrayLength] = { ++0x019,0x00000003, ++0x000,0x000000bf, ++0x001,0x000006e0, ++0x002,0x0000004c, ++0x003,0x000007f1, ++0x004,0x00000975, ++0x005,0x00000c58, ++0x006,0x00000ae6, ++0x007,0x000000ca, ++0x008,0x00000e1c, ++0x000,0x000000b7, ++0x00a,0x00000850, ++0x000,0x000000bf, ++0x00b,0x000001ba, ++0x00c,0x00000240, ++0x00e,0x00000020, ++0x015,0x00000f80, ++0x016,0x00000020, ++0x017,0x00000597, ++0x018,0x0000050a, ++0x01a,0x00000e00, ++0x01b,0x00000f5e, ++0x01d,0x00000607, ++0x01e,0x000006cc, ++0x00b,0x000001ba, ++0x023,0x00000203, ++0x024,0x00000100, ++0x000,0x00000037, ++0x004,0x00000160, ++0x016,0x00000200, ++0x016,0x00000380, ++0x016,0x00000020, ++0x016,0x000001a0, ++0x00d,0x00000ccc, ++0x000,0x000000bf, ++0x002,0x0000004d, ++0x000,0x00000cbf, ++0x004,0x00000975, ++0x007,0x00000700, ++}; ++static u32 Rtl8192PciERadioC_Array[RadioC_ArrayLength] = { ++0x0, }; ++static u32 Rtl8192PciERadioD_Array[RadioD_ArrayLength] = { ++0x0, }; ++#endif ++ ++/*************************Define local function prototype**********************/ ++ ++static u32 phy_FwRFSerialRead(struct net_device* dev,RF90_RADIO_PATH_E eRFPath,u32 Offset); ++static void phy_FwRFSerialWrite(struct net_device* dev,RF90_RADIO_PATH_E eRFPath,u32 Offset,u32 Data); ++/*************************Define local function prototype**********************/ ++/****************************************************************************** ++ *function: This function read BB parameters from Header file we gen, ++ * and do register read/write ++ * input: u32 dwBitMask //taget bit pos in the addr to be modified ++ * output: none ++ * return: u32 return the shift bit bit position of the mask ++ * ****************************************************************************/ ++static u32 rtl8192_CalculateBitShift(u32 dwBitMask) ++{ ++ u32 i; ++ for (i=0; i<=31; i++) ++ { ++ if (((dwBitMask>>i)&0x1) == 1) ++ break; ++ } ++ return i; ++} ++/****************************************************************************** ++ *function: This function check different RF type to execute legal judgement. If RF Path is illegal, we will return false. ++ * input: none ++ * output: none ++ * return: 0(illegal, false), 1(legal,true) ++ * ***************************************************************************/ ++u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device* dev, u32 eRFPath) ++{ ++ u8 ret = 1; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef RTL8190P ++ if(priv->rf_type == RF_2T4R) ++ { ++ ret= 1; ++ } ++ else if (priv->rf_type == RF_1T2R) ++ { ++ if(eRFPath == RF90_PATH_A || eRFPath == RF90_PATH_B) ++ ret = 0; ++ else if(eRFPath == RF90_PATH_C || eRFPath == RF90_PATH_D) ++ ret = 1; ++ } ++#else ++ #ifdef RTL8192E ++ if (priv->rf_type == RF_2T4R) ++ ret = 0; ++ else if (priv->rf_type == RF_1T2R) ++ { ++ if (eRFPath == RF90_PATH_A || eRFPath == RF90_PATH_B) ++ ret = 1; ++ else if (eRFPath == RF90_PATH_C || eRFPath == RF90_PATH_D) ++ ret = 0; ++ } ++ #endif ++#endif ++ return ret; ++} ++/****************************************************************************** ++ *function: This function set specific bits to BB register ++ * input: net_device dev ++ * u32 dwRegAddr //target addr to be modified ++ * u32 dwBitMask //taget bit pos in the addr to be modified ++ * u32 dwData //value to be write ++ * output: none ++ * return: none ++ * notice: ++ * ****************************************************************************/ ++void rtl8192_setBBreg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask, u32 dwData) ++{ ++ ++ u32 OriginalValue, BitShift, NewValue; ++ ++ if(dwBitMask!= bMaskDWord) ++ {//if not "double word" write ++ OriginalValue = read_nic_dword(dev, dwRegAddr); ++ BitShift = rtl8192_CalculateBitShift(dwBitMask); ++ NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift)); ++ write_nic_dword(dev, dwRegAddr, NewValue); ++ }else ++ write_nic_dword(dev, dwRegAddr, dwData); ++ return; ++} ++/****************************************************************************** ++ *function: This function reads specific bits from BB register ++ * input: net_device dev ++ * u32 dwRegAddr //target addr to be readback ++ * u32 dwBitMask //taget bit pos in the addr to be readback ++ * output: none ++ * return: u32 Data //the readback register value ++ * notice: ++ * ****************************************************************************/ ++u32 rtl8192_QueryBBReg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask) ++{ ++ u32 Ret = 0, OriginalValue, BitShift; ++ ++ OriginalValue = read_nic_dword(dev, dwRegAddr); ++ BitShift = rtl8192_CalculateBitShift(dwBitMask); ++ Ret = (OriginalValue & dwBitMask) >> BitShift; ++ ++ return (Ret); ++} ++/****************************************************************************** ++ *function: This function read register from RF chip ++ * input: net_device dev ++ * RF90_RADIO_PATH_E eRFPath //radio path of A/B/C/D ++ * u32 Offset //target address to be read ++ * output: none ++ * return: u32 readback value ++ * notice: There are three types of serial operations:(1) Software serial write.(2)Hardware LSSI-Low Speed Serial Interface.(3)Hardware HSSI-High speed serial write. Driver here need to implement (1) and (2)---need more spec for this information. ++ * ****************************************************************************/ ++static u32 rtl8192_phy_RFSerialRead(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 Offset) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 ret = 0; ++ u32 NewOffset = 0; ++ BB_REGISTER_DEFINITION_T* pPhyReg = &priv->PHYRegDef[eRFPath]; ++ //rtl8192_setBBreg(dev, pPhyReg->rfLSSIReadBack, bLSSIReadBackData, 0); ++ //make sure RF register offset is correct ++ Offset &= 0x3f; ++ ++ //switch page for 8256 RF IC ++ if (priv->rf_chip == RF_8256) ++ { ++#ifdef RTL8190P ++ //analog to digital off, for protection ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++#else ++ #ifdef RTL8192E ++ //analog to digital off, for protection ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++ #endif ++#endif ++ if (Offset >= 31) ++ { ++ priv->RfReg0Value[eRFPath] |= 0x140; ++ //Switch to Reg_Mode2 for Reg 31-45 ++ rtl8192_setBBreg(dev, pPhyReg->rf3wireOffset, bMaskDWord, (priv->RfReg0Value[eRFPath]<<16) ); ++ //modify offset ++ NewOffset = Offset -30; ++ } ++ else if (Offset >= 16) ++ { ++ priv->RfReg0Value[eRFPath] |= 0x100; ++ priv->RfReg0Value[eRFPath] &= (~0x40); ++ //Switch to Reg_Mode 1 for Reg16-30 ++ rtl8192_setBBreg(dev, pPhyReg->rf3wireOffset, bMaskDWord, (priv->RfReg0Value[eRFPath]<<16) ); ++ ++ NewOffset = Offset - 15; ++ } ++ else ++ NewOffset = Offset; ++ } ++ else ++ { ++ RT_TRACE((COMP_PHY|COMP_ERR), "check RF type here, need to be 8256\n"); ++ NewOffset = Offset; ++ } ++ //put desired read addr to LSSI control Register ++ rtl8192_setBBreg(dev, pPhyReg->rfHSSIPara2, bLSSIReadAddress, NewOffset); ++ //Issue a posedge trigger ++ // ++ rtl8192_setBBreg(dev, pPhyReg->rfHSSIPara2, bLSSIReadEdge, 0x0); ++ rtl8192_setBBreg(dev, pPhyReg->rfHSSIPara2, bLSSIReadEdge, 0x1); ++ ++ ++ // TODO: we should not delay such a long time. Ask help from SD3 ++ msleep(1); ++ ++ ret = rtl8192_QueryBBReg(dev, pPhyReg->rfLSSIReadBack, bLSSIReadBackData); ++ ++ ++ // Switch back to Reg_Mode0; ++ if(priv->rf_chip == RF_8256) ++ { ++ priv->RfReg0Value[eRFPath] &= 0xebf; ++ ++ rtl8192_setBBreg( ++ dev, ++ pPhyReg->rf3wireOffset, ++ bMaskDWord, ++ (priv->RfReg0Value[eRFPath] << 16)); ++ ++#ifdef RTL8190P ++ if(priv->rf_type == RF_2T4R) ++ { ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0xf);// 0x88c[11:8] ++ } ++ else if(priv->rf_type == RF_1T2R) ++ { ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xc00, 0x3);// 0x88c[11:10] ++ } ++#else ++ #ifdef RTL8192E ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3);// 0x88c[9:8] ++ #endif ++#endif ++ } ++ ++ ++ return ret; ++ ++} ++ ++/****************************************************************************** ++ *function: This function write data to RF register ++ * input: net_device dev ++ * RF90_RADIO_PATH_E eRFPath //radio path of A/B/C/D ++ * u32 Offset //target address to be written ++ * u32 Data //The new register data to be written ++ * output: none ++ * return: none ++ * notice: For RF8256 only. ++ =========================================================== ++ *Reg Mode RegCTL[1] RegCTL[0] Note ++ * (Reg00[12]) (Reg00[10]) ++ *=========================================================== ++ *Reg_Mode0 0 x Reg 0 ~15(0x0 ~ 0xf) ++ *------------------------------------------------------------------ ++ *Reg_Mode1 1 0 Reg 16 ~30(0x1 ~ 0xf) ++ *------------------------------------------------------------------ ++ * Reg_Mode2 1 1 Reg 31 ~ 45(0x1 ~ 0xf) ++ *------------------------------------------------------------------ ++ * ****************************************************************************/ ++static void rtl8192_phy_RFSerialWrite(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 Offset, u32 Data) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 DataAndAddr = 0, NewOffset = 0; ++ BB_REGISTER_DEFINITION_T *pPhyReg = &priv->PHYRegDef[eRFPath]; ++ ++ Offset &= 0x3f; ++ if (priv->rf_chip == RF_8256) ++ { ++ ++#ifdef RTL8190P ++ //analog to digital off, for protection ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++#else ++ #ifdef RTL8192E ++ //analog to digital off, for protection ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0x0);// 0x88c[11:8] ++ #endif ++#endif ++ ++ if (Offset >= 31) ++ { ++ priv->RfReg0Value[eRFPath] |= 0x140; ++ rtl8192_setBBreg(dev, pPhyReg->rf3wireOffset, bMaskDWord, (priv->RfReg0Value[eRFPath] << 16)); ++ NewOffset = Offset - 30; ++ } ++ else if (Offset >= 16) ++ { ++ priv->RfReg0Value[eRFPath] |= 0x100; ++ priv->RfReg0Value[eRFPath] &= (~0x40); ++ rtl8192_setBBreg(dev, pPhyReg->rf3wireOffset, bMaskDWord, (priv->RfReg0Value[eRFPath]<<16)); ++ NewOffset = Offset - 15; ++ } ++ else ++ NewOffset = Offset; ++ } ++ else ++ { ++ RT_TRACE((COMP_PHY|COMP_ERR), "check RF type here, need to be 8256\n"); ++ NewOffset = Offset; ++ } ++ ++ // Put write addr in [5:0] and write data in [31:16] ++ DataAndAddr = (Data<<16) | (NewOffset&0x3f); ++ ++ // Write Operation ++ rtl8192_setBBreg(dev, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); ++ ++ ++ if(Offset==0x0) ++ priv->RfReg0Value[eRFPath] = Data; ++ ++ // Switch back to Reg_Mode0; ++ if(priv->rf_chip == RF_8256) ++ { ++ if(Offset != 0) ++ { ++ priv->RfReg0Value[eRFPath] &= 0xebf; ++ rtl8192_setBBreg( ++ dev, ++ pPhyReg->rf3wireOffset, ++ bMaskDWord, ++ (priv->RfReg0Value[eRFPath] << 16)); ++ } ++#ifdef RTL8190P ++ if(priv->rf_type == RF_2T4R) ++ { ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xf00, 0xf);// 0x88c[11:8] ++ } ++ else if(priv->rf_type == RF_1T2R) ++ { ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0xc00, 0x3);// 0x88c[11:10] ++ } ++#else ++ #ifdef RTL8192E ++ //analog to digital on ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3);// 0x88c[9:8] ++ #endif ++#endif ++ } ++ ++ return; ++} ++ ++/****************************************************************************** ++ *function: This function set specific bits to RF register ++ * input: net_device dev ++ * RF90_RADIO_PATH_E eRFPath //radio path of A/B/C/D ++ * u32 RegAddr //target addr to be modified ++ * u32 BitMask //taget bit pos in the addr to be modified ++ * u32 Data //value to be write ++ * output: none ++ * return: none ++ * notice: ++ * ****************************************************************************/ ++void rtl8192_phy_SetRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 Original_Value, BitShift, New_Value; ++// u8 time = 0; ++ ++ if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath)) ++ return; ++#ifdef RTL8192E ++ if(priv->ieee80211->eRFPowerState != eRfOn && !priv->being_init_adapter) ++ return; ++#endif ++ //spin_lock_irqsave(&priv->rf_lock, flags); ++ //down(&priv->rf_sem); ++ ++ RT_TRACE(COMP_PHY, "FW RF CTRL is not ready now\n"); ++ if (priv->Rf_Mode == RF_OP_By_FW) ++ { ++ if (BitMask != bMask12Bits) // RF data is 12 bits only ++ { ++ Original_Value = phy_FwRFSerialRead(dev, eRFPath, RegAddr); ++ BitShift = rtl8192_CalculateBitShift(BitMask); ++ New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift)); ++ ++ phy_FwRFSerialWrite(dev, eRFPath, RegAddr, New_Value); ++ }else ++ phy_FwRFSerialWrite(dev, eRFPath, RegAddr, Data); ++ udelay(200); ++ ++ } ++ else ++ { ++ if (BitMask != bMask12Bits) // RF data is 12 bits only ++ { ++ Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr); ++ BitShift = rtl8192_CalculateBitShift(BitMask); ++ New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift)); ++ ++ rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, New_Value); ++ }else ++ rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, Data); ++ } ++ //spin_unlock_irqrestore(&priv->rf_lock, flags); ++ //up(&priv->rf_sem); ++ return; ++} ++ ++/****************************************************************************** ++ *function: This function reads specific bits from RF register ++ * input: net_device dev ++ * u32 RegAddr //target addr to be readback ++ * u32 BitMask //taget bit pos in the addr to be readback ++ * output: none ++ * return: u32 Data //the readback register value ++ * notice: ++ * ****************************************************************************/ ++u32 rtl8192_phy_QueryRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask) ++{ ++ u32 Original_Value, Readback_Value, BitShift; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath)) ++ return 0; ++#ifdef RTL8192E ++ if(priv->ieee80211->eRFPowerState != eRfOn && !priv->being_init_adapter) ++ return 0; ++#endif ++ down(&priv->rf_sem); ++ if (priv->Rf_Mode == RF_OP_By_FW) ++ { ++ Original_Value = phy_FwRFSerialRead(dev, eRFPath, RegAddr); ++ udelay(200); ++ } ++ else ++ { ++ Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr); ++ ++ } ++ BitShift = rtl8192_CalculateBitShift(BitMask); ++ Readback_Value = (Original_Value & BitMask) >> BitShift; ++ up(&priv->rf_sem); ++// udelay(200); ++ return (Readback_Value); ++} ++ ++/****************************************************************************** ++ *function: We support firmware to execute RF-R/W. ++ * input: dev ++ * output: none ++ * return: none ++ * notice: ++ * ***************************************************************************/ ++static u32 phy_FwRFSerialRead( ++ struct net_device* dev, ++ RF90_RADIO_PATH_E eRFPath, ++ u32 Offset ) ++{ ++ u32 retValue = 0; ++ u32 Data = 0; ++ u8 time = 0; ++ //DbgPrint("FW RF CTRL\n\r"); ++ /* 2007/11/02 MH Firmware RF Write control. By Francis' suggestion, we can ++ not execute the scheme in the initial step. Otherwise, RF-R/W will waste ++ much time. This is only for site survey. */ ++ // 1. Read operation need not insert data. bit 0-11 ++ //Data &= bMask12Bits; ++ // 2. Write RF register address. Bit 12-19 ++ Data |= ((Offset&0xFF)<<12); ++ // 3. Write RF path. bit 20-21 ++ Data |= ((eRFPath&0x3)<<20); ++ // 4. Set RF read indicator. bit 22=0 ++ //Data |= 0x00000; ++ // 5. Trigger Fw to operate the command. bit 31 ++ Data |= 0x80000000; ++ // 6. We can not execute read operation if bit 31 is 1. ++ while (read_nic_dword(dev, QPNR)&0x80000000) ++ { ++ // If FW can not finish RF-R/W for more than ?? times. We must reset FW. ++ if (time++ < 100) ++ { ++ //DbgPrint("FW not finish RF-R Time=%d\n\r", time); ++ udelay(10); ++ } ++ else ++ break; ++ } ++ // 7. Execute read operation. ++ write_nic_dword(dev, QPNR, Data); ++ // 8. Check if firmawre send back RF content. ++ while (read_nic_dword(dev, QPNR)&0x80000000) ++ { ++ // If FW can not finish RF-R/W for more than ?? times. We must reset FW. ++ if (time++ < 100) ++ { ++ //DbgPrint("FW not finish RF-W Time=%d\n\r", time); ++ udelay(10); ++ } ++ else ++ return (0); ++ } ++ retValue = read_nic_dword(dev, RF_DATA); ++ ++ return (retValue); ++ ++} /* phy_FwRFSerialRead */ ++ ++/****************************************************************************** ++ *function: We support firmware to execute RF-R/W. ++ * input: dev ++ * output: none ++ * return: none ++ * notice: ++ * ***************************************************************************/ ++static void ++phy_FwRFSerialWrite( ++ struct net_device* dev, ++ RF90_RADIO_PATH_E eRFPath, ++ u32 Offset, ++ u32 Data ) ++{ ++ u8 time = 0; ++ ++ //DbgPrint("N FW RF CTRL RF-%d OF%02x DATA=%03x\n\r", eRFPath, Offset, Data); ++ /* 2007/11/02 MH Firmware RF Write control. By Francis' suggestion, we can ++ not execute the scheme in the initial step. Otherwise, RF-R/W will waste ++ much time. This is only for site survey. */ ++ ++ // 1. Set driver write bit and 12 bit data. bit 0-11 ++ //Data &= bMask12Bits; // Done by uper layer. ++ // 2. Write RF register address. bit 12-19 ++ Data |= ((Offset&0xFF)<<12); ++ // 3. Write RF path. bit 20-21 ++ Data |= ((eRFPath&0x3)<<20); ++ // 4. Set RF write indicator. bit 22=1 ++ Data |= 0x400000; ++ // 5. Trigger Fw to operate the command. bit 31=1 ++ Data |= 0x80000000; ++ ++ // 6. Write operation. We can not write if bit 31 is 1. ++ while (read_nic_dword(dev, QPNR)&0x80000000) ++ { ++ // If FW can not finish RF-R/W for more than ?? times. We must reset FW. ++ if (time++ < 100) ++ { ++ //DbgPrint("FW not finish RF-W Time=%d\n\r", time); ++ udelay(10); ++ } ++ else ++ break; ++ } ++ // 7. No matter check bit. We always force the write. Because FW will ++ // not accept the command. ++ write_nic_dword(dev, QPNR, Data); ++ /* 2007/11/02 MH Acoording to test, we must delay 20us to wait firmware ++ to finish RF write operation. */ ++ /* 2008/01/17 MH We support delay in firmware side now. */ ++ //delay_us(20); ++ ++} /* phy_FwRFSerialWrite */ ++ ++ ++/****************************************************************************** ++ *function: This function read BB parameters from Header file we gen, ++ * and do register read/write ++ * input: dev ++ * output: none ++ * return: none ++ * notice: BB parameters may change all the time, so please make ++ * sure it has been synced with the newest. ++ * ***************************************************************************/ ++void rtl8192_phy_configmac(struct net_device* dev) ++{ ++ u32 dwArrayLen = 0, i = 0; ++ u32* pdwArray = NULL; ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef TO_DO_LIST ++if(Adapter->bInHctTest) ++ { ++ RT_TRACE(COMP_PHY, "Rtl819XMACPHY_ArrayDTM\n"); ++ dwArrayLen = MACPHY_ArrayLengthDTM; ++ pdwArray = Rtl819XMACPHY_ArrayDTM; ++ } ++ else if(priv->bTXPowerDataReadFromEEPORM) ++#endif ++ if(priv->bTXPowerDataReadFromEEPORM) ++ { ++ RT_TRACE(COMP_PHY, "Rtl819XMACPHY_Array_PG\n"); ++ dwArrayLen = MACPHY_Array_PGLength; ++ pdwArray = Rtl819XMACPHY_Array_PG; ++ ++ } ++ else ++ { ++ RT_TRACE(COMP_PHY,"Read rtl819XMACPHY_Array\n"); ++ dwArrayLen = MACPHY_ArrayLength; ++ pdwArray = Rtl819XMACPHY_Array; ++ } ++ for(i = 0; ibInHctTest) ++ { ++ AGCTAB_ArrayLen = AGCTAB_ArrayLengthDTM; ++ Rtl819XAGCTAB_Array_Table = Rtl819XAGCTAB_ArrayDTM; ++ ++ if(priv->RF_Type == RF_2T4R) ++ { ++ PHY_REGArrayLen = PHY_REGArrayLengthDTM; ++ Rtl819XPHY_REGArray_Table = Rtl819XPHY_REGArrayDTM; ++ } ++ else if (priv->RF_Type == RF_1T2R) ++ { ++ PHY_REGArrayLen = PHY_REG_1T2RArrayLengthDTM; ++ Rtl819XPHY_REGArray_Table = Rtl819XPHY_REG_1T2RArrayDTM; ++ } ++ } ++ else ++#endif ++ { ++ AGCTAB_ArrayLen = AGCTAB_ArrayLength; ++ Rtl819XAGCTAB_Array_Table = Rtl819XAGCTAB_Array; ++ if(priv->rf_type == RF_2T4R) ++ { ++ PHY_REGArrayLen = PHY_REGArrayLength; ++ Rtl819XPHY_REGArray_Table = Rtl819XPHY_REGArray; ++ } ++ else if (priv->rf_type == RF_1T2R) ++ { ++ PHY_REGArrayLen = PHY_REG_1T2RArrayLength; ++ Rtl819XPHY_REGArray_Table = Rtl819XPHY_REG_1T2RArray; ++ } ++ } ++ ++ if (ConfigType == BaseBand_Config_PHY_REG) ++ { ++ for (i=0; iPHYRegDef[RF90_PATH_A].rfintfs = rFPGA0_XAB_RFInterfaceSW; // 16 LSBs if read 32-bit from 0x870 ++ priv->PHYRegDef[RF90_PATH_B].rfintfs = rFPGA0_XAB_RFInterfaceSW; // 16 MSBs if read 32-bit from 0x870 (16-bit for 0x872) ++ priv->PHYRegDef[RF90_PATH_C].rfintfs = rFPGA0_XCD_RFInterfaceSW;// 16 LSBs if read 32-bit from 0x874 ++ priv->PHYRegDef[RF90_PATH_D].rfintfs = rFPGA0_XCD_RFInterfaceSW;// 16 MSBs if read 32-bit from 0x874 (16-bit for 0x876) ++ ++ // RF Interface Readback Value ++ priv->PHYRegDef[RF90_PATH_A].rfintfi = rFPGA0_XAB_RFInterfaceRB; // 16 LSBs if read 32-bit from 0x8E0 ++ priv->PHYRegDef[RF90_PATH_B].rfintfi = rFPGA0_XAB_RFInterfaceRB;// 16 MSBs if read 32-bit from 0x8E0 (16-bit for 0x8E2) ++ priv->PHYRegDef[RF90_PATH_C].rfintfi = rFPGA0_XCD_RFInterfaceRB;// 16 LSBs if read 32-bit from 0x8E4 ++ priv->PHYRegDef[RF90_PATH_D].rfintfi = rFPGA0_XCD_RFInterfaceRB;// 16 MSBs if read 32-bit from 0x8E4 (16-bit for 0x8E6) ++ ++ // RF Interface Output (and Enable) ++ priv->PHYRegDef[RF90_PATH_A].rfintfo = rFPGA0_XA_RFInterfaceOE; // 16 LSBs if read 32-bit from 0x860 ++ priv->PHYRegDef[RF90_PATH_B].rfintfo = rFPGA0_XB_RFInterfaceOE; // 16 LSBs if read 32-bit from 0x864 ++ priv->PHYRegDef[RF90_PATH_C].rfintfo = rFPGA0_XC_RFInterfaceOE;// 16 LSBs if read 32-bit from 0x868 ++ priv->PHYRegDef[RF90_PATH_D].rfintfo = rFPGA0_XD_RFInterfaceOE;// 16 LSBs if read 32-bit from 0x86C ++ ++ // RF Interface (Output and) Enable ++ priv->PHYRegDef[RF90_PATH_A].rfintfe = rFPGA0_XA_RFInterfaceOE; // 16 MSBs if read 32-bit from 0x860 (16-bit for 0x862) ++ priv->PHYRegDef[RF90_PATH_B].rfintfe = rFPGA0_XB_RFInterfaceOE; // 16 MSBs if read 32-bit from 0x864 (16-bit for 0x866) ++ priv->PHYRegDef[RF90_PATH_C].rfintfe = rFPGA0_XC_RFInterfaceOE;// 16 MSBs if read 32-bit from 0x86A (16-bit for 0x86A) ++ priv->PHYRegDef[RF90_PATH_D].rfintfe = rFPGA0_XD_RFInterfaceOE;// 16 MSBs if read 32-bit from 0x86C (16-bit for 0x86E) ++ ++ //Addr of LSSI. Wirte RF register by driver ++ priv->PHYRegDef[RF90_PATH_A].rf3wireOffset = rFPGA0_XA_LSSIParameter; //LSSI Parameter ++ priv->PHYRegDef[RF90_PATH_B].rf3wireOffset = rFPGA0_XB_LSSIParameter; ++ priv->PHYRegDef[RF90_PATH_C].rf3wireOffset = rFPGA0_XC_LSSIParameter; ++ priv->PHYRegDef[RF90_PATH_D].rf3wireOffset = rFPGA0_XD_LSSIParameter; ++ ++ // RF parameter ++ priv->PHYRegDef[RF90_PATH_A].rfLSSI_Select = rFPGA0_XAB_RFParameter; //BB Band Select ++ priv->PHYRegDef[RF90_PATH_B].rfLSSI_Select = rFPGA0_XAB_RFParameter; ++ priv->PHYRegDef[RF90_PATH_C].rfLSSI_Select = rFPGA0_XCD_RFParameter; ++ priv->PHYRegDef[RF90_PATH_D].rfLSSI_Select = rFPGA0_XCD_RFParameter; ++ ++ // Tx AGC Gain Stage (same for all path. Should we remove this?) ++ priv->PHYRegDef[RF90_PATH_A].rfTxGainStage = rFPGA0_TxGainStage; //Tx gain stage ++ priv->PHYRegDef[RF90_PATH_B].rfTxGainStage = rFPGA0_TxGainStage; //Tx gain stage ++ priv->PHYRegDef[RF90_PATH_C].rfTxGainStage = rFPGA0_TxGainStage; //Tx gain stage ++ priv->PHYRegDef[RF90_PATH_D].rfTxGainStage = rFPGA0_TxGainStage; //Tx gain stage ++ ++ // Tranceiver A~D HSSI Parameter-1 ++ priv->PHYRegDef[RF90_PATH_A].rfHSSIPara1 = rFPGA0_XA_HSSIParameter1; //wire control parameter1 ++ priv->PHYRegDef[RF90_PATH_B].rfHSSIPara1 = rFPGA0_XB_HSSIParameter1; //wire control parameter1 ++ priv->PHYRegDef[RF90_PATH_C].rfHSSIPara1 = rFPGA0_XC_HSSIParameter1; //wire control parameter1 ++ priv->PHYRegDef[RF90_PATH_D].rfHSSIPara1 = rFPGA0_XD_HSSIParameter1; //wire control parameter1 ++ ++ // Tranceiver A~D HSSI Parameter-2 ++ priv->PHYRegDef[RF90_PATH_A].rfHSSIPara2 = rFPGA0_XA_HSSIParameter2; //wire control parameter2 ++ priv->PHYRegDef[RF90_PATH_B].rfHSSIPara2 = rFPGA0_XB_HSSIParameter2; //wire control parameter2 ++ priv->PHYRegDef[RF90_PATH_C].rfHSSIPara2 = rFPGA0_XC_HSSIParameter2; //wire control parameter2 ++ priv->PHYRegDef[RF90_PATH_D].rfHSSIPara2 = rFPGA0_XD_HSSIParameter2; //wire control parameter1 ++ ++ // RF switch Control ++ priv->PHYRegDef[RF90_PATH_A].rfSwitchControl = rFPGA0_XAB_SwitchControl; //TR/Ant switch control ++ priv->PHYRegDef[RF90_PATH_B].rfSwitchControl = rFPGA0_XAB_SwitchControl; ++ priv->PHYRegDef[RF90_PATH_C].rfSwitchControl = rFPGA0_XCD_SwitchControl; ++ priv->PHYRegDef[RF90_PATH_D].rfSwitchControl = rFPGA0_XCD_SwitchControl; ++ ++ // AGC control 1 ++ priv->PHYRegDef[RF90_PATH_A].rfAGCControl1 = rOFDM0_XAAGCCore1; ++ priv->PHYRegDef[RF90_PATH_B].rfAGCControl1 = rOFDM0_XBAGCCore1; ++ priv->PHYRegDef[RF90_PATH_C].rfAGCControl1 = rOFDM0_XCAGCCore1; ++ priv->PHYRegDef[RF90_PATH_D].rfAGCControl1 = rOFDM0_XDAGCCore1; ++ ++ // AGC control 2 ++ priv->PHYRegDef[RF90_PATH_A].rfAGCControl2 = rOFDM0_XAAGCCore2; ++ priv->PHYRegDef[RF90_PATH_B].rfAGCControl2 = rOFDM0_XBAGCCore2; ++ priv->PHYRegDef[RF90_PATH_C].rfAGCControl2 = rOFDM0_XCAGCCore2; ++ priv->PHYRegDef[RF90_PATH_D].rfAGCControl2 = rOFDM0_XDAGCCore2; ++ ++ // RX AFE control 1 ++ priv->PHYRegDef[RF90_PATH_A].rfRxIQImbalance = rOFDM0_XARxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_B].rfRxIQImbalance = rOFDM0_XBRxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_C].rfRxIQImbalance = rOFDM0_XCRxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_D].rfRxIQImbalance = rOFDM0_XDRxIQImbalance; ++ ++ // RX AFE control 1 ++ priv->PHYRegDef[RF90_PATH_A].rfRxAFE = rOFDM0_XARxAFE; ++ priv->PHYRegDef[RF90_PATH_B].rfRxAFE = rOFDM0_XBRxAFE; ++ priv->PHYRegDef[RF90_PATH_C].rfRxAFE = rOFDM0_XCRxAFE; ++ priv->PHYRegDef[RF90_PATH_D].rfRxAFE = rOFDM0_XDRxAFE; ++ ++ // Tx AFE control 1 ++ priv->PHYRegDef[RF90_PATH_A].rfTxIQImbalance = rOFDM0_XATxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_B].rfTxIQImbalance = rOFDM0_XBTxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_C].rfTxIQImbalance = rOFDM0_XCTxIQImbalance; ++ priv->PHYRegDef[RF90_PATH_D].rfTxIQImbalance = rOFDM0_XDTxIQImbalance; ++ ++ // Tx AFE control 2 ++ priv->PHYRegDef[RF90_PATH_A].rfTxAFE = rOFDM0_XATxAFE; ++ priv->PHYRegDef[RF90_PATH_B].rfTxAFE = rOFDM0_XBTxAFE; ++ priv->PHYRegDef[RF90_PATH_C].rfTxAFE = rOFDM0_XCTxAFE; ++ priv->PHYRegDef[RF90_PATH_D].rfTxAFE = rOFDM0_XDTxAFE; ++ ++ // Tranceiver LSSI Readback ++ priv->PHYRegDef[RF90_PATH_A].rfLSSIReadBack = rFPGA0_XA_LSSIReadBack; ++ priv->PHYRegDef[RF90_PATH_B].rfLSSIReadBack = rFPGA0_XB_LSSIReadBack; ++ priv->PHYRegDef[RF90_PATH_C].rfLSSIReadBack = rFPGA0_XC_LSSIReadBack; ++ priv->PHYRegDef[RF90_PATH_D].rfLSSIReadBack = rFPGA0_XD_LSSIReadBack; ++ ++} ++/****************************************************************************** ++ *function: This function is to write register and then readback to make sure whether BB and RF is OK ++ * input: net_device dev ++ * HW90_BLOCK_E CheckBlock ++ * RF90_RADIO_PATH_E eRFPath //only used when checkblock is HW90_BLOCK_RF ++ * output: none ++ * return: return whether BB and RF is ok(0:OK; 1:Fail) ++ * notice: This function may be removed in the ASIC ++ * ***************************************************************************/ ++RT_STATUS rtl8192_phy_checkBBAndRF(struct net_device* dev, HW90_BLOCK_E CheckBlock, RF90_RADIO_PATH_E eRFPath) ++{ ++ //struct r8192_priv *priv = ieee80211_priv(dev); ++// BB_REGISTER_DEFINITION_T *pPhyReg = &priv->PHYRegDef[eRFPath]; ++ RT_STATUS ret = RT_STATUS_SUCCESS; ++ u32 i, CheckTimes = 4, dwRegRead = 0; ++ u32 WriteAddr[4]; ++ u32 WriteData[] = {0xfffff027, 0xaa55a02f, 0x00000027, 0x55aa502f}; ++ // Initialize register address offset to be checked ++ WriteAddr[HW90_BLOCK_MAC] = 0x100; ++ WriteAddr[HW90_BLOCK_PHY0] = 0x900; ++ WriteAddr[HW90_BLOCK_PHY1] = 0x800; ++ WriteAddr[HW90_BLOCK_RF] = 0x3; ++ RT_TRACE(COMP_PHY, "=======>%s(), CheckBlock:%d\n", __FUNCTION__, CheckBlock); ++ for(i=0 ; i < CheckTimes ; i++) ++ { ++ ++ // ++ // Write Data to register and readback ++ // ++ switch(CheckBlock) ++ { ++ case HW90_BLOCK_MAC: ++ RT_TRACE(COMP_ERR, "PHY_CheckBBRFOK(): Never Write 0x100 here!"); ++ break; ++ ++ case HW90_BLOCK_PHY0: ++ case HW90_BLOCK_PHY1: ++ write_nic_dword(dev, WriteAddr[CheckBlock], WriteData[i]); ++ dwRegRead = read_nic_dword(dev, WriteAddr[CheckBlock]); ++ break; ++ ++ case HW90_BLOCK_RF: ++ WriteData[i] &= 0xfff; ++ rtl8192_phy_SetRFReg(dev, eRFPath, WriteAddr[HW90_BLOCK_RF], bMask12Bits, WriteData[i]); ++ // TODO: we should not delay for such a long time. Ask SD3 ++ mdelay(10); ++ dwRegRead = rtl8192_phy_QueryRFReg(dev, eRFPath, WriteAddr[HW90_BLOCK_RF], bMaskDWord); ++ mdelay(10); ++ break; ++ ++ default: ++ ret = RT_STATUS_FAILURE; ++ break; ++ } ++ ++ ++ // ++ // Check whether readback data is correct ++ // ++ if(dwRegRead != WriteData[i]) ++ { ++ RT_TRACE(COMP_ERR, "====>error=====dwRegRead: %x, WriteData: %x \n", dwRegRead, WriteData[i]); ++ ret = RT_STATUS_FAILURE; ++ break; ++ } ++ } ++ ++ return ret; ++} ++ ++ ++/****************************************************************************** ++ *function: This function initialize BB&RF ++ * input: net_device dev ++ * output: none ++ * return: none ++ * notice: Initialization value may change all the time, so please make ++ * sure it has been synced with the newest. ++ * ***************************************************************************/ ++static RT_STATUS rtl8192_BB_Config_ParaFile(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ u8 bRegValue = 0, eCheckItem = 0; ++ u32 dwRegValue = 0; ++ /************************************** ++ //<1>Initialize BaseBand ++ **************************************/ ++ ++ /*--set BB Global Reset--*/ ++ bRegValue = read_nic_byte(dev, BB_GLOBAL_RESET); ++ write_nic_byte(dev, BB_GLOBAL_RESET,(bRegValue|BB_GLOBAL_RESET_BIT)); ++ ++ /*---set BB reset Active---*/ ++ dwRegValue = read_nic_dword(dev, CPU_GEN); ++ write_nic_dword(dev, CPU_GEN, (dwRegValue&(~CPU_GEN_BB_RST))); ++ ++ /*----Ckeck FPGAPHY0 and PHY1 board is OK----*/ ++ // TODO: this function should be removed on ASIC , Emily 2007.2.2 ++ for(eCheckItem=(HW90_BLOCK_E)HW90_BLOCK_PHY0; eCheckItem<=HW90_BLOCK_PHY1; eCheckItem++) ++ { ++ rtStatus = rtl8192_phy_checkBBAndRF(dev, (HW90_BLOCK_E)eCheckItem, (RF90_RADIO_PATH_E)0); //don't care RF path ++ if(rtStatus != RT_STATUS_SUCCESS) ++ { ++ RT_TRACE((COMP_ERR | COMP_PHY), "PHY_RF8256_Config():Check PHY%d Fail!!\n", eCheckItem-1); ++ return rtStatus; ++ } ++ } ++ /*---- Set CCK and OFDM Block "OFF"----*/ ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); ++ /*----BB Register Initilazation----*/ ++ //==m==>Set PHY REG From Header<==m== ++ rtl8192_phyConfigBB(dev, BaseBand_Config_PHY_REG); ++ ++ /*----Set BB reset de-Active----*/ ++ dwRegValue = read_nic_dword(dev, CPU_GEN); ++ write_nic_dword(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST)); ++ ++ /*----BB AGC table Initialization----*/ ++ //==m==>Set PHY REG From Header<==m== ++ rtl8192_phyConfigBB(dev, BaseBand_Config_AGC_TAB); ++ ++ if (priv->card_8192_version > VERSION_8190_BD) ++ { ++ if(priv->rf_type == RF_2T4R) ++ { ++ // Antenna gain offset from B/C/D to A ++ dwRegValue = ( priv->AntennaTxPwDiff[2]<<8 | ++ priv->AntennaTxPwDiff[1]<<4 | ++ priv->AntennaTxPwDiff[0]); ++ } ++ else ++ dwRegValue = 0x0; //Antenna gain offset doesn't make sense in RF 1T2R. ++ rtl8192_setBBreg(dev, rFPGA0_TxGainStage, ++ (bXBTxAGC|bXCTxAGC|bXDTxAGC), dwRegValue); ++ ++ ++ //XSTALLCap ++#ifdef RTL8190P ++ dwRegValue = priv->CrystalCap & 0x3; // bit0~1 of crystal cap ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, bXtalCap01, dwRegValue); ++ dwRegValue = ((priv->CrystalCap & 0xc)>>2); // bit2~3 of crystal cap ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, bXtalCap23, dwRegValue); ++#else ++ #ifdef RTL8192E ++ dwRegValue = priv->CrystalCap; ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, bXtalCap92x, dwRegValue); ++ #endif ++#endif ++ ++ } ++ ++ // Check if the CCK HighPower is turned ON. ++ // This is used to calculate PWDB. ++// priv->bCckHighPower = (u8)(rtl8192_QueryBBReg(dev, rFPGA0_XA_HSSIParameter2, 0x200)); ++ return rtStatus; ++} ++/****************************************************************************** ++ *function: This function initialize BB&RF ++ * input: net_device dev ++ * output: none ++ * return: none ++ * notice: Initialization value may change all the time, so please make ++ * sure it has been synced with the newest. ++ * ***************************************************************************/ ++RT_STATUS rtl8192_BBConfig(struct net_device* dev) ++{ ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ rtl8192_InitBBRFRegDef(dev); ++ //config BB&RF. As hardCode based initialization has not been well ++ //implemented, so use file first.FIXME:should implement it for hardcode? ++ rtStatus = rtl8192_BB_Config_ParaFile(dev); ++ return rtStatus; ++} ++ ++/****************************************************************************** ++ *function: This function obtains the initialization value of Tx power Level offset ++ * input: net_device dev ++ * output: none ++ * return: none ++ * ***************************************************************************/ ++void rtl8192_phy_getTxPower(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#ifdef RTL8190P ++ priv->MCSTxPowerLevelOriginalOffset[0] = ++ read_nic_dword(dev, MCS_TXAGC); ++ priv->MCSTxPowerLevelOriginalOffset[1] = ++ read_nic_dword(dev, (MCS_TXAGC+4)); ++ priv->CCKTxPowerLevelOriginalOffset = ++ read_nic_dword(dev, CCK_TXAGC); ++#else ++ #ifdef RTL8192E ++ priv->MCSTxPowerLevelOriginalOffset[0] = ++ read_nic_dword(dev, rTxAGC_Rate18_06); ++ priv->MCSTxPowerLevelOriginalOffset[1] = ++ read_nic_dword(dev, rTxAGC_Rate54_24); ++ priv->MCSTxPowerLevelOriginalOffset[2] = ++ read_nic_dword(dev, rTxAGC_Mcs03_Mcs00); ++ priv->MCSTxPowerLevelOriginalOffset[3] = ++ read_nic_dword(dev, rTxAGC_Mcs07_Mcs04); ++ priv->MCSTxPowerLevelOriginalOffset[4] = ++ read_nic_dword(dev, rTxAGC_Mcs11_Mcs08); ++ priv->MCSTxPowerLevelOriginalOffset[5] = ++ read_nic_dword(dev, rTxAGC_Mcs15_Mcs12); ++ #endif ++#endif ++ ++ // read rx initial gain ++ priv->DefaultInitialGain[0] = read_nic_byte(dev, rOFDM0_XAAGCCore1); ++ priv->DefaultInitialGain[1] = read_nic_byte(dev, rOFDM0_XBAGCCore1); ++ priv->DefaultInitialGain[2] = read_nic_byte(dev, rOFDM0_XCAGCCore1); ++ priv->DefaultInitialGain[3] = read_nic_byte(dev, rOFDM0_XDAGCCore1); ++ RT_TRACE(COMP_INIT, "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x) \n", ++ priv->DefaultInitialGain[0], priv->DefaultInitialGain[1], ++ priv->DefaultInitialGain[2], priv->DefaultInitialGain[3]); ++ ++ // read framesync ++ priv->framesync = read_nic_byte(dev, rOFDM0_RxDetector3); ++ priv->framesyncC34 = read_nic_dword(dev, rOFDM0_RxDetector2); ++ RT_TRACE(COMP_INIT, "Default framesync (0x%x) = 0x%x \n", ++ rOFDM0_RxDetector3, priv->framesync); ++ // read SIFS (save the value read fome MACPHY_REG.txt) ++ priv->SifsTime = read_nic_word(dev, SIFS); ++ return; ++} ++ ++/****************************************************************************** ++ *function: This function obtains the initialization value of Tx power Level offset ++ * input: net_device dev ++ * output: none ++ * return: none ++ * ***************************************************************************/ ++void rtl8192_phy_setTxPower(struct net_device* dev, u8 channel) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 powerlevel = 0,powerlevelOFDM24G = 0; ++ char ant_pwr_diff; ++ u32 u4RegValue; ++ ++ if(priv->epromtype == EPROM_93c46) ++ { ++ powerlevel = priv->TxPowerLevelCCK[channel-1]; ++ powerlevelOFDM24G = priv->TxPowerLevelOFDM24G[channel-1]; ++ } ++ else if(priv->epromtype == EPROM_93c56) ++ { ++ if(priv->rf_type == RF_1T2R) ++ { ++ powerlevel = priv->TxPowerLevelCCK_C[channel-1]; ++ powerlevelOFDM24G = priv->TxPowerLevelOFDM24G_C[channel-1]; ++ } ++ else if(priv->rf_type == RF_2T4R) ++ { ++ // Mainly we use RF-A Tx Power to write the Tx Power registers, but the RF-C Tx ++ // Power must be calculated by the antenna diff. ++ // So we have to rewrite Antenna gain offset register here. ++ powerlevel = priv->TxPowerLevelCCK_A[channel-1]; ++ powerlevelOFDM24G = priv->TxPowerLevelOFDM24G_A[channel-1]; ++ ++ ant_pwr_diff = priv->TxPowerLevelOFDM24G_C[channel-1] ++ -priv->TxPowerLevelOFDM24G_A[channel-1]; ++ ant_pwr_diff &= 0xf; ++ //DbgPrint(" ant_pwr_diff = 0x%x", (u8)(ant_pwr_diff)); ++ priv->RF_C_TxPwDiff = ant_pwr_diff; ++ ++ priv->AntennaTxPwDiff[2] = 0;// RF-D, don't care ++ priv->AntennaTxPwDiff[1] = (u8)(ant_pwr_diff);// RF-C ++ priv->AntennaTxPwDiff[0] = 0;// RF-B, don't care ++ ++ // Antenna gain offset from B/C/D to A ++ u4RegValue = ( priv->AntennaTxPwDiff[2]<<8 | ++ priv->AntennaTxPwDiff[1]<<4 | ++ priv->AntennaTxPwDiff[0]); ++ ++ rtl8192_setBBreg(dev, rFPGA0_TxGainStage, ++ (bXBTxAGC|bXCTxAGC|bXDTxAGC), u4RegValue); ++ } ++ } ++#ifdef TODO ++ // ++ // CCX 2 S31, AP control of client transmit power: ++ // 1. We shall not exceed Cell Power Limit as possible as we can. ++ // 2. Tolerance is +/- 5dB. ++ // 3. 802.11h Power Contraint takes higher precedence over CCX Cell Power Limit. ++ // ++ // TODO: ++ // 1. 802.11h power contraint ++ // ++ // 071011, by rcnjko. ++ // ++ if( pMgntInfo->OpMode == RT_OP_MODE_INFRASTRUCTURE && ++ pMgntInfo->bWithCcxCellPwr && ++ channel == pMgntInfo->dot11CurrentChannelNumber) ++ { ++ u8 CckCellPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_B, pMgntInfo->CcxCellPwr); ++ u8 LegacyOfdmCellPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_G, pMgntInfo->CcxCellPwr); ++ u8 OfdmCellPwrIdx = DbmToTxPwrIdx(Adapter, WIRELESS_MODE_N_24G, pMgntInfo->CcxCellPwr); ++ ++ RT_TRACE(COMP_TXAGC, DBG_LOUD, ++ ("CCX Cell Limit: %d dbm => CCK Tx power index : %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n", ++ pMgntInfo->CcxCellPwr, CckCellPwrIdx, LegacyOfdmCellPwrIdx, OfdmCellPwrIdx)); ++ RT_TRACE(COMP_TXAGC, DBG_LOUD, ++ ("EEPROM channel(%d) => CCK Tx power index: %d, Legacy OFDM Tx power index : %d, OFDM Tx power index: %d\n", ++ channel, powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G)); ++ ++ // CCK ++ if(powerlevel > CckCellPwrIdx) ++ powerlevel = CckCellPwrIdx; ++ // Legacy OFDM, HT OFDM ++ if(powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff > OfdmCellPwrIdx) ++ { ++ if((OfdmCellPwrIdx - pHalData->LegacyHTTxPowerDiff) > 0) ++ { ++ powerlevelOFDM24G = OfdmCellPwrIdx - pHalData->LegacyHTTxPowerDiff; ++ } ++ else ++ { ++ LegacyOfdmCellPwrIdx = 0; ++ } ++ } ++ ++ RT_TRACE(COMP_TXAGC, DBG_LOUD, ++ ("Altered CCK Tx power index : %d, Legacy OFDM Tx power index: %d, OFDM Tx power index: %d\n", ++ powerlevel, powerlevelOFDM24G + pHalData->LegacyHTTxPowerDiff, powerlevelOFDM24G)); ++ } ++ ++ pHalData->CurrentCckTxPwrIdx = powerlevel; ++ pHalData->CurrentOfdm24GTxPwrIdx = powerlevelOFDM24G; ++#endif ++ switch(priv->rf_chip) ++ { ++ case RF_8225: ++ // PHY_SetRF8225CckTxPower(Adapter, powerlevel); ++ // PHY_SetRF8225OfdmTxPower(Adapter, powerlevelOFDM24G); ++ break; ++ case RF_8256: ++ PHY_SetRF8256CCKTxPower(dev, powerlevel); //need further implement ++ PHY_SetRF8256OFDMTxPower(dev, powerlevelOFDM24G); ++ break; ++ case RF_8258: ++ break; ++ default: ++ RT_TRACE(COMP_ERR, "unknown rf chip in funtion %s()\n", __FUNCTION__); ++ break; ++ } ++ return; ++} ++ ++/****************************************************************************** ++ *function: This function check Rf chip to do RF config ++ * input: net_device dev ++ * output: none ++ * return: only 8256 is supported ++ * ***************************************************************************/ ++RT_STATUS rtl8192_phy_RFConfig(struct net_device* dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_STATUS rtStatus = RT_STATUS_SUCCESS; ++ switch(priv->rf_chip) ++ { ++ case RF_8225: ++// rtStatus = PHY_RF8225_Config(Adapter); ++ break; ++ case RF_8256: ++ rtStatus = PHY_RF8256_Config(dev); ++ break; ++ ++ case RF_8258: ++ break; ++ case RF_PSEUDO_11N: ++ //rtStatus = PHY_RF8225_Config(Adapter); ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "error chip id\n"); ++ break; ++ } ++ return rtStatus; ++} ++ ++/****************************************************************************** ++ *function: This function update Initial gain ++ * input: net_device dev ++ * output: none ++ * return: As Windows has not implemented this, wait for complement ++ * ***************************************************************************/ ++void rtl8192_phy_updateInitGain(struct net_device* dev) ++{ ++ return; ++} ++ ++/****************************************************************************** ++ *function: This function read RF parameters from general head file, and do RF 3-wire ++ * input: net_device dev ++ * output: none ++ * return: return code show if RF configuration is successful(0:pass, 1:fail) ++ * Note: Delay may be required for RF configuration ++ * ***************************************************************************/ ++u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device* dev, RF90_RADIO_PATH_E eRFPath) ++{ ++ ++ int i; ++ //u32* pRFArray; ++ u8 ret = 0; ++ ++ switch(eRFPath){ ++ case RF90_PATH_A: ++ for(i = 0;iTxPowerLevelCCK[channel-1]; ++ u8 powerlevelOFDM24G = priv->TxPowerLevelOFDM24G[channel-1]; ++ ++ switch(priv->rf_chip) ++ { ++ case RF_8225: ++#ifdef TO_DO_LIST ++ PHY_SetRF8225CckTxPower(Adapter, powerlevel); ++ PHY_SetRF8225OfdmTxPower(Adapter, powerlevelOFDM24G); ++#endif ++ break; ++ ++ case RF_8256: ++ PHY_SetRF8256CCKTxPower(dev, powerlevel); ++ PHY_SetRF8256OFDMTxPower(dev, powerlevelOFDM24G); ++ break; ++ ++ case RF_8258: ++ break; ++ default: ++ RT_TRACE(COMP_ERR, "unknown rf chip ID in rtl8192_SetTxPowerLevel()\n"); ++ break; ++ } ++ return; ++} ++/**************************************************************************************** ++ *function: This function set command table variable(struct SwChnlCmd). ++ * input: SwChnlCmd* CmdTable //table to be set. ++ * u32 CmdTableIdx //variable index in table to be set ++ * u32 CmdTableSz //table size. ++ * SwChnlCmdID CmdID //command ID to set. ++ * u32 Para1 ++ * u32 Para2 ++ * u32 msDelay ++ * output: ++ * return: true if finished, false otherwise ++ * Note: ++ * ************************************************************************************/ ++static u8 rtl8192_phy_SetSwChnlCmdArray( ++ SwChnlCmd* CmdTable, ++ u32 CmdTableIdx, ++ u32 CmdTableSz, ++ SwChnlCmdID CmdID, ++ u32 Para1, ++ u32 Para2, ++ u32 msDelay ++ ) ++{ ++ SwChnlCmd* pCmd; ++ ++ if(CmdTable == NULL) ++ { ++ RT_TRACE(COMP_ERR, "phy_SetSwChnlCmdArray(): CmdTable cannot be NULL.\n"); ++ return false; ++ } ++ if(CmdTableIdx >= CmdTableSz) ++ { ++ RT_TRACE(COMP_ERR, "phy_SetSwChnlCmdArray(): Access invalid index, please check size of the table, CmdTableIdx:%d, CmdTableSz:%d\n", ++ CmdTableIdx, CmdTableSz); ++ return false; ++ } ++ ++ pCmd = CmdTable + CmdTableIdx; ++ pCmd->CmdID = CmdID; ++ pCmd->Para1 = Para1; ++ pCmd->Para2 = Para2; ++ pCmd->msDelay = msDelay; ++ ++ return true; ++} ++/****************************************************************************** ++ *function: This function set channel step by step ++ * input: struct net_device *dev ++ * u8 channel ++ * u8* stage //3 stages ++ * u8* step // ++ * u32* delay //whether need to delay ++ * output: store new stage, step and delay for next step(combine with function above) ++ * return: true if finished, false otherwise ++ * Note: Wait for simpler function to replace it //wb ++ * ***************************************************************************/ ++static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8* stage, u8* step, u32* delay) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++// PCHANNEL_ACCESS_SETTING pChnlAccessSetting; ++ SwChnlCmd PreCommonCmd[MAX_PRECMD_CNT]; ++ u32 PreCommonCmdCnt; ++ SwChnlCmd PostCommonCmd[MAX_POSTCMD_CNT]; ++ u32 PostCommonCmdCnt; ++ SwChnlCmd RfDependCmd[MAX_RFDEPENDCMD_CNT]; ++ u32 RfDependCmdCnt; ++ SwChnlCmd *CurrentCmd = NULL; ++ //RF90_RADIO_PATH_E eRFPath; ++ u8 eRFPath; ++// u32 RfRetVal; ++// u8 RetryCnt; ++ ++ RT_TRACE(COMP_TRACE, "====>%s()====stage:%d, step:%d, channel:%d\n", __FUNCTION__, *stage, *step, channel); ++// RT_ASSERT(IsLegalChannel(Adapter, channel), ("illegal channel: %d\n", channel)); ++ ++#ifdef ENABLE_DOT11D ++ if (!IsLegalChannel(priv->ieee80211, channel)) ++ { ++ RT_TRACE(COMP_ERR, "=============>set to illegal channel:%d\n", channel); ++ return true; //return true to tell upper caller function this channel setting is finished! Or it will in while loop. ++ } ++#endif ++ ++ //for(eRFPath = RF90_PATH_A; eRFPath NumTotalRFPath; eRFPath++) ++ //for(eRFPath = 0; eRFPath Fill up pre common command. ++ PreCommonCmdCnt = 0; ++ rtl8192_phy_SetSwChnlCmdArray(PreCommonCmd, PreCommonCmdCnt++, MAX_PRECMD_CNT, ++ CmdID_SetTxPowerLevel, 0, 0, 0); ++ rtl8192_phy_SetSwChnlCmdArray(PreCommonCmd, PreCommonCmdCnt++, MAX_PRECMD_CNT, ++ CmdID_End, 0, 0, 0); ++ ++ // <2> Fill up post common command. ++ PostCommonCmdCnt = 0; ++ ++ rtl8192_phy_SetSwChnlCmdArray(PostCommonCmd, PostCommonCmdCnt++, MAX_POSTCMD_CNT, ++ CmdID_End, 0, 0, 0); ++ ++ // <3> Fill up RF dependent command. ++ RfDependCmdCnt = 0; ++ switch( priv->rf_chip ) ++ { ++ case RF_8225: ++ if (!(channel >= 1 && channel <= 14)) ++ { ++ RT_TRACE(COMP_ERR, "illegal channel for Zebra 8225: %d\n", channel); ++ return false; ++ } ++ rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, ++ CmdID_RF_WriteReg, rZebra1_Channel, RF_CHANNEL_TABLE_ZEBRA[channel], 10); ++ rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, ++ CmdID_End, 0, 0, 0); ++ break; ++ ++ case RF_8256: ++ // TEST!! This is not the table for 8256!! ++ if (!(channel >= 1 && channel <= 14)) ++ { ++ RT_TRACE(COMP_ERR, "illegal channel for Zebra 8256: %d\n", channel); ++ return false; ++ } ++ rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, ++ CmdID_RF_WriteReg, rZebra1_Channel, channel, 10); ++ rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, ++ CmdID_End, 0, 0, 0); ++ break; ++ ++ case RF_8258: ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip); ++ return false; ++ break; ++ } ++ ++ ++ do{ ++ switch(*stage) ++ { ++ case 0: ++ CurrentCmd=&PreCommonCmd[*step]; ++ break; ++ case 1: ++ CurrentCmd=&RfDependCmd[*step]; ++ break; ++ case 2: ++ CurrentCmd=&PostCommonCmd[*step]; ++ break; ++ } ++ ++ if(CurrentCmd->CmdID==CmdID_End) ++ { ++ if((*stage)==2) ++ { ++ return true; ++ } ++ else ++ { ++ (*stage)++; ++ (*step)=0; ++ continue; ++ } ++ } ++ ++ switch(CurrentCmd->CmdID) ++ { ++ case CmdID_SetTxPowerLevel: ++ if(priv->card_8192_version > (u8)VERSION_8190_BD) //xiong: consider it later! ++ rtl8192_SetTxPowerLevel(dev,channel); ++ break; ++ case CmdID_WritePortUlong: ++ write_nic_dword(dev, CurrentCmd->Para1, CurrentCmd->Para2); ++ break; ++ case CmdID_WritePortUshort: ++ write_nic_word(dev, CurrentCmd->Para1, (u16)CurrentCmd->Para2); ++ break; ++ case CmdID_WritePortUchar: ++ write_nic_byte(dev, CurrentCmd->Para1, (u8)CurrentCmd->Para2); ++ break; ++ case CmdID_RF_WriteReg: ++ for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) ++ rtl8192_phy_SetRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, CurrentCmd->Para1, bMask12Bits, CurrentCmd->Para2<<7); ++ break; ++ default: ++ break; ++ } ++ ++ break; ++ }while(true); ++ }/*for(Number of RF paths)*/ ++ ++ (*delay)=CurrentCmd->msDelay; ++ (*step)++; ++ return false; ++} ++ ++/****************************************************************************** ++ *function: This function does acturally set channel work ++ * input: struct net_device *dev ++ * u8 channel ++ * output: none ++ * return: noin ++ * Note: We should not call this function directly ++ * ***************************************************************************/ ++static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 delay = 0; ++ ++ while(!rtl8192_phy_SwChnlStepByStep(dev,channel,&priv->SwChnlStage,&priv->SwChnlStep,&delay)) ++ { ++ if(delay>0) ++ msleep(delay);//or mdelay? need further consideration ++ if(!priv->up) ++ break; ++ } ++} ++/****************************************************************************** ++ *function: Callback routine of the work item for switch channel. ++ * input: ++ * ++ * output: none ++ * return: noin ++ * ***************************************************************************/ ++void rtl8192_SwChnl_WorkItem(struct net_device *dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ RT_TRACE(COMP_TRACE, "==> SwChnlCallback819xUsbWorkItem()\n"); ++ ++ RT_TRACE(COMP_TRACE, "=====>--%s(), set chan:%d, priv:%p\n", __FUNCTION__, priv->chan, priv); ++ ++ rtl8192_phy_FinishSwChnlNow(dev , priv->chan); ++ ++ RT_TRACE(COMP_TRACE, "<== SwChnlCallback819xUsbWorkItem()\n"); ++} ++ ++/****************************************************************************** ++ *function: This function scheduled actural workitem to set channel ++ * input: net_device dev ++ * u8 channel //channel to set ++ * output: none ++ * return: return code show if workitem is scheduled(1:pass, 0:fail) ++ * Note: Delay may be required for RF configuration ++ * ***************************************************************************/ ++u8 rtl8192_phy_SwChnl(struct net_device* dev, u8 channel) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ RT_TRACE(COMP_PHY, "=====>%s()\n", __FUNCTION__); ++ if(!priv->up) ++ return false; ++ if(priv->SwChnlInProgress) ++ return false; ++ ++// if(pHalData->SetBWModeInProgress) ++// return; ++ ++ //-------------------------------------------- ++ switch(priv->ieee80211->mode) ++ { ++ case WIRELESS_MODE_A: ++ case WIRELESS_MODE_N_5G: ++ if (channel<=14){ ++ RT_TRACE(COMP_ERR, "WIRELESS_MODE_A but channel<=14"); ++ return false; ++ } ++ break; ++ case WIRELESS_MODE_B: ++ if (channel>14){ ++ RT_TRACE(COMP_ERR, "WIRELESS_MODE_B but channel>14"); ++ return false; ++ } ++ break; ++ case WIRELESS_MODE_G: ++ case WIRELESS_MODE_N_24G: ++ if (channel>14){ ++ RT_TRACE(COMP_ERR, "WIRELESS_MODE_G but channel>14"); ++ return false; ++ } ++ break; ++ } ++ //-------------------------------------------- ++ ++ priv->SwChnlInProgress = true; ++ if(channel == 0) ++ channel = 1; ++ ++ priv->chan=channel; ++ ++ priv->SwChnlStage=0; ++ priv->SwChnlStep=0; ++// schedule_work(&(priv->SwChnlWorkItem)); ++// rtl8192_SwChnl_WorkItem(dev); ++ if(priv->up) { ++// queue_work(priv->priv_wq,&(priv->SwChnlWorkItem)); ++ rtl8192_SwChnl_WorkItem(dev); ++ } ++ priv->SwChnlInProgress = false; ++ return true; ++} ++ ++static void CCK_Tx_Power_Track_BW_Switch_TSSI(struct net_device *dev ) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ switch(priv->CurrentChannelBW) ++ { ++ /* 20 MHz channel*/ ++ case HT_CHANNEL_WIDTH_20: ++ //added by vivi, cck,tx power track, 20080703 ++ priv->CCKPresentAttentuation = ++ priv->CCKPresentAttentuation_20Mdefault + priv->CCKPresentAttentuation_difference; ++ ++ if(priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1)) ++ priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1; ++ if(priv->CCKPresentAttentuation < 0) ++ priv->CCKPresentAttentuation = 0; ++ ++ RT_TRACE(COMP_POWER_TRACKING, "20M, priv->CCKPresentAttentuation = %d\n", priv->CCKPresentAttentuation); ++ ++ if(priv->ieee80211->current_network.channel== 14 && !priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = TRUE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else if(priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = FALSE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ break; ++ ++ /* 40 MHz channel*/ ++ case HT_CHANNEL_WIDTH_20_40: ++ //added by vivi, cck,tx power track, 20080703 ++ priv->CCKPresentAttentuation = ++ priv->CCKPresentAttentuation_40Mdefault + priv->CCKPresentAttentuation_difference; ++ ++ RT_TRACE(COMP_POWER_TRACKING, "40M, priv->CCKPresentAttentuation = %d\n", priv->CCKPresentAttentuation); ++ if(priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1)) ++ priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1; ++ if(priv->CCKPresentAttentuation < 0) ++ priv->CCKPresentAttentuation = 0; ++ ++ if(priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = TRUE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else if(priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) ++ { ++ priv->bcck_in_ch14 = FALSE; ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ } ++ else ++ dm_cck_txpower_adjust(dev,priv->bcck_in_ch14); ++ break; ++ } ++} ++ ++#ifndef RTL8190P ++static void CCK_Tx_Power_Track_BW_Switch_ThermalMeter(struct net_device *dev) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ if(priv->ieee80211->current_network.channel == 14 && !priv->bcck_in_ch14) ++ priv->bcck_in_ch14 = TRUE; ++ else if(priv->ieee80211->current_network.channel != 14 && priv->bcck_in_ch14) ++ priv->bcck_in_ch14 = FALSE; ++ ++ //write to default index and tx power track will be done in dm. ++ switch(priv->CurrentChannelBW) ++ { ++ /* 20 MHz channel*/ ++ case HT_CHANNEL_WIDTH_20: ++ if(priv->Record_CCK_20Mindex == 0) ++ priv->Record_CCK_20Mindex = 6; //set default value. ++ priv->CCK_index = priv->Record_CCK_20Mindex;//6; ++ RT_TRACE(COMP_POWER_TRACKING, "20MHz, CCK_Tx_Power_Track_BW_Switch_ThermalMeter(),CCK_index = %d\n", priv->CCK_index); ++ break; ++ ++ /* 40 MHz channel*/ ++ case HT_CHANNEL_WIDTH_20_40: ++ priv->CCK_index = priv->Record_CCK_40Mindex;//0; ++ RT_TRACE(COMP_POWER_TRACKING, "40MHz, CCK_Tx_Power_Track_BW_Switch_ThermalMeter(), CCK_index = %d\n", priv->CCK_index); ++ break; ++ } ++ dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); ++} ++#endif ++ ++static void CCK_Tx_Power_Track_BW_Switch(struct net_device *dev) ++{ ++#ifdef RTL8192E ++ struct r8192_priv *priv = ieee80211_priv(dev); ++#endif ++ ++#ifdef RTL8190P ++ CCK_Tx_Power_Track_BW_Switch_TSSI(dev); ++#else ++ //if(pHalData->bDcut == TRUE) ++ if(priv->IC_Cut >= IC_VersionCut_D) ++ CCK_Tx_Power_Track_BW_Switch_TSSI(dev); ++ else ++ CCK_Tx_Power_Track_BW_Switch_ThermalMeter(dev); ++#endif ++} ++ ++ ++// ++/****************************************************************************** ++ *function: Callback routine of the work item for set bandwidth mode. ++ * input: struct net_device *dev ++ * HT_CHANNEL_WIDTH Bandwidth //20M or 40M ++ * HT_EXTCHNL_OFFSET Offset //Upper, Lower, or Don't care ++ * output: none ++ * return: none ++ * Note: I doubt whether SetBWModeInProgress flag is necessary as we can ++ * test whether current work in the queue or not.//do I? ++ * ***************************************************************************/ ++void rtl8192_SetBWModeWorkItem(struct net_device *dev) ++{ ++ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u8 regBwOpMode; ++ ++ RT_TRACE(COMP_SWBW, "==>rtl8192_SetBWModeWorkItem() Switch to %s bandwidth\n", \ ++ priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20?"20MHz":"40MHz") ++ ++ ++ if(priv->rf_chip== RF_PSEUDO_11N) ++ { ++ priv->SetBWModeInProgress= false; ++ return; ++ } ++ if(!priv->up) ++ { ++ priv->SetBWModeInProgress= false; ++ return; ++ } ++ //<1>Set MAC register ++ regBwOpMode = read_nic_byte(dev, BW_OPMODE); ++ ++ switch(priv->CurrentChannelBW) ++ { ++ case HT_CHANNEL_WIDTH_20: ++ regBwOpMode |= BW_OPMODE_20MHZ; ++ // 2007/02/07 Mark by Emily becasue we have not verify whether this register works ++ write_nic_byte(dev, BW_OPMODE, regBwOpMode); ++ break; ++ ++ case HT_CHANNEL_WIDTH_20_40: ++ regBwOpMode &= ~BW_OPMODE_20MHZ; ++ // 2007/02/07 Mark by Emily becasue we have not verify whether this register works ++ write_nic_byte(dev, BW_OPMODE, regBwOpMode); ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "SetChannelBandwidth819xUsb(): unknown Bandwidth: %#X\n",priv->CurrentChannelBW); ++ break; ++ } ++ ++ //<2>Set PHY related register ++ switch(priv->CurrentChannelBW) ++ { ++ case HT_CHANNEL_WIDTH_20: ++ // Add by Vivi 20071119 ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x0); ++ rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x0); ++// rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 1); ++ ++ // Correct the tx power for CCK rate in 20M. Suggest by YN, 20071207 ++// write_nic_dword(dev, rCCK0_TxFilter1, 0x1a1b0000); ++// write_nic_dword(dev, rCCK0_TxFilter2, 0x090e1317); ++// write_nic_dword(dev, rCCK0_DebugPort, 0x00000204); ++ if(!priv->btxpower_tracking) ++ { ++ write_nic_dword(dev, rCCK0_TxFilter1, 0x1a1b0000); ++ write_nic_dword(dev, rCCK0_TxFilter2, 0x090e1317); ++ write_nic_dword(dev, rCCK0_DebugPort, 0x00000204); ++ } ++ else ++ CCK_Tx_Power_Track_BW_Switch(dev); ++ ++#ifdef RTL8190P ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, bADClkPhase, 1); ++ rtl8192_setBBreg(dev, rOFDM0_RxDetector1, bMaskByte0, 0x44); // 0xc30 is for 8190 only, Emily ++#else ++ #ifdef RTL8192E ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 1); ++ #endif ++#endif ++ ++ break; ++ case HT_CHANNEL_WIDTH_20_40: ++ // Add by Vivi 20071119 ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1); ++ rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1); ++ //rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1)); ++ //rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0); ++ //rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC); ++ ++ // Correct the tx power for CCK rate in 40M. Suggest by YN, 20071207 ++ //write_nic_dword(dev, rCCK0_TxFilter1, 0x35360000); ++ //write_nic_dword(dev, rCCK0_TxFilter2, 0x121c252e); ++ //write_nic_dword(dev, rCCK0_DebugPort, 0x00000409); ++ if(!priv->btxpower_tracking) ++ { ++ write_nic_dword(dev, rCCK0_TxFilter1, 0x35360000); ++ write_nic_dword(dev, rCCK0_TxFilter2, 0x121c252e); ++ write_nic_dword(dev, rCCK0_DebugPort, 0x00000409); ++ } ++ else ++ CCK_Tx_Power_Track_BW_Switch(dev); ++ ++ // Set Control channel to upper or lower. These settings are required only for 40MHz ++ rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1)); ++ rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC); ++ ++ ++#ifdef RTL8190P ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, bADClkPhase, 0); ++ rtl8192_setBBreg(dev, rOFDM0_RxDetector1, bMaskByte0, 0x42); // 0xc30 is for 8190 only, Emily ++ ++ // Set whether CCK should be sent in upper or lower channel. Suggest by YN. 20071207 ++ // It is set in Tx descriptor for 8192x series ++ if(priv->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) ++ { ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, (BIT6|BIT5), 0x01); ++ }else if(priv->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) ++ { ++ rtl8192_setBBreg(dev, rFPGA0_RFMOD, (BIT6|BIT5), 0x02); ++ } ++ ++#else ++ #ifdef RTL8192E ++ rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0); ++ #endif ++#endif ++ break; ++ default: ++ RT_TRACE(COMP_ERR, "SetChannelBandwidth819xUsb(): unknown Bandwidth: %#X\n" ,priv->CurrentChannelBW); ++ break; ++ ++ } ++ //Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 ++ ++#if 1 ++ //<3>Set RF related register ++ switch( priv->rf_chip ) ++ { ++ case RF_8225: ++#ifdef TO_DO_LIST ++ PHY_SetRF8225Bandwidth(Adapter, pHalData->CurrentChannelBW); ++#endif ++ break; ++ ++ case RF_8256: ++ PHY_SetRF8256Bandwidth(dev, priv->CurrentChannelBW); ++ break; ++ ++ case RF_8258: ++ // PHY_SetRF8258Bandwidth(); ++ break; ++ ++ case RF_PSEUDO_11N: ++ // Do Nothing ++ break; ++ ++ default: ++ RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip); ++ break; ++ } ++#endif ++ atomic_dec(&(priv->ieee80211->atm_swbw)); ++ priv->SetBWModeInProgress= false; ++ ++ RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb()"); ++} ++ ++/****************************************************************************** ++ *function: This function schedules bandwith switch work. ++ * input: struct net_device *dev ++ * HT_CHANNEL_WIDTH Bandwidth //20M or 40M ++ * HT_EXTCHNL_OFFSET Offset //Upper, Lower, or Don't care ++ * output: none ++ * return: none ++ * Note: I doubt whether SetBWModeInProgress flag is necessary as we can ++ * test whether current work in the queue or not.//do I? ++ * ***************************************************************************/ ++void rtl8192_SetBWMode(struct net_device *dev, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset) ++{ ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ ++ ++ if(priv->SetBWModeInProgress) ++ return; ++ ++ atomic_inc(&(priv->ieee80211->atm_swbw)); ++ priv->SetBWModeInProgress= true; ++ ++ priv->CurrentChannelBW = Bandwidth; ++ ++ if(Offset==HT_EXTCHNL_OFFSET_LOWER) ++ priv->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_UPPER; ++ else if(Offset==HT_EXTCHNL_OFFSET_UPPER) ++ priv->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_LOWER; ++ else ++ priv->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_DONT_CARE; ++ ++ //queue_work(priv->priv_wq, &(priv->SetBWModeWorkItem)); ++ // schedule_work(&(priv->SetBWModeWorkItem)); ++ rtl8192_SetBWModeWorkItem(dev); ++ ++} ++ ++ ++void InitialGain819xPci(struct net_device *dev, u8 Operation) ++{ ++#define SCAN_RX_INITIAL_GAIN 0x17 ++#define POWER_DETECTION_TH 0x08 ++ struct r8192_priv *priv = ieee80211_priv(dev); ++ u32 BitMask; ++ u8 initial_gain; ++ ++ if(priv->up) ++ { ++ switch(Operation) ++ { ++ case IG_Backup: ++ RT_TRACE(COMP_SCAN, "IG_Backup, backup the initial gain.\n"); ++ initial_gain = SCAN_RX_INITIAL_GAIN;//pHalData->DefaultInitialGain[0];// ++ BitMask = bMaskByte0; ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM) ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // FW DIG OFF ++ priv->initgain_backup.xaagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XAAGCCore1, BitMask); ++ priv->initgain_backup.xbagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XBAGCCore1, BitMask); ++ priv->initgain_backup.xcagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XCAGCCore1, BitMask); ++ priv->initgain_backup.xdagccore1 = (u8)rtl8192_QueryBBReg(dev, rOFDM0_XDAGCCore1, BitMask); ++ BitMask = bMaskByte2; ++ priv->initgain_backup.cca = (u8)rtl8192_QueryBBReg(dev, rCCK0_CCA, BitMask); ++ ++ RT_TRACE(COMP_SCAN, "Scan InitialGainBackup 0xc50 is %x\n",priv->initgain_backup.xaagccore1); ++ RT_TRACE(COMP_SCAN, "Scan InitialGainBackup 0xc58 is %x\n",priv->initgain_backup.xbagccore1); ++ RT_TRACE(COMP_SCAN, "Scan InitialGainBackup 0xc60 is %x\n",priv->initgain_backup.xcagccore1); ++ RT_TRACE(COMP_SCAN, "Scan InitialGainBackup 0xc68 is %x\n",priv->initgain_backup.xdagccore1); ++ RT_TRACE(COMP_SCAN, "Scan InitialGainBackup 0xa0a is %x\n",priv->initgain_backup.cca); ++ ++ RT_TRACE(COMP_SCAN, "Write scan initial gain = 0x%x \n", initial_gain); ++ write_nic_byte(dev, rOFDM0_XAAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XBAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XCAGCCore1, initial_gain); ++ write_nic_byte(dev, rOFDM0_XDAGCCore1, initial_gain); ++ RT_TRACE(COMP_SCAN, "Write scan 0xa0a = 0x%x \n", POWER_DETECTION_TH); ++ write_nic_byte(dev, 0xa0a, POWER_DETECTION_TH); ++ break; ++ case IG_Restore: ++ RT_TRACE(COMP_SCAN, "IG_Restore, restore the initial gain.\n"); ++ BitMask = 0x7f; //Bit0~ Bit6 ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM) ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8); // FW DIG OFF ++ ++ rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, BitMask, (u32)priv->initgain_backup.xaagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, BitMask, (u32)priv->initgain_backup.xbagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, BitMask, (u32)priv->initgain_backup.xcagccore1); ++ rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, BitMask, (u32)priv->initgain_backup.xdagccore1); ++ BitMask = bMaskByte2; ++ rtl8192_setBBreg(dev, rCCK0_CCA, BitMask, (u32)priv->initgain_backup.cca); ++ ++ RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xc50 is %x\n",priv->initgain_backup.xaagccore1); ++ RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xc58 is %x\n",priv->initgain_backup.xbagccore1); ++ RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xc60 is %x\n",priv->initgain_backup.xcagccore1); ++ RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xc68 is %x\n",priv->initgain_backup.xdagccore1); ++ RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xa0a is %x\n",priv->initgain_backup.cca); ++ ++ rtl8192_phy_setTxPower(dev,priv->ieee80211->current_network.channel); ++ ++ ++ if(dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM) ++ rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x1); // FW DIG ON ++ break; ++ default: ++ RT_TRACE(COMP_SCAN, "Unknown IG Operation. \n"); ++ break; ++ } ++ } ++} ++ +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_phy.h +@@ -0,0 +1,125 @@ ++#ifndef _R819XU_PHY_H ++#define _R819XU_PHY_H ++/* Channel switch:The size of command tables for switch channel*/ ++#define MAX_PRECMD_CNT 16 ++#define MAX_RFDEPENDCMD_CNT 16 ++#define MAX_POSTCMD_CNT 16 ++ ++#ifdef RTL8190P ++#define MACPHY_Array_PGLength 21 ++#define Rtl819XMACPHY_Array_PG Rtl8190PciMACPHY_Array_PG ++#define Rtl819XMACPHY_Array Rtl8190PciMACPHY_Array ++#define RadioC_ArrayLength 246 ++#define RadioD_ArrayLength 78 ++#define Rtl819XRadioA_Array Rtl8190PciRadioA_Array ++#define Rtl819XRadioB_Array Rtl8190PciRadioB_Array ++#define Rtl819XRadioC_Array Rtl8190PciRadioC_Array ++#define Rtl819XRadioD_Array Rtl8190PciRadioD_Array ++#define Rtl819XAGCTAB_Array Rtl8190PciAGCTAB_Array ++#define PHY_REGArrayLength 280 ++#define Rtl819XPHY_REGArray Rtl8190PciPHY_REGArray ++#define PHY_REG_1T2RArrayLength 280 ++#define Rtl819XPHY_REG_1T2RArray Rtl8190PciPHY_REG_1T2RArray ++#endif ++ ++ #ifdef RTL8192E ++ #define MACPHY_Array_PGLength 30 ++ #define Rtl819XMACPHY_Array_PG Rtl8192PciEMACPHY_Array_PG ++ #define Rtl819XMACPHY_Array Rtl8192PciEMACPHY_Array ++ #define RadioC_ArrayLength 1 ++ #define RadioD_ArrayLength 1 ++ #define Rtl819XRadioA_Array Rtl8192PciERadioA_Array ++ #define Rtl819XRadioB_Array Rtl8192PciERadioB_Array ++ #define Rtl819XRadioC_Array Rtl8192PciERadioC_Array ++ #define Rtl819XRadioD_Array Rtl8192PciERadioD_Array ++ #define Rtl819XAGCTAB_Array Rtl8192PciEAGCTAB_Array ++ #define PHY_REGArrayLength 1 ++ #define Rtl819XPHY_REGArray Rtl8192PciEPHY_REGArray ++ #define PHY_REG_1T2RArrayLength 296 ++ #define Rtl819XPHY_REG_1T2RArray Rtl8192PciEPHY_REG_1T2RArray ++ #endif ++#define AGCTAB_ArrayLength 384 ++#define MACPHY_ArrayLength 18 ++ ++#define RadioA_ArrayLength 246 ++#define RadioB_ArrayLength 78 ++ ++ ++typedef enum _SwChnlCmdID{ ++ CmdID_End, ++ CmdID_SetTxPowerLevel, ++ CmdID_BBRegWrite10, ++ CmdID_WritePortUlong, ++ CmdID_WritePortUshort, ++ CmdID_WritePortUchar, ++ CmdID_RF_WriteReg, ++}SwChnlCmdID; ++ ++/*--------------------------------Define structure--------------------------------*/ ++/* 1. Switch channel related */ ++typedef struct _SwChnlCmd{ ++ SwChnlCmdID CmdID; ++ u32 Para1; ++ u32 Para2; ++ u32 msDelay; ++}__attribute__ ((packed)) SwChnlCmd; ++ ++extern u32 rtl819XMACPHY_Array_PG[]; ++extern u32 rtl819XPHY_REG_1T2RArray[]; ++extern u32 rtl819XAGCTAB_Array[]; ++extern u32 rtl819XRadioA_Array[]; ++extern u32 rtl819XRadioB_Array[]; ++extern u32 rtl819XRadioC_Array[]; ++extern u32 rtl819XRadioD_Array[]; ++ ++typedef enum _HW90_BLOCK{ ++ HW90_BLOCK_MAC = 0, ++ HW90_BLOCK_PHY0 = 1, ++ HW90_BLOCK_PHY1 = 2, ++ HW90_BLOCK_RF = 3, ++ HW90_BLOCK_MAXIMUM = 4, // Never use this ++}HW90_BLOCK_E, *PHW90_BLOCK_E; ++ ++typedef enum _RF90_RADIO_PATH{ ++ RF90_PATH_A = 0, //Radio Path A ++ RF90_PATH_B = 1, //Radio Path B ++ RF90_PATH_C = 2, //Radio Path C ++ RF90_PATH_D = 3, //Radio Path D ++ RF90_PATH_MAX //Max RF number 92 support ++}RF90_RADIO_PATH_E, *PRF90_RADIO_PATH_E; ++ ++#define bMaskByte0 0xff ++#define bMaskByte1 0xff00 ++#define bMaskByte2 0xff0000 ++#define bMaskByte3 0xff000000 ++#define bMaskHWord 0xffff0000 ++#define bMaskLWord 0x0000ffff ++#define bMaskDWord 0xffffffff ++ ++//extern u32 rtl8192_CalculateBitShift(u32 dwBitMask); ++extern u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device* dev, u32 eRFPath); ++extern void rtl8192_setBBreg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask, u32 dwData); ++extern u32 rtl8192_QueryBBReg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask); ++//extern u32 rtl8192_phy_RFSerialRead(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 Offset); ++//extern void rtl8192_phy_RFSerialWrite(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 Offset, u32 Data); ++extern void rtl8192_phy_SetRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask, u32 Data); ++extern u32 rtl8192_phy_QueryRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask); ++extern void rtl8192_phy_configmac(struct net_device* dev); ++extern void rtl8192_phyConfigBB(struct net_device* dev, u8 ConfigType); ++//extern void rtl8192_InitBBRFRegDef(struct net_device* dev); ++extern RT_STATUS rtl8192_phy_checkBBAndRF(struct net_device* dev, HW90_BLOCK_E CheckBlock, RF90_RADIO_PATH_E eRFPath); ++//extern RT_STATUS rtl8192_BB_Config_ParaFile(struct net_device* dev); ++extern RT_STATUS rtl8192_BBConfig(struct net_device* dev); ++extern void rtl8192_phy_getTxPower(struct net_device* dev); ++extern void rtl8192_phy_setTxPower(struct net_device* dev, u8 channel); ++extern RT_STATUS rtl8192_phy_RFConfig(struct net_device* dev); ++extern void rtl8192_phy_updateInitGain(struct net_device* dev); ++extern u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device* dev, RF90_RADIO_PATH_E eRFPath); ++ ++extern u8 rtl8192_phy_SwChnl(struct net_device* dev, u8 channel); ++extern void rtl8192_SetBWMode(struct net_device *dev, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); ++extern void rtl8192_SwChnl_WorkItem(struct net_device *dev); ++extern void rtl8192_SetBWModeWorkItem(struct net_device *dev); ++extern void InitialGain819xPci(struct net_device *dev, u8 Operation); ++ ++#endif +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xE_phyreg.h +@@ -0,0 +1,878 @@ ++#ifndef _R819XU_PHYREG_H ++#define _R819XU_PHYREG_H ++ ++ ++#define RF_DATA 0x1d4 // FW will write RF data in the register. ++ ++//Register //duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF ++//page 1 ++#define rPMAC_Reset 0x100 ++#define rPMAC_TxStart 0x104 ++#define rPMAC_TxLegacySIG 0x108 ++#define rPMAC_TxHTSIG1 0x10c ++#define rPMAC_TxHTSIG2 0x110 ++#define rPMAC_PHYDebug 0x114 ++#define rPMAC_TxPacketNum 0x118 ++#define rPMAC_TxIdle 0x11c ++#define rPMAC_TxMACHeader0 0x120 ++#define rPMAC_TxMACHeader1 0x124 ++#define rPMAC_TxMACHeader2 0x128 ++#define rPMAC_TxMACHeader3 0x12c ++#define rPMAC_TxMACHeader4 0x130 ++#define rPMAC_TxMACHeader5 0x134 ++#define rPMAC_TxDataType 0x138 ++#define rPMAC_TxRandomSeed 0x13c ++#define rPMAC_CCKPLCPPreamble 0x140 ++#define rPMAC_CCKPLCPHeader 0x144 ++#define rPMAC_CCKCRC16 0x148 ++#define rPMAC_OFDMRxCRC32OK 0x170 ++#define rPMAC_OFDMRxCRC32Er 0x174 ++#define rPMAC_OFDMRxParityEr 0x178 ++#define rPMAC_OFDMRxCRC8Er 0x17c ++#define rPMAC_CCKCRxRC16Er 0x180 ++#define rPMAC_CCKCRxRC32Er 0x184 ++#define rPMAC_CCKCRxRC32OK 0x188 ++#define rPMAC_TxStatus 0x18c ++ ++//90P ++#define MCS_TXAGC 0x340 // MCS AGC ++#define CCK_TXAGC 0x348 // CCK AGC ++ ++//page8 ++#define rFPGA0_RFMOD 0x800 //RF mode & CCK TxSC ++#define rFPGA0_TxInfo 0x804 ++#define rFPGA0_PSDFunction 0x808 ++#define rFPGA0_TxGainStage 0x80c ++#define rFPGA0_RFTiming1 0x810 ++#define rFPGA0_RFTiming2 0x814 ++//#define rFPGA0_XC_RFTiming 0x818 ++//#define rFPGA0_XD_RFTiming 0x81c ++#define rFPGA0_XA_HSSIParameter1 0x820 ++#define rFPGA0_XA_HSSIParameter2 0x824 ++#define rFPGA0_XB_HSSIParameter1 0x828 ++#define rFPGA0_XB_HSSIParameter2 0x82c ++#define rFPGA0_XC_HSSIParameter1 0x830 ++#define rFPGA0_XC_HSSIParameter2 0x834 ++#define rFPGA0_XD_HSSIParameter1 0x838 ++#define rFPGA0_XD_HSSIParameter2 0x83c ++#define rFPGA0_XA_LSSIParameter 0x840 ++#define rFPGA0_XB_LSSIParameter 0x844 ++#define rFPGA0_XC_LSSIParameter 0x848 ++#define rFPGA0_XD_LSSIParameter 0x84c ++#define rFPGA0_RFWakeUpParameter 0x850 ++#define rFPGA0_RFSleepUpParameter 0x854 ++#define rFPGA0_XAB_SwitchControl 0x858 ++#define rFPGA0_XCD_SwitchControl 0x85c ++#define rFPGA0_XA_RFInterfaceOE 0x860 ++#define rFPGA0_XB_RFInterfaceOE 0x864 ++#define rFPGA0_XC_RFInterfaceOE 0x868 ++#define rFPGA0_XD_RFInterfaceOE 0x86c ++#define rFPGA0_XAB_RFInterfaceSW 0x870 ++#define rFPGA0_XCD_RFInterfaceSW 0x874 ++#define rFPGA0_XAB_RFParameter 0x878 ++#define rFPGA0_XCD_RFParameter 0x87c ++#define rFPGA0_AnalogParameter1 0x880 ++#define rFPGA0_AnalogParameter2 0x884 ++#define rFPGA0_AnalogParameter3 0x888 ++#define rFPGA0_AnalogParameter4 0x88c ++#define rFPGA0_XA_LSSIReadBack 0x8a0 ++#define rFPGA0_XB_LSSIReadBack 0x8a4 ++#define rFPGA0_XC_LSSIReadBack 0x8a8 ++#define rFPGA0_XD_LSSIReadBack 0x8ac ++#define rFPGA0_PSDReport 0x8b4 ++#define rFPGA0_XAB_RFInterfaceRB 0x8e0 ++#define rFPGA0_XCD_RFInterfaceRB 0x8e4 ++ ++//page 9 ++#define rFPGA1_RFMOD 0x900 //RF mode & OFDM TxSC ++#define rFPGA1_TxBlock 0x904 ++#define rFPGA1_DebugSelect 0x908 ++#define rFPGA1_TxInfo 0x90c ++ ++//page a ++#define rCCK0_System 0xa00 ++#define rCCK0_AFESetting 0xa04 ++#define rCCK0_CCA 0xa08 ++#define rCCK0_RxAGC1 0xa0c //AGC default value, saturation level ++#define rCCK0_RxAGC2 0xa10 //AGC & DAGC ++#define rCCK0_RxHP 0xa14 ++#define rCCK0_DSPParameter1 0xa18 //Timing recovery & Channel estimation threshold ++#define rCCK0_DSPParameter2 0xa1c //SQ threshold ++#define rCCK0_TxFilter1 0xa20 ++#define rCCK0_TxFilter2 0xa24 ++#define rCCK0_DebugPort 0xa28 //debug port and Tx filter3 ++#define rCCK0_FalseAlarmReport 0xa2c //0xa2d ++#define rCCK0_TRSSIReport 0xa50 ++#define rCCK0_RxReport 0xa54 //0xa57 ++#define rCCK0_FACounterLower 0xa5c //0xa5b ++#define rCCK0_FACounterUpper 0xa58 //0xa5c ++ ++//page c ++#define rOFDM0_LSTF 0xc00 ++#define rOFDM0_TRxPathEnable 0xc04 ++#define rOFDM0_TRMuxPar 0xc08 ++#define rOFDM0_TRSWIsolation 0xc0c ++#define rOFDM0_XARxAFE 0xc10 //RxIQ DC offset, Rx digital filter, DC notch filter ++#define rOFDM0_XARxIQImbalance 0xc14 //RxIQ imblance matrix ++#define rOFDM0_XBRxAFE 0xc18 ++#define rOFDM0_XBRxIQImbalance 0xc1c ++#define rOFDM0_XCRxAFE 0xc20 ++#define rOFDM0_XCRxIQImbalance 0xc24 ++#define rOFDM0_XDRxAFE 0xc28 ++#define rOFDM0_XDRxIQImbalance 0xc2c ++#define rOFDM0_RxDetector1 0xc30 //PD,BW & SBD ++#define rOFDM0_RxDetector2 0xc34 //SBD & Fame Sync. ++#define rOFDM0_RxDetector3 0xc38 //Frame Sync. ++#define rOFDM0_RxDetector4 0xc3c //PD, SBD, Frame Sync & Short-GI ++#define rOFDM0_RxDSP 0xc40 //Rx Sync Path ++#define rOFDM0_CFOandDAGC 0xc44 //CFO & DAGC ++#define rOFDM0_CCADropThreshold 0xc48 //CCA Drop threshold ++#define rOFDM0_ECCAThreshold 0xc4c // energy CCA ++#define rOFDM0_XAAGCCore1 0xc50 ++#define rOFDM0_XAAGCCore2 0xc54 ++#define rOFDM0_XBAGCCore1 0xc58 ++#define rOFDM0_XBAGCCore2 0xc5c ++#define rOFDM0_XCAGCCore1 0xc60 ++#define rOFDM0_XCAGCCore2 0xc64 ++#define rOFDM0_XDAGCCore1 0xc68 ++#define rOFDM0_XDAGCCore2 0xc6c ++#define rOFDM0_AGCParameter1 0xc70 ++#define rOFDM0_AGCParameter2 0xc74 ++#define rOFDM0_AGCRSSITable 0xc78 ++#define rOFDM0_HTSTFAGC 0xc7c ++#define rOFDM0_XATxIQImbalance 0xc80 ++#define rOFDM0_XATxAFE 0xc84 ++#define rOFDM0_XBTxIQImbalance 0xc88 ++#define rOFDM0_XBTxAFE 0xc8c ++#define rOFDM0_XCTxIQImbalance 0xc90 ++#define rOFDM0_XCTxAFE 0xc94 ++#define rOFDM0_XDTxIQImbalance 0xc98 ++#define rOFDM0_XDTxAFE 0xc9c ++#define rOFDM0_RxHPParameter 0xce0 ++#define rOFDM0_TxPseudoNoiseWgt 0xce4 ++#define rOFDM0_FrameSync 0xcf0 ++#define rOFDM0_DFSReport 0xcf4 ++#define rOFDM0_TxCoeff1 0xca4 ++#define rOFDM0_TxCoeff2 0xca8 ++#define rOFDM0_TxCoeff3 0xcac ++#define rOFDM0_TxCoeff4 0xcb0 ++#define rOFDM0_TxCoeff5 0xcb4 ++#define rOFDM0_TxCoeff6 0xcb8 ++ ++ ++//page d ++#define rOFDM1_LSTF 0xd00 ++#define rOFDM1_TRxPathEnable 0xd04 ++#define rOFDM1_CFO 0xd08 ++#define rOFDM1_CSI1 0xd10 ++#define rOFDM1_SBD 0xd14 ++#define rOFDM1_CSI2 0xd18 ++#define rOFDM1_CFOTracking 0xd2c ++#define rOFDM1_TRxMesaure1 0xd34 ++#define rOFDM1_IntfDet 0xd3c ++#define rOFDM1_PseudoNoiseStateAB 0xd50 ++#define rOFDM1_PseudoNoiseStateCD 0xd54 ++#define rOFDM1_RxPseudoNoiseWgt 0xd58 ++#define rOFDM_PHYCounter1 0xda0 //cca, parity fail ++#define rOFDM_PHYCounter2 0xda4 //rate illegal, crc8 fail ++#define rOFDM_PHYCounter3 0xda8 //MCS not support ++#define rOFDM_ShortCFOAB 0xdac ++#define rOFDM_ShortCFOCD 0xdb0 ++#define rOFDM_LongCFOAB 0xdb4 ++#define rOFDM_LongCFOCD 0xdb8 ++#define rOFDM_TailCFOAB 0xdbc ++#define rOFDM_TailCFOCD 0xdc0 ++#define rOFDM_PWMeasure1 0xdc4 ++#define rOFDM_PWMeasure2 0xdc8 ++#define rOFDM_BWReport 0xdcc ++#define rOFDM_AGCReport 0xdd0 ++#define rOFDM_RxSNR 0xdd4 ++#define rOFDM_RxEVMCSI 0xdd8 ++#define rOFDM_SIGReport 0xddc ++ ++//page e ++#define rTxAGC_Rate18_06 0xe00 ++#define rTxAGC_Rate54_24 0xe04 ++#define rTxAGC_CCK_Mcs32 0xe08 ++#define rTxAGC_Mcs03_Mcs00 0xe10 ++#define rTxAGC_Mcs07_Mcs04 0xe14 ++#define rTxAGC_Mcs11_Mcs08 0xe18 ++#define rTxAGC_Mcs15_Mcs12 0xe1c ++ ++ ++//RF ++//Zebra1 ++#define rZebra1_HSSIEnable 0x0 ++#define rZebra1_TRxEnable1 0x1 ++#define rZebra1_TRxEnable2 0x2 ++#define rZebra1_AGC 0x4 ++#define rZebra1_ChargePump 0x5 ++#define rZebra1_Channel 0x7 ++#define rZebra1_TxGain 0x8 ++#define rZebra1_TxLPF 0x9 ++#define rZebra1_RxLPF 0xb ++#define rZebra1_RxHPFCorner 0xc ++ ++//Zebra4 ++#define rGlobalCtrl 0 ++#define rRTL8256_TxLPF 19 ++#define rRTL8256_RxLPF 11 ++ ++//RTL8258 ++#define rRTL8258_TxLPF 0x11 ++#define rRTL8258_RxLPF 0x13 ++#define rRTL8258_RSSILPF 0xa ++ ++//Bit Mask ++//page-1 ++#define bBBResetB 0x100 ++#define bGlobalResetB 0x200 ++#define bOFDMTxStart 0x4 ++#define bCCKTxStart 0x8 ++#define bCRC32Debug 0x100 ++#define bPMACLoopback 0x10 ++#define bTxLSIG 0xffffff ++#define bOFDMTxRate 0xf ++#define bOFDMTxReserved 0x10 ++#define bOFDMTxLength 0x1ffe0 ++#define bOFDMTxParity 0x20000 ++#define bTxHTSIG1 0xffffff ++#define bTxHTMCSRate 0x7f ++#define bTxHTBW 0x80 ++#define bTxHTLength 0xffff00 ++#define bTxHTSIG2 0xffffff ++#define bTxHTSmoothing 0x1 ++#define bTxHTSounding 0x2 ++#define bTxHTReserved 0x4 ++#define bTxHTAggreation 0x8 ++#define bTxHTSTBC 0x30 ++#define bTxHTAdvanceCoding 0x40 ++#define bTxHTShortGI 0x80 ++#define bTxHTNumberHT_LTF 0x300 ++#define bTxHTCRC8 0x3fc00 ++#define bCounterReset 0x10000 ++#define bNumOfOFDMTx 0xffff ++#define bNumOfCCKTx 0xffff0000 ++#define bTxIdleInterval 0xffff ++#define bOFDMService 0xffff0000 ++#define bTxMACHeader 0xffffffff ++#define bTxDataInit 0xff ++#define bTxHTMode 0x100 ++#define bTxDataType 0x30000 ++#define bTxRandomSeed 0xffffffff ++#define bCCKTxPreamble 0x1 ++#define bCCKTxSFD 0xffff0000 ++#define bCCKTxSIG 0xff ++#define bCCKTxService 0xff00 ++#define bCCKLengthExt 0x8000 ++#define bCCKTxLength 0xffff0000 ++#define bCCKTxCRC16 0xffff ++#define bCCKTxStatus 0x1 ++#define bOFDMTxStatus 0x2 ++ ++//page-8 ++#define bRFMOD 0x1 ++#define bJapanMode 0x2 ++#define bCCKTxSC 0x30 ++#define bCCKEn 0x1000000 ++#define bOFDMEn 0x2000000 ++#define bOFDMRxADCPhase 0x10000 ++#define bOFDMTxDACPhase 0x40000 ++#define bXATxAGC 0x3f ++#define bXBTxAGC 0xf00 ++#define bXCTxAGC 0xf000 ++#define bXDTxAGC 0xf0000 ++#define bPAStart 0xf0000000 ++#define bTRStart 0x00f00000 ++#define bRFStart 0x0000f000 ++#define bBBStart 0x000000f0 ++#define bBBCCKStart 0x0000000f ++#define bPAEnd 0xf //Reg0x814 ++#define bTREnd 0x0f000000 ++#define bRFEnd 0x000f0000 ++#define bCCAMask 0x000000f0 //T2R ++#define bR2RCCAMask 0x00000f00 ++#define bHSSI_R2TDelay 0xf8000000 ++#define bHSSI_T2RDelay 0xf80000 ++#define bContTxHSSI 0x400 //chane gain at continue Tx ++#define bIGFromCCK 0x200 ++#define bAGCAddress 0x3f ++#define bRxHPTx 0x7000 ++#define bRxHPT2R 0x38000 ++#define bRxHPCCKIni 0xc0000 ++#define bAGCTxCode 0xc00000 ++#define bAGCRxCode 0x300000 ++#define b3WireDataLength 0x800 ++#define b3WireAddressLength 0x400 ++#define b3WireRFPowerDown 0x1 ++//#define bHWSISelect 0x8 ++#define b5GPAPEPolarity 0x40000000 ++#define b2GPAPEPolarity 0x80000000 ++#define bRFSW_TxDefaultAnt 0x3 ++#define bRFSW_TxOptionAnt 0x30 ++#define bRFSW_RxDefaultAnt 0x300 ++#define bRFSW_RxOptionAnt 0x3000 ++#define bRFSI_3WireData 0x1 ++#define bRFSI_3WireClock 0x2 ++#define bRFSI_3WireLoad 0x4 ++#define bRFSI_3WireRW 0x8 ++#define bRFSI_3Wire 0xf //3-wire total control ++#define bRFSI_RFENV 0x10 ++#define bRFSI_TRSW 0x20 ++#define bRFSI_TRSWB 0x40 ++#define bRFSI_ANTSW 0x100 ++#define bRFSI_ANTSWB 0x200 ++#define bRFSI_PAPE 0x400 ++#define bRFSI_PAPE5G 0x800 ++#define bBandSelect 0x1 ++#define bHTSIG2_GI 0x80 ++#define bHTSIG2_Smoothing 0x01 ++#define bHTSIG2_Sounding 0x02 ++#define bHTSIG2_Aggreaton 0x08 ++#define bHTSIG2_STBC 0x30 ++#define bHTSIG2_AdvCoding 0x40 ++#define bHTSIG2_NumOfHTLTF 0x300 ++#define bHTSIG2_CRC8 0x3fc ++#define bHTSIG1_MCS 0x7f ++#define bHTSIG1_BandWidth 0x80 ++#define bHTSIG1_HTLength 0xffff ++#define bLSIG_Rate 0xf ++#define bLSIG_Reserved 0x10 ++#define bLSIG_Length 0x1fffe ++#define bLSIG_Parity 0x20 ++#define bCCKRxPhase 0x4 ++#define bLSSIReadAddress 0x3f000000 //LSSI "Read" Address ++#define bLSSIReadEdge 0x80000000 //LSSI "Read" edge signal ++#define bLSSIReadBackData 0xfff ++#define bLSSIReadOKFlag 0x1000 ++#define bCCKSampleRate 0x8 //0: 44MHz, 1:88MHz ++ ++#define bRegulator0Standby 0x1 ++#define bRegulatorPLLStandby 0x2 ++#define bRegulator1Standby 0x4 ++#define bPLLPowerUp 0x8 ++#define bDPLLPowerUp 0x10 ++#define bDA10PowerUp 0x20 ++#define bAD7PowerUp 0x200 ++#define bDA6PowerUp 0x2000 ++#define bXtalPowerUp 0x4000 ++#define b40MDClkPowerUP 0x8000 ++#define bDA6DebugMode 0x20000 ++#define bDA6Swing 0x380000 ++#define bADClkPhase 0x4000000 ++#define b80MClkDelay 0x18000000 ++#define bAFEWatchDogEnable 0x20000000 ++#define bXtalCap 0x0f000000 ++#define bXtalCap01 0xc0000000 ++#define bXtalCap23 0x3 ++#define bXtalCap92x 0x0f000000 ++#define bIntDifClkEnable 0x400 ++#define bExtSigClkEnable 0x800 ++#define bBandgapMbiasPowerUp 0x10000 ++#define bAD11SHGain 0xc0000 ++#define bAD11InputRange 0x700000 ++#define bAD11OPCurrent 0x3800000 ++#define bIPathLoopback 0x4000000 ++#define bQPathLoopback 0x8000000 ++#define bAFELoopback 0x10000000 ++#define bDA10Swing 0x7e0 ++#define bDA10Reverse 0x800 ++#define bDAClkSource 0x1000 ++#define bAD7InputRange 0x6000 ++#define bAD7Gain 0x38000 ++#define bAD7OutputCMMode 0x40000 ++#define bAD7InputCMMode 0x380000 ++#define bAD7Current 0xc00000 ++#define bRegulatorAdjust 0x7000000 ++#define bAD11PowerUpAtTx 0x1 ++#define bDA10PSAtTx 0x10 ++#define bAD11PowerUpAtRx 0x100 ++#define bDA10PSAtRx 0x1000 ++ ++#define bCCKRxAGCFormat 0x200 ++ ++#define bPSDFFTSamplepPoint 0xc000 ++#define bPSDAverageNum 0x3000 ++#define bIQPathControl 0xc00 ++#define bPSDFreq 0x3ff ++#define bPSDAntennaPath 0x30 ++#define bPSDIQSwitch 0x40 ++#define bPSDRxTrigger 0x400000 ++#define bPSDTxTrigger 0x80000000 ++#define bPSDSineToneScale 0x7f000000 ++#define bPSDReport 0xffff ++ ++//page-9 ++#define bOFDMTxSC 0x30000000 ++#define bCCKTxOn 0x1 ++#define bOFDMTxOn 0x2 ++#define bDebugPage 0xfff //reset debug page and also HWord, LWord ++#define bDebugItem 0xff //reset debug page and LWord ++#define bAntL 0x10 ++#define bAntNonHT 0x100 ++#define bAntHT1 0x1000 ++#define bAntHT2 0x10000 ++#define bAntHT1S1 0x100000 ++#define bAntNonHTS1 0x1000000 ++ ++//page-a ++#define bCCKBBMode 0x3 ++#define bCCKTxPowerSaving 0x80 ++#define bCCKRxPowerSaving 0x40 ++#define bCCKSideBand 0x10 ++#define bCCKScramble 0x8 ++#define bCCKAntDiversity 0x8000 ++#define bCCKCarrierRecovery 0x4000 ++#define bCCKTxRate 0x3000 ++#define bCCKDCCancel 0x0800 ++#define bCCKISICancel 0x0400 ++#define bCCKMatchFilter 0x0200 ++#define bCCKEqualizer 0x0100 ++#define bCCKPreambleDetect 0x800000 ++#define bCCKFastFalseCCA 0x400000 ++#define bCCKChEstStart 0x300000 ++#define bCCKCCACount 0x080000 ++#define bCCKcs_lim 0x070000 ++#define bCCKBistMode 0x80000000 ++#define bCCKCCAMask 0x40000000 ++#define bCCKTxDACPhase 0x4 ++#define bCCKRxADCPhase 0x20000000 //r_rx_clk ++#define bCCKr_cp_mode0 0x0100 ++#define bCCKTxDCOffset 0xf0 ++#define bCCKRxDCOffset 0xf ++#define bCCKCCAMode 0xc000 ++#define bCCKFalseCS_lim 0x3f00 ++#define bCCKCS_ratio 0xc00000 ++#define bCCKCorgBit_sel 0x300000 ++#define bCCKPD_lim 0x0f0000 ++#define bCCKNewCCA 0x80000000 ++#define bCCKRxHPofIG 0x8000 ++#define bCCKRxIG 0x7f00 ++#define bCCKLNAPolarity 0x800000 ++#define bCCKRx1stGain 0x7f0000 ++#define bCCKRFExtend 0x20000000 //CCK Rx Iinital gain polarity ++#define bCCKRxAGCSatLevel 0x1f000000 ++#define bCCKRxAGCSatCount 0xe0 ++#define bCCKRxRFSettle 0x1f //AGCsamp_dly ++#define bCCKFixedRxAGC 0x8000 ++//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824 ++#define bCCKAntennaPolarity 0x2000 ++#define bCCKTxFilterType 0x0c00 ++#define bCCKRxAGCReportType 0x0300 ++#define bCCKRxDAGCEn 0x80000000 ++#define bCCKRxDAGCPeriod 0x20000000 ++#define bCCKRxDAGCSatLevel 0x1f000000 ++#define bCCKTimingRecovery 0x800000 ++#define bCCKTxC0 0x3f0000 ++#define bCCKTxC1 0x3f000000 ++#define bCCKTxC2 0x3f ++#define bCCKTxC3 0x3f00 ++#define bCCKTxC4 0x3f0000 ++#define bCCKTxC5 0x3f000000 ++#define bCCKTxC6 0x3f ++#define bCCKTxC7 0x3f00 ++#define bCCKDebugPort 0xff0000 ++#define bCCKDACDebug 0x0f000000 ++#define bCCKFalseAlarmEnable 0x8000 ++#define bCCKFalseAlarmRead 0x4000 ++#define bCCKTRSSI 0x7f ++#define bCCKRxAGCReport 0xfe ++#define bCCKRxReport_AntSel 0x80000000 ++#define bCCKRxReport_MFOff 0x40000000 ++#define bCCKRxRxReport_SQLoss 0x20000000 ++#define bCCKRxReport_Pktloss 0x10000000 ++#define bCCKRxReport_Lockedbit 0x08000000 ++#define bCCKRxReport_RateError 0x04000000 ++#define bCCKRxReport_RxRate 0x03000000 ++#define bCCKRxFACounterLower 0xff ++#define bCCKRxFACounterUpper 0xff000000 ++#define bCCKRxHPAGCStart 0xe000 ++#define bCCKRxHPAGCFinal 0x1c00 ++ ++#define bCCKRxFalseAlarmEnable 0x8000 ++#define bCCKFACounterFreeze 0x4000 ++ ++#define bCCKTxPathSel 0x10000000 ++#define bCCKDefaultRxPath 0xc000000 ++#define bCCKOptionRxPath 0x3000000 ++ ++//page c ++#define bNumOfSTF 0x3 ++#define bShift_L 0xc0 ++#define bGI_TH 0xc ++#define bRxPathA 0x1 ++#define bRxPathB 0x2 ++#define bRxPathC 0x4 ++#define bRxPathD 0x8 ++#define bTxPathA 0x1 ++#define bTxPathB 0x2 ++#define bTxPathC 0x4 ++#define bTxPathD 0x8 ++#define bTRSSIFreq 0x200 ++#define bADCBackoff 0x3000 ++#define bDFIRBackoff 0xc000 ++#define bTRSSILatchPhase 0x10000 ++#define bRxIDCOffset 0xff ++#define bRxQDCOffset 0xff00 ++#define bRxDFIRMode 0x1800000 ++#define bRxDCNFType 0xe000000 ++#define bRXIQImb_A 0x3ff ++#define bRXIQImb_B 0xfc00 ++#define bRXIQImb_C 0x3f0000 ++#define bRXIQImb_D 0xffc00000 ++#define bDC_dc_Notch 0x60000 ++#define bRxNBINotch 0x1f000000 ++#define bPD_TH 0xf ++#define bPD_TH_Opt2 0xc000 ++#define bPWED_TH 0x700 ++#define bIfMF_Win_L 0x800 ++#define bPD_Option 0x1000 ++#define bMF_Win_L 0xe000 ++#define bBW_Search_L 0x30000 ++#define bwin_enh_L 0xc0000 ++#define bBW_TH 0x700000 ++#define bED_TH2 0x3800000 ++#define bBW_option 0x4000000 ++#define bRatio_TH 0x18000000 ++#define bWindow_L 0xe0000000 ++#define bSBD_Option 0x1 ++#define bFrame_TH 0x1c ++#define bFS_Option 0x60 ++#define bDC_Slope_check 0x80 ++#define bFGuard_Counter_DC_L 0xe00 ++#define bFrame_Weight_Short 0x7000 ++#define bSub_Tune 0xe00000 ++#define bFrame_DC_Length 0xe000000 ++#define bSBD_start_offset 0x30000000 ++#define bFrame_TH_2 0x7 ++#define bFrame_GI2_TH 0x38 ++#define bGI2_Sync_en 0x40 ++#define bSarch_Short_Early 0x300 ++#define bSarch_Short_Late 0xc00 ++#define bSarch_GI2_Late 0x70000 ++#define bCFOAntSum 0x1 ++#define bCFOAcc 0x2 ++#define bCFOStartOffset 0xc ++#define bCFOLookBack 0x70 ++#define bCFOSumWeight 0x80 ++#define bDAGCEnable 0x10000 ++#define bTXIQImb_A 0x3ff ++#define bTXIQImb_B 0xfc00 ++#define bTXIQImb_C 0x3f0000 ++#define bTXIQImb_D 0xffc00000 ++#define bTxIDCOffset 0xff ++#define bTxQDCOffset 0xff00 ++#define bTxDFIRMode 0x10000 ++#define bTxPesudoNoiseOn 0x4000000 ++#define bTxPesudoNoise_A 0xff ++#define bTxPesudoNoise_B 0xff00 ++#define bTxPesudoNoise_C 0xff0000 ++#define bTxPesudoNoise_D 0xff000000 ++#define bCCADropOption 0x20000 ++#define bCCADropThres 0xfff00000 ++#define bEDCCA_H 0xf ++#define bEDCCA_L 0xf0 ++#define bLambda_ED 0x300 ++#define bRxInitialGain 0x7f ++#define bRxAntDivEn 0x80 ++#define bRxAGCAddressForLNA 0x7f00 ++#define bRxHighPowerFlow 0x8000 ++#define bRxAGCFreezeThres 0xc0000 ++#define bRxFreezeStep_AGC1 0x300000 ++#define bRxFreezeStep_AGC2 0xc00000 ++#define bRxFreezeStep_AGC3 0x3000000 ++#define bRxFreezeStep_AGC0 0xc000000 ++#define bRxRssi_Cmp_En 0x10000000 ++#define bRxQuickAGCEn 0x20000000 ++#define bRxAGCFreezeThresMode 0x40000000 ++#define bRxOverFlowCheckType 0x80000000 ++#define bRxAGCShift 0x7f ++#define bTRSW_Tri_Only 0x80 ++#define bPowerThres 0x300 ++#define bRxAGCEn 0x1 ++#define bRxAGCTogetherEn 0x2 ++#define bRxAGCMin 0x4 ++#define bRxHP_Ini 0x7 ++#define bRxHP_TRLNA 0x70 ++#define bRxHP_RSSI 0x700 ++#define bRxHP_BBP1 0x7000 ++#define bRxHP_BBP2 0x70000 ++#define bRxHP_BBP3 0x700000 ++#define bRSSI_H 0x7f0000 //the threshold for high power ++#define bRSSI_Gen 0x7f000000 //the threshold for ant diversity ++#define bRxSettle_TRSW 0x7 ++#define bRxSettle_LNA 0x38 ++#define bRxSettle_RSSI 0x1c0 ++#define bRxSettle_BBP 0xe00 ++#define bRxSettle_RxHP 0x7000 ++#define bRxSettle_AntSW_RSSI 0x38000 ++#define bRxSettle_AntSW 0xc0000 ++#define bRxProcessTime_DAGC 0x300000 ++#define bRxSettle_HSSI 0x400000 ++#define bRxProcessTime_BBPPW 0x800000 ++#define bRxAntennaPowerShift 0x3000000 ++#define bRSSITableSelect 0xc000000 ++#define bRxHP_Final 0x7000000 ++#define bRxHTSettle_BBP 0x7 ++#define bRxHTSettle_HSSI 0x8 ++#define bRxHTSettle_RxHP 0x70 ++#define bRxHTSettle_BBPPW 0x80 ++#define bRxHTSettle_Idle 0x300 ++#define bRxHTSettle_Reserved 0x1c00 ++#define bRxHTRxHPEn 0x8000 ++#define bRxHTAGCFreezeThres 0x30000 ++#define bRxHTAGCTogetherEn 0x40000 ++#define bRxHTAGCMin 0x80000 ++#define bRxHTAGCEn 0x100000 ++#define bRxHTDAGCEn 0x200000 ++#define bRxHTRxHP_BBP 0x1c00000 ++#define bRxHTRxHP_Final 0xe0000000 ++#define bRxPWRatioTH 0x3 ++#define bRxPWRatioEn 0x4 ++#define bRxMFHold 0x3800 ++#define bRxPD_Delay_TH1 0x38 ++#define bRxPD_Delay_TH2 0x1c0 ++#define bRxPD_DC_COUNT_MAX 0x600 ++//#define bRxMF_Hold 0x3800 ++#define bRxPD_Delay_TH 0x8000 ++#define bRxProcess_Delay 0xf0000 ++#define bRxSearchrange_GI2_Early 0x700000 ++#define bRxFrame_Guard_Counter_L 0x3800000 ++#define bRxSGI_Guard_L 0xc000000 ++#define bRxSGI_Search_L 0x30000000 ++#define bRxSGI_TH 0xc0000000 ++#define bDFSCnt0 0xff ++#define bDFSCnt1 0xff00 ++#define bDFSFlag 0xf0000 ++ ++#define bMFWeightSum 0x300000 ++#define bMinIdxTH 0x7f000000 ++ ++#define bDAFormat 0x40000 ++ ++#define bTxChEmuEnable 0x01000000 ++ ++#define bTRSWIsolation_A 0x7f ++#define bTRSWIsolation_B 0x7f00 ++#define bTRSWIsolation_C 0x7f0000 ++#define bTRSWIsolation_D 0x7f000000 ++ ++#define bExtLNAGain 0x7c00 ++ ++//page d ++#define bSTBCEn 0x4 ++#define bAntennaMapping 0x10 ++#define bNss 0x20 ++#define bCFOAntSumD 0x200 ++#define bPHYCounterReset 0x8000000 ++#define bCFOReportGet 0x4000000 ++#define bOFDMContinueTx 0x10000000 ++#define bOFDMSingleCarrier 0x20000000 ++#define bOFDMSingleTone 0x40000000 ++//#define bRxPath1 0x01 ++//#define bRxPath2 0x02 ++//#define bRxPath3 0x04 ++//#define bRxPath4 0x08 ++//#define bTxPath1 0x10 ++//#define bTxPath2 0x20 ++#define bHTDetect 0x100 ++#define bCFOEn 0x10000 ++#define bCFOValue 0xfff00000 ++#define bSigTone_Re 0x3f ++#define bSigTone_Im 0x7f00 ++#define bCounter_CCA 0xffff ++#define bCounter_ParityFail 0xffff0000 ++#define bCounter_RateIllegal 0xffff ++#define bCounter_CRC8Fail 0xffff0000 ++#define bCounter_MCSNoSupport 0xffff ++#define bCounter_FastSync 0xffff ++#define bShortCFO 0xfff ++#define bShortCFOTLength 12 //total ++#define bShortCFOFLength 11 //fraction ++#define bLongCFO 0x7ff ++#define bLongCFOTLength 11 ++#define bLongCFOFLength 11 ++#define bTailCFO 0x1fff ++#define bTailCFOTLength 13 ++#define bTailCFOFLength 12 ++ ++#define bmax_en_pwdB 0xffff ++#define bCC_power_dB 0xffff0000 ++#define bnoise_pwdB 0xffff ++#define bPowerMeasTLength 10 ++#define bPowerMeasFLength 3 ++#define bRx_HT_BW 0x1 ++#define bRxSC 0x6 ++#define bRx_HT 0x8 ++ ++#define bNB_intf_det_on 0x1 ++#define bIntf_win_len_cfg 0x30 ++#define bNB_Intf_TH_cfg 0x1c0 ++ ++#define bRFGain 0x3f ++#define bTableSel 0x40 ++#define bTRSW 0x80 ++ ++#define bRxSNR_A 0xff ++#define bRxSNR_B 0xff00 ++#define bRxSNR_C 0xff0000 ++#define bRxSNR_D 0xff000000 ++#define bSNREVMTLength 8 ++#define bSNREVMFLength 1 ++ ++#define bCSI1st 0xff ++#define bCSI2nd 0xff00 ++#define bRxEVM1st 0xff0000 ++#define bRxEVM2nd 0xff000000 ++ ++#define bSIGEVM 0xff ++#define bPWDB 0xff00 ++#define bSGIEN 0x10000 ++ ++#define bSFactorQAM1 0xf ++#define bSFactorQAM2 0xf0 ++#define bSFactorQAM3 0xf00 ++#define bSFactorQAM4 0xf000 ++#define bSFactorQAM5 0xf0000 ++#define bSFactorQAM6 0xf0000 ++#define bSFactorQAM7 0xf00000 ++#define bSFactorQAM8 0xf000000 ++#define bSFactorQAM9 0xf0000000 ++#define bCSIScheme 0x100000 ++ ++#define bNoiseLvlTopSet 0x3 ++#define bChSmooth 0x4 ++#define bChSmoothCfg1 0x38 ++#define bChSmoothCfg2 0x1c0 ++#define bChSmoothCfg3 0xe00 ++#define bChSmoothCfg4 0x7000 ++#define bMRCMode 0x800000 ++#define bTHEVMCfg 0x7000000 ++ ++#define bLoopFitType 0x1 ++#define bUpdCFO 0x40 ++#define bUpdCFOOffData 0x80 ++#define bAdvUpdCFO 0x100 ++#define bAdvTimeCtrl 0x800 ++#define bUpdClko 0x1000 ++#define bFC 0x6000 ++#define bTrackingMode 0x8000 ++#define bPhCmpEnable 0x10000 ++#define bUpdClkoLTF 0x20000 ++#define bComChCFO 0x40000 ++#define bCSIEstiMode 0x80000 ++#define bAdvUpdEqz 0x100000 ++#define bUChCfg 0x7000000 ++#define bUpdEqz 0x8000000 ++ ++//page e ++#define bTxAGCRate18_06 0x7f7f7f7f ++#define bTxAGCRate54_24 0x7f7f7f7f ++#define bTxAGCRateMCS32 0x7f ++#define bTxAGCRateCCK 0x7f00 ++#define bTxAGCRateMCS3_MCS0 0x7f7f7f7f ++#define bTxAGCRateMCS7_MCS4 0x7f7f7f7f ++#define bTxAGCRateMCS11_MCS8 0x7f7f7f7f ++#define bTxAGCRateMCS15_MCS12 0x7f7f7f7f ++ ++ ++//Rx Pseduo noise ++#define bRxPesudoNoiseOn 0x20000000 ++#define bRxPesudoNoise_A 0xff ++#define bRxPesudoNoise_B 0xff00 ++#define bRxPesudoNoise_C 0xff0000 ++#define bRxPesudoNoise_D 0xff000000 ++#define bPesudoNoiseState_A 0xffff ++#define bPesudoNoiseState_B 0xffff0000 ++#define bPesudoNoiseState_C 0xffff ++#define bPesudoNoiseState_D 0xffff0000 ++ ++//RF ++//Zebra1 ++#define bZebra1_HSSIEnable 0x8 ++#define bZebra1_TRxControl 0xc00 ++#define bZebra1_TRxGainSetting 0x07f ++#define bZebra1_RxCorner 0xc00 ++#define bZebra1_TxChargePump 0x38 ++#define bZebra1_RxChargePump 0x7 ++#define bZebra1_ChannelNum 0xf80 ++#define bZebra1_TxLPFBW 0x400 ++#define bZebra1_RxLPFBW 0x600 ++ ++//Zebra4 ++#define bRTL8256RegModeCtrl1 0x100 ++#define bRTL8256RegModeCtrl0 0x40 ++#define bRTL8256_TxLPFBW 0x18 ++#define bRTL8256_RxLPFBW 0x600 ++ ++//RTL8258 ++#define bRTL8258_TxLPFBW 0xc ++#define bRTL8258_RxLPFBW 0xc00 ++#define bRTL8258_RSSILPFBW 0xc0 ++ ++//byte endable for sb_write ++#define bByte0 0x1 ++#define bByte1 0x2 ++#define bByte2 0x4 ++#define bByte3 0x8 ++#define bWord0 0x3 ++#define bWord1 0xc ++#define bDWord 0xf ++ ++//for PutRegsetting & GetRegSetting BitMask ++#define bMaskByte0 0xff ++#define bMaskByte1 0xff00 ++#define bMaskByte2 0xff0000 ++#define bMaskByte3 0xff000000 ++#define bMaskHWord 0xffff0000 ++#define bMaskLWord 0x0000ffff ++#define bMaskDWord 0xffffffff ++ ++//for PutRFRegsetting & GetRFRegSetting BitMask ++#define bMask12Bits 0xfff ++ ++#define bEnable 0x1 ++#define bDisable 0x0 ++ ++#define LeftAntenna 0x0 ++#define RightAntenna 0x1 ++ ++#define tCheckTxStatus 500 //500ms ++#define tUpdateRxCounter 100 //100ms ++ ++#define rateCCK 0 ++#define rateOFDM 1 ++#define rateHT 2 ++ ++//define Register-End ++#define bPMAC_End 0x1ff ++#define bFPGAPHY0_End 0x8ff ++#define bFPGAPHY1_End 0x9ff ++#define bCCKPHY0_End 0xaff ++#define bOFDMPHY0_End 0xcff ++#define bOFDMPHY1_End 0xdff ++ ++//define max debug item in each debug page ++//#define bMaxItem_FPGA_PHY0 0x9 ++//#define bMaxItem_FPGA_PHY1 0x3 ++//#define bMaxItem_PHY_11B 0x16 ++//#define bMaxItem_OFDM_PHY0 0x29 ++//#define bMaxItem_OFDM_PHY1 0x0 ++ ++#define bPMACControl 0x0 ++#define bWMACControl 0x1 ++#define bWNICControl 0x2 ++ ++#define PathA 0x0 ++#define PathB 0x1 ++#define PathC 0x2 ++#define PathD 0x3 ++ ++#define rRTL8256RxMixerPole 0xb ++#define bZebraRxMixerPole 0x6 ++#define rRTL8256TxBBOPBias 0x9 ++#define bRTL8256TxBBOPBias 0x400 ++#define rRTL8256TxBBBW 19 ++#define bRTL8256TxBBBW 0x18 ++ ++#endif //__INC_HAL8190PCIPHYREG_H +--- /dev/null ++++ b/drivers/staging/rtl8192e/r819xP_firmware_img.h +@@ -0,0 +1,3637 @@ ++#ifndef __INC_R819XU_FIRMWARE_IMG_H ++#define __INC_R819XU_FIRMWARE_IMG_H ++/*Created on 2008/ 5/19, 6:38*/ ++#include ++ ++u8 rtl8190_fwboot_array[] = { ++0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x3c,0x08,0xbf,0xc0,0x25,0x08,0x00,0x08, ++0x3c,0x09,0xb0,0x03,0xad,0x28,0x00,0x20,0x40,0x80,0x68,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0xd0,0x00,0x40,0x8a,0x60,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x01, ++0x25,0x08,0xd6,0x04,0x24,0x09,0x00,0x01,0x3c,0x01,0x7f,0xff,0x34,0x21,0xff,0xff, ++0x01,0x01,0x50,0x24,0x00,0x09,0x48,0x40,0x35,0x29,0x00,0x01,0x01,0x2a,0x10,0x2b, ++0x14,0x40,0xff,0xfc,0x00,0x00,0x00,0x00,0x3c,0x0a,0x00,0x00,0x25,0x4a,0x00,0x00, ++0x4c,0x8a,0x00,0x00,0x4c,0x89,0x08,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x01, ++0x25,0x08,0xd6,0x04,0x3c,0x01,0x80,0x00,0x01,0x21,0x48,0x25,0x3c,0x0a,0xbf,0xc0, ++0x25,0x4a,0x00,0x7c,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0xad,0x00,0x00,0x00, ++0x21,0x08,0x00,0x04,0x01,0x09,0x10,0x2b,0x14,0x40,0xff,0xf8,0x00,0x00,0x00,0x00, ++0x3c,0x08,0x80,0x01,0x25,0x08,0x7f,0xff,0x24,0x09,0x00,0x01,0x3c,0x01,0x7f,0xff, ++0x34,0x21,0xff,0xff,0x01,0x01,0x50,0x24,0x00,0x09,0x48,0x40,0x35,0x29,0x00,0x01, ++0x01,0x2a,0x10,0x2b,0x14,0x40,0xff,0xfc,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x01, ++0x25,0x4a,0x00,0x00,0x3c,0x01,0x7f,0xff,0x34,0x21,0xff,0xff,0x01,0x41,0x50,0x24, ++0x3c,0x09,0x00,0x01,0x35,0x29,0x7f,0xff,0x4c,0x8a,0x20,0x00,0x4c,0x89,0x28,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x08,0x04,0x10, ++0x00,0x00,0x00,0x00,0x40,0x88,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x08,0xbf,0xc0,0x00,0x00,0x00,0x00,0x8d,0x09,0x00,0x00,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0xbf,0xc0,0x25,0x4a,0x01,0x20,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20, ++0x3c,0x08,0xb0,0x03,0x8d,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x29,0x00,0x10, ++0xad,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x08,0x80,0x00,0x25,0x08,0x6a,0xbc, ++0x01,0x00,0x00,0x08,0x00,0x00,0x00,0x00,}; ++ ++u8 rtl8190_fwmain_array[] = { ++0x40,0x04,0x68,0x00,0x40,0x05,0x70,0x00,0x40,0x06,0x40,0x00,0x0c,0x00,0x1a,0x1e, ++0x00,0x00,0x00,0x00,0x40,0x1a,0x68,0x00,0x33,0x5b,0x00,0x3c,0x17,0x60,0x00,0x09, ++0x00,0x00,0x00,0x00,0x40,0x1b,0x60,0x00,0x00,0x00,0x00,0x00,0x03,0x5b,0xd0,0x24, ++0x40,0x1a,0x70,0x00,0x03,0x40,0x00,0x08,0x42,0x00,0x00,0x10,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xff,0xff,0x34,0x42,0xff,0xff,0x8c,0x43,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x00,0xd0, ++0xac,0x62,0x00,0x00,0x00,0x00,0x20,0x21,0x27,0x85,0x94,0x50,0x00,0x85,0x18,0x21, ++0x24,0x84,0x00,0x01,0x28,0x82,0x00,0x0a,0x14,0x40,0xff,0xfc,0xa0,0x60,0x00,0x00, ++0x27,0x82,0x94,0x5a,0x24,0x04,0x00,0x06,0x24,0x84,0xff,0xff,0xa4,0x40,0x00,0x00, ++0x04,0x81,0xff,0xfd,0x24,0x42,0x00,0x02,0x24,0x02,0x00,0x03,0xa3,0x82,0x94,0x50, ++0x24,0x02,0x00,0x0a,0x24,0x03,0x09,0xc4,0xa3,0x82,0x94,0x52,0x24,0x02,0x00,0x04, ++0x24,0x04,0x00,0x01,0x24,0x05,0x00,0x02,0xa7,0x83,0x94,0x66,0xa3,0x82,0x94,0x58, ++0x24,0x03,0x04,0x00,0x24,0x02,0x02,0x00,0xaf,0x83,0x94,0x6c,0xa3,0x85,0x94,0x59, ++0xa7,0x82,0x94,0x5a,0xa7,0x84,0x94,0x5c,0xaf,0x84,0x94,0x68,0xa3,0x84,0x94,0x51, ++0xa3,0x80,0x94,0x53,0xa3,0x80,0x94,0x54,0xa3,0x80,0x94,0x55,0xa3,0x84,0x94,0x56, ++0xa3,0x85,0x94,0x57,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x24,0x42,0x01,0x7c,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00, ++0x27,0x84,0x94,0x78,0x00,0x00,0x10,0x21,0x24,0x42,0x00,0x01,0x00,0x02,0x16,0x00, ++0x00,0x02,0x16,0x03,0x28,0x43,0x00,0x03,0xac,0x80,0xff,0xfc,0xa0,0x80,0x00,0x00, ++0x14,0x60,0xff,0xf9,0x24,0x84,0x00,0x0c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x01,0xc0, ++0x3c,0x08,0xb0,0x03,0xac,0x62,0x00,0x00,0x35,0x08,0x00,0x70,0x8d,0x02,0x00,0x00, ++0x00,0xa0,0x48,0x21,0x00,0x04,0x26,0x00,0x00,0x02,0x2a,0x43,0x00,0x06,0x36,0x00, ++0x00,0x07,0x3e,0x00,0x00,0x02,0x12,0x03,0x29,0x23,0x00,0x03,0x00,0x04,0x56,0x03, ++0x00,0x06,0x36,0x03,0x00,0x07,0x3e,0x03,0x30,0x48,0x00,0x01,0x10,0x60,0x00,0x11, ++0x30,0xa5,0x00,0x07,0x24,0x02,0x00,0x02,0x00,0x49,0x10,0x23,0x00,0x45,0x10,0x07, ++0x30,0x42,0x00,0x01,0x10,0x40,0x00,0x66,0x00,0x00,0x00,0x00,0x8f,0xa2,0x00,0x10, ++0x00,0x00,0x00,0x00,0x00,0x02,0x21,0x43,0x11,0x00,0x00,0x10,0x00,0x07,0x20,0x0b, ++0x15,0x20,0x00,0x06,0x24,0x02,0x00,0x01,0x3c,0x02,0xb0,0x05,0x34,0x42,0x01,0x20, ++0xa4,0x44,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x11,0x22,0x00,0x04, ++0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x05,0x08,0x00,0x00,0x94,0x34,0x42,0x01,0x24, ++0x3c,0x02,0xb0,0x05,0x08,0x00,0x00,0x94,0x34,0x42,0x01,0x22,0x15,0x20,0x00,0x54, ++0x24,0x02,0x00,0x01,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x74,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x83,0x94,0x74,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x70, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x6b,0x00,0x08,0x11,0x60,0x00,0x18, ++0x00,0x09,0x28,0x40,0x00,0x00,0x40,0x21,0x27,0x85,0x94,0x70,0x8c,0xa3,0x00,0x00, ++0x8c,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x62,0x38,0x23,0x00,0x43,0x10,0x2a, ++0x10,0x40,0x00,0x3d,0x00,0x00,0x00,0x00,0xac,0xa7,0x00,0x00,0x25,0x02,0x00,0x01, ++0x00,0x02,0x16,0x00,0x00,0x02,0x46,0x03,0x29,0x03,0x00,0x03,0x14,0x60,0xff,0xf3, ++0x24,0xa5,0x00,0x0c,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x70,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4b,0x10,0x23,0xa0,0x62,0x00,0x00,0x00,0x09,0x28,0x40, ++0x00,0xa9,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x94,0x78,0x00,0x0a,0x20,0x0b, ++0x00,0x43,0x18,0x21,0x10,0xc0,0x00,0x05,0x00,0x00,0x38,0x21,0x80,0x62,0x00,0x01, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x80,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x03,0x00,0xa9,0x10,0x21,0x24,0x07,0x00,0x01, ++0x00,0xa9,0x10,0x21,0x00,0x02,0x30,0x80,0x27,0x82,0x94,0x78,0xa0,0x67,0x00,0x01, ++0x00,0xc2,0x38,0x21,0x80,0xe3,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x07, ++0x00,0x00,0x00,0x00,0x27,0x83,0x94,0x70,0x00,0xc3,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x21,0xac,0x62,0x00,0x00,0x27,0x85,0x94,0x74, ++0x27,0x82,0x94,0x70,0x00,0xc5,0x28,0x21,0x00,0xc2,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x8c,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x18,0x2a,0x14,0x60,0x00,0x03, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0xa0,0xe2,0x00,0x00,0xa0,0xe0,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0xb7,0xac,0xa0,0x00,0x00, ++0x11,0x22,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x7c, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x83,0x94,0x8c,0x08,0x00,0x00,0xa7, ++0x3c,0x02,0xb0,0x03,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x78,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x83,0x94,0x80,0x08,0x00,0x00,0xa7,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x04,0x10, ++0x3c,0x05,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0xa5,0x00,0x70,0x8c,0xa2,0x00,0x00, ++0x90,0x84,0x00,0x08,0x3c,0x06,0xb0,0x03,0x00,0x02,0x16,0x00,0x2c,0x83,0x00,0x03, ++0x34,0xc6,0x00,0x72,0x24,0x07,0x00,0x01,0x10,0x60,0x00,0x11,0x00,0x02,0x2f,0xc2, ++0x90,0xc2,0x00,0x00,0x00,0x00,0x18,0x21,0x00,0x02,0x16,0x00,0x10,0xa7,0x00,0x09, ++0x00,0x02,0x16,0x03,0x14,0x80,0x00,0x0c,0x30,0x43,0x00,0x03,0x83,0x82,0x94,0x78, ++0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0x02,0x16,0x00, ++0x00,0x02,0x1e,0x03,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x72,0xa0,0x43,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0x45,0x00,0x05,0x10,0x87,0x00,0x04, ++0x30,0x43,0x00,0x06,0x93,0x82,0x94,0x90,0x08,0x00,0x01,0x1f,0x00,0x43,0x10,0x21, ++0x83,0x82,0x94,0x84,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x40,0x08,0x00,0x01,0x1f, ++0x00,0x45,0x10,0x21,0x10,0x80,0x00,0x05,0x00,0x00,0x18,0x21,0x24,0x63,0x00,0x01, ++0x00,0x64,0x10,0x2b,0x14,0x40,0xff,0xfd,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x04,0xe4, ++0x3c,0x04,0xb0,0x02,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0x08, ++0x24,0x02,0x00,0x01,0xaf,0x84,0x94,0xa0,0xa3,0x82,0x94,0xb0,0xa7,0x80,0x94,0xa4, ++0xa7,0x80,0x94,0xa6,0xaf,0x80,0x94,0xa8,0xaf,0x80,0x94,0xac,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20, ++0x24,0x42,0x05,0x24,0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0xac, ++0x80,0xa2,0x00,0x15,0x8c,0x83,0x00,0x00,0x27,0xbd,0xff,0xf0,0x00,0x43,0x10,0x21, ++0xac,0x82,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x10,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x00,0x34,0x42,0x00,0x20,0x24,0x63,0x05,0x5c,0x27,0xbd,0xff,0xe0, ++0xac,0x43,0x00,0x00,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x18, ++0x8f,0x90,0x94,0xa0,0x0c,0x00,0x02,0x90,0x00,0x80,0x88,0x21,0x14,0x40,0x00,0x2a, ++0x3c,0x02,0x00,0x80,0x16,0x20,0x00,0x02,0x34,0x42,0x02,0x01,0x24,0x02,0x02,0x01, ++0xae,0x02,0x00,0x00,0x97,0x84,0x94,0xa4,0x97,0x82,0x94,0xa6,0x3c,0x03,0xb0,0x02, ++0x00,0x83,0x20,0x21,0x24,0x42,0x00,0x04,0xa7,0x82,0x94,0xa6,0xa4,0x82,0x00,0x00, ++0x8f,0x84,0x94,0xa8,0x8f,0x82,0x94,0xa0,0x93,0x85,0x94,0x52,0x24,0x84,0x00,0x01, ++0x24,0x42,0x00,0x04,0x24,0x03,0x8f,0xff,0x3c,0x07,0xb0,0x06,0x3c,0x06,0xb0,0x03, ++0x00,0x43,0x10,0x24,0x00,0x85,0x28,0x2a,0x34,0xe7,0x80,0x18,0xaf,0x82,0x94,0xa0, ++0xaf,0x84,0x94,0xa8,0x10,0xa0,0x00,0x08,0x34,0xc6,0x01,0x08,0x8f,0x83,0x94,0xac, ++0x8f,0x84,0x94,0x6c,0x8c,0xc2,0x00,0x00,0x00,0x64,0x18,0x21,0x00,0x43,0x10,0x2b, ++0x14,0x40,0x00,0x09,0x00,0x00,0x00,0x00,0x8c,0xe2,0x00,0x00,0x3c,0x03,0x0f,0x00, ++0x3c,0x04,0x04,0x00,0x00,0x43,0x10,0x24,0x10,0x44,0x00,0x03,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xd8,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x00,0x24,0x63,0x06,0x48,0xaf,0xb0,0x00,0x10,0x34,0x42,0x00,0x20, ++0x8f,0x90,0x94,0xa0,0xac,0x43,0x00,0x00,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x20,0x00,0x80,0x88,0x21,0x00,0xa0,0x90,0x21, ++0x0c,0x00,0x02,0x90,0x00,0xc0,0x98,0x21,0x24,0x07,0x8f,0xff,0x14,0x40,0x00,0x19, ++0x26,0x03,0x00,0x04,0x24,0x02,0x0e,0x03,0xae,0x02,0x00,0x00,0x00,0x67,0x80,0x24, ++0x26,0x02,0x00,0x04,0xae,0x11,0x00,0x00,0x00,0x47,0x80,0x24,0x97,0x86,0x94,0xa4, ++0x26,0x03,0x00,0x04,0xae,0x12,0x00,0x00,0x00,0x67,0x80,0x24,0xae,0x13,0x00,0x00, ++0x8f,0x84,0x94,0xa0,0x3c,0x02,0xb0,0x02,0x97,0x85,0x94,0xa6,0x00,0xc2,0x30,0x21, ++0x8f,0x82,0x94,0xa8,0x24,0x84,0x00,0x10,0x24,0xa5,0x00,0x10,0x00,0x87,0x20,0x24, ++0x24,0x42,0x00,0x01,0xa7,0x85,0x94,0xa6,0xaf,0x84,0x94,0xa0,0xaf,0x82,0x94,0xa8, ++0xa4,0xc5,0x00,0x00,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10, ++0x94,0x82,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0xe0,0x00,0x14,0x40,0x00,0x14, ++0x00,0x00,0x00,0x00,0x90,0x82,0x00,0x02,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfc, ++0x00,0x82,0x28,0x21,0x8c,0xa4,0x00,0x00,0x3c,0x02,0x00,0x70,0x8c,0xa6,0x00,0x08, ++0x00,0x82,0x10,0x21,0x2c,0x43,0x00,0x06,0x10,0x60,0x00,0x09,0x3c,0x03,0x80,0x01, ++0x00,0x02,0x10,0x80,0x24,0x63,0x08,0x94,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0xaf,0x86,0x80,0x14, ++0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x8c,0xa4,0x00,0x00,0x0c,0x00,0x1e,0xfc,0x00,0x00,0x00,0x00,0x08,0x00,0x01,0xdc, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x2b,0x59,0x00,0xc0,0x20,0x21,0x08,0x00,0x01,0xdc, ++0x00,0x00,0x00,0x00,0x87,0x83,0x88,0x06,0x93,0x82,0x80,0x18,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x08,0x00,0x00,0x00,0x00,0x93,0x83,0x88,0x07,0x24,0x02,0x00,0x01, ++0xa3,0x82,0x80,0x11,0xa3,0x83,0x80,0x19,0xa3,0x83,0x80,0x18,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x93,0x82,0x80,0x19,0x00,0x00,0x00,0x00,0x14,0x62,0xff,0xf6, ++0x00,0x00,0x00,0x00,0x08,0x00,0x01,0xf3,0x00,0x00,0x00,0x00,0x30,0x84,0x00,0xff, ++0x14,0x80,0x00,0x2f,0x00,0x00,0x00,0x00,0x8f,0x82,0x80,0x14,0xa3,0x85,0x8b,0xcb, ++0x10,0x40,0x00,0x2b,0x2c,0xa2,0x00,0x04,0x14,0x40,0x00,0x06,0x00,0x05,0x10,0x40, ++0x24,0xa2,0xff,0xfc,0x2c,0x42,0x00,0x08,0x10,0x40,0x00,0x09,0x24,0xa2,0xff,0xf0, ++0x00,0x05,0x10,0x40,0x27,0x84,0x8b,0xd4,0x00,0x44,0x10,0x21,0x94,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08,0xa4,0x43,0x00,0x00, ++0x2c,0x42,0x00,0x10,0x14,0x40,0x00,0x0a,0x00,0x05,0x10,0x40,0x24,0xa2,0xff,0xe0, ++0x2c,0x42,0x00,0x10,0x14,0x40,0x00,0x06,0x00,0x05,0x10,0x40,0x24,0xa2,0xff,0xd0, ++0x2c,0x42,0x00,0x10,0x10,0x40,0x00,0x09,0x24,0xa2,0xff,0xc0,0x00,0x05,0x10,0x40, ++0x27,0x84,0x8b,0xd4,0x00,0x44,0x10,0x21,0x94,0x43,0xff,0xf8,0x00,0x00,0x00,0x00, ++0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08,0xa4,0x43,0xff,0xf8,0x2c,0x42,0x00,0x10, ++0x10,0x40,0x00,0x07,0x00,0x05,0x10,0x40,0x27,0x84,0x8b,0xd4,0x00,0x44,0x10,0x21, ++0x94,0x43,0xff,0xf8,0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0xa4,0x43,0xff,0xf8, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8f,0x86,0x94,0xa0,0x8f,0x82,0x80,0x14, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x10,0x40,0x00,0x2a,0x00,0xc0,0x38,0x21, ++0x24,0x02,0x00,0x07,0x24,0x03,0xff,0x9c,0xa3,0x82,0x8b,0xd3,0xa3,0x83,0x8b,0xd2, ++0x27,0x8a,0x8b,0xd0,0x00,0x00,0x20,0x21,0x24,0x09,0x8f,0xff,0x00,0x04,0x10,0x80, ++0x00,0x4a,0x28,0x21,0x8c,0xa2,0x00,0x00,0x24,0xe3,0x00,0x04,0x24,0x88,0x00,0x01, ++0xac,0xe2,0x00,0x00,0x10,0x80,0x00,0x02,0x00,0x69,0x38,0x24,0xac,0xa0,0x00,0x00, ++0x31,0x04,0x00,0xff,0x2c,0x82,0x00,0x27,0x14,0x40,0xff,0xf5,0x00,0x04,0x10,0x80, ++0x97,0x83,0x94,0xa6,0x97,0x85,0x94,0xa4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x9c, ++0x00,0xa2,0x28,0x21,0x3c,0x04,0xb0,0x06,0xa7,0x83,0x94,0xa6,0x34,0x84,0x80,0x18, ++0xa4,0xa3,0x00,0x00,0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x9c, ++0x3c,0x03,0x0f,0x00,0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00, ++0xaf,0x86,0x94,0xa0,0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x8e, ++0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x8f,0x86,0x94,0xa0,0x27,0xbd,0xff,0xc8,0x24,0x02,0x00,0x08, ++0x24,0x03,0x00,0x20,0xaf,0xbf,0x00,0x30,0xa3,0xa2,0x00,0x13,0xa3,0xa3,0x00,0x12, ++0xa7,0xa4,0x00,0x10,0x00,0xc0,0x28,0x21,0x27,0xa9,0x00,0x10,0x00,0x00,0x38,0x21, ++0x24,0x08,0x8f,0xff,0x00,0x07,0x10,0x80,0x00,0x49,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x24,0xe3,0x00,0x01,0x30,0x67,0x00,0xff,0x24,0xa2,0x00,0x04,0x2c,0xe3,0x00,0x08, ++0xac,0xa4,0x00,0x00,0x14,0x60,0xff,0xf7,0x00,0x48,0x28,0x24,0x97,0x83,0x94,0xa6, ++0x97,0x85,0x94,0xa4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x20,0x00,0xa2,0x28,0x21, ++0x3c,0x04,0xb0,0x06,0xa7,0x83,0x94,0xa6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00, ++0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x20,0x3c,0x03,0x0f,0x00, ++0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x86,0x94,0xa0, ++0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x30,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38, ++0x93,0x82,0x94,0xb0,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x11,0x24,0x06,0x00,0x01, ++0x8f,0x82,0x94,0xa8,0x3c,0x05,0xb0,0x06,0x3c,0x04,0xb0,0x03,0x34,0xa5,0x80,0x18, ++0x34,0x84,0x01,0x08,0x14,0x40,0x00,0x09,0x00,0x00,0x30,0x21,0x97,0x82,0x94,0xa4, ++0x8c,0x84,0x00,0x00,0x3c,0x03,0xb0,0x02,0x00,0x43,0x10,0x21,0xaf,0x84,0x94,0xac, ++0xa7,0x80,0x94,0xa6,0xac,0x40,0x00,0x00,0xac,0x40,0x00,0x04,0x8c,0xa2,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0xc0,0x10,0x21,0x8f,0x86,0x94,0xa0,0x8f,0x82,0x94,0xa8, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x00,0xc0,0x40,0x21,0x14,0x40,0x00,0x0a, ++0x00,0x40,0x50,0x21,0x00,0x00,0x38,0x21,0x27,0x89,0x8b,0xa0,0x24,0xe2,0x00,0x01, ++0x00,0x07,0x18,0x80,0x30,0x47,0x00,0xff,0x00,0x69,0x18,0x21,0x2c,0xe2,0x00,0x0a, ++0x14,0x40,0xff,0xfa,0xac,0x60,0x00,0x00,0x3c,0x02,0x00,0x80,0x10,0x82,0x00,0x6f, ++0x00,0x00,0x00,0x00,0x97,0x82,0x8b,0xa6,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x8b,0xa6,0x90,0xa3,0x00,0x15,0x97,0x82,0x8b,0xa8,0x00,0x03,0x1e,0x00, ++0x00,0x03,0x1e,0x03,0x00,0x43,0x10,0x21,0xa7,0x82,0x8b,0xa8,0x8c,0xa4,0x00,0x20, ++0x3c,0x02,0x00,0x60,0x3c,0x03,0x00,0x20,0x00,0x82,0x20,0x24,0x10,0x83,0x00,0x54, ++0x00,0x00,0x00,0x00,0x14,0x80,0x00,0x47,0x00,0x00,0x00,0x00,0x97,0x82,0x8b,0xac, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x8b,0xac,0x84,0xa3,0x00,0x06, ++0x8f,0x82,0x8b,0xbc,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21,0xaf,0x82,0x8b,0xbc, ++0x25,0x42,0x00,0x01,0x28,0x43,0x27,0x10,0xaf,0x82,0x94,0xa8,0x10,0x60,0x00,0x09, ++0x24,0x02,0x00,0x04,0x93,0x83,0x80,0x11,0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x05, ++0x24,0x02,0x00,0x04,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x24,0x03,0x00,0x28,0xa3,0x83,0x8b,0xa2,0xa3,0x82,0x8b,0xa3, ++0x90,0xa2,0x00,0x18,0x93,0x83,0x8b,0xcb,0x00,0x00,0x38,0x21,0x00,0x02,0x16,0x00, ++0x00,0x02,0x16,0x03,0xa7,0x82,0x8b,0xb6,0xa3,0x83,0x8b,0xc4,0x27,0x89,0x8b,0xa0, ++0x24,0x05,0x8f,0xff,0x00,0x07,0x10,0x80,0x00,0x49,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x24,0xe3,0x00,0x01,0x30,0x67,0x00,0xff,0x25,0x02,0x00,0x04,0x2c,0xe3,0x00,0x0a, ++0xad,0x04,0x00,0x00,0x14,0x60,0xff,0xf7,0x00,0x45,0x40,0x24,0x97,0x83,0x94,0xa6, ++0x97,0x85,0x94,0xa4,0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x28,0x00,0xa2,0x28,0x21, ++0x3c,0x04,0xb0,0x06,0xa7,0x83,0x94,0xa6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00, ++0x8c,0x85,0x00,0x00,0x24,0x02,0x8f,0xff,0x24,0xc6,0x00,0x28,0x3c,0x03,0x0f,0x00, ++0x00,0xc2,0x30,0x24,0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x86,0x94,0xa0, ++0x10,0xa2,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x02,0x2e,0x00,0x00,0x00,0x00,0xa3,0x80,0x80,0x11,0x08,0x00,0x02,0xdd, ++0x00,0x00,0x00,0x00,0x97,0x82,0x8b,0xae,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x8b,0xae,0x84,0xa3,0x00,0x06,0x8f,0x82,0x8b,0xc0,0x00,0x00,0x00,0x00, ++0x00,0x43,0x10,0x21,0xaf,0x82,0x8b,0xc0,0x08,0x00,0x02,0xd5,0x25,0x42,0x00,0x01, ++0x97,0x82,0x8b,0xaa,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x8b,0xaa, ++0x84,0xa3,0x00,0x06,0x8f,0x82,0x8b,0xb8,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21, ++0xaf,0x82,0x8b,0xb8,0x08,0x00,0x02,0xd5,0x25,0x42,0x00,0x01,0x97,0x82,0x8b,0xa4, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xa7,0x82,0x8b,0xa4,0x08,0x00,0x02,0xbd, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xd0,0xaf,0xbf,0x00,0x28,0x8c,0xa3,0x00,0x20, ++0x8f,0x8a,0x94,0xa0,0x3c,0x02,0x00,0x10,0x00,0x62,0x10,0x24,0x00,0xa0,0x38,0x21, ++0x01,0x40,0x48,0x21,0x10,0x40,0x00,0x3d,0x00,0x80,0x28,0x21,0x8c,0xe4,0x00,0x1c, ++0x34,0xa5,0x12,0x06,0xaf,0xa5,0x00,0x10,0x8c,0x82,0x00,0x08,0x00,0x03,0x1c,0x42, ++0x30,0x63,0x00,0x30,0x00,0x02,0x13,0x02,0x30,0x42,0x00,0x40,0x00,0x43,0x10,0x25, ++0x90,0xe6,0x00,0x10,0x90,0xe4,0x00,0x13,0x94,0xe8,0x00,0x0c,0x94,0xe3,0x00,0x1a, ++0x00,0x02,0x16,0x00,0x90,0xe7,0x00,0x12,0x00,0xa2,0x28,0x25,0x24,0x02,0x12,0x34, ++0xa7,0xa2,0x00,0x1c,0x24,0x02,0x56,0x78,0xaf,0xa5,0x00,0x10,0xa3,0xa6,0x00,0x18, ++0xa3,0xa7,0x00,0x1f,0xa7,0xa3,0x00,0x1a,0xa3,0xa4,0x00,0x19,0xa7,0xa8,0x00,0x20, ++0xa7,0xa2,0x00,0x22,0x00,0x00,0x28,0x21,0x27,0xa7,0x00,0x10,0x24,0x06,0x8f,0xff, ++0x00,0x05,0x10,0x80,0x00,0x47,0x10,0x21,0x8c,0x44,0x00,0x00,0x24,0xa3,0x00,0x01, ++0x30,0x65,0x00,0xff,0x25,0x22,0x00,0x04,0x2c,0xa3,0x00,0x05,0xad,0x24,0x00,0x00, ++0x14,0x60,0xff,0xf7,0x00,0x46,0x48,0x24,0x97,0x83,0x94,0xa6,0x97,0x85,0x94,0xa4, ++0x3c,0x02,0xb0,0x02,0x24,0x63,0x00,0x14,0x00,0xa2,0x28,0x21,0x3c,0x04,0xb0,0x06, ++0xa7,0x83,0x94,0xa6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00,0x8c,0x85,0x00,0x00, ++0x24,0x02,0x8f,0xff,0x25,0x46,0x00,0x14,0x3c,0x03,0x0f,0x00,0x00,0xc2,0x50,0x24, ++0x00,0xa3,0x28,0x24,0x3c,0x02,0x04,0x00,0xaf,0x8a,0x94,0xa0,0x10,0xa2,0x00,0x03, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x28, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30,0x3c,0x05,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xc8,0x00,0x04,0x22,0x00,0x34,0xa5,0x00,0x20, ++0x24,0x42,0x0d,0xdc,0x3c,0x03,0xb0,0x00,0xaf,0xb5,0x00,0x24,0xaf,0xb4,0x00,0x20, ++0xaf,0xb2,0x00,0x18,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x30,0x00,0x83,0x80,0x21, ++0xaf,0xb7,0x00,0x2c,0xaf,0xb6,0x00,0x28,0xaf,0xb3,0x00,0x1c,0xaf,0xb1,0x00,0x14, ++0xac,0xa2,0x00,0x00,0x8e,0x09,0x00,0x00,0x00,0x00,0x90,0x21,0x26,0x10,0x00,0x08, ++0x00,0x09,0xa6,0x02,0x12,0x80,0x00,0x13,0x00,0x00,0xa8,0x21,0x24,0x13,0x00,0x02, ++0x3c,0x16,0x00,0xff,0x3c,0x17,0xff,0x00,0x8e,0x09,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x09,0x12,0x02,0x24,0x42,0x00,0x02,0x31,0x25,0x00,0xff,0x10,0xb3,0x00,0x76, ++0x30,0x51,0x00,0xff,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x18,0x00,0x00,0x00,0x00, ++0x02,0x51,0x10,0x21,0x30,0x52,0xff,0xff,0x02,0x54,0x18,0x2b,0x14,0x60,0xff,0xf2, ++0x02,0x11,0x80,0x21,0x12,0xa0,0x00,0x0a,0x3c,0x02,0xb0,0x06,0x34,0x42,0x80,0x18, ++0x8c,0x43,0x00,0x00,0x3c,0x04,0x0f,0x00,0x3c,0x02,0x04,0x00,0x00,0x64,0x18,0x24, ++0x10,0x62,0x00,0x03,0x00,0x00,0x00,0x00,0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x30,0x7b,0xb6,0x01,0x7c,0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x8e,0x09,0x00,0x04, ++0x24,0x15,0x00,0x01,0x8e,0x06,0x00,0x0c,0x00,0x09,0x11,0x42,0x00,0x09,0x18,0xc2, ++0x30,0x48,0x00,0x03,0x00,0x09,0x14,0x02,0x30,0x6c,0x00,0x03,0x00,0x09,0x26,0x02, ++0x11,0x15,0x00,0x45,0x30,0x43,0x00,0x0f,0x29,0x02,0x00,0x02,0x14,0x40,0x00,0x26, ++0x00,0x00,0x00,0x00,0x11,0x13,0x00,0x0f,0x00,0x00,0x38,0x21,0x00,0x07,0x22,0x02, ++0x30,0x84,0xff,0x00,0x3c,0x03,0x00,0xff,0x00,0x07,0x2e,0x02,0x00,0x07,0x12,0x00, ++0x00,0x43,0x10,0x24,0x00,0xa4,0x28,0x25,0x00,0xa2,0x28,0x25,0x00,0x07,0x1e,0x00, ++0x00,0xa3,0x28,0x25,0x0c,0x00,0x01,0x92,0x01,0x20,0x20,0x21,0x08,0x00,0x03,0x9d, ++0x02,0x51,0x10,0x21,0x11,0x95,0x00,0x0f,0x00,0x00,0x00,0x00,0x11,0x88,0x00,0x07, ++0x00,0x00,0x00,0x00,0x00,0x04,0x10,0x80,0x27,0x83,0x94,0x50,0x00,0x43,0x10,0x21, ++0x8c,0x47,0x00,0x18,0x08,0x00,0x03,0xc4,0x00,0x07,0x22,0x02,0x00,0x04,0x10,0x40, ++0x27,0x83,0x94,0x58,0x00,0x43,0x10,0x21,0x94,0x47,0x00,0x02,0x08,0x00,0x03,0xc4, ++0x00,0x07,0x22,0x02,0x27,0x82,0x94,0x50,0x00,0x82,0x10,0x21,0x90,0x47,0x00,0x00, ++0x08,0x00,0x03,0xc4,0x00,0x07,0x22,0x02,0x15,0x00,0xff,0xdc,0x00,0x00,0x38,0x21, ++0x10,0x75,0x00,0x05,0x00,0x80,0x38,0x21,0x00,0x65,0x18,0x26,0x24,0x82,0x01,0x00, ++0x00,0x00,0x38,0x21,0x00,0x43,0x38,0x0a,0x24,0x02,0x00,0x01,0x11,0x82,0x00,0x0e, ++0x3c,0x02,0xb0,0x03,0x24,0x02,0x00,0x02,0x11,0x82,0x00,0x06,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x00,0xe2,0x10,0x21,0x8c,0x47,0x00,0x00,0x08,0x00,0x03,0xc4, ++0x00,0x07,0x22,0x02,0x3c,0x02,0xb0,0x03,0x00,0xe2,0x10,0x21,0x94,0x43,0x00,0x00, ++0x08,0x00,0x03,0xc3,0x30,0x67,0xff,0xff,0x00,0xe2,0x10,0x21,0x90,0x43,0x00,0x00, ++0x08,0x00,0x03,0xc3,0x30,0x67,0x00,0xff,0x30,0x62,0x00,0x03,0x00,0x02,0x12,0x00, ++0x11,0x95,0x00,0x07,0x00,0x44,0x38,0x21,0x11,0x93,0x00,0x03,0x00,0x00,0x00,0x00, ++0x08,0x00,0x03,0xf5,0x3c,0x02,0xb0,0x0a,0x08,0x00,0x03,0xfa,0x3c,0x02,0xb0,0x0a, ++0x08,0x00,0x03,0xfe,0x3c,0x02,0xb0,0x0a,0x8e,0x09,0x00,0x04,0x8e,0x02,0x00,0x08, ++0x8e,0x03,0x00,0x0c,0x00,0x09,0x41,0x42,0x00,0x02,0x22,0x02,0x00,0x03,0x3a,0x02, ++0x30,0x84,0xff,0x00,0x30,0xe7,0xff,0x00,0x00,0x02,0x5e,0x02,0x00,0x02,0x32,0x00, ++0x00,0x03,0x56,0x02,0x00,0x03,0x2a,0x00,0x01,0x64,0x58,0x25,0x00,0xd6,0x30,0x24, ++0x01,0x47,0x50,0x25,0x00,0x02,0x16,0x00,0x00,0xb6,0x28,0x24,0x00,0x03,0x1e,0x00, ++0x01,0x66,0x58,0x25,0x01,0x45,0x50,0x25,0x00,0x57,0x10,0x24,0x00,0x77,0x18,0x24, ++0x01,0x62,0x38,0x25,0x01,0x43,0x30,0x25,0x00,0x09,0x10,0xc2,0x00,0x09,0x1c,0x02, ++0x31,0x08,0x00,0x03,0x30,0x4c,0x00,0x03,0x30,0x63,0x00,0x0f,0x00,0x09,0x26,0x02, ++0x00,0xe0,0x58,0x21,0x15,0x00,0x00,0x28,0x00,0xc0,0x50,0x21,0x24,0x02,0x00,0x01, ++0x10,0x62,0x00,0x06,0x00,0x80,0x28,0x21,0x24,0x02,0x00,0x03,0x14,0x62,0xff,0x69, ++0x02,0x51,0x10,0x21,0x24,0x85,0x01,0x00,0x24,0x02,0x00,0x01,0x11,0x82,0x00,0x15, ++0x24,0x02,0x00,0x02,0x11,0x82,0x00,0x0a,0x3c,0x03,0xb0,0x03,0x00,0xa3,0x18,0x21, ++0x8c,0x62,0x00,0x00,0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24,0x00,0x44,0x10,0x24, ++0x00,0x45,0x10,0x25,0xac,0x62,0x00,0x00,0x08,0x00,0x03,0x9d,0x02,0x51,0x10,0x21, ++0x00,0xa3,0x18,0x21,0x94,0x62,0x00,0x00,0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24, ++0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25,0xa4,0x62,0x00,0x00,0x08,0x00,0x03,0x9d, ++0x02,0x51,0x10,0x21,0x3c,0x03,0xb0,0x03,0x00,0xa3,0x18,0x21,0x90,0x62,0x00,0x00, ++0x00,0x0a,0x20,0x27,0x01,0x6a,0x28,0x24,0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25, ++0x08,0x00,0x03,0x9c,0xa0,0x62,0x00,0x00,0x24,0x02,0x00,0x01,0x11,0x02,0x00,0x21, ++0x00,0x00,0x00,0x00,0x15,0x13,0xff,0x42,0x00,0x00,0x00,0x00,0x11,0x82,0x00,0x17, ++0x00,0x00,0x00,0x00,0x11,0x88,0x00,0x0b,0x00,0x00,0x00,0x00,0x27,0x83,0x94,0x50, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x18,0x00,0x06,0x18,0x27, ++0x00,0xe6,0x28,0x24,0x00,0x43,0x10,0x24,0x00,0x45,0x10,0x25,0x08,0x00,0x03,0x9c, ++0xac,0x82,0x00,0x18,0x27,0x83,0x94,0x58,0x00,0x04,0x20,0x40,0x00,0x83,0x20,0x21, ++0x94,0x82,0x00,0x02,0x00,0x06,0x18,0x27,0x00,0xe6,0x28,0x24,0x00,0x43,0x10,0x24, ++0x00,0x45,0x10,0x25,0x08,0x00,0x03,0x9c,0xa4,0x82,0x00,0x02,0x27,0x83,0x94,0x50, ++0x00,0x83,0x18,0x21,0x90,0x62,0x00,0x00,0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x52, ++0x00,0xe6,0x28,0x24,0x30,0x62,0x00,0x07,0x00,0x02,0x12,0x00,0x11,0x88,0x00,0x0f, ++0x00,0x44,0x10,0x21,0x11,0x93,0x00,0x07,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a, ++0x00,0x43,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x3f, ++0x00,0xe6,0x28,0x24,0x3c,0x03,0xb0,0x0a,0x00,0x43,0x18,0x21,0x94,0x62,0x00,0x00, ++0x00,0x06,0x20,0x27,0x08,0x00,0x04,0x48,0x00,0xe6,0x28,0x24,0x3c,0x03,0xb0,0x0a, ++0x08,0x00,0x04,0x75,0x00,0x43,0x18,0x21,0x97,0x85,0x94,0xa4,0x3c,0x07,0xb0,0x02, ++0x3c,0x04,0xb0,0x03,0x3c,0x02,0x80,0x00,0x00,0xa7,0x28,0x21,0x34,0x84,0x00,0x20, ++0x24,0x42,0x12,0x38,0x24,0x03,0xff,0x80,0xac,0x82,0x00,0x00,0xa0,0xa3,0x00,0x07, ++0x97,0x82,0x94,0xa6,0x97,0x85,0x94,0xa4,0x3c,0x06,0xb0,0x06,0x30,0x42,0xff,0xf8, ++0x24,0x42,0x00,0x10,0x00,0xa2,0x10,0x21,0x30,0x42,0x0f,0xff,0x24,0x44,0x00,0x08, ++0x30,0x84,0x0f,0xff,0x00,0x05,0x28,0xc2,0x3c,0x03,0x00,0x40,0x00,0xa3,0x28,0x25, ++0x00,0x87,0x20,0x21,0x34,0xc6,0x80,0x18,0xac,0xc5,0x00,0x00,0xaf,0x84,0x94,0xa0, ++0xa7,0x82,0x94,0xa4,0xa7,0x80,0x94,0xa6,0xaf,0x80,0x94,0xa8,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa5,0x00,0xff,0x30,0x84,0x00,0xff,0x24,0x02,0x00,0x01, ++0x00,0xe0,0x48,0x21,0x30,0xc6,0x00,0xff,0x8f,0xa7,0x00,0x10,0x10,0x82,0x00,0x07, ++0x00,0xa0,0x40,0x21,0x24,0x02,0x00,0x03,0x10,0x82,0x00,0x03,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x24,0xa8,0x01,0x00,0x3c,0x03,0xb0,0x03, ++0x24,0x02,0x00,0x01,0x00,0x07,0x20,0x27,0x01,0x27,0x28,0x24,0x10,0xc2,0x00,0x14, ++0x01,0x03,0x18,0x21,0x24,0x02,0x00,0x02,0x10,0xc2,0x00,0x09,0x00,0x07,0x50,0x27, ++0x3c,0x03,0xb0,0x03,0x01,0x03,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x45,0x10,0x25,0x08,0x00,0x04,0xd9,0xac,0x62,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x01,0x03,0x18,0x21,0x94,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x45,0x10,0x25,0x03,0xe0,0x00,0x08,0xa4,0x62,0x00,0x00, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x24,0x00,0x45,0x10,0x25, ++0xa0,0x62,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0x84,0x00,0x07, ++0x00,0x04,0x22,0x00,0x30,0xa5,0x00,0xff,0x00,0x85,0x28,0x21,0x3c,0x02,0xb0,0x0a, ++0x00,0xa2,0x40,0x21,0x30,0xc6,0x00,0xff,0x24,0x02,0x00,0x01,0x8f,0xa4,0x00,0x10, ++0x10,0xc2,0x00,0x14,0x24,0x02,0x00,0x02,0x00,0x04,0x50,0x27,0x10,0xc2,0x00,0x09, ++0x00,0xe4,0x48,0x24,0x3c,0x03,0xb0,0x0a,0x00,0xa3,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4a,0x10,0x24,0x00,0x49,0x10,0x25,0x03,0xe0,0x00,0x08, ++0xac,0x62,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x00,0xa3,0x18,0x21,0x94,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x4a,0x10,0x24,0x00,0x49,0x10,0x25,0x03,0xe0,0x00,0x08, ++0xa4,0x62,0x00,0x00,0x91,0x02,0x00,0x00,0x00,0x04,0x18,0x27,0x00,0xe4,0x20,0x24, ++0x00,0x43,0x10,0x24,0x00,0x44,0x10,0x25,0x03,0xe0,0x00,0x08,0xa1,0x02,0x00,0x00, ++0x30,0xa9,0x00,0xff,0x27,0x83,0x94,0x50,0x30,0x85,0x00,0xff,0x24,0x02,0x00,0x01, ++0x00,0x07,0x50,0x27,0x00,0xc7,0x40,0x24,0x11,0x22,0x00,0x17,0x00,0xa3,0x18,0x21, ++0x00,0x05,0x20,0x40,0x27,0x82,0x94,0x50,0x00,0x05,0x28,0x80,0x27,0x83,0x94,0x58, ++0x00,0x83,0x50,0x21,0x00,0xa2,0x20,0x21,0x24,0x02,0x00,0x02,0x00,0x07,0x40,0x27, ++0x11,0x22,0x00,0x07,0x00,0xc7,0x28,0x24,0x8c,0x82,0x00,0x18,0x00,0x00,0x00,0x00, ++0x00,0x48,0x10,0x24,0x00,0x45,0x10,0x25,0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x18, ++0x95,0x42,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x48,0x10,0x24,0x00,0x45,0x10,0x25, ++0x03,0xe0,0x00,0x08,0xa5,0x42,0x00,0x02,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x4a,0x10,0x24,0x00,0x48,0x10,0x25,0x03,0xe0,0x00,0x08,0xa0,0x62,0x00,0x00, ++0x00,0x04,0x32,0x02,0x30,0xc6,0xff,0x00,0x00,0x04,0x16,0x02,0x00,0x04,0x1a,0x00, ++0x3c,0x05,0x00,0xff,0x00,0x65,0x18,0x24,0x00,0x46,0x10,0x25,0x00,0x43,0x10,0x25, ++0x00,0x04,0x26,0x00,0x03,0xe0,0x00,0x08,0x00,0x44,0x10,0x25,0x3c,0x02,0xb0,0x02, ++0x34,0x42,0x00,0x08,0x3c,0x03,0xb0,0x02,0xaf,0x82,0x8c,0x78,0xaf,0x83,0x8c,0x7c, ++0xa7,0x80,0x8c,0x80,0xa7,0x80,0x8c,0x82,0xaf,0x80,0x8c,0x84,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xd8,0xaf,0xbf,0x00,0x20,0x94,0x82,0x00,0x04, ++0x3c,0x05,0xff,0x8f,0x00,0x80,0x18,0x21,0x30,0x42,0xe0,0x00,0x14,0x40,0x00,0x0a, ++0x34,0xa5,0xff,0xff,0x90,0x84,0x00,0x02,0x00,0x00,0x00,0x00,0x30,0x84,0x00,0xfc, ++0x00,0x64,0x20,0x21,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x10,0x2b, ++0x10,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x20,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x0c,0x00,0x07,0xc9,0x00,0x00,0x00,0x00, ++0x08,0x00,0x05,0x4a,0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xd8,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c, ++0x8f,0x90,0x94,0xa0,0x0c,0x00,0x30,0x54,0x00,0x80,0x90,0x21,0x00,0x40,0x88,0x21, ++0x93,0x82,0x82,0x28,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x1b,0x24,0x02,0x00,0x01, ++0xa3,0x82,0x82,0x28,0x24,0x03,0x00,0x05,0x24,0x02,0x00,0x04,0xa3,0x83,0x8c,0x73, ++0xa3,0x82,0x8c,0x72,0xa7,0x80,0x82,0x2a,0x00,0x00,0x28,0x21,0x27,0x86,0x8c,0x70, ++0x00,0x05,0x10,0x80,0x00,0x46,0x10,0x21,0x8c,0x44,0x00,0x00,0x24,0xa3,0x00,0x01, ++0x30,0x65,0xff,0xff,0xae,0x04,0x00,0x00,0x10,0xa0,0xff,0xfa,0x00,0x05,0x10,0x80, ++0x8f,0x83,0x94,0xa0,0x97,0x82,0x94,0xa6,0x24,0x05,0x8f,0xff,0x24,0x63,0x00,0x04, ++0x00,0x65,0x18,0x24,0x26,0x04,0x00,0x04,0x24,0x42,0x00,0x04,0xaf,0x83,0x94,0xa0, ++0xa7,0x82,0x94,0xa6,0x00,0x85,0x80,0x24,0x97,0x84,0x82,0x2a,0x27,0x93,0x80,0x34, ++0x02,0x40,0x28,0x21,0x00,0x93,0x20,0x21,0x0c,0x00,0x30,0xd8,0x02,0x20,0x30,0x21, ++0x97,0x87,0x82,0x2a,0x24,0x02,0x00,0x52,0x00,0xf1,0x18,0x21,0xa7,0x83,0x82,0x2a, ++0x82,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x82,0x00,0x06,0x00,0x60,0x38,0x21, ++0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x28,0x82,0x43,0x00,0x01,0x24,0x02,0x00,0x54,0x14,0x62,0xff,0xf8, ++0x24,0x02,0x00,0x4c,0x82,0x43,0x00,0x02,0x00,0x00,0x00,0x00,0x14,0x62,0xff,0xf4, ++0x00,0x00,0x00,0x00,0x30,0xe6,0xff,0xff,0x10,0xc0,0x00,0x0c,0x00,0x00,0x28,0x21, ++0x02,0x60,0x48,0x21,0x24,0x08,0x8f,0xff,0x00,0xa9,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x24,0xa3,0x00,0x04,0x30,0x65,0xff,0xff,0x26,0x02,0x00,0x04,0x00,0xa6,0x18,0x2b, ++0xae,0x04,0x00,0x00,0x14,0x60,0xff,0xf8,0x00,0x48,0x80,0x24,0x97,0x83,0x94,0xa6, ++0x97,0x85,0x94,0xa4,0x3c,0x02,0xb0,0x02,0x00,0x67,0x18,0x21,0x00,0xa2,0x28,0x21, ++0x3c,0x04,0xb0,0x06,0xa7,0x83,0x94,0xa6,0x34,0x84,0x80,0x18,0xa4,0xa3,0x00,0x00, ++0x8f,0x82,0x94,0xa0,0x8c,0x86,0x00,0x00,0x30,0xe5,0xff,0xff,0x24,0x03,0x8f,0xff, ++0x00,0x45,0x10,0x21,0x3c,0x04,0x0f,0x00,0x00,0x43,0x10,0x24,0x00,0xc4,0x30,0x24, ++0x3c,0x03,0x04,0x00,0xaf,0x82,0x94,0xa0,0x10,0xc3,0xff,0xd1,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x04,0x8e,0x00,0x00,0x00,0x00,0xa3,0x80,0x82,0x28,0x08,0x00,0x05,0x88, ++0x00,0x00,0x00,0x00,0x8f,0x82,0x8c,0x7c,0x97,0x83,0x8c,0x80,0x8f,0x87,0x8c,0x78, ++0x3c,0x06,0xff,0xff,0xac,0x43,0x00,0x00,0x8f,0x82,0x8c,0x7c,0x3c,0x03,0x80,0x00, ++0x24,0xe5,0x00,0x08,0xac,0x43,0x00,0x04,0x8f,0x82,0x8c,0x7c,0x34,0xc6,0x1f,0xff, ++0x3c,0x03,0x00,0x40,0x30,0x42,0x0f,0xff,0x3c,0x04,0xb0,0x06,0x00,0x02,0x10,0xc2, ++0x00,0x43,0x10,0x25,0x00,0xa6,0x28,0x24,0x34,0x84,0x80,0x18,0x27,0xbd,0xff,0xf8, ++0xac,0x82,0x00,0x00,0xaf,0x85,0x8c,0x78,0xaf,0x87,0x8c,0x7c,0xa7,0x80,0x8c,0x80, ++0xa7,0x80,0x8c,0x82,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x08,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe0, ++0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0x8f,0x91,0x8c,0x78, ++0x00,0x80,0x80,0x21,0xaf,0xbf,0x00,0x1c,0x0c,0x00,0x06,0x78,0x00,0xa0,0x90,0x21, ++0x97,0x82,0x8c,0x80,0x36,0x10,0x12,0x00,0x26,0x2a,0x00,0x04,0x24,0x4c,0x00,0x14, ++0x2c,0x42,0x04,0x01,0x14,0x40,0x00,0x0a,0x24,0x09,0x8f,0xff,0x8f,0x82,0x80,0x20, ++0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xaf,0x82,0x80,0x20,0x8f,0xbf,0x00,0x1c, ++0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x8e,0x44,0x00,0x1c,0x86,0x47,0x00,0x06,0x97,0x86,0x8c,0x82,0x8c,0x82,0x00,0x08, ++0x00,0x07,0x3c,0x00,0x8f,0x85,0x8c,0x78,0x00,0x02,0x11,0x02,0x30,0x42,0x40,0x00, ++0x02,0x02,0x80,0x25,0xae,0x30,0x00,0x00,0x8c,0x82,0x00,0x04,0x82,0x43,0x00,0x15, ++0x01,0x49,0x88,0x24,0x00,0x02,0x14,0xc2,0x00,0x03,0x1a,0x00,0x00,0x02,0x14,0x00, ++0x00,0x62,0x80,0x25,0xae,0x30,0x00,0x00,0x92,0x43,0x00,0x13,0x92,0x44,0x00,0x10, ++0x96,0x50,0x00,0x1a,0x00,0x03,0x1c,0x00,0x00,0x04,0x26,0x00,0x02,0x03,0x80,0x25, ++0x26,0x22,0x00,0x04,0x00,0x49,0x88,0x24,0x02,0x04,0x80,0x25,0xae,0x30,0x00,0x00, ++0x92,0x42,0x00,0x0f,0x92,0x43,0x00,0x11,0x26,0x24,0x00,0x04,0x00,0x02,0x12,0x00, ++0x00,0x89,0x88,0x24,0x00,0x62,0x80,0x25,0x02,0x07,0x80,0x25,0x26,0x22,0x00,0x04, ++0xae,0x30,0x00,0x00,0x00,0x49,0x88,0x24,0xae,0x20,0x00,0x00,0x8f,0x82,0x80,0x1c, ++0x24,0xc6,0x00,0x01,0x24,0xa5,0x00,0x14,0x30,0xc8,0xff,0xff,0x3c,0x0b,0xb0,0x03, ++0x00,0xa9,0x28,0x24,0x24,0x42,0x00,0x01,0x2d,0x08,0x00,0x0a,0xaf,0x85,0x8c,0x78, ++0xa7,0x8c,0x8c,0x80,0xaf,0x82,0x80,0x1c,0xa7,0x86,0x8c,0x82,0x11,0x00,0x00,0x07, ++0x35,0x6b,0x01,0x08,0x8f,0x82,0x8c,0x84,0x8d,0x63,0x00,0x00,0x24,0x42,0x04,0x00, ++0x00,0x62,0x18,0x2b,0x14,0x60,0xff,0xc1,0x00,0x00,0x00,0x00,0x0c,0x00,0x05,0xbd, ++0x00,0x00,0x00,0x00,0x08,0x00,0x05,0xf3,0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe8, ++0xaf,0xbf,0x00,0x10,0x0c,0x00,0x06,0x78,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x27,0xbd,0xff,0xe0, ++0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x1c, ++0x8f,0x90,0x8c,0x78,0x0c,0x00,0x06,0x78,0x00,0x80,0x90,0x21,0x97,0x82,0x8c,0x80, ++0x24,0x11,0x8f,0xff,0x2c,0x42,0x04,0x01,0x14,0x40,0x00,0x06,0x26,0x03,0x00,0x04, ++0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x24,0x02,0x0e,0x03,0xae,0x02,0x00,0x00,0x00,0x71,0x80,0x24, ++0xae,0x00,0x00,0x00,0x8e,0x44,0x00,0x08,0x26,0x02,0x00,0x04,0x0c,0x00,0x06,0x86, ++0x00,0x51,0x80,0x24,0x97,0x86,0x8c,0x82,0x8f,0x83,0x8c,0x78,0xae,0x02,0x00,0x00, ++0x97,0x82,0x8c,0x80,0x24,0xc6,0x00,0x01,0x8e,0x47,0x00,0x0c,0x24,0x63,0x00,0x10, ++0x30,0xc5,0xff,0xff,0x26,0x04,0x00,0x04,0x3c,0x08,0xb0,0x03,0x00,0x71,0x18,0x24, ++0x00,0x91,0x80,0x24,0x24,0x42,0x00,0x10,0x2c,0xa5,0x00,0x0a,0x35,0x08,0x01,0x08, ++0xae,0x07,0x00,0x00,0xaf,0x83,0x8c,0x78,0xa7,0x82,0x8c,0x80,0xa7,0x86,0x8c,0x82, ++0x10,0xa0,0x00,0x07,0x00,0x00,0x00,0x00,0x8f,0x82,0x8c,0x84,0x8d,0x03,0x00,0x00, ++0x24,0x42,0x04,0x00,0x00,0x62,0x18,0x2b,0x14,0x60,0xff,0xd9,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x05,0xbd,0x00,0x00,0x00,0x00,0x08,0x00,0x06,0x4c,0x00,0x00,0x00,0x00, ++0x97,0x82,0x8c,0x82,0x3c,0x03,0xb0,0x03,0x14,0x40,0x00,0x09,0x34,0x63,0x01,0x08, ++0x8c,0x62,0x00,0x00,0x8f,0x83,0x8c,0x7c,0xa7,0x80,0x8c,0x80,0xaf,0x82,0x8c,0x84, ++0xac,0x60,0x00,0x00,0x8f,0x82,0x8c,0x7c,0x00,0x00,0x00,0x00,0xac,0x40,0x00,0x04, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x32,0x02,0x30,0xc6,0xff,0x00, ++0x00,0x04,0x16,0x02,0x00,0x04,0x1a,0x00,0x3c,0x05,0x00,0xff,0x00,0x65,0x18,0x24, ++0x00,0x46,0x10,0x25,0x00,0x43,0x10,0x25,0x00,0x04,0x26,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x44,0x10,0x25,0x80,0x82,0x00,0x00,0x90,0x83,0x00,0x00,0x10,0x40,0x00,0x0c, ++0x00,0x80,0x28,0x21,0x24,0x62,0xff,0x9f,0x30,0x42,0x00,0xff,0x2c,0x42,0x00,0x1a, ++0x10,0x40,0x00,0x02,0x24,0x63,0xff,0xe0,0xa0,0xa3,0x00,0x00,0x24,0xa5,0x00,0x01, ++0x90,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xf6,0x00,0x40,0x18,0x21, ++0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x80,0x82,0x00,0x00,0x90,0x83,0x00,0x00, ++0x10,0x40,0x00,0x0c,0x00,0x80,0x28,0x21,0x24,0x62,0xff,0xbf,0x30,0x42,0x00,0xff, ++0x2c,0x42,0x00,0x1a,0x10,0x40,0x00,0x02,0x24,0x63,0x00,0x20,0xa0,0xa3,0x00,0x00, ++0x24,0xa5,0x00,0x01,0x90,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xf6, ++0x00,0x40,0x18,0x21,0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x27,0xbd,0xff,0xe8, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0x24,0x10,0xff,0xff,0x0c,0x00,0x2d,0x94, ++0x00,0x00,0x00,0x00,0x10,0x50,0xff,0xfd,0x00,0x02,0x16,0x00,0x00,0x02,0x16,0x03, ++0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x27,0xbd,0xff,0xc8,0xaf,0xb3,0x00,0x1c,0x00,0x00,0x98,0x21,0xaf,0xb1,0x00,0x14, ++0x02,0x65,0x88,0x2b,0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x34,0xaf,0xbe,0x00,0x30,0xaf,0xb7,0x00,0x2c,0xaf,0xb4,0x00,0x20, ++0xaf,0xb2,0x00,0x18,0x00,0xa0,0xb0,0x21,0xaf,0xa4,0x00,0x38,0x00,0xc0,0xa8,0x21, ++0x12,0x20,0x00,0x17,0x00,0x80,0x80,0x21,0x24,0x17,0xff,0xff,0x24,0x1e,0x00,0x0a, ++0x0c,0x00,0x2d,0x94,0x00,0x00,0x00,0x00,0x10,0x57,0x00,0x0f,0x00,0x02,0x16,0x00, ++0x00,0x02,0x26,0x03,0x10,0x9e,0x00,0x0e,0x24,0x02,0x00,0x0d,0x10,0x82,0x00,0x34, ++0x24,0x02,0x00,0x08,0x10,0x82,0x00,0x25,0x24,0x02,0x00,0x09,0x10,0x82,0x00,0x13, ++0x00,0x00,0x90,0x21,0xa2,0x04,0x00,0x00,0x26,0x73,0x00,0x01,0x16,0xa0,0x00,0x0b, ++0x26,0x10,0x00,0x01,0x02,0x76,0x88,0x2b,0x16,0x20,0xff,0xed,0x00,0x00,0x00,0x00, ++0x7b,0xbe,0x01,0xbc,0x7b,0xb6,0x01,0x7c,0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x0c,0x00,0x2d,0x87, ++0x02,0x76,0x88,0x2b,0x08,0x00,0x06,0xe6,0x00,0x00,0x00,0x00,0x24,0x14,0x00,0x20, ++0xa2,0x14,0x00,0x00,0x26,0x52,0x00,0x01,0x24,0x04,0x00,0x20,0x26,0x73,0x00,0x01, ++0x16,0xa0,0x00,0x06,0x26,0x10,0x00,0x01,0x2a,0x42,0x00,0x08,0x10,0x40,0xff,0xea, ++0x02,0x76,0x88,0x2b,0x08,0x00,0x06,0xf5,0xa2,0x14,0x00,0x00,0x0c,0x00,0x2d,0x87, ++0x00,0x00,0x00,0x00,0x08,0x00,0x06,0xfb,0x2a,0x42,0x00,0x08,0x8f,0xa2,0x00,0x38, ++0x00,0x00,0x00,0x00,0x12,0x02,0xff,0xe0,0x00,0x00,0x00,0x00,0x26,0x10,0xff,0xff, ++0x12,0xa0,0xff,0xdc,0x26,0x73,0xff,0xff,0x0c,0x00,0x2d,0x87,0x24,0x04,0x00,0x08, ++0x0c,0x00,0x2d,0x87,0x24,0x04,0x00,0x20,0x08,0x00,0x06,0xef,0x24,0x04,0x00,0x08, ++0x08,0x00,0x06,0xe8,0xa2,0x00,0x00,0x00,0x90,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x02,0x1e,0x00,0x10,0x60,0x00,0x16,0x00,0x00,0x30,0x21,0x24,0x07,0x00,0x20, ++0x00,0x03,0x1e,0x03,0x10,0x67,0x00,0x17,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x15, ++0x00,0x00,0x00,0x00,0x10,0x67,0x00,0x0b,0x24,0xc6,0x00,0x01,0x10,0x60,0x00,0x0a, ++0x00,0x02,0x1e,0x00,0x24,0x05,0x00,0x20,0x24,0x84,0x00,0x01,0x80,0x83,0x00,0x00, ++0x90,0x82,0x00,0x00,0x10,0x65,0x00,0x03,0x00,0x00,0x00,0x00,0x14,0x60,0xff,0xfa, ++0x00,0x00,0x00,0x00,0x00,0x02,0x1e,0x00,0x14,0x60,0xff,0xed,0x00,0x00,0x00,0x00, ++0x28,0xc3,0x00,0x08,0x24,0x02,0x00,0x07,0x00,0x43,0x30,0x0a,0x03,0xe0,0x00,0x08, ++0x00,0xc0,0x10,0x21,0x24,0x84,0x00,0x01,0x90,0x82,0x00,0x00,0x08,0x00,0x07,0x2a, ++0x00,0x02,0x1e,0x00,0x27,0xbd,0xff,0xe0,0xaf,0xb1,0x00,0x14,0x27,0x91,0x8c,0x88, ++0xaf,0xb0,0x00,0x10,0x24,0x06,0x00,0x20,0x00,0x80,0x80,0x21,0x00,0x00,0x28,0x21, ++0xaf,0xbf,0x00,0x18,0x0c,0x00,0x30,0xce,0x02,0x20,0x20,0x21,0x82,0x02,0x00,0x00, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x1f,0x00,0x00,0x30,0x21,0x02,0x20,0x20,0x21, ++0x24,0x09,0x00,0x20,0x24,0x08,0x00,0x20,0x24,0x07,0x00,0x08,0xac,0x90,0x00,0x00, ++0x82,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x49,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x08,0x24,0x03,0x00,0x20,0x26,0x10,0x00,0x01,0x82,0x02,0x00,0x00, ++0x00,0x00,0x00,0x00,0x10,0x43,0x00,0x03,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfa, ++0x00,0x00,0x00,0x00,0xa2,0x00,0x00,0x00,0x26,0x10,0x00,0x01,0x82,0x02,0x00,0x00, ++0x92,0x03,0x00,0x00,0x10,0x48,0x00,0x0c,0x24,0x05,0x00,0x20,0x24,0xc6,0x00,0x01, ++0x10,0xc7,0x00,0x04,0x24,0x84,0x00,0x04,0x00,0x03,0x16,0x00,0x14,0x40,0xff,0xe7, ++0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x27,0x82,0x8c,0x88, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x26,0x10,0x00,0x01,0x82,0x02,0x00,0x00, ++0x92,0x03,0x00,0x00,0x10,0x45,0xff,0xfc,0x00,0x00,0x00,0x00,0x08,0x00,0x07,0x5c, ++0x24,0xc6,0x00,0x01,0x00,0x80,0x30,0x21,0x90,0x84,0x00,0x00,0x00,0x00,0x38,0x21, ++0x10,0x80,0x00,0x19,0x24,0xc6,0x00,0x01,0x24,0x82,0xff,0xd0,0x30,0x42,0x00,0xff, ++0x2c,0x43,0x00,0x0a,0x14,0x60,0x00,0x0c,0x00,0x07,0x19,0x00,0x24,0x83,0xff,0x9f, ++0x24,0x82,0xff,0xa9,0x24,0x88,0xff,0xc9,0x2c,0x63,0x00,0x06,0x24,0x84,0xff,0xbf, ++0x2c,0x84,0x00,0x06,0x14,0x60,0x00,0x03,0x30,0x42,0x00,0xff,0x10,0x80,0x00,0x0e, ++0x31,0x02,0x00,0xff,0x00,0x07,0x19,0x00,0x00,0x62,0x18,0x21,0x00,0x67,0x10,0x2b, ++0x14,0x40,0x00,0x07,0x00,0x00,0x20,0x21,0x90,0xc4,0x00,0x00,0x00,0x60,0x38,0x21, ++0x14,0x80,0xff,0xe9,0x24,0xc6,0x00,0x01,0xac,0xa7,0x00,0x00,0x24,0x04,0x00,0x01, ++0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x08,0x00,0x07,0x8c,0x00,0x00,0x20,0x21, ++0x00,0x00,0x20,0x21,0x27,0x85,0x94,0xc0,0x24,0x82,0x00,0x01,0x00,0x04,0x18,0x80, ++0x30,0x44,0x00,0xff,0x00,0x65,0x18,0x21,0x2c,0x82,0x00,0x0b,0x14,0x40,0xff,0xfa, ++0xac,0x60,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0xaf,0x84,0x8d,0x08, ++0xaf,0x85,0x8d,0x0c,0xaf,0x86,0x8d,0x10,0xaf,0x87,0x8d,0x14,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x8f,0x82,0x84,0x98,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10, ++0x2c,0x43,0x00,0x64,0x24,0x42,0x00,0x01,0x27,0x84,0x8c,0xa8,0xaf,0x82,0x84,0x98, ++0x10,0x60,0x00,0x05,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0xaf,0x80,0x84,0x98,0x0c,0x00,0x07,0xf6, ++0x00,0x00,0x00,0x00,0x00,0x40,0x18,0x21,0x28,0x44,0x00,0x08,0x24,0x02,0x00,0x07, ++0x10,0x62,0x00,0x08,0x00,0x00,0x00,0x00,0x14,0x80,0xff,0xf3,0x24,0x02,0x00,0x08, ++0x27,0x84,0x8c,0xa8,0x14,0x62,0xff,0xf0,0x00,0x00,0x00,0x00,0x0c,0x00,0x1a,0x7e, ++0x00,0x00,0x00,0x00,0x27,0x84,0x8c,0xa8,0x0c,0x00,0x08,0x54,0x00,0x00,0x00,0x00, ++0x8f,0x83,0x84,0x9c,0x3c,0x04,0x80,0x01,0x00,0x60,0x28,0x21,0x24,0x63,0x00,0x01, ++0xaf,0x83,0x84,0x9c,0x0c,0x00,0x1a,0x6b,0x24,0x84,0x04,0x90,0x08,0x00,0x07,0xaa, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xc0,0xaf,0xbf,0x00,0x38,0x8c,0x85,0x00,0x0c, ++0x8c,0x88,0x00,0x08,0x18,0xa0,0x00,0x0e,0x00,0x00,0x30,0x21,0x24,0x87,0x00,0x08, ++0x27,0xa9,0x00,0x10,0x00,0x06,0x10,0x80,0x00,0x06,0x19,0x00,0x00,0x49,0x10,0x21, ++0x14,0xc0,0x00,0x1f,0x00,0x83,0x18,0x21,0xaf,0xa7,0x00,0x10,0x24,0xc2,0x00,0x01, ++0x30,0x46,0x00,0xff,0x00,0xc5,0x18,0x2a,0x14,0x60,0xff,0xf7,0x00,0x06,0x10,0x80, ++0x29,0x02,0x00,0x0a,0x14,0x40,0x00,0x05,0x00,0x08,0x18,0x40,0x8f,0xbf,0x00,0x38, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40,0x00,0x68,0x18,0x21, ++0x27,0x82,0x83,0x94,0x00,0x03,0x18,0xc0,0x00,0x62,0x18,0x21,0x8c,0x62,0x00,0x10, ++0x01,0x00,0x20,0x21,0x00,0x40,0xf8,0x09,0x27,0xa6,0x00,0x10,0x8f,0x83,0x84,0xb0, ++0x3c,0x04,0x80,0x01,0x00,0x60,0x28,0x21,0x24,0x63,0x00,0x01,0xaf,0x83,0x84,0xb0, ++0x0c,0x00,0x1a,0x6b,0x24,0x84,0x04,0xa4,0x08,0x00,0x07,0xdf,0x00,0x00,0x00,0x00, ++0x08,0x00,0x07,0xd7,0xac,0x43,0x00,0x00,0x27,0xbd,0xff,0xe0,0xaf,0xb1,0x00,0x14, ++0xaf,0xbf,0x00,0x18,0x00,0x80,0x88,0x21,0x0c,0x00,0x1a,0xa2,0xaf,0xb0,0x00,0x10, ++0x00,0x40,0x20,0x21,0x24,0x02,0xff,0xff,0x10,0x82,0x00,0x1f,0x24,0x03,0x00,0x06, ++0x8f,0x85,0x84,0xc4,0x00,0x00,0x00,0x00,0x14,0xa0,0x00,0x0a,0x24,0x02,0x00,0x08, ++0x24,0x02,0x00,0x02,0x10,0x82,0x00,0x3b,0x28,0x82,0x00,0x03,0x10,0x40,0x00,0x32, ++0x24,0x02,0x00,0x1b,0x24,0x02,0x00,0x01,0x10,0x82,0x00,0x13,0x24,0x03,0x00,0x08, ++0x24,0x02,0x00,0x08,0x10,0x82,0x00,0x23,0x24,0x02,0x00,0x0d,0x10,0x82,0x00,0x18, ++0x02,0x25,0x10,0x21,0x24,0xa3,0x00,0x01,0xa0,0x44,0x00,0x00,0xaf,0x83,0x84,0xc4, ++0x18,0x60,0x00,0x08,0x24,0x02,0x00,0x43,0x82,0x23,0x00,0x00,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x0a,0x00,0x00,0x00,0x00,0x30,0x84,0xff,0xff,0x0c,0x00,0x1a,0x9e, ++0x00,0x00,0x00,0x00,0x24,0x03,0x00,0x06,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x3c,0x04,0x80,0x01, ++0x0c,0x00,0x1a,0x7e,0x24,0x84,0x04,0xb8,0x08,0x00,0x08,0x1e,0x24,0x03,0x00,0x06, ++0xa0,0x40,0x00,0x00,0x24,0xa5,0x00,0x01,0xaf,0x85,0x84,0xc4,0x0c,0x00,0x1a,0x9e, ++0x24,0x04,0x00,0x0d,0x24,0x03,0x00,0x07,0xaf,0x80,0x84,0xc4,0x08,0x00,0x08,0x1e, ++0x00,0x00,0x00,0x00,0x18,0xa0,0xff,0xeb,0x24,0xa5,0xff,0xff,0xaf,0x85,0x84,0xc4, ++0x0c,0x00,0x1a,0x9e,0x24,0x04,0x00,0x08,0x0c,0x00,0x1a,0x9e,0x24,0x04,0x00,0x20, ++0x08,0x00,0x08,0x1b,0x24,0x04,0x00,0x08,0x14,0x82,0xff,0xd2,0x24,0x02,0x00,0x08, ++0x0c,0x00,0x07,0x90,0x00,0x00,0x00,0x00,0x8f,0x85,0x84,0xc4,0x08,0x00,0x08,0x0c, ++0x24,0x04,0x00,0x0d,0x0c,0x00,0x30,0x54,0x02,0x20,0x20,0x21,0xaf,0x82,0x84,0xc4, ++0x04,0x40,0x00,0x0d,0x00,0x00,0x80,0x21,0x02,0x30,0x10,0x21,0x90,0x44,0x00,0x00, ++0x26,0x10,0x00,0x01,0x00,0x04,0x26,0x00,0x00,0x04,0x26,0x03,0x0c,0x00,0x1a,0x9e, ++0x30,0x84,0xff,0xff,0x8f,0x83,0x84,0xc4,0x00,0x00,0x00,0x00,0x00,0x70,0x18,0x2a, ++0x10,0x60,0xff,0xf6,0x02,0x30,0x10,0x21,0x08,0x00,0x08,0x2e,0x24,0x03,0x00,0x06, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x27,0x83,0x8c,0xe8,0x24,0x02,0x00,0x07, ++0x24,0x42,0xff,0xff,0xac,0x60,0x00,0x00,0x04,0x41,0xff,0xfd,0x24,0x63,0x00,0x04, ++0x0c,0x00,0x08,0x66,0x00,0x00,0x00,0x00,0x8f,0x84,0x8c,0xe8,0x27,0x86,0x8c,0xe8, ++0x0c,0x00,0x08,0x83,0x00,0x40,0x28,0x21,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x27,0xbd,0xff,0xe0,0x00,0x80,0x28,0x21, ++0x27,0x84,0x8c,0xc8,0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x18,0x0c,0x00,0x30,0xe5, ++0xaf,0xb0,0x00,0x10,0x8f,0x85,0x83,0x34,0x27,0x84,0x8c,0xc8,0x0c,0x00,0x30,0xa9, ++0x00,0x00,0x88,0x21,0x10,0x40,0x00,0x0c,0x00,0x00,0x00,0x00,0x27,0x90,0x8c,0xe8, ++0x8f,0x85,0x83,0x34,0x00,0x00,0x20,0x21,0xae,0x02,0x00,0x00,0x0c,0x00,0x30,0xa9, ++0x26,0x31,0x00,0x01,0x26,0x10,0x00,0x04,0x10,0x40,0x00,0x03,0x2a,0x23,0x00,0x64, ++0x14,0x60,0xff,0xf7,0x00,0x00,0x00,0x00,0x02,0x20,0x10,0x21,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xd0, ++0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24,0xaf,0xb4,0x00,0x20,0xaf,0xbf,0x00,0x2c, ++0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0x00,0xa0,0xa8,0x21,0x00,0x80,0xa0,0x21,0x00,0xc0,0xb0,0x21,0x10,0xa0,0x00,0x1d, ++0x24,0x02,0x00,0x05,0x3c,0x02,0x80,0x00,0x24,0x43,0x2c,0x80,0x8f,0x82,0x83,0xa4, ++0x00,0x00,0x00,0x00,0x10,0x43,0x00,0x1e,0x00,0x00,0x88,0x21,0x00,0x60,0x98,0x21, ++0x00,0x00,0x90,0x21,0x27,0x90,0x83,0xa4,0x8e,0x05,0xff,0xec,0x02,0x80,0x20,0x21, ++0x0c,0x00,0x30,0xed,0x26,0x10,0x00,0x18,0x10,0x40,0x00,0x06,0x02,0x51,0x18,0x21, ++0x8e,0x02,0x00,0x00,0x26,0x31,0x00,0x01,0x14,0x53,0xff,0xf7,0x00,0x11,0x90,0x40, ++0x02,0x51,0x18,0x21,0x27,0x82,0x83,0x94,0x00,0x03,0x18,0xc0,0x00,0x62,0x18,0x21, ++0x8c,0x62,0x00,0x10,0x02,0x20,0x20,0x21,0x02,0xa0,0x28,0x21,0x00,0x40,0xf8,0x09, ++0x02,0xc0,0x30,0x21,0x8f,0xbf,0x00,0x2c,0x8f,0xb6,0x00,0x28,0x7b,0xb4,0x01,0x3c, ++0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30, ++0x08,0x00,0x08,0xa4,0x00,0x00,0x90,0x21,0x27,0xbd,0xff,0xc0,0xaf,0xb5,0x00,0x34, ++0xaf,0xb3,0x00,0x2c,0xaf,0xb1,0x00,0x24,0xaf,0xbf,0x00,0x38,0xaf,0xb4,0x00,0x30, ++0xaf,0xb2,0x00,0x28,0xaf,0xb0,0x00,0x20,0x00,0xc0,0x98,0x21,0x30,0xa5,0x00,0xff, ++0xac,0xc0,0x00,0x00,0x24,0x15,0x00,0x0a,0x00,0x00,0x88,0x21,0x27,0xa8,0x00,0x10, ++0x00,0x91,0x18,0x21,0x80,0x62,0x00,0x00,0x26,0x27,0x00,0x01,0x10,0x40,0x00,0x0c, ++0x01,0x11,0x30,0x21,0x90,0x63,0x00,0x00,0x30,0xf1,0x00,0xff,0x2e,0x22,0x00,0x0a, ++0x14,0x40,0xff,0xf7,0xa0,0xc3,0x00,0x00,0x8f,0xbf,0x00,0x38,0x7b,0xb4,0x01,0xbc, ++0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40, ++0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x23,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x1f, ++0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x1a,0x00,0x00,0x00,0x00,0x02,0x20,0x90,0x21, ++0x12,0x40,0xff,0xf1,0x00,0x00,0x88,0x21,0x27,0xb4,0x00,0x10,0x02,0x91,0x10,0x21, ++0x90,0x44,0x00,0x00,0x0c,0x00,0x09,0x0a,0x00,0x00,0x00,0x00,0x02,0x51,0x20,0x23, ++0x24,0x84,0xff,0xff,0x30,0x84,0x00,0xff,0x02,0xa0,0x28,0x21,0x0c,0x00,0x08,0xfb, ++0x00,0x40,0x80,0x21,0x02,0x02,0x00,0x18,0x8e,0x63,0x00,0x00,0x26,0x22,0x00,0x01, ++0x30,0x51,0x00,0xff,0x02,0x32,0x20,0x2b,0x00,0x00,0x80,0x12,0x00,0x70,0x18,0x21, ++0x14,0x80,0xff,0xee,0xae,0x63,0x00,0x00,0x08,0x00,0x08,0xce,0x00,0x00,0x00,0x00, ++0x80,0x82,0x00,0x00,0x08,0x00,0x08,0xce,0xae,0x62,0x00,0x00,0x08,0x00,0x08,0xdb, ++0x24,0x15,0x00,0x10,0x08,0x00,0x08,0xdb,0x24,0x15,0x00,0x0a,0x30,0x84,0x00,0xff, ++0x30,0xa5,0x00,0xff,0x24,0x06,0x00,0x01,0x10,0x80,0x00,0x09,0x00,0x00,0x10,0x21, ++0x00,0xc5,0x00,0x18,0x24,0x42,0x00,0x01,0x30,0x42,0x00,0xff,0x00,0x44,0x18,0x2b, ++0x00,0x00,0x30,0x12,0x00,0x00,0x00,0x00,0x14,0x60,0xff,0xfa,0x00,0xc5,0x00,0x18, ++0x03,0xe0,0x00,0x08,0x00,0xc0,0x10,0x21,0x30,0x84,0x00,0xff,0x24,0x83,0xff,0xd0, ++0x30,0x62,0x00,0xff,0x2c,0x42,0x00,0x0a,0x14,0x40,0x00,0x06,0x00,0x00,0x00,0x00, ++0x24,0x82,0xff,0xbf,0x2c,0x42,0x00,0x06,0x14,0x40,0x00,0x02,0x24,0x83,0xff,0xc9, ++0x24,0x83,0xff,0xa9,0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21,0x27,0xbd,0xff,0xc8, ++0x24,0x02,0x00,0x01,0xaf,0xbf,0x00,0x30,0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28, ++0xaf,0xb3,0x00,0x24,0xaf,0xb2,0x00,0x20,0xaf,0xb1,0x00,0x1c,0x10,0xa2,0x00,0x3e, ++0xaf,0xb0,0x00,0x18,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x08,0x24,0x05,0x00,0x01, ++0x00,0x00,0x10,0x21,0x8f,0xbf,0x00,0x30,0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c, ++0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x8c,0xc4,0x00,0x04, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x10,0x8f,0xa2,0x00,0x10,0x00,0x00,0x00,0x00, ++0x28,0x42,0x00,0x65,0x14,0x40,0x00,0x06,0x00,0x00,0x00,0x00,0x3c,0x04,0x80,0x01, ++0x0c,0x00,0x1a,0x7e,0x24,0x84,0x04,0xbc,0x08,0x00,0x09,0x25,0x24,0x02,0x00,0x01, ++0x3c,0x04,0x80,0x01,0x0c,0x00,0x1a,0x7e,0x24,0x84,0x04,0xc8,0x8f,0x83,0x83,0xa4, ++0x3c,0x02,0x80,0x00,0x24,0x42,0x2c,0x80,0x10,0x62,0xff,0xe5,0x00,0x40,0x90,0x21, ++0x3c,0x13,0x80,0x01,0x27,0x95,0x83,0x90,0x3c,0x14,0x80,0x01,0x27,0x90,0x83,0x94, ++0x00,0x00,0x88,0x21,0x8e,0x03,0x00,0x08,0x8f,0xa2,0x00,0x10,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x08,0x26,0x64,0x04,0xd4,0x26,0x10,0x00,0x18,0x8e,0x02,0x00,0x10, ++0x00,0x00,0x00,0x00,0x14,0x52,0xff,0xf7,0x26,0x31,0x00,0x18,0x08,0x00,0x09,0x25, ++0x00,0x00,0x10,0x21,0x0c,0x00,0x1a,0x7e,0x00,0x00,0x00,0x00,0x02,0x35,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x0c,0x00,0x1a,0x7e,0x00,0x00,0x00,0x00,0x0c,0x00,0x1a,0x7e, ++0x26,0x84,0x04,0xd8,0x8e,0x04,0x00,0x00,0x0c,0x00,0x1a,0x7e,0x26,0x10,0x00,0x18, ++0x08,0x00,0x09,0x4b,0x00,0x00,0x00,0x00,0x3c,0x04,0x80,0x01,0x0c,0x00,0x1a,0x7e, ++0x24,0x84,0x04,0xdc,0x3c,0x04,0x80,0x01,0x0c,0x00,0x1a,0x6b,0x24,0x84,0x04,0xec, ++0x24,0x11,0x00,0x05,0x3c,0x12,0x80,0x01,0x27,0x90,0x88,0x0e,0x86,0x05,0x00,0x00, ++0x26,0x44,0x05,0x0c,0x0c,0x00,0x1a,0x6b,0x26,0x31,0xff,0xff,0x06,0x21,0xff,0xfb, ++0x26,0x10,0xff,0xfe,0x08,0x00,0x09,0x25,0x00,0x00,0x10,0x21,0x27,0xbd,0xff,0xd0, ++0x28,0xa2,0x00,0x02,0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18,0xaf,0xbf,0x00,0x2c, ++0xaf,0xb4,0x00,0x28,0xaf,0xb3,0x00,0x24,0xaf,0xb2,0x00,0x20,0x00,0xa0,0x80,0x21, ++0x14,0x40,0x00,0x51,0x00,0xc0,0x88,0x21,0x8c,0xc4,0x00,0x04,0x24,0x05,0x00,0x02, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x10,0x24,0x02,0x00,0x02,0x12,0x02,0x00,0x48, ++0x24,0x05,0x00,0x01,0x8e,0x24,0x00,0x08,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x14, ++0x8f,0xa2,0x00,0x14,0x00,0x00,0x00,0x00,0x30,0x42,0x0f,0xff,0xaf,0xa2,0x00,0x14, ++0x7b,0xa4,0x00,0xbc,0x0c,0x00,0x0a,0x06,0x24,0x06,0x00,0x04,0x24,0x03,0x00,0x04, ++0x10,0x43,0x00,0x2a,0x24,0x04,0x00,0x04,0x8f,0xa2,0x00,0x10,0x3c,0x04,0x80,0x01, ++0x24,0x84,0x05,0x10,0x00,0x02,0x19,0x02,0x00,0x03,0x81,0x00,0x8f,0xa3,0x00,0x14, ++0x00,0x50,0x10,0x23,0x00,0x02,0x10,0x82,0x00,0x62,0x18,0x21,0x0c,0x00,0x1a,0x7e, ++0xaf,0xa3,0x00,0x14,0x3c,0x04,0x80,0x01,0x0c,0x00,0x1a,0x7e,0x24,0x84,0x05,0x38, ++0x8f,0xa2,0x00,0x14,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x17,0x00,0x00,0x88,0x21, ++0x3c,0x13,0x80,0x01,0x3c,0x12,0x80,0x01,0x3c,0x14,0x80,0x01,0x0c,0x00,0x2e,0x24, ++0x24,0x04,0x27,0x10,0x32,0x23,0x00,0x03,0x02,0x00,0x28,0x21,0x10,0x60,0x00,0x1c, ++0x26,0x64,0x05,0x64,0x8f,0xa2,0x00,0x10,0x00,0x00,0x00,0x00,0x02,0x02,0x10,0x23, ++0x28,0x42,0xff,0xfd,0x10,0x40,0x00,0x10,0x26,0x44,0x05,0x70,0x0c,0x00,0x1a,0x7e, ++0x26,0x10,0x00,0x04,0x8f,0xa2,0x00,0x14,0x26,0x31,0x00,0x01,0x02,0x22,0x10,0x2b, ++0x14,0x40,0xff,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x21,0x8f,0xbf,0x00,0x2c, ++0x8f,0xb4,0x00,0x28,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x00,0x80,0x10,0x21, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30,0x8e,0x05,0x00,0x00,0x26,0x84,0x05,0x74, ++0x0c,0x00,0x1a,0x6b,0x26,0x10,0x00,0x04,0x08,0x00,0x09,0xb1,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x1a,0x6b,0x00,0x00,0x00,0x00,0x08,0x00,0x09,0xa9,0x00,0x00,0x00,0x00, ++0x08,0x00,0x09,0x87,0x24,0x02,0x00,0x01,0x0c,0x00,0x0b,0x2b,0x00,0x00,0x00,0x00, ++0x08,0x00,0x09,0xb7,0x24,0x04,0x00,0x04,0x27,0xbd,0xff,0xd0,0x28,0xa2,0x00,0x03, ++0xaf,0xb1,0x00,0x24,0xaf,0xb0,0x00,0x20,0xaf,0xbf,0x00,0x28,0x00,0xa0,0x88,0x21, ++0x10,0x40,0x00,0x09,0x00,0xc0,0x80,0x21,0x0c,0x00,0x0b,0x2b,0x00,0x00,0x00,0x00, ++0x24,0x04,0x00,0x04,0x8f,0xbf,0x00,0x28,0x7b,0xb0,0x01,0x3c,0x00,0x80,0x10,0x21, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30,0x8c,0xc4,0x00,0x04,0x24,0x05,0x00,0x02, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x10,0x8e,0x04,0x00,0x08,0x24,0x05,0x00,0x02, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x14,0x24,0x02,0x00,0x03,0x12,0x22,0x00,0x1b, ++0x24,0x05,0x00,0x01,0x8e,0x04,0x00,0x0c,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x18, ++0x8f,0xa4,0x00,0x10,0x8f,0xa5,0x00,0x18,0x0c,0x00,0x0a,0x06,0x24,0x06,0x00,0x04, ++0x24,0x03,0x00,0x04,0x10,0x43,0xff,0xe7,0x24,0x04,0x00,0x04,0x8f,0xa2,0x00,0x18, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0b,0x00,0x00,0x28,0x21,0x8f,0xa2,0x00,0x10, ++0x8f,0xa4,0x00,0x14,0x24,0xa5,0x00,0x01,0xac,0x44,0x00,0x00,0x8f,0xa3,0x00,0x10, ++0x8f,0xa2,0x00,0x18,0x24,0x63,0x00,0x04,0x00,0xa2,0x10,0x2b,0x14,0x40,0xff,0xf7, ++0xaf,0xa3,0x00,0x10,0x08,0x00,0x09,0xd9,0x00,0x00,0x20,0x21,0x24,0x02,0x00,0x01, ++0x08,0x00,0x09,0xec,0xaf,0xa2,0x00,0x18,0x30,0xc6,0x00,0xff,0x00,0xa6,0x00,0x18, ++0x00,0x00,0x28,0x12,0x04,0x81,0x00,0x07,0x00,0x00,0x30,0x21,0x3c,0x02,0x80,0x01, ++0x00,0x85,0x18,0x21,0x34,0x42,0x7f,0xff,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x0b, ++0x3c,0x02,0xb0,0x03,0x3c,0x02,0xaf,0xff,0x34,0x42,0xff,0xff,0x00,0x44,0x10,0x2b, ++0x10,0x40,0x00,0x17,0x3c,0x02,0xb0,0x0a,0x00,0x85,0x18,0x21,0x34,0x42,0xff,0xff, ++0x00,0x43,0x10,0x2b,0x14,0x40,0x00,0x12,0x3c,0x02,0xb0,0x03,0x34,0x42,0xff,0xff, ++0x00,0x44,0x10,0x2b,0x10,0x40,0x00,0x06,0x3c,0x02,0xb0,0x07,0x3c,0x02,0xb0,0x04, ++0x34,0x42,0xff,0xff,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x09,0x3c,0x02,0xb0,0x07, ++0x34,0x42,0x00,0x3f,0x00,0x44,0x10,0x2b,0x10,0x40,0x00,0x06,0x3c,0x02,0xb0,0x07, ++0x34,0x42,0xff,0xff,0x00,0x43,0x10,0x2b,0x14,0x40,0x00,0x02,0x00,0x00,0x00,0x00, ++0x24,0x06,0x00,0x01,0x14,0xc0,0x00,0x11,0x24,0x02,0x00,0x04,0x3c,0x02,0xb0,0x08, ++0x34,0x42,0x0f,0xff,0x00,0x44,0x10,0x2b,0x14,0x40,0x00,0x08,0x3c,0x02,0x4f,0xf7, ++0x00,0x85,0x20,0x21,0x34,0x42,0xf0,0x00,0x00,0x82,0x20,0x21,0x34,0x03,0xef,0xff, ++0x00,0x64,0x18,0x2b,0x14,0x60,0x00,0x02,0x00,0x00,0x00,0x00,0x24,0x06,0x00,0x02, ++0x10,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x04,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe0,0x24,0x02,0x00,0x02,0xaf,0xb0,0x00,0x18, ++0xaf,0xbf,0x00,0x1c,0x10,0xa2,0x00,0x23,0x00,0xc0,0x80,0x21,0x28,0xa2,0x00,0x03, ++0x10,0x40,0x00,0x0c,0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x04, ++0x00,0x00,0x18,0x21,0x0c,0x00,0x0b,0x2b,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x21, ++0x8f,0xbf,0x00,0x1c,0x8f,0xb0,0x00,0x18,0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x14,0xa2,0xff,0xf7,0x24,0x05,0x00,0x01,0x8c,0xc4,0x00,0x04, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x10,0x8e,0x04,0x00,0x08,0x24,0x05,0x00,0x02, ++0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x14,0x8f,0xa4,0x00,0x10,0x00,0x00,0x00,0x00, ++0x2c,0x82,0x00,0x0b,0x10,0x40,0xff,0xee,0x24,0x03,0x00,0x04,0x00,0x04,0x10,0x80, ++0x8f,0xa4,0x00,0x14,0x27,0x83,0x94,0xc0,0x00,0x43,0x10,0x21,0x08,0x00,0x0a,0x4f, ++0xac,0x44,0x00,0x00,0x8c,0xc4,0x00,0x04,0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6, ++0x27,0xa6,0x00,0x10,0x8f,0xa5,0x00,0x10,0x27,0x83,0x94,0xc0,0x3c,0x04,0x80,0x01, ++0x00,0x05,0x10,0x80,0x00,0x43,0x10,0x21,0x8c,0x46,0x00,0x00,0x0c,0x00,0x1a,0x6b, ++0x24,0x84,0x05,0x7c,0x08,0x00,0x0a,0x50,0x00,0x00,0x18,0x21,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xb8,0x28,0xa5,0x00,0x04,0xaf,0xb0,0x00,0x20, ++0xaf,0xbf,0x00,0x40,0xaf,0xb7,0x00,0x3c,0xaf,0xb6,0x00,0x38,0xaf,0xb5,0x00,0x34, ++0xaf,0xb4,0x00,0x30,0xaf,0xb3,0x00,0x2c,0xaf,0xb2,0x00,0x28,0xaf,0xb1,0x00,0x24, ++0x10,0xa0,0x00,0x0b,0x00,0xc0,0x80,0x21,0x0c,0x00,0x0b,0x2b,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x04,0x8f,0xbf,0x00,0x40,0x7b,0xb6,0x01,0xfc,0x7b,0xb4,0x01,0xbc, ++0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x48, ++0x8c,0xc4,0x00,0x04,0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x10, ++0x8e,0x04,0x00,0x08,0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x14, ++0x8e,0x04,0x00,0x0c,0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x18, ++0x8f,0xa3,0x00,0x18,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x3a,0x24,0x02,0x00,0x01, ++0x10,0x62,0x00,0x33,0x3c,0x04,0x80,0x01,0x97,0xb0,0x00,0x12,0x8f,0xa2,0x00,0x14, ++0x00,0x00,0x00,0x00,0x02,0x02,0x10,0x2b,0x10,0x40,0xff,0xe2,0x3c,0x15,0x80,0x01, ++0x3c,0x02,0x80,0x01,0x24,0x52,0x05,0xbc,0x3c,0x14,0xb0,0x06,0x24,0x13,0x00,0x01, ++0x3c,0x17,0xb0,0x08,0x3c,0x16,0x80,0x01,0x32,0x02,0x00,0x01,0x02,0x00,0x28,0x21, ++0x10,0x40,0x00,0x1f,0x26,0xa4,0x05,0xb0,0x8f,0xa3,0x00,0x18,0x00,0x10,0x10,0xc0, ++0x00,0x54,0x10,0x21,0x10,0x60,0x00,0x14,0x02,0x40,0x20,0x21,0x00,0x10,0x10,0xc0, ++0x00,0x57,0x10,0x21,0x10,0x73,0x00,0x09,0x26,0xc4,0x05,0xc4,0x8f,0xa2,0x00,0x14, ++0x26,0x03,0x00,0x01,0x30,0x70,0xff,0xff,0x02,0x02,0x10,0x2b,0x14,0x40,0xff,0xee, ++0x00,0x00,0x00,0x00,0x08,0x00,0x0a,0x8d,0x00,0x00,0x00,0x00,0x8c,0x51,0x00,0x00, ++0x00,0x00,0x00,0x00,0x32,0x25,0x00,0xff,0x0c,0x00,0x1a,0x6b,0x00,0x00,0x00,0x00, ++0x08,0x00,0x0a,0xbf,0x00,0x00,0x00,0x00,0x8c,0x51,0x00,0x00,0x0c,0x00,0x1a,0x6b, ++0x00,0x11,0x2c,0x02,0x32,0x25,0x00,0xff,0x08,0x00,0x0a,0xca,0x02,0x40,0x20,0x21, ++0x0c,0x00,0x1a,0x6b,0x00,0x00,0x00,0x00,0x08,0x00,0x0a,0xb6,0x00,0x00,0x00,0x00, ++0x24,0x84,0x05,0x90,0x0c,0x00,0x1a,0x7e,0x00,0x00,0x00,0x00,0x08,0x00,0x0a,0xa6, ++0x00,0x00,0x00,0x00,0x3c,0x04,0x80,0x01,0x08,0x00,0x0a,0xd9,0x24,0x84,0x05,0xd0, ++0x00,0xa0,0x10,0x21,0x27,0xbd,0xff,0xd8,0x28,0x42,0x00,0x04,0xaf,0xb0,0x00,0x20, ++0xaf,0xbf,0x00,0x24,0x00,0xc0,0x80,0x21,0x24,0x05,0x00,0x01,0x10,0x40,0x00,0x08, ++0x27,0xa6,0x00,0x10,0x0c,0x00,0x0b,0x2b,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x04, ++0x8f,0xbf,0x00,0x24,0x8f,0xb0,0x00,0x20,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28, ++0x8e,0x04,0x00,0x04,0x0c,0x00,0x08,0xb6,0x00,0x00,0x00,0x00,0x8e,0x04,0x00,0x08, ++0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x14,0x8e,0x04,0x00,0x0c, ++0x24,0x05,0x00,0x01,0x0c,0x00,0x08,0xb6,0x27,0xa6,0x00,0x18,0x08,0x00,0x0a,0xec, ++0x24,0x02,0x00,0x01,0x24,0x03,0x00,0x01,0x00,0x65,0x10,0x2a,0x27,0xbd,0xff,0xd8, ++0x00,0xa0,0x40,0x21,0x10,0x40,0x00,0x0b,0x00,0xc0,0x38,0x21,0x00,0x03,0x20,0x80, ++0x00,0x87,0x10,0x21,0x8c,0x45,0x00,0x00,0x24,0x63,0x00,0x01,0x30,0x63,0x00,0xff, ++0x8c,0xa6,0x00,0x00,0x00,0x9d,0x20,0x21,0x00,0x68,0x10,0x2a,0x14,0x40,0xff,0xf7, ++0xac,0x86,0xff,0xfc,0x8f,0xa3,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x0b, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0x62,0x00,0x03,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x93,0xa2,0x00,0x07,0x00,0x00,0x00,0x00, ++0xa3,0x82,0x87,0x6c,0x08,0x00,0x0b,0x14,0x00,0x00,0x00,0x00,0x93,0xa2,0x00,0x07, ++0x00,0x00,0x00,0x00,0xa3,0x82,0x94,0xb0,0x08,0x00,0x0b,0x14,0x00,0x00,0x00,0x00, ++0x27,0xbd,0xff,0xe8,0x3c,0x04,0x80,0x01,0xaf,0xbf,0x00,0x10,0x18,0xa0,0x00,0x03, ++0x24,0x84,0x05,0xf8,0x0c,0x00,0x1a,0x7e,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x27,0xbd,0xff,0xe8, ++0xaf,0xb0,0x00,0x10,0x00,0x80,0x80,0x21,0x3c,0x04,0x80,0x01,0xaf,0xbf,0x00,0x14, ++0x0c,0x00,0x1a,0x7e,0x24,0x84,0x06,0x0c,0x00,0x10,0x10,0x40,0x00,0x50,0x10,0x21, ++0x27,0x83,0x83,0x90,0x00,0x02,0x10,0xc0,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x08, ++0x0c,0x00,0x1a,0x7e,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x2c,0xf8,0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00, ++0x34,0x84,0x00,0x2c,0x8c,0x86,0x00,0x00,0x3c,0x05,0xb0,0x0a,0x34,0xa5,0x1a,0x00, ++0x00,0x06,0x1a,0x02,0x30,0x63,0x0f,0xff,0x00,0x06,0x25,0x02,0x24,0x02,0xff,0xff, ++0xac,0xa2,0x00,0x00,0xa7,0x83,0xc5,0x4a,0xa7,0x84,0xc5,0x4c,0xa3,0x86,0xc5,0x48, ++0xa7,0x80,0xc5,0x40,0xa7,0x80,0xc5,0x42,0xa7,0x80,0xc5,0x44,0xa7,0x80,0xc5,0x46, ++0x00,0xa0,0x38,0x21,0x24,0x03,0x00,0x01,0x8c,0xe2,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x0a,0x00,0x8c,0x45,0x00,0x00, ++0x3c,0x04,0xb0,0x0a,0x34,0x84,0x1a,0x00,0xa0,0x45,0x00,0x00,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x0a,0x00,0x3c,0x04,0xb0,0x0a,0xa0,0x45,0x00,0x00,0x34,0x84,0x1a,0x00, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x3c,0x04,0xb0,0x03,0x34,0x63,0x01,0x08, ++0x34,0x84,0x01,0x18,0x8c,0x65,0x00,0x00,0x8c,0x82,0x00,0x00,0xaf,0x85,0xc5,0x50, ++0x30,0x42,0x02,0x00,0x10,0x40,0x00,0x06,0x3c,0x02,0x00,0x0f,0x3c,0x02,0x00,0x4c, ++0x34,0x42,0x4b,0x40,0xaf,0x82,0xc5,0x54,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x08,0x00,0x0b,0x79,0x34,0x42,0x42,0x40,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x2d,0xf8,0x30,0x84,0x00,0xff,0xac,0x62,0x00,0x00, ++0x14,0x80,0x02,0xb3,0x24,0x02,0x00,0x02,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x1b,0x40, ++0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x0b,0x40,0x8c,0x46,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x1b,0x48, ++0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x00,0x06,0x54,0x02, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x0b,0x48,0x8c,0x46,0x00,0x00,0x3c,0x03,0xb0,0x0a, ++0x34,0x63,0x1b,0x50,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21, ++0x00,0x06,0x64,0x02,0x30,0xcb,0xff,0xff,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x0b,0x50, ++0x8c,0x46,0x00,0x00,0x97,0x84,0xc5,0x40,0x97,0x82,0xc5,0x42,0x97,0x83,0xc5,0x46, ++0x01,0x44,0x20,0x23,0x01,0x62,0x10,0x23,0x00,0x82,0x20,0x21,0x97,0x82,0xc5,0x44, ++0x30,0xcd,0xff,0xff,0x01,0xa3,0x18,0x23,0x01,0x82,0x10,0x23,0x00,0x82,0x20,0x21, ++0x93,0x82,0xc5,0x48,0x00,0x83,0x20,0x21,0x30,0x84,0xff,0xff,0x00,0x82,0x10,0x2b, ++0x10,0x40,0x00,0xec,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x18,0xa0,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xa0, ++0x8c,0x46,0x00,0x00,0x24,0x02,0x00,0x20,0x30,0xc8,0x00,0x7f,0x11,0x02,0x00,0x4d, ++0x2d,0x02,0x00,0x21,0x14,0x40,0x00,0x2b,0x24,0x02,0xff,0x80,0x00,0xc2,0x10,0x24, ++0x25,0x08,0xff,0xff,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x08,0xa0,0x00,0x48,0x30,0x25, ++0x3c,0x04,0xb0,0x0a,0xac,0x66,0x00,0x00,0x34,0x84,0x18,0xa0,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x08,0xb0,0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xb0, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xc0,0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00, ++0x34,0x84,0x18,0xc0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xd0,0x3c,0x04,0xb0,0x0a, ++0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xd0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x24,0x02,0x00,0x20,0x11,0x02,0x00,0x07, ++0x24,0x02,0xff,0xff,0xa7,0x8a,0xc5,0x40,0xa7,0x8b,0xc5,0x42,0xa7,0x8c,0xc5,0x44, ++0xa7,0x8d,0xc5,0x46,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a, ++0x34,0x63,0x14,0x58,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x04,0x58,0x8c,0x69,0x00,0x00,0x3c,0x02,0xff,0xff, ++0x34,0x42,0x3f,0xff,0x01,0x22,0x10,0x24,0x34,0x49,0x80,0x00,0x3c,0x04,0xb0,0x0a, ++0xac,0x69,0x00,0x00,0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x08,0x00,0x0b,0xf9, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x58,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x58, ++0x8c,0x49,0x00,0x00,0x3c,0x04,0xb0,0x0a,0x34,0x84,0x14,0x58,0x35,0x29,0x40,0x00, ++0xac,0x49,0x00,0x00,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x24,0x02,0xff,0xff,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0xb0, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0xb0, ++0x8c,0x47,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0xb8,0x3c,0x05,0xb0,0x0a, ++0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x34,0xa5,0x14,0xb8,0x00,0x07,0x1e,0x02, ++0x24,0x04,0x00,0x01,0x8c,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x44,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0xb8,0x8c,0x47,0x00,0x00,0x00,0x03,0x1a,0x00, ++0x30,0xe2,0x00,0xff,0x00,0x62,0x18,0x25,0x2c,0x62,0x00,0x04,0x10,0x40,0x00,0x3a, ++0x2c,0x62,0x00,0x11,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x10,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x10, ++0x8c,0x47,0x00,0x00,0x24,0x02,0x00,0x03,0x00,0x07,0x1d,0x82,0x30,0x64,0x00,0x03, ++0x10,0x82,0x00,0x1a,0x3c,0x02,0xff,0x3f,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x04,0x58,0x01,0x22,0x48,0x24,0x3c,0x04,0xb0,0x0a, ++0xac,0x69,0x00,0x00,0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x35,0x29,0x80,0x00, ++0x34,0x42,0x04,0x58,0x3c,0x04,0xb0,0x0a,0xac,0x49,0x00,0x00,0x34,0x84,0x14,0x58, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x2d,0x02,0x00,0x21,0x08,0x00,0x0b,0xcd,0x00,0x00,0x00,0x00,0x34,0x42,0xff,0xff, ++0x3c,0x03,0x00,0x80,0x00,0xe2,0x10,0x24,0x00,0x43,0x38,0x25,0x3c,0x04,0xb0,0x0a, ++0x3c,0x01,0xb0,0x0a,0xac,0x27,0x04,0x10,0x34,0x84,0x14,0x10,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xff,0xff, ++0x08,0x00,0x0c,0x60,0x34,0x42,0x3f,0xff,0x14,0x40,0xff,0xd8,0x3c,0x02,0xff,0xff, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x10,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x10,0x8c,0x47,0x00,0x00, ++0x3c,0x05,0x00,0xc0,0x24,0x03,0x00,0x02,0x00,0xe5,0x10,0x24,0x00,0x02,0x25,0x82, ++0x14,0x83,0xff,0xc6,0x3c,0x02,0xff,0xff,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff, ++0x00,0xe2,0x10,0x24,0x00,0x45,0x38,0x25,0x3c,0x04,0xb0,0x0a,0x3c,0x01,0xb0,0x0a, ++0xac,0x27,0x04,0x10,0x34,0x84,0x14,0x10,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xff,0xff,0x08,0x00,0x0c,0x60, ++0x34,0x42,0x3f,0xff,0x97,0x82,0xc5,0x4c,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x2b, ++0x10,0x40,0x00,0x74,0x34,0x63,0x18,0xa0,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xa0,0x8c,0x46,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0xc8,0x00,0x7f,0x2d,0x02,0x00,0x32,0x10,0x40,0xff,0x3d, ++0x24,0x02,0x00,0x20,0x11,0x02,0x00,0x2b,0x24,0x02,0xff,0x80,0x00,0xc2,0x10,0x24, ++0x25,0x08,0x00,0x02,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x08,0xa0,0x00,0x48,0x30,0x25, ++0x3c,0x04,0xb0,0x0a,0xac,0x66,0x00,0x00,0x34,0x84,0x18,0xa0,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x08,0xb0,0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xb0, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xc0,0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00, ++0x34,0x84,0x18,0xc0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xd0,0x3c,0x04,0xb0,0x0a, ++0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xd0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x08,0x00,0x0b,0xf9, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x10,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x10, ++0x8c,0x47,0x00,0x00,0x3c,0x05,0x00,0xc0,0x24,0x03,0x00,0x03,0x00,0xe5,0x10,0x24, ++0x00,0x02,0x25,0x82,0x10,0x83,0x00,0x0d,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff, ++0x00,0xe2,0x10,0x24,0x00,0x45,0x38,0x25,0x3c,0x04,0xb0,0x0a,0x3c,0x01,0xb0,0x0a, ++0xac,0x27,0x04,0x10,0x34,0x84,0x14,0x10,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a, ++0x34,0x63,0x14,0x58,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x04,0x58,0x8c,0x69,0x00,0x00, ++0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x01,0x22,0x48,0x24,0x3c,0x04,0xb0,0x0a, ++0xac,0x69,0x00,0x00,0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x24,0x02,0xff,0x80,0x08,0x00,0x0c,0xc0, ++0x00,0xc2,0x10,0x24,0x97,0x82,0xc5,0x4a,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x2b, ++0x10,0x40,0x00,0x75,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x18,0xa0,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xa0, ++0x8c,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xc8,0x00,0x7f,0x2d,0x02,0x00,0x32, ++0x10,0x40,0xfe,0xc4,0x24,0x02,0x00,0x20,0x11,0x02,0x00,0x2b,0x24,0x02,0xff,0x80, ++0x00,0xc2,0x10,0x24,0x25,0x08,0x00,0x01,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x08,0xa0, ++0x00,0x48,0x30,0x25,0x3c,0x04,0xb0,0x0a,0xac,0x66,0x00,0x00,0x34,0x84,0x18,0xa0, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xb0,0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00, ++0x34,0x84,0x18,0xb0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xc0,0x3c,0x04,0xb0,0x0a, ++0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xc0,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xd0, ++0x3c,0x04,0xb0,0x0a,0xac,0x46,0x00,0x00,0x34,0x84,0x18,0xd0,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00, ++0x08,0x00,0x0b,0xf9,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x10, ++0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x04,0x10,0x8c,0x47,0x00,0x00,0x3c,0x05,0x00,0xc0,0x24,0x03,0x00,0x03, ++0x00,0xe5,0x10,0x24,0x00,0x02,0x25,0x82,0x10,0x83,0x00,0x0d,0x3c,0x02,0xff,0x3f, ++0x34,0x42,0xff,0xff,0x00,0xe2,0x10,0x24,0x00,0x45,0x38,0x25,0x3c,0x04,0xb0,0x0a, ++0x3c,0x01,0xb0,0x0a,0xac,0x27,0x04,0x10,0x34,0x84,0x14,0x10,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x58,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x04,0x58, ++0x8c,0x69,0x00,0x00,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x01,0x22,0x48,0x24, ++0x3c,0x04,0xb0,0x0a,0xac,0x69,0x00,0x00,0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x24,0x02,0xff,0x80, ++0x08,0x00,0x0d,0x39,0x00,0xc2,0x10,0x24,0x34,0x63,0x18,0xa0,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x08,0xa0, ++0x8c,0x46,0x00,0x00,0x24,0x02,0x00,0x20,0x30,0xc8,0x00,0x7f,0x15,0x02,0xfe,0x51, ++0x24,0x02,0xff,0xff,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x58,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x58,0x8c,0x49,0x00,0x00, ++0x3c,0x04,0xb0,0x0a,0x34,0x84,0x14,0x58,0x35,0x29,0x40,0x00,0xac,0x49,0x00,0x00, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x24,0x02,0xff,0xff,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0xb0,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0xb0,0x8c,0x47,0x00,0x00, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0xb8,0x3c,0x05,0xb0,0x0a,0x24,0x02,0xff,0xff, ++0xac,0x62,0x00,0x00,0x34,0xa5,0x14,0xb8,0x00,0x07,0x1e,0x02,0x24,0x04,0x00,0x01, ++0x8c,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x44,0xff,0xfd,0x3c,0x02,0xb0,0x0a, ++0x34,0x42,0x04,0xb8,0x8c,0x47,0x00,0x00,0x00,0x03,0x1a,0x00,0x30,0xe2,0x00,0xff, ++0x00,0x62,0x18,0x25,0x2c,0x62,0x00,0x04,0x10,0x40,0x00,0x3a,0x2c,0x62,0x00,0x11, ++0x3c,0x03,0xb0,0x0a,0x34,0x63,0x14,0x10,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00, ++0x00,0x60,0x20,0x21,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x10,0x8c,0x47,0x00,0x00, ++0x24,0x02,0x00,0x03,0x00,0x07,0x1d,0x82,0x30,0x64,0x00,0x03,0x10,0x82,0x00,0x1a, ++0x3c,0x02,0xff,0x3f,0x3c,0x02,0xff,0xff,0x34,0x42,0x3f,0xff,0x3c,0x03,0xb0,0x0a, ++0x34,0x63,0x04,0x58,0x01,0x22,0x48,0x24,0x3c,0x04,0xb0,0x0a,0xac,0x69,0x00,0x00, ++0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x35,0x29,0x80,0x00,0x34,0x42,0x04,0x58, ++0x3c,0x04,0xb0,0x0a,0xac,0x49,0x00,0x00,0x34,0x84,0x14,0x58,0x24,0x03,0x00,0x01, ++0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00, ++0x08,0x00,0x0b,0xf9,0x00,0x00,0x00,0x00,0x34,0x42,0xff,0xff,0x3c,0x03,0x00,0x80, ++0x00,0xe2,0x10,0x24,0x00,0x43,0x38,0x25,0x3c,0x03,0xb0,0x0a,0x3c,0x01,0xb0,0x0a, ++0xac,0x27,0x04,0x10,0x34,0x63,0x14,0x10,0x24,0x04,0x00,0x01,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x44,0xff,0xfd,0x3c,0x02,0xff,0xff,0x08,0x00,0x0d,0xef, ++0x34,0x42,0x3f,0xff,0x14,0x40,0xff,0xd8,0x3c,0x02,0xff,0xff,0x3c,0x03,0xb0,0x0a, ++0x34,0x63,0x14,0x10,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x3c,0x02,0xb0,0x0a,0x34,0x42,0x04,0x10,0x8c,0x47,0x00,0x00,0x3c,0x05,0x00,0xc0, ++0x24,0x03,0x00,0x02,0x00,0xe5,0x10,0x24,0x00,0x02,0x25,0x82,0x14,0x83,0xff,0xc6, ++0x3c,0x02,0xff,0xff,0x3c,0x02,0xff,0x3f,0x34,0x42,0xff,0xff,0x00,0xe2,0x10,0x24, ++0x00,0x45,0x38,0x25,0x3c,0x03,0xb0,0x0a,0x3c,0x01,0xb0,0x0a,0xac,0x27,0x04,0x10, ++0x34,0x63,0x14,0x10,0x24,0x04,0x00,0x01,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x44,0xff,0xfd,0x3c,0x02,0xff,0xff,0x08,0x00,0x0d,0xef,0x34,0x42,0x3f,0xff, ++0x10,0x82,0x00,0x03,0x3c,0x03,0xb0,0x0a,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x34,0x63,0x1a,0x00,0x24,0x02,0xff,0xff,0xac,0x62,0x00,0x00,0x00,0x60,0x20,0x21, ++0xa7,0x80,0xc5,0x40,0xa7,0x80,0xc5,0x42,0xa7,0x80,0xc5,0x44,0xa7,0x80,0xc5,0x46, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x0a,0x34,0x63,0x0a,0x00,0x8c,0x66,0x00,0x00, ++0x3c,0x02,0x08,0x00,0x3c,0x04,0xb0,0x0a,0x00,0xc2,0x10,0x25,0xac,0x62,0x00,0x00, ++0x34,0x84,0x1a,0x00,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x3c,0x02,0xf7,0xff,0x3c,0x03,0xb0,0x0a,0x34,0x42,0xff,0xff, ++0x34,0x63,0x0a,0x00,0x00,0xc2,0x10,0x24,0x3c,0x04,0xb0,0x0a,0xac,0x62,0x00,0x00, ++0x34,0x84,0x1a,0x00,0x24,0x03,0x00,0x01,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x43,0xff,0xfd,0x00,0x00,0x00,0x00,0x08,0x00,0x0e,0x3a,0x00,0x00,0x00,0x00, ++0x30,0x83,0x00,0x03,0x00,0x04,0x20,0x40,0x00,0x83,0x20,0x23,0x3c,0x02,0xb0,0x0a, ++0x00,0x82,0x20,0x21,0xac,0x85,0x00,0x00,0x00,0x00,0x18,0x21,0x24,0x63,0x00,0x01, ++0x2c,0x62,0x27,0x10,0x14,0x40,0xff,0xfe,0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08, ++0x24,0x63,0xff,0xff,0x30,0x86,0x00,0x03,0x00,0x04,0x28,0x40,0x3c,0x03,0xb0,0x0a, ++0x00,0xa6,0x10,0x23,0x00,0x43,0x10,0x21,0x24,0x04,0xff,0xff,0xac,0x44,0x10,0x00, ++0x00,0x00,0x18,0x21,0x24,0x63,0x00,0x01,0x2c,0x62,0x27,0x10,0x14,0x40,0xff,0xfe, ++0x24,0x63,0x00,0x01,0x24,0x63,0xff,0xff,0x00,0xa6,0x18,0x23,0x3c,0x02,0xb0,0x0a, ++0x00,0x62,0x18,0x21,0x8c,0x62,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x05,0xb0,0x03,0x3c,0x02,0x80,0x00,0x24,0x42,0x3a,0x10,0x24,0x03,0x00,0x01, ++0x34,0xa5,0x00,0x20,0x3c,0x06,0xb0,0x03,0xac,0xa2,0x00,0x00,0x34,0xc6,0x01,0x04, ++0xa0,0x83,0x00,0x48,0xa0,0x80,0x00,0x04,0xa0,0x80,0x00,0x05,0xa0,0x80,0x00,0x06, ++0xa0,0x80,0x00,0x07,0xa0,0x80,0x00,0x08,0xa0,0x80,0x00,0x09,0xa0,0x80,0x00,0x0a, ++0xa0,0x80,0x00,0x11,0xa0,0x80,0x00,0x13,0xa0,0x80,0x00,0x49,0x94,0xc2,0x00,0x00, ++0xac,0x80,0x00,0x00,0xac,0x80,0x00,0x24,0x00,0x02,0x14,0x00,0x00,0x02,0x14,0x03, ++0x30,0x43,0x00,0xff,0x30,0x42,0xff,0x00,0xa4,0x83,0x00,0x46,0xa4,0x82,0x00,0x44, ++0xac,0x80,0x00,0x28,0xac,0x80,0x00,0x2c,0xac,0x80,0x00,0x30,0xac,0x80,0x00,0x34, ++0xac,0x80,0x00,0x38,0xac,0x80,0x00,0x3c,0x03,0xe0,0x00,0x08,0xac,0x80,0x00,0x40, ++0x84,0x83,0x00,0x0c,0x3c,0x07,0xb0,0x03,0x34,0xe7,0x00,0x20,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x44,0x00,0x43,0x10,0x21, ++0x8c,0x48,0x00,0x18,0x3c,0x02,0x80,0x00,0x24,0x42,0x3a,0xa0,0xac,0xe2,0x00,0x00, ++0x8d,0x03,0x00,0x08,0x80,0x82,0x00,0x13,0x00,0x05,0x2c,0x00,0x00,0x03,0x1e,0x02, ++0x00,0x02,0x12,0x00,0x30,0x63,0x00,0x7e,0x00,0x62,0x18,0x21,0x00,0x65,0x18,0x21, ++0x3c,0x02,0xc0,0x00,0x3c,0x05,0xb0,0x05,0x34,0x42,0x04,0x00,0x24,0x63,0x00,0x01, ++0x3c,0x07,0xb0,0x05,0x3c,0x08,0xb0,0x05,0x34,0xa5,0x04,0x20,0xac,0xa3,0x00,0x00, ++0x00,0xc2,0x30,0x21,0x34,0xe7,0x04,0x24,0x35,0x08,0x02,0x28,0x24,0x02,0x00,0x01, ++0x24,0x03,0x00,0x20,0xac,0xe6,0x00,0x00,0xac,0x82,0x00,0x3c,0x03,0xe0,0x00,0x08, ++0xa1,0x03,0x00,0x00,0x27,0xbd,0xff,0xb0,0x00,0x07,0x60,0x80,0x27,0x82,0xbd,0x40, ++0xaf,0xb7,0x00,0x44,0xaf,0xb6,0x00,0x40,0xaf,0xb5,0x00,0x3c,0xaf,0xb3,0x00,0x34, ++0xaf,0xbf,0x00,0x4c,0xaf,0xbe,0x00,0x48,0xaf,0xb4,0x00,0x38,0xaf,0xb2,0x00,0x30, ++0xaf,0xb1,0x00,0x2c,0xaf,0xb0,0x00,0x28,0x01,0x82,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x00,0xe0,0x70,0x21,0x3c,0x02,0x80,0x00,0x94,0x71,0x00,0x14,0x3c,0x07,0xb0,0x03, ++0x34,0xe7,0x00,0x20,0x24,0x42,0x3b,0x34,0x3c,0x03,0xb0,0x05,0xac,0xe2,0x00,0x00, ++0x34,0x63,0x01,0x28,0x90,0x67,0x00,0x00,0x00,0x11,0xa8,0xc0,0x02,0xb1,0x18,0x21, ++0x27,0x82,0x99,0x44,0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x00,0x05,0x2c,0x00, ++0x00,0x07,0x3e,0x00,0x28,0xc2,0x00,0x03,0x00,0xc0,0x98,0x21,0xaf,0xa4,0x00,0x50, ++0x00,0x05,0xb4,0x03,0x8c,0x68,0x00,0x18,0x02,0xa0,0x58,0x21,0x10,0x40,0x01,0x70, ++0x00,0x07,0xbe,0x03,0x00,0xd7,0x10,0x07,0x30,0x57,0x00,0x01,0x01,0x71,0x10,0x21, ++0x27,0x83,0x99,0x48,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x80,0x4d,0x00,0x06, ++0x8d,0x03,0x00,0x00,0x8d,0x02,0x00,0x04,0x8d,0x0a,0x00,0x08,0x8d,0x03,0x00,0x0c, ++0xaf,0xa2,0x00,0x1c,0x11,0xa0,0x01,0x60,0xaf,0xa3,0x00,0x18,0x27,0x82,0xbd,0x40, ++0x01,0x82,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x83,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x04,0x14,0x60,0x00,0x14,0x00,0x00,0xa0,0x21, ++0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x46,0x90,0x43,0x00,0x00,0x2a,0x64,0x00,0x04, ++0x10,0x80,0x01,0x43,0x30,0x65,0x00,0x01,0x8f,0xa3,0x00,0x50,0x00,0x00,0x00,0x00, ++0x90,0x62,0x00,0x09,0x00,0x00,0x00,0x00,0x12,0x62,0x00,0x02,0x00,0x00,0x00,0x00, ++0x00,0x00,0x28,0x21,0x14,0xa0,0x00,0x03,0x00,0x00,0x38,0x21,0x12,0xe0,0x00,0x03, ++0x38,0xf4,0x00,0x01,0x24,0x07,0x00,0x01,0x38,0xf4,0x00,0x01,0x01,0x71,0x10,0x21, ++0x00,0x02,0x30,0x80,0x27,0x83,0x99,0x50,0x00,0xc3,0x48,0x21,0x91,0x25,0x00,0x00, ++0x8f,0xa3,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x03,0x11,0xc3,0x2c,0xa3,0x00,0x04, ++0x30,0x42,0x00,0x01,0x00,0x03,0xa0,0x0b,0x12,0x80,0x00,0xc7,0xaf,0xa2,0x00,0x20, ++0x93,0x90,0xc5,0x2a,0x00,0x0a,0x16,0x42,0x30,0x52,0x00,0x3f,0x2e,0x06,0x00,0x0c, ++0x10,0xc0,0x00,0xaf,0x00,0xa0,0x20,0x21,0x2c,0xa2,0x00,0x10,0x14,0x40,0x00,0x04, ++0x00,0x90,0x10,0x2b,0x30,0xa2,0x00,0x07,0x24,0x44,0x00,0x04,0x00,0x90,0x10,0x2b, ++0x10,0x40,0x00,0x0b,0x01,0x71,0x10,0x21,0x27,0x85,0xc4,0x5c,0x00,0x10,0x10,0x40, ++0x00,0x50,0x10,0x21,0x00,0x45,0x10,0x21,0x90,0x50,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x90,0x18,0x2b,0x14,0x60,0xff,0xfa,0x00,0x10,0x10,0x40,0x01,0x71,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x48,0x00,0x43,0x10,0x21,0x31,0xa4,0x00,0x01, ++0x10,0x80,0x00,0x94,0xa0,0x50,0x00,0x07,0x24,0x16,0x00,0x0e,0x24,0x11,0x01,0x06, ++0x27,0x82,0xbd,0x40,0x01,0x82,0x10,0x21,0x8c,0x43,0x00,0x00,0x24,0x1e,0x00,0x01, ++0x00,0x11,0xa8,0xc0,0x90,0x62,0x00,0x16,0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x04, ++0xa0,0x62,0x00,0x16,0x8f,0xa5,0x00,0x1c,0x00,0x10,0x32,0x00,0x00,0x05,0x13,0x43, ++0x30,0x47,0x00,0x01,0x8f,0xa2,0x00,0x18,0x8f,0xa5,0x00,0x20,0x00,0x02,0x22,0x02, ++0x00,0x12,0x10,0x40,0x00,0x05,0x19,0xc0,0x30,0x84,0x07,0xff,0x00,0x47,0x10,0x21, ++0x00,0x1e,0x2a,0x80,0x00,0x43,0x10,0x21,0x00,0x04,0x24,0x80,0x02,0x25,0x28,0x21, ++0x00,0xa4,0x28,0x21,0x00,0x46,0x10,0x21,0x00,0x16,0x1c,0x00,0x3c,0x04,0xc0,0x00, ++0x00,0x43,0x30,0x21,0x16,0x60,0x00,0x2b,0x00,0xa4,0x28,0x21,0x3c,0x02,0xb0,0x05, ++0x34,0x42,0x04,0x00,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00, ++0x34,0x63,0x04,0x04,0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x01,0xac,0x65,0x00,0x00, ++0xa0,0x82,0x00,0x00,0x3c,0x02,0xb0,0x09,0x34,0x42,0x01,0x46,0x90,0x44,0x00,0x00, ++0x8f,0xa2,0x00,0x50,0x30,0x86,0x00,0x01,0x90,0x43,0x00,0x09,0x00,0x00,0x00,0x00, ++0x02,0x63,0x18,0x26,0x00,0x03,0x30,0x0b,0x14,0xc0,0x00,0x03,0x00,0x00,0x28,0x21, ++0x12,0xe0,0x00,0x03,0x02,0xb1,0x10,0x21,0x24,0x05,0x00,0x01,0x02,0xb1,0x10,0x21, ++0x27,0x83,0x99,0x48,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x84,0x48,0x00,0x04, ++0x00,0xa0,0x30,0x21,0x00,0xe0,0x20,0x21,0x02,0x60,0x28,0x21,0x02,0x80,0x38,0x21, ++0x0c,0x00,0x00,0x70,0xaf,0xa8,0x00,0x10,0x7b,0xbe,0x02,0x7c,0x7b,0xb6,0x02,0x3c, ++0x7b,0xb4,0x01,0xfc,0x7b,0xb2,0x01,0xbc,0x7b,0xb0,0x01,0x7c,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x50,0x24,0x02,0x00,0x01,0x12,0x62,0x00,0x3d,0x3c,0x02,0xb0,0x05, ++0x24,0x02,0x00,0x02,0x12,0x62,0x00,0x31,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x03, ++0x12,0x62,0x00,0x25,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x10,0x12,0x62,0x00,0x19, ++0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x11,0x12,0x62,0x00,0x0d,0x3c,0x02,0xb0,0x05, ++0x24,0x02,0x00,0x12,0x16,0x62,0xff,0xcf,0x3c,0x02,0xb0,0x05,0x3c,0x03,0xb0,0x05, ++0x34,0x42,0x04,0x20,0x3c,0x04,0xb0,0x05,0x34,0x63,0x04,0x24,0xac,0x46,0x00,0x00, ++0x34,0x84,0x02,0x28,0xac,0x65,0x00,0x00,0x08,0x00,0x0f,0x74,0x24,0x02,0x00,0x20, ++0x34,0x42,0x04,0x40,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00, ++0x34,0x63,0x04,0x44,0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x40,0x08,0x00,0x0f,0x74, ++0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x28,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05, ++0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x2c,0x34,0x84,0x02,0x28,0x24,0x02,0xff,0x80, ++0x08,0x00,0x0f,0x74,0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x18,0x3c,0x03,0xb0,0x05, ++0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x1c,0x34,0x84,0x02,0x28, ++0x24,0x02,0x00,0x08,0x08,0x00,0x0f,0x74,0xac,0x65,0x00,0x00,0x34,0x42,0x04,0x10, ++0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00,0x34,0x63,0x04,0x14, ++0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x04,0x08,0x00,0x0f,0x74,0xac,0x65,0x00,0x00, ++0x34,0x42,0x04,0x08,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05,0xac,0x46,0x00,0x00, ++0x34,0x63,0x04,0x0c,0x34,0x84,0x02,0x28,0x24,0x02,0x00,0x02,0x08,0x00,0x0f,0x74, ++0xac,0x65,0x00,0x00,0x24,0x16,0x00,0x14,0x08,0x00,0x0f,0x4c,0x24,0x11,0x01,0x02, ++0x30,0xa2,0x00,0x07,0x24,0x44,0x00,0x0c,0x00,0x90,0x18,0x2b,0x10,0x60,0x00,0x0c, ++0x26,0x02,0x00,0x04,0x27,0x85,0xc4,0x5c,0x00,0x10,0x10,0x40,0x00,0x50,0x10,0x21, ++0x00,0x45,0x10,0x21,0x90,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x18,0x2b, ++0x14,0x60,0xff,0xfa,0x00,0x10,0x10,0x40,0x2e,0x06,0x00,0x0c,0x26,0x02,0x00,0x04, ++0x08,0x00,0x0f,0x43,0x00,0x46,0x80,0x0a,0x27,0x82,0xbd,0x40,0x01,0x82,0x20,0x21, ++0x8c,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xe2,0x00,0x19,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x07,0x00,0x00,0x00,0x00,0x27,0x82,0x99,0x60,0x00,0xc2,0x10,0x21, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x12,0x00,0x00,0x00,0x00, ++0x90,0xe3,0x00,0x16,0x27,0x82,0x99,0x48,0x00,0xc2,0x10,0x21,0x34,0x63,0x00,0x20, ++0x90,0x50,0x00,0x07,0xa0,0xe3,0x00,0x16,0x8c,0x84,0x00,0x00,0x00,0x0a,0x16,0x42, ++0x30,0x52,0x00,0x3f,0x90,0x83,0x00,0x16,0x24,0x16,0x00,0x18,0x24,0x11,0x01,0x03, ++0x30,0x63,0x00,0xfb,0x24,0x1e,0x00,0x01,0x24,0x15,0x08,0x18,0x08,0x00,0x0f,0x55, ++0xa0,0x83,0x00,0x16,0x8d,0x02,0x00,0x04,0x00,0x0a,0x1c,0x42,0x30,0x42,0x00,0x10, ++0x14,0x40,0x00,0x15,0x30,0x72,0x00,0x3f,0x81,0x22,0x00,0x05,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x11,0x30,0x72,0x00,0x3e,0x27,0x83,0x99,0x58,0x00,0xc3,0x18,0x21, ++0x80,0x64,0x00,0x00,0x27,0x83,0xbe,0xb8,0x00,0x04,0x11,0x00,0x00,0x44,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x90,0x44,0x00,0x05,0x90,0x43,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x64,0x18,0x24, ++0x30,0x63,0x00,0x01,0x02,0x43,0x90,0x25,0x27,0x85,0xbd,0x40,0x01,0x85,0x28,0x21, ++0x8c,0xa6,0x00,0x00,0x01,0x71,0x10,0x21,0x27,0x83,0x99,0x50,0x90,0xc4,0x00,0x16, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x30,0x84,0x00,0xdf,0x90,0x50,0x00,0x00, ++0xa0,0xc4,0x00,0x16,0x8c,0xa3,0x00,0x00,0x2d,0xc4,0x00,0x02,0x80,0xde,0x00,0x12, ++0x90,0x62,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfb,0x14,0x80,0x00,0x06, ++0xa0,0x62,0x00,0x16,0x24,0x02,0x00,0x06,0x11,0xc2,0x00,0x03,0x24,0x02,0x00,0x04, ++0x15,0xc2,0xff,0x14,0x00,0x00,0x00,0x00,0x32,0x42,0x00,0x02,0x2e,0x03,0x00,0x0c, ++0x14,0x60,0x00,0x0d,0x00,0x02,0x20,0x2b,0x32,0x02,0x00,0x0f,0x34,0x42,0x00,0x10, ++0x00,0x04,0x19,0x00,0x00,0x43,0x18,0x21,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xb8, ++0x00,0x00,0x20,0x21,0x02,0x00,0x28,0x21,0x0c,0x00,0x01,0xfb,0xa0,0x43,0x00,0x00, ++0x08,0x00,0x0f,0x55,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x4a,0x32,0x03,0x00,0xff, ++0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x42,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x0f,0x14,0x40,0xfe,0xbf,0x00,0x00,0x00,0x00,0x8f,0xa3,0x00,0x50, ++0x00,0x00,0x00,0x00,0x90,0x62,0x00,0x09,0x00,0x00,0x00,0x00,0x02,0x62,0x10,0x26, ++0x08,0x00,0x0f,0x19,0x00,0x02,0x28,0x0b,0x08,0x00,0x0f,0x1f,0x00,0x00,0xa0,0x21, ++0x24,0x02,0x00,0x10,0x10,0xc2,0x00,0x08,0x24,0x02,0x00,0x11,0x10,0xc2,0xfe,0x8e, ++0x00,0x07,0x17,0x83,0x24,0x02,0x00,0x12,0x14,0xc2,0xfe,0x8c,0x00,0x07,0x17,0x43, ++0x08,0x00,0x0e,0xf7,0x30,0x57,0x00,0x01,0x08,0x00,0x0e,0xf7,0x00,0x07,0xbf,0xc2, ++0x00,0x04,0x10,0x40,0x27,0x83,0x86,0x30,0x00,0x43,0x10,0x21,0x00,0x80,0x40,0x21, ++0x94,0x44,0x00,0x00,0x2d,0x07,0x00,0x04,0x24,0xc2,0x00,0x03,0x00,0x47,0x30,0x0a, ++0x00,0x86,0x00,0x18,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20, ++0x24,0x42,0x41,0xc0,0xac,0x62,0x00,0x00,0x2d,0x06,0x00,0x10,0x00,0x00,0x20,0x12, ++0x00,0x04,0x22,0x42,0x24,0x84,0x00,0x01,0x24,0x83,0x00,0xc0,0x10,0xe0,0x00,0x0b, ++0x24,0x82,0x00,0x60,0x00,0x40,0x20,0x21,0x00,0x65,0x20,0x0a,0x3c,0x03,0xb0,0x03, ++0x34,0x63,0x01,0x00,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x00,0x44,0x20,0x04,0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x24,0x85,0x00,0x28, ++0x24,0x83,0x00,0x24,0x31,0x02,0x00,0x08,0x14,0xc0,0xff,0xf4,0x24,0x84,0x00,0x14, ++0x00,0x60,0x20,0x21,0x08,0x00,0x10,0x87,0x00,0xa2,0x20,0x0b,0x27,0xbd,0xff,0xe0, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0xaf,0xb0,0x00,0x10,0x24,0x42,0x42,0x5c, ++0x00,0x80,0x80,0x21,0x34,0x63,0x00,0x20,0x3c,0x04,0xb0,0x03,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x1c,0x83,0xb1,0x00,0x33,0x83,0xa8,0x00,0x37, ++0x34,0x84,0x01,0x10,0xac,0x62,0x00,0x00,0x2e,0x02,0x00,0x10,0x00,0xe0,0x90,0x21, ++0x8c,0x87,0x00,0x00,0x14,0x40,0x00,0x0c,0x2e,0x02,0x00,0x0c,0x3c,0x02,0x00,0x0f, ++0x34,0x42,0xf0,0x00,0x00,0xe2,0x10,0x24,0x14,0x40,0x00,0x37,0x32,0x02,0x00,0x08, ++0x32,0x02,0x00,0x07,0x27,0x83,0x86,0xe0,0x00,0x43,0x10,0x21,0x90,0x50,0x00,0x00, ++0x00,0x00,0x00,0x00,0x2e,0x02,0x00,0x0c,0x14,0x40,0x00,0x03,0x02,0x00,0x20,0x21, ++0x32,0x02,0x00,0x0f,0x24,0x44,0x00,0x0c,0x00,0x87,0x10,0x06,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x07,0x2c,0x82,0x00,0x0c,0x00,0x04,0x10,0x80,0x27,0x83,0xbd,0x90, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x82,0x00,0x0c, ++0x14,0x40,0x00,0x05,0x00,0x05,0x10,0x40,0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00, ++0x00,0x82,0x10,0x21,0x24,0x44,0x00,0x04,0x15,0x00,0x00,0x02,0x24,0x06,0x00,0x20, ++0x24,0x06,0x00,0x0e,0x0c,0x00,0x10,0x70,0x00,0x00,0x00,0x00,0x00,0x40,0x30,0x21, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x00,0x90,0x43,0x00,0x00,0x2e,0x04,0x00,0x04, ++0x24,0x02,0x00,0x10,0x24,0x05,0x00,0x0a,0x00,0x44,0x28,0x0a,0x30,0x63,0x00,0x01, ++0x14,0x60,0x00,0x02,0x00,0x05,0x10,0x40,0x00,0xa0,0x10,0x21,0x30,0x45,0x00,0xff, ++0x00,0xc5,0x10,0x21,0x24,0x46,0x00,0x46,0x02,0x26,0x18,0x04,0xa6,0x43,0x00,0x00, ++0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x00,0xc0,0x10,0x21, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x10,0x40,0xff,0xcf,0x2e,0x02,0x00,0x0c, ++0x32,0x02,0x00,0x07,0x27,0x83,0x86,0xd8,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x00, ++0x08,0x00,0x10,0xb5,0x02,0x04,0x80,0x23,0x27,0xbd,0xff,0xb8,0x00,0x05,0x38,0x80, ++0x27,0x82,0xbd,0x40,0xaf,0xbe,0x00,0x40,0xaf,0xb6,0x00,0x38,0xaf,0xb3,0x00,0x2c, ++0xaf,0xbf,0x00,0x44,0xaf,0xb7,0x00,0x3c,0xaf,0xb5,0x00,0x34,0xaf,0xb4,0x00,0x30, ++0xaf,0xb2,0x00,0x28,0xaf,0xb1,0x00,0x24,0xaf,0xb0,0x00,0x20,0x00,0xe2,0x38,0x21, ++0x8c,0xe6,0x00,0x00,0xaf,0xa5,0x00,0x4c,0x3c,0x02,0x80,0x00,0x3c,0x05,0xb0,0x03, ++0x34,0xa5,0x00,0x20,0x24,0x42,0x43,0xb8,0x24,0x03,0x00,0x01,0xac,0xa2,0x00,0x00, ++0xa0,0xc3,0x00,0x12,0x8c,0xe5,0x00,0x00,0x94,0xc3,0x00,0x06,0x90,0xa2,0x00,0x16, ++0xa4,0xc3,0x00,0x14,0x27,0x83,0x99,0x40,0x34,0x42,0x00,0x08,0xa0,0xa2,0x00,0x16, ++0x8c,0xe8,0x00,0x00,0xaf,0xa4,0x00,0x48,0x27,0x82,0x99,0x44,0x95,0x11,0x00,0x14, ++0x00,0x00,0x00,0x00,0x00,0x11,0x98,0xc0,0x02,0x71,0x20,0x21,0x00,0x04,0x20,0x80, ++0x00,0x82,0x10,0x21,0x8c,0x52,0x00,0x18,0x00,0x83,0x18,0x21,0x84,0x75,0x00,0x06, ++0x8e,0x45,0x00,0x08,0x8e,0x46,0x00,0x04,0x8e,0x47,0x00,0x04,0x00,0x05,0x1c,0x82, ++0x00,0x06,0x31,0x42,0x27,0x82,0x99,0x50,0x30,0x63,0x00,0x01,0x30,0xc6,0x00,0x01, ++0x00,0x82,0x20,0x21,0xa5,0x15,0x00,0x1a,0x00,0x05,0x14,0x42,0xaf,0xa3,0x00,0x18, ++0xaf,0xa6,0x00,0x1c,0x30,0xe7,0x00,0x10,0x30,0x56,0x00,0x01,0x80,0x97,0x00,0x06, ++0x14,0xe0,0x00,0x47,0x00,0x05,0xf7,0xc2,0x80,0x82,0x00,0x05,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x44,0x02,0x71,0x10,0x21,0x93,0x90,0xc5,0x29,0x00,0x00,0x00,0x00, ++0x2e,0x02,0x00,0x0c,0x14,0x40,0x00,0x06,0x02,0x00,0x20,0x21,0x00,0x16,0x10,0x40, ++0x00,0x43,0x10,0x21,0x00,0x02,0x11,0x00,0x02,0x02,0x10,0x21,0x24,0x44,0x00,0x04, ++0x02,0x71,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21, ++0x00,0x80,0x80,0x21,0xa0,0x44,0x00,0x03,0xa0,0x44,0x00,0x00,0x02,0x00,0x20,0x21, ++0x02,0xc0,0x28,0x21,0x0c,0x00,0x10,0x70,0x02,0xa0,0x30,0x21,0x02,0x71,0x18,0x21, ++0x00,0x03,0x88,0x80,0x00,0x40,0xa0,0x21,0x27,0x82,0x99,0x60,0x02,0x22,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x26,0xe3,0x00,0x02,0x00,0x03,0x17,0xc2,0x00,0x62,0x18,0x21, ++0x00,0x04,0x25,0xc2,0x00,0x03,0x18,0x43,0x30,0x84,0x00,0x01,0x00,0x03,0x18,0x40, ++0x03,0xc4,0x20,0x24,0x14,0x80,0x00,0x15,0x02,0x43,0x38,0x21,0x3c,0x08,0xb0,0x03, ++0x35,0x08,0x00,0x28,0x8d,0x03,0x00,0x00,0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x48, ++0x27,0x82,0x99,0x48,0x02,0x22,0x10,0x21,0x24,0x63,0x00,0x01,0x02,0xa0,0x28,0x21, ++0xa4,0x54,0x00,0x04,0x00,0xc0,0x38,0x21,0x0c,0x00,0x0e,0xcd,0xad,0x03,0x00,0x00, ++0x7b,0xbe,0x02,0x3c,0x7b,0xb6,0x01,0xfc,0x7b,0xb4,0x01,0xbc,0x7b,0xb2,0x01,0x7c, ++0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x48,0x8f,0xa2,0x00,0x1c, ++0x8f,0xa6,0x00,0x18,0x02,0x00,0x20,0x21,0x02,0xc0,0x28,0x21,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x10,0x97,0xaf,0xa0,0x00,0x14,0x08,0x00,0x11,0x53,0x02,0x82,0xa0,0x21, ++0x02,0x71,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21, ++0x90,0x50,0x00,0x00,0x08,0x00,0x11,0x3f,0xa0,0x50,0x00,0x03,0x27,0xbd,0xff,0xb8, ++0xaf,0xb1,0x00,0x24,0x8f,0xb1,0x00,0x5c,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x34,0x63,0x00,0x20,0x24,0x42,0x45,0xdc,0xaf,0xbe,0x00,0x40,0xaf,0xb7,0x00,0x3c, ++0xaf,0xb6,0x00,0x38,0xaf,0xb5,0x00,0x34,0xaf,0xb4,0x00,0x30,0xaf,0xa5,0x00,0x4c, ++0x8f,0xb5,0x00,0x58,0xaf,0xbf,0x00,0x44,0xaf,0xb3,0x00,0x2c,0xaf,0xb2,0x00,0x28, ++0xaf,0xb0,0x00,0x20,0x00,0xe0,0xb0,0x21,0xac,0x62,0x00,0x00,0x00,0x80,0xf0,0x21, ++0x00,0x00,0xb8,0x21,0x16,0x20,0x00,0x2b,0x00,0x00,0xa0,0x21,0x27,0x85,0xbd,0x40, ++0x00,0x07,0x10,0x80,0x00,0x45,0x10,0x21,0x8c,0x53,0x00,0x00,0x00,0x15,0x18,0x80, ++0x00,0x65,0x18,0x21,0x92,0x62,0x00,0x16,0x8c,0x72,0x00,0x00,0x30,0x42,0x00,0x03, ++0x14,0x40,0x00,0x2d,0x00,0x00,0x00,0x00,0x92,0x42,0x00,0x16,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x03,0x14,0x40,0x00,0x28,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x34, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x18,0x02,0x20,0x10,0x21,0x8c,0x82,0x00,0x38, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x14,0x02,0x20,0x10,0x21,0x8c,0x82,0x00,0x3c, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x0f,0x3c,0x03,0xb0,0x09,0x3c,0x05,0xb0,0x05, ++0x34,0x63,0x01,0x44,0x34,0xa5,0x02,0x52,0x94,0x66,0x00,0x00,0x90,0xa2,0x00,0x00, ++0x8f,0xa3,0x00,0x4c,0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x06,0x30,0x42,0x00,0x01, ++0x10,0x40,0x00,0x04,0x30,0xc6,0xff,0xff,0x2c,0xc2,0x00,0x41,0x10,0x40,0x00,0x09, ++0x24,0x05,0x00,0x14,0x02,0x20,0x10,0x21,0x7b,0xbe,0x02,0x3c,0x7b,0xb6,0x01,0xfc, ++0x7b,0xb4,0x01,0xbc,0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x48,0x0c,0x00,0x0e,0xa8,0x24,0x06,0x01,0x07,0x24,0x02,0x00,0x01, ++0x08,0x00,0x11,0xb9,0xa3,0xc2,0x00,0x11,0x10,0xc0,0x00,0x1c,0x24,0x02,0x00,0x01, ++0x10,0xc2,0x00,0x17,0x00,0xc0,0x88,0x21,0x96,0x54,0x00,0x1a,0x02,0xa0,0xb8,0x21, ++0x12,0x20,0xff,0xed,0x02,0x20,0x10,0x21,0x27,0x83,0xbd,0x40,0x00,0x17,0x10,0x80, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x28, ++0x80,0x86,0x00,0x12,0x8c,0x62,0x00,0x00,0x00,0x14,0x2c,0x00,0x00,0x05,0x2c,0x03, ++0x00,0x46,0x10,0x21,0x8f,0xa6,0x00,0x4c,0x02,0xe0,0x38,0x21,0x03,0xc0,0x20,0x21, ++0x0c,0x00,0x0e,0xcd,0xac,0x62,0x00,0x00,0x08,0x00,0x11,0xb9,0xaf,0xd1,0x00,0x40, ++0x96,0x74,0x00,0x1a,0x08,0x00,0x11,0xcc,0x02,0xc0,0xb8,0x21,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x08,0x8c,0x50,0x00,0x00,0x02,0x60,0x20,0x21,0x0c,0x00,0x26,0x64, ++0x02,0x00,0x28,0x21,0x30,0x42,0x00,0xff,0x02,0x00,0x28,0x21,0x02,0x40,0x20,0x21, ++0x0c,0x00,0x26,0x64,0xaf,0xa2,0x00,0x18,0x8f,0xa4,0x00,0x18,0x00,0x00,0x00,0x00, ++0x10,0x80,0x00,0xed,0x30,0x50,0x00,0xff,0x12,0x00,0x00,0x18,0x24,0x11,0x00,0x01, ++0x96,0x63,0x00,0x14,0x96,0x44,0x00,0x14,0x27,0x85,0x99,0x40,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21,0x00,0x04,0x18,0xc0, ++0x8c,0x46,0x00,0x08,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x65,0x18,0x21, ++0x00,0x06,0x17,0x02,0x24,0x04,0x00,0xff,0x8c,0x63,0x00,0x08,0x10,0x44,0x00,0xd6, ++0x00,0x03,0x17,0x02,0x10,0x44,0x00,0xd5,0x3c,0x02,0x80,0x00,0x00,0x66,0x18,0x2b, ++0x24,0x11,0x00,0x02,0x24,0x02,0x00,0x01,0x00,0x43,0x88,0x0a,0x24,0x02,0x00,0x01, ++0x12,0x22,0x00,0x5a,0x24,0x02,0x00,0x02,0x16,0x22,0xff,0xbd,0x00,0x00,0x00,0x00, ++0x96,0x49,0x00,0x14,0x27,0x82,0x99,0x44,0x02,0xa0,0xb8,0x21,0x00,0x09,0x50,0xc0, ++0x01,0x49,0x18,0x21,0x00,0x03,0x40,0x80,0x01,0x02,0x10,0x21,0x8c,0x43,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x65,0x00,0x08,0x8c,0x62,0x00,0x0c,0x8c,0x62,0x00,0x04, ++0x00,0x05,0x24,0x42,0x00,0x05,0x1c,0x82,0x30,0x42,0x00,0x10,0x30,0x66,0x00,0x01, ++0x14,0x40,0x00,0x41,0x30,0x87,0x00,0x01,0x27,0x82,0x99,0x58,0x01,0x02,0x10,0x21, ++0x80,0x44,0x00,0x00,0x27,0x82,0xbe,0xb8,0x00,0x04,0x19,0x00,0x00,0x64,0x18,0x23, ++0x00,0x03,0x18,0x80,0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21, ++0x90,0x45,0x00,0x05,0x27,0x84,0xbd,0xe0,0x00,0x64,0x18,0x21,0x90,0x63,0x00,0x00, ++0x10,0xa0,0x00,0x2b,0x2c,0x64,0x00,0x0c,0x14,0x80,0x00,0x04,0x00,0x60,0x10,0x21, ++0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21,0x24,0x42,0x00,0x24,0x3c,0x01,0xb0,0x03, ++0xa0,0x22,0x00,0xb9,0x14,0x80,0x00,0x06,0x00,0x60,0x28,0x21,0x00,0x07,0x10,0x40, ++0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0x62,0x10,0x21,0x24,0x45,0x00,0x04, ++0x01,0x49,0x10,0x21,0x27,0x83,0x99,0x50,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x00,0xa0,0x18,0x21,0xa0,0x45,0x00,0x03,0xa0,0x45,0x00,0x00,0x24,0x02,0x00,0x08, ++0x12,0x02,0x00,0x0b,0x24,0x02,0x00,0x01,0x00,0x60,0x28,0x21,0x02,0x40,0x20,0x21, ++0x0c,0x00,0x26,0xe0,0xaf,0xa2,0x00,0x10,0x30,0x54,0xff,0xff,0x92,0x42,0x00,0x16, ++0x00,0x00,0x00,0x00,0x02,0x02,0x10,0x25,0x08,0x00,0x11,0xcc,0xa2,0x42,0x00,0x16, ++0x00,0x60,0x28,0x21,0x02,0x40,0x20,0x21,0x0c,0x00,0x26,0x91,0xaf,0xa0,0x00,0x10, ++0x08,0x00,0x12,0x4f,0x30,0x54,0xff,0xff,0x08,0x00,0x12,0x37,0x00,0x60,0x10,0x21, ++0x14,0x80,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21, ++0x08,0x00,0x12,0x37,0x24,0x42,0x00,0x04,0x27,0x82,0x99,0x50,0x01,0x02,0x10,0x21, ++0x90,0x43,0x00,0x00,0x08,0x00,0x12,0x47,0xa0,0x43,0x00,0x03,0x96,0x69,0x00,0x14, ++0x02,0xc0,0xb8,0x21,0x24,0x0b,0x00,0x01,0x00,0x09,0x10,0xc0,0x00,0x49,0x18,0x21, ++0x00,0x03,0x40,0x80,0x00,0x40,0x50,0x21,0x27,0x82,0x99,0x44,0x01,0x02,0x10,0x21, ++0x8c,0x43,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x65,0x00,0x08,0x8c,0x62,0x00,0x0c, ++0x8c,0x62,0x00,0x04,0x00,0x05,0x24,0x42,0x00,0x05,0x1c,0x82,0x30,0x42,0x00,0x10, ++0x30,0x66,0x00,0x01,0x10,0x40,0x00,0x0d,0x30,0x87,0x00,0x01,0x27,0x82,0x99,0x58, ++0x01,0x02,0x10,0x21,0x80,0x43,0x00,0x00,0x00,0x00,0x58,0x21,0x00,0x03,0x11,0x00, ++0x00,0x43,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x23,0x00,0x02,0x10,0x80, ++0x27,0x83,0xbe,0xb0,0x00,0x43,0x10,0x21,0xa0,0x40,0x00,0x04,0x11,0x60,0x00,0x4f, ++0x00,0x00,0x00,0x00,0x01,0x49,0x10,0x21,0x00,0x02,0x20,0x80,0x27,0x85,0x99,0x50, ++0x00,0x85,0x10,0x21,0x80,0x43,0x00,0x05,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x42, ++0x01,0x49,0x10,0x21,0x27,0x82,0x99,0x58,0x00,0x82,0x10,0x21,0x80,0x44,0x00,0x00, ++0x27,0x82,0xbe,0xb8,0x00,0x04,0x19,0x00,0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80, ++0x00,0x64,0x18,0x23,0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21,0x90,0x45,0x00,0x05, ++0x27,0x84,0xbd,0xe0,0x00,0x64,0x18,0x21,0x90,0x63,0x00,0x00,0x10,0xa0,0x00,0x2c, ++0x2c,0x64,0x00,0x0c,0x14,0x80,0x00,0x04,0x00,0x60,0x10,0x21,0x00,0x06,0x11,0x00, ++0x00,0x62,0x10,0x21,0x24,0x42,0x00,0x24,0x3c,0x01,0xb0,0x03,0xa0,0x22,0x00,0xb9, ++0x14,0x80,0x00,0x06,0x00,0x60,0x28,0x21,0x00,0x07,0x10,0x40,0x00,0x46,0x10,0x21, ++0x00,0x02,0x11,0x00,0x00,0x62,0x10,0x21,0x24,0x45,0x00,0x04,0x01,0x49,0x10,0x21, ++0x27,0x83,0x99,0x50,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x00,0xa0,0x18,0x21, ++0xa0,0x45,0x00,0x03,0xa0,0x45,0x00,0x00,0x8f,0xa4,0x00,0x18,0x24,0x02,0x00,0x08, ++0x10,0x82,0x00,0x0c,0x00,0x60,0x28,0x21,0x24,0x02,0x00,0x01,0x02,0x60,0x20,0x21, ++0x0c,0x00,0x26,0xe0,0xaf,0xa2,0x00,0x10,0x8f,0xa3,0x00,0x18,0x30,0x54,0xff,0xff, ++0x92,0x62,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x25,0x08,0x00,0x11,0xcc, ++0xa2,0x62,0x00,0x16,0x02,0x60,0x20,0x21,0x0c,0x00,0x26,0x91,0xaf,0xa0,0x00,0x10, ++0x08,0x00,0x12,0xbe,0x00,0x00,0x00,0x00,0x08,0x00,0x12,0xa6,0x00,0x60,0x10,0x21, ++0x14,0x80,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x06,0x11,0x00,0x00,0x62,0x10,0x21, ++0x08,0x00,0x12,0xa6,0x24,0x42,0x00,0x04,0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21, ++0x90,0x43,0x00,0x00,0x08,0x00,0x12,0xb6,0xa0,0x43,0x00,0x03,0x27,0x85,0x99,0x50, ++0x08,0x00,0x12,0xd2,0x01,0x49,0x10,0x21,0x3c,0x02,0x80,0x00,0x00,0x62,0x18,0x26, ++0x08,0x00,0x12,0x07,0x00,0xc2,0x30,0x26,0x12,0x00,0xff,0x2d,0x24,0x02,0x00,0x01, ++0x08,0x00,0x12,0x0c,0x24,0x11,0x00,0x02,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00, ++0x27,0xbd,0xff,0xd0,0x24,0x42,0x4b,0x88,0x34,0x63,0x00,0x20,0x3c,0x05,0xb0,0x05, ++0xaf,0xb3,0x00,0x24,0xaf,0xb2,0x00,0x20,0xaf,0xb1,0x00,0x1c,0xaf,0xbf,0x00,0x28, ++0xaf,0xb0,0x00,0x18,0xac,0x62,0x00,0x00,0x34,0xa5,0x02,0x42,0x90,0xa2,0x00,0x00, ++0x00,0x80,0x90,0x21,0x24,0x11,0x00,0x10,0x30,0x53,0x00,0xff,0x24,0x02,0x00,0x10, ++0x12,0x22,0x00,0xcf,0x00,0x00,0x18,0x21,0x24,0x02,0x00,0x11,0x12,0x22,0x00,0xc1, ++0x24,0x02,0x00,0x12,0x12,0x22,0x00,0xb4,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0xad, ++0xae,0x43,0x00,0x40,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c,0x8c,0x44,0x00,0x00, ++0x3c,0x03,0x00,0x02,0x34,0x63,0x00,0xff,0x00,0x83,0x80,0x24,0x00,0x10,0x14,0x43, ++0x10,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x8e,0x42,0x00,0x34,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x92,0x00,0x00,0x00,0x00,0x93,0x83,0x94,0x51,0x00,0x00,0x00,0x00, ++0x30,0x62,0x00,0x02,0x10,0x40,0x00,0x04,0x32,0x10,0x00,0xff,0x00,0x10,0x11,0xc3, ++0x14,0x40,0x00,0x86,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x15,0x02,0x00,0x10,0x21, ++0x26,0x22,0x00,0x01,0x30,0x51,0x00,0xff,0x2e,0x23,0x00,0x13,0x14,0x60,0xff,0xdb, ++0x24,0x03,0x00,0x02,0x12,0x63,0x00,0x73,0x24,0x02,0x00,0x05,0x2a,0x62,0x00,0x03, ++0x10,0x40,0x00,0x58,0x24,0x02,0x00,0x04,0x24,0x02,0x00,0x01,0x12,0x62,0x00,0x4b, ++0x02,0x40,0x20,0x21,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x70,0x00,0xff,0x12,0x00,0x00,0x06,0x02,0x00,0x10,0x21, ++0x8f,0xbf,0x00,0x28,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x30,0x92,0x46,0x00,0x04,0x8e,0x43,0x00,0x24,0x24,0x02,0x00,0x07, ++0x02,0x40,0x20,0x21,0x00,0x00,0x28,0x21,0x24,0x07,0x00,0x06,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x24,0x3c,0x02,0xb0,0x05, ++0x8c,0x42,0x02,0x2c,0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xec, ++0x02,0x00,0x10,0x21,0x92,0x46,0x00,0x05,0x8e,0x43,0x00,0x28,0x24,0x02,0x00,0x05, ++0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x01,0x24,0x07,0x00,0x04,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x28,0x3c,0x02,0xb0,0x05, ++0x8c,0x42,0x02,0x2c,0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xdc, ++0x02,0x00,0x10,0x21,0x92,0x46,0x00,0x06,0x8e,0x43,0x00,0x2c,0x24,0x02,0x00,0x03, ++0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x02,0x00,0x00,0x38,0x21,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x2c,0x3c,0x02,0xb0,0x05, ++0x8c,0x42,0x02,0x2c,0x00,0x00,0x00,0x00,0x30,0x50,0x00,0xff,0x16,0x00,0xff,0xcc, ++0x02,0x00,0x10,0x21,0x92,0x46,0x00,0x07,0x8e,0x43,0x00,0x30,0x24,0x02,0x00,0x02, ++0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x03,0x24,0x07,0x00,0x01,0xaf,0xa2,0x00,0x10, ++0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0xae,0x42,0x00,0x30,0x3c,0x02,0xb0,0x05, ++0x8c,0x42,0x02,0x2c,0x08,0x00,0x13,0x28,0x30,0x42,0x00,0xff,0x92,0x46,0x00,0x04, ++0x8e,0x43,0x00,0x24,0x24,0x02,0x00,0x07,0x00,0x00,0x28,0x21,0x24,0x07,0x00,0x06, ++0xaf,0xa2,0x00,0x10,0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0x08,0x00,0x13,0x21, ++0xae,0x42,0x00,0x24,0x12,0x62,0x00,0x0d,0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x08, ++0x16,0x62,0xff,0xa8,0x02,0x40,0x20,0x21,0x92,0x46,0x00,0x07,0x8e,0x42,0x00,0x30, ++0x24,0x05,0x00,0x03,0x24,0x07,0x00,0x01,0xaf,0xa3,0x00,0x10,0x0c,0x00,0x11,0x77, ++0xaf,0xa2,0x00,0x14,0x08,0x00,0x13,0x21,0xae,0x42,0x00,0x30,0x92,0x46,0x00,0x06, ++0x8e,0x43,0x00,0x2c,0x02,0x40,0x20,0x21,0x24,0x05,0x00,0x02,0x00,0x00,0x38,0x21, ++0xaf,0xa2,0x00,0x10,0x0c,0x00,0x11,0x77,0xaf,0xa3,0x00,0x14,0x08,0x00,0x13,0x21, ++0xae,0x42,0x00,0x2c,0x92,0x46,0x00,0x05,0x8e,0x43,0x00,0x28,0x02,0x40,0x20,0x21, ++0x24,0x05,0x00,0x01,0x24,0x07,0x00,0x04,0xaf,0xa2,0x00,0x10,0x0c,0x00,0x11,0x77, ++0xaf,0xa3,0x00,0x14,0x08,0x00,0x13,0x21,0xae,0x42,0x00,0x28,0x0c,0x00,0x01,0x57, ++0x24,0x04,0x00,0x01,0x08,0x00,0x13,0x12,0x00,0x00,0x00,0x00,0x8f,0x84,0xbd,0x80, ++0xae,0x40,0x00,0x34,0x94,0x85,0x00,0x14,0x0c,0x00,0x22,0xe1,0x00,0x00,0x00,0x00, ++0x93,0x83,0x94,0x51,0x00,0x00,0x00,0x00,0x30,0x62,0x00,0x02,0x10,0x40,0xff,0x69, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x01,0x57,0x00,0x00,0x20,0x21,0x08,0x00,0x13,0x0a, ++0x00,0x00,0x00,0x00,0x02,0x40,0x20,0x21,0x0c,0x00,0x10,0xee,0x02,0x20,0x28,0x21, ++0x08,0x00,0x12,0xfe,0x3c,0x02,0xb0,0x05,0x8e,0x42,0x00,0x3c,0x00,0x00,0x00,0x00, ++0x14,0x40,0xff,0x4a,0x00,0x00,0x00,0x00,0x8f,0x82,0xbd,0x88,0x00,0x00,0x00,0x00, ++0x90,0x42,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x2b,0x08,0x00,0x12,0xfb, ++0xae,0x43,0x00,0x3c,0x8e,0x42,0x00,0x38,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x3d, ++0x24,0x02,0x00,0x12,0x8f,0x82,0xbd,0x84,0x00,0x00,0x00,0x00,0x90,0x42,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x00,0x02,0x18,0x2b,0x08,0x00,0x12,0xfb,0xae,0x43,0x00,0x38, ++0x8e,0x42,0x00,0x34,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x30,0x24,0x02,0x00,0x11, ++0x8f,0x82,0xbd,0x80,0x00,0x00,0x00,0x00,0x90,0x42,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x00,0x02,0x18,0x2b,0x08,0x00,0x12,0xfb,0xae,0x43,0x00,0x34,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xe0,0x34,0x63,0x00,0x20,0x24,0x42,0x4f,0x3c, ++0x3c,0x08,0xb0,0x03,0xaf,0xb1,0x00,0x14,0xac,0x62,0x00,0x00,0x35,0x08,0x01,0x00, ++0xaf,0xbf,0x00,0x18,0xaf,0xb0,0x00,0x10,0x91,0x03,0x00,0x00,0x00,0xa0,0x48,0x21, ++0x24,0x11,0x00,0x0a,0x2c,0xa5,0x00,0x04,0x24,0x02,0x00,0x10,0x00,0x45,0x88,0x0a, ++0x30,0x63,0x00,0x01,0x00,0xc0,0x28,0x21,0x14,0x60,0x00,0x02,0x00,0x11,0x40,0x40, ++0x02,0x20,0x40,0x21,0x84,0x83,0x00,0x0c,0x31,0x11,0x00,0xff,0x01,0x20,0x20,0x21, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x48, ++0x00,0x43,0x10,0x21,0x84,0x43,0x00,0x04,0x24,0x06,0x00,0x0e,0x10,0xe0,0x00,0x06, ++0x02,0x23,0x80,0x21,0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x10,0x70,0x00,0x00,0x00,0x00, ++0x02,0x11,0x18,0x21,0x08,0x00,0x13,0xf1,0x00,0x62,0x80,0x21,0x27,0xbd,0xff,0xd0, ++0xaf,0xbf,0x00,0x28,0xaf,0xb4,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18, ++0xaf,0xb5,0x00,0x24,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0x84,0x82,0x00,0x0c, ++0x3c,0x06,0xb0,0x03,0x34,0xc6,0x00,0x20,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21, ++0x00,0x03,0x18,0x80,0x27,0x82,0x99,0x44,0x00,0x62,0x10,0x21,0x8c,0x55,0x00,0x18, ++0x3c,0x02,0x80,0x00,0x24,0x42,0x4f,0xec,0xac,0xc2,0x00,0x00,0x8e,0xb0,0x00,0x08, ++0x27,0x82,0x99,0x48,0x00,0x62,0x18,0x21,0x90,0x71,0x00,0x07,0x00,0x10,0x86,0x43, ++0x32,0x10,0x00,0x01,0x00,0xa0,0x38,0x21,0x02,0x00,0x30,0x21,0x00,0xa0,0x98,0x21, ++0x02,0x20,0x28,0x21,0x0c,0x00,0x13,0xcf,0x00,0x80,0x90,0x21,0x02,0x20,0x20,0x21, ++0x02,0x00,0x28,0x21,0x24,0x06,0x00,0x14,0x0c,0x00,0x10,0x70,0x00,0x40,0xa0,0x21, ++0x86,0x43,0x00,0x0c,0x3c,0x09,0xb0,0x09,0x3c,0x08,0xb0,0x09,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21, ++0x80,0x43,0x00,0x06,0x3c,0x07,0xb0,0x09,0x3c,0x05,0xb0,0x09,0x28,0x62,0x00,0x00, ++0x24,0x64,0x00,0x03,0x00,0x82,0x18,0x0b,0x00,0x03,0x18,0x83,0x3c,0x02,0xb0,0x09, ++0x00,0x03,0x18,0x80,0x34,0x42,0x01,0x02,0x35,0x29,0x01,0x10,0x35,0x08,0x01,0x14, ++0x34,0xe7,0x01,0x20,0x34,0xa5,0x01,0x24,0xa4,0x54,0x00,0x00,0x12,0x60,0x00,0x11, ++0x02,0xa3,0xa8,0x21,0x8e,0xa2,0x00,0x0c,0x8e,0xa3,0x00,0x08,0x00,0x02,0x14,0x00, ++0x00,0x03,0x1c,0x02,0x00,0x43,0x10,0x21,0xad,0x22,0x00,0x00,0x8e,0xa3,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x00,0x03,0x1c,0x02,0xa5,0x03,0x00,0x00,0x8f,0xbf,0x00,0x28, ++0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x30,0x8e,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0xad,0x22,0x00,0x00, ++0x8e,0xa4,0x00,0x08,0x00,0x00,0x00,0x00,0xa5,0x04,0x00,0x00,0x7a,0xa2,0x00,0x7c, ++0x00,0x00,0x00,0x00,0x00,0x03,0x1c,0x00,0x00,0x02,0x14,0x02,0x00,0x62,0x18,0x21, ++0xac,0xe3,0x00,0x00,0x8e,0xa2,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x02,0x14,0x02, ++0x08,0x00,0x14,0x43,0xa4,0xa2,0x00,0x00,0x27,0xbd,0xff,0xe0,0xaf,0xb2,0x00,0x18, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x1c,0xaf,0xb1,0x00,0x14,0x84,0x82,0x00,0x0c, ++0x00,0x80,0x90,0x21,0x3c,0x05,0xb0,0x03,0x00,0x02,0x20,0xc0,0x00,0x82,0x20,0x21, ++0x00,0x04,0x20,0x80,0x27,0x82,0x99,0x44,0x00,0x82,0x10,0x21,0x8c,0x51,0x00,0x18, ++0x3c,0x02,0x80,0x00,0x34,0xa5,0x00,0x20,0x24,0x42,0x51,0x68,0x27,0x83,0x99,0x48, ++0xac,0xa2,0x00,0x00,0x00,0x83,0x20,0x21,0x3c,0x02,0xb0,0x03,0x90,0x86,0x00,0x07, ++0x34,0x42,0x01,0x00,0x8e,0x23,0x00,0x08,0x90,0x44,0x00,0x00,0x2c,0xc5,0x00,0x04, ++0x24,0x02,0x00,0x10,0x24,0x10,0x00,0x0a,0x00,0x45,0x80,0x0a,0x00,0x03,0x1e,0x43, ++0x30,0x84,0x00,0x01,0x30,0x65,0x00,0x01,0x14,0x80,0x00,0x02,0x00,0x10,0x10,0x40, ++0x02,0x00,0x10,0x21,0x00,0xc0,0x20,0x21,0x24,0x06,0x00,0x20,0x0c,0x00,0x10,0x70, ++0x30,0x50,0x00,0xff,0x86,0x44,0x00,0x0c,0x27,0x85,0x99,0x50,0x3c,0x06,0xb0,0x09, ++0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x65,0x18,0x21, ++0x80,0x64,0x00,0x06,0x00,0x50,0x10,0x21,0x34,0xc6,0x01,0x02,0x24,0x85,0x00,0x03, ++0x28,0x83,0x00,0x00,0x00,0xa3,0x20,0x0b,0x00,0x04,0x20,0x83,0x00,0x04,0x20,0x80, ++0xa4,0xc2,0x00,0x00,0x02,0x24,0x20,0x21,0x8c,0x83,0x00,0x04,0x3c,0x02,0xb0,0x09, ++0x34,0x42,0x01,0x10,0xac,0x43,0x00,0x00,0x8c,0x86,0x00,0x08,0x3c,0x02,0xb0,0x09, ++0x34,0x42,0x01,0x14,0xa4,0x46,0x00,0x00,0x8c,0x85,0x00,0x0c,0x8c,0x82,0x00,0x08, ++0x3c,0x06,0xb0,0x09,0x00,0x05,0x2c,0x00,0x00,0x02,0x14,0x02,0x00,0xa2,0x28,0x21, ++0x34,0xc6,0x01,0x20,0xac,0xc5,0x00,0x00,0x8c,0x83,0x00,0x0c,0x3c,0x05,0xb0,0x09, ++0x34,0xa5,0x01,0x24,0x00,0x03,0x1c,0x02,0xa4,0xa3,0x00,0x00,0x92,0x42,0x00,0x0a, ++0x3c,0x03,0xb0,0x09,0x34,0x63,0x01,0x30,0x00,0x02,0x13,0x00,0x24,0x42,0x00,0x04, ++0x30,0x42,0xff,0xff,0xa4,0x62,0x00,0x00,0x86,0x44,0x00,0x0c,0x27,0x83,0x99,0x58, ++0x8f,0xbf,0x00,0x1c,0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x94,0x44,0x00,0x02,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x3c,0x05,0xb0,0x09,0x34,0xa5,0x01,0x32,0xa4,0xa4,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xe0,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x00, ++0xaf,0xb0,0x00,0x10,0x34,0x42,0x00,0x20,0x00,0xa0,0x80,0x21,0x24,0x63,0x52,0xf4, ++0x00,0x05,0x2c,0x43,0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x18,0xac,0x43,0x00,0x00, ++0x10,0xa0,0x00,0x05,0x00,0x80,0x88,0x21,0x8c,0x82,0x00,0x34,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0xaf,0x00,0x00,0x00,0x00,0x32,0x10,0x00,0xff,0x12,0x00,0x00,0x47, ++0x00,0x00,0x10,0x21,0x24,0x02,0x00,0x08,0x12,0x02,0x00,0x9c,0x2a,0x02,0x00,0x09, ++0x10,0x40,0x00,0x84,0x24,0x02,0x00,0x40,0x24,0x04,0x00,0x02,0x12,0x04,0x00,0x74, ++0x2a,0x02,0x00,0x03,0x10,0x40,0x00,0x64,0x24,0x02,0x00,0x04,0x24,0x02,0x00,0x01, ++0x12,0x02,0x00,0x55,0x00,0x00,0x00,0x00,0x82,0x22,0x00,0x11,0x92,0x27,0x00,0x11, ++0x10,0x40,0x00,0x4e,0x00,0x00,0x00,0x00,0x92,0x26,0x00,0x0a,0x24,0x02,0x00,0x12, ++0x10,0x46,0x00,0x09,0x30,0xc2,0x00,0xff,0x27,0x83,0xbd,0x40,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x83,0x00,0x14, ++0x00,0x00,0x00,0x00,0xa6,0x23,0x00,0x0c,0x3c,0x02,0xb0,0x09,0x34,0x42,0x00,0x40, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x03,0xa2,0x23,0x00,0x10, ++0x14,0x60,0x00,0x2b,0x30,0x65,0x00,0x01,0x30,0xc2,0x00,0xff,0x27,0x83,0xbd,0x40, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x82,0x23,0x00,0x12, ++0x90,0x82,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x42,0x30,0x42,0x00,0x01, ++0x00,0x62,0x18,0x21,0x00,0x03,0x26,0x00,0x14,0x80,0x00,0x18,0xa2,0x23,0x00,0x12, ++0x00,0x07,0x16,0x00,0x14,0x40,0x00,0x11,0x24,0x02,0x00,0x01,0x96,0x23,0x00,0x0c, ++0x27,0x84,0x99,0x50,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x44,0x10,0x21,0x80,0x45,0x00,0x06,0x00,0x03,0x1a,0x00,0x3c,0x02,0xb0,0x00, ++0x00,0x65,0x18,0x21,0x00,0x62,0x18,0x21,0x90,0x64,0x00,0x00,0x90,0x62,0x00,0x04, ++0xa2,0x20,0x00,0x15,0xa3,0x80,0x95,0x14,0x24,0x02,0x00,0x01,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x14,0x5a, ++0x02,0x20,0x20,0x21,0x92,0x27,0x00,0x11,0x08,0x00,0x15,0x05,0x00,0x07,0x16,0x00, ++0x0c,0x00,0x13,0xfb,0x02,0x20,0x20,0x21,0x86,0x23,0x00,0x0c,0x27,0x84,0x99,0x48, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x44,0x20,0x21, ++0x90,0x85,0x00,0x07,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21,0xa2,0x25,0x00,0x13, ++0x90,0x83,0x00,0x07,0x08,0x00,0x15,0x1d,0xa0,0x43,0x00,0x02,0x92,0x26,0x00,0x0a, ++0x08,0x00,0x14,0xe6,0x30,0xc2,0x00,0xff,0x8e,0x22,0x00,0x24,0x00,0x00,0x00,0x00, ++0x10,0x50,0x00,0x07,0xa2,0x20,0x00,0x08,0x24,0x02,0x00,0x07,0xa2,0x22,0x00,0x0a, ++0x92,0x22,0x00,0x27,0xae,0x20,0x00,0x24,0x08,0x00,0x14,0xde,0xa2,0x22,0x00,0x04, ++0x08,0x00,0x15,0x37,0x24,0x02,0x00,0x06,0x16,0x02,0xff,0x9f,0x24,0x02,0x00,0x01, ++0x8e,0x23,0x00,0x2c,0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x07,0xa2,0x24,0x00,0x08, ++0x24,0x02,0x00,0x03,0xa2,0x22,0x00,0x0a,0x92,0x22,0x00,0x2f,0xae,0x20,0x00,0x2c, ++0x08,0x00,0x14,0xde,0xa2,0x22,0x00,0x06,0x08,0x00,0x15,0x46,0xa2,0x20,0x00,0x0a, ++0x8e,0x22,0x00,0x28,0x24,0x03,0x00,0x01,0x24,0x04,0x00,0x01,0x10,0x44,0x00,0x07, ++0xa2,0x23,0x00,0x08,0x24,0x02,0x00,0x05,0xa2,0x22,0x00,0x0a,0x92,0x22,0x00,0x2b, ++0xae,0x20,0x00,0x28,0x08,0x00,0x14,0xde,0xa2,0x22,0x00,0x05,0x08,0x00,0x15,0x52, ++0x24,0x02,0x00,0x04,0x12,0x02,0x00,0x10,0x2a,0x02,0x00,0x41,0x10,0x40,0x00,0x08, ++0x24,0x02,0x00,0x80,0x24,0x02,0x00,0x20,0x16,0x02,0xff,0x7f,0x24,0x02,0x00,0x12, ++0xa2,0x22,0x00,0x0a,0xa2,0x22,0x00,0x08,0x08,0x00,0x14,0xde,0xae,0x20,0x00,0x3c, ++0x16,0x02,0xff,0x79,0x24,0x02,0x00,0x10,0xa2,0x22,0x00,0x0a,0xa2,0x22,0x00,0x08, ++0x08,0x00,0x14,0xde,0xae,0x20,0x00,0x34,0x24,0x02,0x00,0x11,0xa2,0x22,0x00,0x0a, ++0xa2,0x22,0x00,0x08,0x08,0x00,0x14,0xde,0xae,0x20,0x00,0x38,0x8e,0x24,0x00,0x30, ++0x24,0x02,0x00,0x03,0x24,0x03,0x00,0x01,0x10,0x83,0x00,0x07,0xa2,0x22,0x00,0x08, ++0x24,0x02,0x00,0x02,0xa2,0x22,0x00,0x0a,0x92,0x22,0x00,0x33,0xae,0x20,0x00,0x30, ++0x08,0x00,0x14,0xde,0xa2,0x22,0x00,0x07,0x08,0x00,0x15,0x76,0xa2,0x24,0x00,0x0a, ++0x8f,0x84,0xbd,0x80,0xae,0x20,0x00,0x34,0x94,0x85,0x00,0x14,0x0c,0x00,0x22,0xe1, ++0x32,0x10,0x00,0xff,0x08,0x00,0x14,0xcf,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x24,0x42,0x56,0x0c,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00, ++0x80,0xa2,0x00,0x15,0x3c,0x06,0xb0,0x05,0x10,0x40,0x00,0x0a,0x34,0xc6,0x02,0x54, ++0x83,0x83,0x95,0x14,0x00,0x00,0x00,0x00,0xac,0x83,0x00,0x24,0x8c,0xc2,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x17,0x42,0x30,0x42,0x00,0x01,0x03,0xe0,0x00,0x08, ++0xac,0x82,0x00,0x28,0x8c,0x82,0x00,0x2c,0x3c,0x06,0xb0,0x05,0x34,0xc6,0x04,0x50, ++0x00,0x02,0x18,0x43,0x30,0x63,0x00,0x01,0x10,0x40,0x00,0x04,0x30,0x45,0x00,0x01, ++0xac,0x83,0x00,0x28,0x03,0xe0,0x00,0x08,0xac,0x85,0x00,0x24,0x90,0xc2,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x30,0x43,0x00,0x02,0x30,0x42,0x00,0x01, ++0xac,0x83,0x00,0x28,0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x24,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xd8,0x34,0x63,0x00,0x20,0x24,0x42,0x56,0x9c, ++0xac,0x62,0x00,0x00,0xaf,0xb1,0x00,0x1c,0xaf,0xbf,0x00,0x20,0xaf,0xb0,0x00,0x18, ++0x90,0xa6,0x00,0x0a,0x27,0x83,0xbd,0x40,0x00,0xa0,0x88,0x21,0x00,0x06,0x10,0x80, ++0x00,0x43,0x10,0x21,0x8c,0x50,0x00,0x00,0x80,0xa5,0x00,0x11,0x92,0x03,0x00,0x12, ++0x10,0xa0,0x00,0x04,0xa2,0x20,0x00,0x15,0x24,0x02,0x00,0x12,0x10,0xc2,0x00,0xda, ++0x00,0x00,0x00,0x00,0x82,0x22,0x00,0x12,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x67, ++0x00,0x00,0x00,0x00,0xa2,0x20,0x00,0x12,0xa2,0x00,0x00,0x19,0x86,0x23,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x99,0x60,0x00,0x43,0x10,0x21,0xa0,0x40,0x00,0x00,0x92,0x03,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0xdf,0xa2,0x03,0x00,0x16,0x82,0x02,0x00,0x12, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x92,0x23,0x00,0x08, ++0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x45,0x24,0x02,0x00,0x01,0xa2,0x20,0x00,0x04, ++0x92,0x08,0x00,0x04,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x1e,0x24,0x02,0x00,0x01, ++0x92,0x07,0x00,0x0a,0xa2,0x02,0x00,0x17,0x92,0x02,0x00,0x16,0x30,0xe3,0x00,0xff, ++0x30,0x42,0x00,0xe4,0x10,0x60,0x00,0x03,0xa2,0x02,0x00,0x16,0x34,0x42,0x00,0x01, ++0xa2,0x02,0x00,0x16,0x11,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x92,0x02,0x00,0x16, ++0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02,0xa2,0x02,0x00,0x16,0x92,0x02,0x00,0x17, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x08,0x00,0x00,0x00,0x00,0x96,0x02,0x00,0x06, ++0x00,0x00,0x00,0x00,0xa6,0x02,0x00,0x14,0x8f,0xbf,0x00,0x20,0x7b,0xb0,0x00,0xfc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x96,0x02,0x00,0x00,0x08,0x00,0x15,0xf2, ++0xa6,0x02,0x00,0x14,0x92,0x07,0x00,0x0a,0x00,0x00,0x00,0x00,0x14,0xe0,0x00,0x03, ++0x00,0x00,0x00,0x00,0x08,0x00,0x15,0xde,0xa2,0x00,0x00,0x17,0x96,0x04,0x00,0x00, ++0x96,0x05,0x00,0x06,0x27,0x86,0x99,0x40,0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21, ++0x00,0x05,0x10,0xc0,0x00,0x45,0x10,0x21,0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21, ++0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21,0x8c,0x66,0x00,0x08,0x8c,0x45,0x00,0x08, ++0x3c,0x03,0x80,0x00,0x00,0xc3,0x20,0x24,0x10,0x80,0x00,0x08,0x00,0xa3,0x10,0x24, ++0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21,0x10,0x80,0x00,0x02,0x24,0x03,0x00,0x01, ++0x00,0xa6,0x18,0x2b,0x08,0x00,0x15,0xde,0xa2,0x03,0x00,0x17,0x10,0x40,0xff,0xfd, ++0x00,0xa6,0x18,0x2b,0x08,0x00,0x16,0x12,0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x09, ++0x24,0x02,0x00,0x02,0x10,0x62,0x00,0x05,0x24,0x02,0x00,0x03,0x14,0x62,0xff,0xb8, ++0x00,0x00,0x00,0x00,0x08,0x00,0x15,0xd8,0xa2,0x20,0x00,0x07,0x08,0x00,0x15,0xd8, ++0xa2,0x20,0x00,0x06,0x08,0x00,0x15,0xd8,0xa2,0x20,0x00,0x05,0x82,0x22,0x00,0x10, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x69,0x2c,0x62,0x00,0x02,0x10,0x40,0x00,0x49, ++0x3c,0x02,0xb0,0x09,0x92,0x25,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa6,0x00,0xff, ++0x2c,0xc2,0x00,0x04,0x10,0x40,0x00,0x3b,0x2c,0xc2,0x00,0x10,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x24,0x02,0x00,0x01,0x00,0xc2,0x10,0x04, ++0x00,0x02,0x10,0x27,0x00,0x62,0x18,0x24,0xa0,0x83,0x00,0x00,0x86,0x23,0x00,0x0c, ++0x96,0x26,0x00,0x0c,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x28,0x80, ++0x27,0x83,0x99,0x44,0x00,0xa3,0x18,0x21,0x8c,0x64,0x00,0x18,0x00,0x00,0x00,0x00, ++0x8c,0x82,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x10,0x10,0x40,0x00,0x18, ++0x24,0x07,0x00,0x01,0x93,0x82,0x94,0x51,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x0a,0x24,0x05,0x00,0x24,0x00,0x06,0x2c,0x00,0x00,0x05,0x2c,0x03, ++0x0c,0x00,0x22,0xe1,0x02,0x00,0x20,0x21,0x92,0x02,0x00,0x16,0xa2,0x00,0x00,0x12, ++0x30,0x42,0x00,0xe7,0x08,0x00,0x15,0xcf,0xa2,0x02,0x00,0x16,0xf0,0xc5,0x00,0x06, ++0x00,0x00,0x28,0x12,0x27,0x82,0x99,0x40,0x00,0xa2,0x28,0x21,0x0c,0x00,0x01,0x49, ++0x3c,0x04,0x00,0x80,0x96,0x26,0x00,0x0c,0x08,0x00,0x16,0x4f,0x00,0x06,0x2c,0x00, ++0x27,0x83,0x99,0x50,0x27,0x82,0x99,0x58,0x00,0xa2,0x10,0x21,0x00,0xa3,0x18,0x21, ++0x90,0x44,0x00,0x00,0x90,0x65,0x00,0x05,0x93,0x82,0x80,0x10,0x00,0x00,0x30,0x21, ++0x0c,0x00,0x29,0x0b,0xaf,0xa2,0x00,0x10,0x96,0x26,0x00,0x0c,0x08,0x00,0x16,0x49, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xcd,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29, ++0x90,0x83,0x00,0x00,0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80,0x08,0x00,0x16,0x38, ++0x00,0xa2,0x10,0x07,0x86,0x26,0x00,0x0c,0x3c,0x03,0xb0,0x09,0x34,0x42,0x01,0x72, ++0x34,0x63,0x01,0x78,0x94,0x47,0x00,0x00,0x8c,0x65,0x00,0x00,0x00,0x06,0x10,0xc0, ++0x00,0x46,0x10,0x21,0x3c,0x04,0xb0,0x09,0xae,0x25,0x00,0x1c,0x34,0x84,0x01,0x7c, ++0x27,0x83,0x99,0x44,0x00,0x02,0x10,0x80,0x8c,0x85,0x00,0x00,0x00,0x43,0x10,0x21, ++0x8c,0x43,0x00,0x18,0xae,0x25,0x00,0x20,0xa6,0x27,0x00,0x18,0x8c,0x66,0x00,0x08, ++0x02,0x20,0x20,0x21,0x0c,0x00,0x16,0x9f,0x00,0x00,0x28,0x21,0x86,0x25,0x00,0x18, ++0x8e,0x26,0x00,0x1c,0x8e,0x27,0x00,0x20,0x02,0x20,0x20,0x21,0x0c,0x00,0x23,0xe3, ++0xaf,0xa2,0x00,0x10,0x08,0x00,0x15,0xcf,0xa2,0x02,0x00,0x12,0x92,0x22,0x00,0x08, ++0x08,0x00,0x15,0xcf,0xa2,0x22,0x00,0x09,0xa2,0x20,0x00,0x11,0x80,0x82,0x00,0x50, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0, ++0xac,0x40,0x00,0x00,0x08,0x00,0x15,0xcf,0xa0,0x80,0x00,0x50,0x94,0x8a,0x00,0x0c, ++0x24,0x03,0x00,0x24,0x00,0x80,0x70,0x21,0x3c,0x02,0x80,0x00,0x3c,0x04,0xb0,0x03, ++0x24,0x42,0x5a,0x7c,0xf1,0x43,0x00,0x06,0x34,0x84,0x00,0x20,0x00,0x00,0x18,0x12, ++0x00,0xa0,0x68,0x21,0xac,0x82,0x00,0x00,0x27,0x85,0x99,0x50,0x27,0x82,0x99,0x4f, ++0x27,0xbd,0xff,0xf8,0x00,0x62,0x60,0x21,0x00,0x65,0x58,0x21,0x00,0x00,0xc0,0x21, ++0x11,0xa0,0x00,0xcc,0x00,0x00,0x78,0x21,0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21, ++0x91,0x87,0x00,0x00,0x80,0x48,0x00,0x04,0x03,0xa0,0x60,0x21,0x00,0x0a,0x1c,0x00, ++0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x48,0x80, ++0x27,0x83,0x99,0x44,0xa3,0xa7,0x00,0x00,0x01,0x23,0x18,0x21,0x8c,0x64,0x00,0x18, ++0x25,0x02,0xff,0xff,0x00,0x48,0x40,0x0b,0x8c,0x83,0x00,0x04,0x2d,0x05,0x00,0x07, ++0x24,0x02,0x00,0x06,0x30,0x63,0x00,0x08,0x14,0x60,0x00,0x35,0x00,0x45,0x40,0x0a, ++0x93,0xa7,0x00,0x00,0x27,0x82,0x99,0x58,0x01,0x22,0x10,0x21,0x30,0xe3,0x00,0xf0, ++0x38,0x63,0x00,0x50,0x30,0xe5,0x00,0xff,0x00,0x05,0x20,0x2b,0x00,0x03,0x18,0x2b, ++0x00,0x64,0x18,0x24,0x90,0x49,0x00,0x00,0x10,0x60,0x00,0x16,0x30,0xe4,0x00,0x0f, ++0x24,0x02,0x00,0x04,0x10,0xa2,0x00,0x9d,0x00,0x00,0x00,0x00,0x11,0xa0,0x00,0x3a, ++0x2c,0xa2,0x00,0x0c,0x10,0x40,0x00,0x02,0x24,0x84,0x00,0x0c,0x00,0xe0,0x20,0x21, ++0x30,0x84,0x00,0xff,0x00,0x04,0x10,0x40,0x27,0x83,0xc4,0x5c,0x00,0x44,0x10,0x21, ++0x00,0x43,0x10,0x21,0x90,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xe3,0x00,0x0c, ++0xa3,0xa7,0x00,0x00,0x10,0x60,0x00,0x02,0x24,0xe2,0x00,0x04,0x00,0xe0,0x10,0x21, ++0xa3,0xa2,0x00,0x00,0x91,0x65,0x00,0x00,0x91,0x82,0x00,0x00,0x30,0xa3,0x00,0xff, ++0x00,0x62,0x10,0x2b,0x10,0x40,0x00,0x0e,0x2c,0x62,0x00,0x0c,0x14,0x40,0x00,0x03, ++0x00,0x60,0x20,0x21,0x30,0xa2,0x00,0x0f,0x24,0x44,0x00,0x0c,0x00,0x04,0x10,0x40, ++0x00,0x44,0x20,0x21,0x27,0x83,0xc4,0x5c,0x00,0x83,0x18,0x21,0x90,0x62,0x00,0x02, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x05,0x00,0x09,0x11,0x00,0xa1,0x85,0x00,0x00, ++0x93,0xa2,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x08,0x00,0x49,0x10,0x23, ++0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21, ++0x27,0x83,0xbd,0xe8,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x2c,0x83,0x00,0x0c,0x14,0x60,0x00,0x06,0x00,0x80,0x10,0x21,0x00,0x18,0x10,0x40, ++0x00,0x4f,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0x82,0x10,0x21,0x24,0x42,0x00,0x04, ++0x08,0x00,0x17,0x00,0xa1,0x82,0x00,0x00,0x8f,0x8d,0x87,0x70,0x00,0x00,0x00,0x00, ++0x01,0xa8,0x10,0x21,0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0xff,0xd1, ++0x00,0x00,0x28,0x21,0x00,0x06,0x74,0x82,0x30,0xe2,0x00,0xff,0x2c,0x42,0x00,0x0c, ++0x14,0x40,0x00,0x03,0x00,0xe0,0x10,0x21,0x30,0xe2,0x00,0x0f,0x24,0x42,0x00,0x0c, ++0x30,0x44,0x00,0xff,0xa3,0xa2,0x00,0x00,0x24,0x02,0x00,0x0c,0x10,0x82,0x00,0x0d, ++0x00,0x09,0x11,0x00,0x00,0x49,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x04,0x18,0x40, ++0x00,0x49,0x10,0x23,0x00,0x64,0x18,0x21,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x27,0x84,0xbd,0xe8,0x00,0x44,0x10,0x21,0x90,0x47,0x00,0x00,0x00,0x00,0x00,0x00, ++0xa3,0xa7,0x00,0x00,0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x44,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0x83,0x00,0x04,0x00,0x00,0x00,0x00, ++0x30,0x63,0x00,0x10,0x14,0x60,0x00,0x33,0x00,0x06,0x14,0x42,0x00,0x09,0x11,0x00, ++0x00,0x49,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x23,0x27,0x83,0xbe,0xb8, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x04,0x90,0x43,0x00,0x05, ++0x00,0x00,0x00,0x00,0x00,0x64,0xc0,0x24,0x93,0xa7,0x00,0x00,0x00,0x00,0x00,0x00, ++0x2c,0xe2,0x00,0x0f,0x10,0x40,0x00,0x0f,0x31,0xcf,0x00,0x01,0x00,0x0a,0x1c,0x00, ++0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x84,0x99,0x40,0x00,0x44,0x10,0x21,0x84,0x43,0x00,0x06,0x00,0x00,0x00,0x00, ++0x28,0x63,0x06,0x41,0x14,0x60,0x00,0x04,0x30,0xe2,0x00,0xff,0x24,0x07,0x00,0x0f, ++0xa3,0xa7,0x00,0x00,0x30,0xe2,0x00,0xff,0x2c,0x42,0x00,0x0c,0x14,0x40,0x00,0x06, ++0x00,0xe0,0x10,0x21,0x00,0x18,0x10,0x40,0x00,0x4f,0x10,0x21,0x00,0x02,0x11,0x00, ++0x00,0x47,0x10,0x21,0x24,0x42,0x00,0x04,0xa3,0xa2,0x00,0x00,0x00,0x40,0x38,0x21, ++0x01,0xa8,0x10,0x21,0x90,0x43,0x00,0x00,0x24,0xa4,0x00,0x01,0x30,0x85,0xff,0xff, ++0x00,0xa3,0x18,0x2b,0x14,0x60,0xff,0xad,0x30,0xe2,0x00,0xff,0x08,0x00,0x16,0xed, ++0x00,0x00,0x00,0x00,0x08,0x00,0x17,0x4e,0x30,0x58,0x00,0x01,0x81,0xc2,0x00,0x48, ++0x00,0x00,0x00,0x00,0x10,0x40,0xff,0x73,0x00,0x00,0x00,0x00,0x08,0x00,0x16,0xdb, ++0x00,0x00,0x00,0x00,0x00,0x0a,0x1c,0x00,0x00,0x03,0x1c,0x03,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x45,0x10,0x21,0x80,0x48,0x00,0x05, ++0x91,0x67,0x00,0x00,0x08,0x00,0x16,0xbb,0x03,0xa0,0x58,0x21,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x5e,0x1c,0x03,0xe0,0x00,0x08, ++0xac,0x62,0x00,0x00,0x27,0xbd,0xff,0xc0,0xaf,0xb7,0x00,0x34,0xaf,0xb6,0x00,0x30, ++0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28,0xaf,0xb3,0x00,0x24,0xaf,0xb2,0x00,0x20, ++0xaf,0xbf,0x00,0x3c,0xaf,0xbe,0x00,0x38,0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18, ++0x84,0x82,0x00,0x0c,0x27,0x93,0x99,0x44,0x3c,0x05,0xb0,0x03,0x00,0x02,0x18,0xc0, ++0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x73,0x10,0x21,0x8c,0x5e,0x00,0x18, ++0x3c,0x02,0x80,0x00,0x34,0xa5,0x00,0x20,0x24,0x42,0x5e,0x34,0xac,0xa2,0x00,0x00, ++0x8f,0xd0,0x00,0x08,0x27,0x95,0x99,0x50,0x00,0x75,0x18,0x21,0x00,0x00,0x28,0x21, ++0x02,0x00,0x30,0x21,0x90,0x71,0x00,0x00,0x0c,0x00,0x16,0x9f,0x00,0x80,0xb0,0x21, ++0x00,0x40,0x90,0x21,0x00,0x10,0x14,0x42,0x30,0x54,0x00,0x01,0x02,0x40,0x20,0x21, ++0x00,0x10,0x14,0x82,0x02,0x80,0x28,0x21,0x12,0x51,0x00,0x23,0x00,0x10,0xbf,0xc2, ++0x86,0xc3,0x00,0x0c,0x30,0x50,0x00,0x01,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x55,0x10,0x21,0xa0,0x52,0x00,0x00,0x86,0xc3,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x53,0x30,0x21,0x8c,0xc7,0x00,0x18,0x27,0x83,0x99,0x40,0x00,0x43,0x10,0x21, ++0x8c,0xe3,0x00,0x04,0x84,0x46,0x00,0x06,0x00,0x03,0x19,0x42,0x0c,0x00,0x10,0x70, ++0x30,0x73,0x00,0x01,0x00,0x40,0x88,0x21,0x02,0x40,0x20,0x21,0x02,0x80,0x28,0x21, ++0x16,0xe0,0x00,0x10,0x02,0x00,0x30,0x21,0x86,0xc2,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80,0x27,0x82,0x99,0x48, ++0x00,0x62,0x18,0x21,0xa4,0x71,0x00,0x04,0x7b,0xbe,0x01,0xfc,0x7b,0xb6,0x01,0xbc, ++0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x40,0x86,0xc3,0x00,0x0c,0xaf,0xb3,0x00,0x10,0xaf,0xa0,0x00,0x14, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x55,0x10,0x21, ++0x80,0x47,0x00,0x06,0x00,0x00,0x00,0x00,0x24,0xe7,0x00,0x02,0x00,0x07,0x17,0xc2, ++0x00,0xe2,0x38,0x21,0x00,0x07,0x38,0x43,0x00,0x07,0x38,0x40,0x0c,0x00,0x10,0x97, ++0x03,0xc7,0x38,0x21,0x08,0x00,0x17,0xce,0x02,0x22,0x88,0x21,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x27,0xbd,0xff,0xd0,0x34,0x63,0x00,0x20,0x24,0x42,0x5f,0xbc, ++0xaf,0xb2,0x00,0x20,0xac,0x62,0x00,0x00,0xaf,0xbf,0x00,0x28,0xaf,0xb3,0x00,0x24, ++0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18,0x3c,0x02,0xb0,0x03,0x90,0x83,0x00,0x0a, ++0x34,0x42,0x01,0x04,0x94,0x45,0x00,0x00,0x00,0x03,0x18,0x80,0x27,0x82,0xbd,0x40, ++0x00,0x62,0x18,0x21,0x30,0xa6,0xff,0xff,0x8c,0x71,0x00,0x00,0x80,0x85,0x00,0x12, ++0x30,0xc9,0x00,0xff,0x00,0x06,0x32,0x02,0xa4,0x86,0x00,0x44,0xa4,0x89,0x00,0x46, ++0x82,0x22,0x00,0x12,0x00,0x80,0x90,0x21,0x10,0xa0,0x00,0x1b,0xa0,0x80,0x00,0x15, ++0x00,0xc5,0x10,0x2a,0x10,0x40,0x00,0x14,0x00,0x00,0x00,0x00,0xa2,0x20,0x00,0x19, ++0x84,0x83,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x60,0x00,0x43,0x10,0x21,0xa0,0x40,0x00,0x00, ++0xa0,0x80,0x00,0x12,0x92,0x22,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xdf, ++0xa2,0x22,0x00,0x16,0x8f,0xbf,0x00,0x28,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x30,0x0c,0x00,0x17,0x87,0x00,0x00,0x00,0x00, ++0x08,0x00,0x18,0x1d,0x00,0x00,0x00,0x00,0x28,0x42,0x00,0x02,0x10,0x40,0x01,0x76, ++0x00,0x00,0x28,0x21,0x94,0x87,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0xe0,0x10,0x21, ++0x00,0x02,0x14,0x00,0x00,0x02,0x14,0x03,0x00,0x07,0x24,0x00,0x00,0x04,0x24,0x03, ++0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21,0x00,0x04,0x28,0xc0,0x00,0xa4,0x28,0x21, ++0x27,0x82,0x99,0x60,0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x00,0x05,0x28,0x80, ++0x27,0x82,0x99,0x48,0x00,0xa2,0x10,0x21,0x8c,0x68,0x00,0x00,0x80,0x44,0x00,0x06, ++0x27,0x82,0x99,0x50,0x00,0x08,0x1d,0x02,0x00,0xa2,0x28,0x21,0x38,0x84,0x00,0x00, ++0x30,0x63,0x00,0x01,0x01,0x24,0x30,0x0b,0x80,0xaa,0x00,0x04,0x80,0xa9,0x00,0x05, ++0x10,0x60,0x00,0x02,0x00,0x08,0x14,0x02,0x30,0x46,0x00,0x0f,0x15,0x20,0x00,0x28, ++0x01,0x49,0x10,0x21,0x15,0x40,0x00,0x11,0x30,0xe3,0xff,0xff,0x92,0x45,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa8,0x00,0xff,0x2d,0x02,0x00,0x04,0x10,0x40,0x01,0x46, ++0x2d,0x02,0x00,0x10,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x24,0x02,0x00,0x01,0x01,0x02,0x10,0x04,0x00,0x62,0x18,0x25,0xa0,0x83,0x00,0x00, ++0x96,0x47,0x00,0x0c,0x00,0x00,0x00,0x00,0x30,0xe3,0xff,0xff,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x27,0x84,0x99,0x50,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21, ++0x80,0x45,0x00,0x06,0x00,0x03,0x1a,0x00,0x3c,0x04,0xb0,0x00,0x00,0x65,0x18,0x21, ++0x00,0x64,0x20,0x21,0x94,0x82,0x00,0x00,0x82,0x43,0x00,0x10,0x00,0x02,0x14,0x00, ++0x14,0x60,0x00,0x06,0x00,0x02,0x3c,0x03,0x30,0xe2,0x00,0x04,0x14,0x40,0x00,0x04, ++0x01,0x49,0x10,0x21,0x34,0xe2,0x08,0x00,0xa4,0x82,0x00,0x00,0x01,0x49,0x10,0x21, ++0x00,0x02,0x16,0x00,0x00,0x02,0x16,0x03,0x00,0x46,0x10,0x2a,0x10,0x40,0x00,0x7c, ++0x00,0x00,0x00,0x00,0x82,0x42,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0e, ++0x00,0x00,0x00,0x00,0x86,0x43,0x00,0x0c,0x25,0x44,0x00,0x01,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21, ++0xa0,0x44,0x00,0x04,0x92,0x23,0x00,0x16,0x02,0x40,0x20,0x21,0x30,0x63,0x00,0xfb, ++0x08,0x00,0x18,0x22,0xa2,0x23,0x00,0x16,0x86,0x43,0x00,0x0c,0x25,0x24,0x00,0x01, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50, ++0x00,0x43,0x10,0x21,0xa0,0x44,0x00,0x05,0x86,0x45,0x00,0x0c,0x0c,0x00,0x26,0x5b, ++0x02,0x20,0x20,0x21,0x10,0x40,0x00,0x5a,0x00,0x00,0x00,0x00,0x92,0x45,0x00,0x08, ++0x00,0x00,0x00,0x00,0x30,0xa6,0x00,0xff,0x2c,0xc2,0x00,0x04,0x10,0x40,0x00,0x4c, ++0x2c,0xc2,0x00,0x10,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x24,0x02,0x00,0x01,0x00,0xc2,0x10,0x04,0x00,0x02,0x10,0x27,0x00,0x62,0x18,0x24, ++0xa0,0x83,0x00,0x00,0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa5,0x00,0xff, ++0x14,0xa0,0x00,0x33,0x24,0x02,0x00,0x01,0xa2,0x40,0x00,0x04,0x92,0x22,0x00,0x04, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x0c,0x24,0x02,0x00,0x01,0xa2,0x22,0x00,0x17, ++0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x04,0x00,0x00,0x00,0x00, ++0x96,0x22,0x00,0x06,0x08,0x00,0x18,0x1d,0xa6,0x22,0x00,0x14,0x96,0x22,0x00,0x00, ++0x08,0x00,0x18,0x1d,0xa6,0x22,0x00,0x14,0x92,0x22,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,0x18,0xac,0xa2,0x20,0x00,0x17, ++0x96,0x24,0x00,0x00,0x96,0x25,0x00,0x06,0x27,0x86,0x99,0x40,0x00,0x04,0x18,0xc0, ++0x00,0x64,0x18,0x21,0x00,0x05,0x10,0xc0,0x00,0x45,0x10,0x21,0x00,0x03,0x18,0x80, ++0x00,0x66,0x18,0x21,0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21,0x8c,0x65,0x00,0x08, ++0x8c,0x44,0x00,0x08,0x3c,0x03,0x80,0x00,0x00,0xa3,0x30,0x24,0x10,0xc0,0x00,0x08, ++0x00,0x83,0x10,0x24,0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21,0x10,0xc0,0x00,0x02, ++0x24,0x03,0x00,0x01,0x00,0x85,0x18,0x2b,0x08,0x00,0x18,0xac,0xa2,0x23,0x00,0x17, ++0x10,0x40,0xff,0xfd,0x00,0x85,0x18,0x2b,0x08,0x00,0x18,0xcf,0x00,0x00,0x00,0x00, ++0x10,0xa2,0x00,0x09,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x05,0x24,0x02,0x00,0x03, ++0x14,0xa2,0xff,0xca,0x00,0x00,0x00,0x00,0x08,0x00,0x18,0xa7,0xa2,0x40,0x00,0x07, ++0x08,0x00,0x18,0xa7,0xa2,0x40,0x00,0x06,0x08,0x00,0x18,0xa7,0xa2,0x40,0x00,0x05, ++0x14,0x40,0xff,0xbe,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00, ++0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80,0x08,0x00,0x18,0x9e,0x00,0xa2,0x10,0x07, ++0x0c,0x00,0x17,0x8d,0x02,0x40,0x20,0x21,0x08,0x00,0x18,0x1d,0x00,0x00,0x00,0x00, ++0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xa6,0x00,0xff,0x2c,0xc2,0x00,0x04, ++0x10,0x40,0x00,0x99,0x2c,0xc2,0x00,0x10,0x3c,0x04,0xb0,0x05,0x34,0x84,0x02,0x29, ++0x90,0x83,0x00,0x00,0x24,0x02,0x00,0x01,0x00,0xc2,0x10,0x04,0x00,0x02,0x10,0x27, ++0x00,0x62,0x18,0x24,0xa0,0x83,0x00,0x00,0x92,0x45,0x00,0x08,0x00,0x00,0x00,0x00, ++0x30,0xa5,0x00,0xff,0x14,0xa0,0x00,0x80,0x24,0x02,0x00,0x01,0xa2,0x40,0x00,0x04, ++0x86,0x43,0x00,0x0c,0x27,0x93,0x99,0x44,0x96,0x47,0x00,0x0c,0x00,0x03,0x10,0xc0, ++0x00,0x43,0x10,0x21,0x00,0x02,0x28,0x80,0x00,0xb3,0x18,0x21,0x8c,0x64,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x10, ++0x10,0x40,0x00,0x64,0x00,0x00,0x30,0x21,0x00,0x07,0x1c,0x00,0x00,0x03,0x1c,0x03, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x53,0x10,0x21, ++0x8c,0x43,0x00,0x18,0x93,0x82,0x94,0x51,0x8c,0x64,0x00,0x04,0x30,0x42,0x00,0x01, ++0x00,0x04,0x21,0x42,0x14,0x40,0x00,0x4d,0x30,0x90,0x00,0x01,0x00,0x07,0x2c,0x00, ++0x00,0x05,0x2c,0x03,0x0c,0x00,0x22,0xe1,0x02,0x20,0x20,0x21,0x96,0x26,0x00,0x06, ++0x12,0x00,0x00,0x14,0x30,0xc5,0xff,0xff,0x02,0x60,0x90,0x21,0x00,0x05,0x10,0xc0, ++0x00,0x45,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x52,0x18,0x21,0x92,0x22,0x00,0x0a, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0b,0x02,0x20,0x20,0x21,0x8c,0x63,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x62,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x42, ++0x0c,0x00,0x22,0xe1,0x30,0x50,0x00,0x01,0x96,0x26,0x00,0x06,0x16,0x00,0xff,0xef, ++0x30,0xc5,0xff,0xff,0x92,0x22,0x00,0x04,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x0d, ++0x24,0x02,0x00,0x01,0xa2,0x22,0x00,0x17,0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0xa6,0x26,0x00,0x14,0x92,0x22,0x00,0x16, ++0x08,0x00,0x18,0x1c,0x30,0x42,0x00,0xc3,0x96,0x22,0x00,0x00,0x08,0x00,0x19,0x43, ++0xa6,0x22,0x00,0x14,0x92,0x22,0x00,0x0a,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0x08,0x00,0x19,0x3e,0xa2,0x20,0x00,0x17,0x96,0x24,0x00,0x00, ++0x30,0xc5,0xff,0xff,0x00,0x05,0x18,0xc0,0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21, ++0x00,0x65,0x18,0x21,0x27,0x84,0x99,0x40,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x21, ++0x00,0x03,0x18,0x80,0x8c,0x45,0x00,0x08,0x00,0x64,0x18,0x21,0x8c,0x64,0x00,0x08, ++0x3c,0x02,0x80,0x00,0x00,0xa2,0x38,0x24,0x10,0xe0,0x00,0x08,0x00,0x82,0x10,0x24, ++0x10,0x40,0x00,0x04,0x00,0x00,0x18,0x21,0x10,0xe0,0x00,0x02,0x24,0x03,0x00,0x01, ++0x00,0x85,0x18,0x2b,0x08,0x00,0x19,0x3e,0xa2,0x23,0x00,0x17,0x10,0x40,0xff,0xfd, ++0x00,0x85,0x18,0x2b,0x08,0x00,0x19,0x62,0x00,0x00,0x00,0x00,0x24,0x05,0x00,0x24, ++0xf0,0xe5,0x00,0x06,0x00,0x00,0x28,0x12,0x27,0x82,0x99,0x40,0x00,0xa2,0x28,0x21, ++0x0c,0x00,0x01,0x49,0x00,0x00,0x20,0x21,0x96,0x47,0x00,0x0c,0x08,0x00,0x19,0x20, ++0x00,0x07,0x2c,0x00,0x27,0x83,0x99,0x50,0x27,0x82,0x99,0x58,0x00,0xa2,0x10,0x21, ++0x00,0xa3,0x18,0x21,0x90,0x44,0x00,0x00,0x90,0x65,0x00,0x05,0x93,0x82,0x80,0x10, ++0x24,0x07,0x00,0x01,0x0c,0x00,0x29,0x0b,0xaf,0xa2,0x00,0x10,0x96,0x47,0x00,0x0c, ++0x08,0x00,0x19,0x13,0x00,0x07,0x1c,0x00,0x10,0xa2,0x00,0x09,0x24,0x02,0x00,0x02, ++0x10,0xa2,0x00,0x05,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0x7d,0x00,0x00,0x00,0x00, ++0x08,0x00,0x19,0x04,0xa2,0x40,0x00,0x07,0x08,0x00,0x19,0x04,0xa2,0x40,0x00,0x06, ++0x08,0x00,0x19,0x04,0xa2,0x40,0x00,0x05,0x14,0x40,0xff,0x71,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80, ++0x08,0x00,0x18,0xfb,0x00,0xa2,0x10,0x07,0x14,0x40,0xfe,0xc3,0x3c,0x04,0xb0,0x05, ++0x34,0x84,0x02,0x29,0x90,0x83,0x00,0x00,0x30,0xa5,0x00,0x0f,0x24,0x02,0x00,0x80, ++0x08,0x00,0x18,0x56,0x00,0xa2,0x10,0x07,0x84,0x83,0x00,0x0c,0x00,0x00,0x00,0x00, ++0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x44, ++0x00,0x43,0x10,0x21,0x8c,0x47,0x00,0x18,0x00,0x00,0x00,0x00,0x8c,0xe6,0x00,0x08, ++0x0c,0x00,0x16,0x9f,0x00,0x00,0x00,0x00,0x02,0x40,0x20,0x21,0x00,0x00,0x28,0x21, ++0x00,0x00,0x30,0x21,0x00,0x00,0x38,0x21,0x0c,0x00,0x23,0xe3,0xaf,0xa2,0x00,0x10, ++0x00,0x02,0x1e,0x00,0x14,0x60,0xfe,0x6b,0xa2,0x22,0x00,0x12,0x92,0x43,0x00,0x08, ++0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x40,0x24,0x02,0x00,0x01,0xa2,0x40,0x00,0x04, ++0x92,0x28,0x00,0x04,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x19,0x24,0x02,0x00,0x01, ++0x92,0x27,0x00,0x0a,0xa2,0x22,0x00,0x17,0x92,0x22,0x00,0x17,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x10,0x00,0x00,0x00,0x00,0x96,0x22,0x00,0x06,0x00,0x00,0x00,0x00, ++0xa6,0x22,0x00,0x14,0x92,0x22,0x00,0x16,0x30,0xe3,0x00,0xff,0x30,0x42,0x00,0xc0, ++0x10,0x60,0x00,0x03,0xa2,0x22,0x00,0x16,0x34,0x42,0x00,0x01,0xa2,0x22,0x00,0x16, ++0x11,0x00,0xfe,0x50,0x00,0x00,0x00,0x00,0x92,0x22,0x00,0x16,0x08,0x00,0x18,0x1c, ++0x34,0x42,0x00,0x02,0x96,0x22,0x00,0x00,0x08,0x00,0x19,0xc5,0xa6,0x22,0x00,0x14, ++0x92,0x27,0x00,0x0a,0x00,0x00,0x00,0x00,0x14,0xe0,0x00,0x03,0x00,0x00,0x00,0x00, ++0x08,0x00,0x19,0xbe,0xa2,0x20,0x00,0x17,0x96,0x24,0x00,0x00,0x96,0x25,0x00,0x06, ++0x27,0x86,0x99,0x40,0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x05,0x10,0xc0, ++0x00,0x45,0x10,0x21,0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21,0x00,0x02,0x10,0x80, ++0x00,0x46,0x10,0x21,0x8c,0x65,0x00,0x08,0x8c,0x44,0x00,0x08,0x3c,0x03,0x80,0x00, ++0x00,0xa3,0x30,0x24,0x10,0xc0,0x00,0x08,0x00,0x83,0x10,0x24,0x10,0x40,0x00,0x04, ++0x00,0x00,0x18,0x21,0x10,0xc0,0x00,0x02,0x24,0x03,0x00,0x01,0x00,0x85,0x18,0x2b, ++0x08,0x00,0x19,0xbe,0xa2,0x23,0x00,0x17,0x10,0x40,0xff,0xfd,0x00,0x85,0x18,0x2b, ++0x08,0x00,0x19,0xed,0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x09,0x24,0x02,0x00,0x02, ++0x10,0x62,0x00,0x05,0x24,0x02,0x00,0x03,0x14,0x62,0xff,0xbd,0x00,0x00,0x00,0x00, ++0x08,0x00,0x19,0xb8,0xa2,0x40,0x00,0x07,0x08,0x00,0x19,0xb8,0xa2,0x40,0x00,0x06, ++0x08,0x00,0x19,0xb8,0xa2,0x40,0x00,0x05,0x3c,0x02,0x80,0x00,0x00,0x82,0x30,0x24, ++0x10,0xc0,0x00,0x08,0x00,0xa2,0x18,0x24,0x10,0x60,0x00,0x04,0x00,0x00,0x10,0x21, ++0x10,0xc0,0x00,0x02,0x24,0x02,0x00,0x01,0x00,0xa4,0x10,0x2b,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x10,0x60,0xff,0xfd,0x00,0xa4,0x10,0x2b,0x08,0x00,0x1a,0x08, ++0x00,0x00,0x00,0x00,0x30,0x82,0xff,0xff,0x00,0x02,0x18,0xc0,0x00,0x62,0x18,0x21, ++0x27,0x84,0x99,0x50,0x00,0x03,0x18,0x80,0x00,0x64,0x18,0x21,0x80,0x66,0x00,0x06, ++0x00,0x02,0x12,0x00,0x3c,0x03,0xb0,0x00,0x00,0x46,0x10,0x21,0x00,0x45,0x10,0x21, ++0x03,0xe0,0x00,0x08,0x00,0x43,0x10,0x21,0x27,0xbd,0xff,0xe0,0x30,0x82,0x00,0x7c, ++0x30,0x84,0xff,0x00,0xaf,0xbf,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0x14,0x40,0x00,0x41,0x00,0x04,0x22,0x03,0x24,0x02,0x00,0x04, ++0x3c,0x10,0xb0,0x03,0x8e,0x10,0x00,0x00,0x10,0x82,0x00,0x32,0x24,0x02,0x00,0x08, ++0x10,0x82,0x00,0x03,0x32,0x02,0x00,0x20,0x08,0x00,0x1a,0x2e,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x17,0x3c,0x02,0xb0,0x06,0x34,0x42,0x80,0x24,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x67,0x00,0xff,0x10,0xe0,0x00,0x23,0x00,0x00,0x88,0x21, ++0x8f,0x85,0x99,0x20,0x00,0x40,0x30,0x21,0x94,0xa2,0x00,0x08,0x8c,0xc3,0x00,0x00, ++0x26,0x31,0x00,0x01,0x24,0x42,0x00,0x02,0x30,0x42,0x01,0xff,0x34,0x63,0x01,0x00, ++0x02,0x27,0x20,0x2a,0xa4,0xa2,0x00,0x08,0x14,0x80,0xff,0xf7,0xac,0xc3,0x00,0x00, ++0x84,0xa3,0x00,0x08,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x30,0xac,0x43,0x00,0x00, ++0x27,0x92,0xbd,0x40,0x24,0x11,0x00,0x12,0x8e,0x44,0x00,0x00,0x26,0x31,0xff,0xff, ++0x90,0x82,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03,0x26,0x52,0x00,0x04, ++0x0c,0x00,0x20,0x48,0x00,0x00,0x00,0x00,0x06,0x21,0xff,0xf7,0x24,0x02,0xff,0xdf, ++0x02,0x02,0x80,0x24,0x3c,0x01,0xb0,0x03,0x0c,0x00,0x1a,0xe6,0xac,0x30,0x00,0x00, ++0x08,0x00,0x1a,0x2e,0x00,0x00,0x00,0x00,0x8f,0x85,0x99,0x20,0x08,0x00,0x1a,0x44, ++0x00,0x00,0x00,0x00,0x24,0x02,0xff,0x95,0x3c,0x03,0xb0,0x03,0x02,0x02,0x80,0x24, ++0x34,0x63,0x00,0x30,0x3c,0x01,0xb0,0x03,0xac,0x30,0x00,0x00,0x0c,0x00,0x1a,0xaf, ++0xac,0x60,0x00,0x00,0x08,0x00,0x1a,0x2e,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x00,0x50,0x08,0x00,0x1a,0x2e,0xac,0x46,0x00,0x00,0xaf,0xa7,0x00,0x0c, ++0xaf,0xa4,0x00,0x00,0xaf,0xa5,0x00,0x04,0xaf,0xa6,0x00,0x08,0x27,0xbd,0xfe,0xe8, ++0x00,0x80,0x28,0x21,0x27,0xa6,0x01,0x1c,0x27,0xa4,0x00,0x10,0xaf,0xbf,0x01,0x14, ++0x0c,0x00,0x2e,0x2c,0xaf,0xb0,0x01,0x10,0x00,0x40,0x80,0x21,0x0c,0x00,0x1a,0x7e, ++0x27,0xa4,0x00,0x10,0x02,0x00,0x10,0x21,0x8f,0xbf,0x01,0x14,0x8f,0xb0,0x01,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x01,0x18,0x93,0x83,0x87,0x6c,0x27,0xbd,0xff,0xe8, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0x14,0x60,0x00,0x14,0x00,0x80,0x80,0x21, ++0x80,0x82,0x00,0x00,0x90,0x84,0x00,0x00,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x00,0x04,0x26,0x00,0x00,0x04,0x26,0x03,0x30,0x84,0xff,0xff,0x0c,0x00,0x1a,0x9e, ++0x26,0x10,0x00,0x01,0x92,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x60,0xff,0xf8, ++0x00,0x60,0x20,0x21,0x08,0x00,0x1a,0x88,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x14,0x43,0xff,0xef,0x00,0x00,0x00,0x00,0x0c,0x00,0x05,0x52,0x00,0x00,0x00,0x00, ++0x08,0x00,0x1a,0x88,0x00,0x00,0x00,0x00,0x30,0x84,0xff,0xff,0x48,0x84,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10, ++0x0c,0x00,0x2d,0x94,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x10,0x00,0x02,0x14,0x00, ++0x00,0x02,0x14,0x03,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x03,0xe0,0x00,0x08, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0x24,0x02,0x00,0x01,0x3c,0x0a,0x80,0x00, ++0x25,0x4a,0x6a,0xbc,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x08,0x80,0x01, ++0x25,0x08,0x00,0x00,0x3c,0x09,0x80,0x01,0x25,0x29,0x0b,0x90,0x11,0x09,0x00,0x10, ++0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x6a,0xe4,0x3c,0x0b,0xb0,0x03, ++0xad,0x6a,0x00,0x20,0x3c,0x08,0xb0,0x06,0x35,0x08,0x80,0x10,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x8d,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x29,0x00,0x01, ++0x00,0x00,0x00,0x00,0x24,0x01,0x00,0x01,0x15,0x21,0xff,0xf2,0x00,0x00,0x00,0x00, ++0x3c,0x0a,0x80,0x00,0x25,0x4a,0x6b,0x20,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20, ++0x3c,0x02,0xb0,0x03,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x63,0x00,0x40, ++0x00,0x00,0x00,0x00,0xac,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00, ++0x25,0x4a,0x6b,0x4c,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x02,0x80,0x01, ++0x24,0x42,0x00,0x00,0x3c,0x03,0x80,0x01,0x24,0x63,0x0b,0x90,0x3c,0x04,0xb0,0x00, ++0x8c,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x45,0x00,0x00,0x24,0x42,0x00,0x04, ++0x24,0x84,0x00,0x04,0x00,0x43,0x08,0x2a,0x14,0x20,0xff,0xf9,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x1a,0xe6,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x6b,0x98, ++0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x02,0x80,0x01,0x24,0x42,0x0b,0x90, ++0x3c,0x03,0x80,0x01,0x24,0x63,0x48,0x64,0xac,0x40,0x00,0x00,0xac,0x40,0x00,0x04, ++0xac,0x40,0x00,0x08,0xac,0x40,0x00,0x0c,0x24,0x42,0x00,0x10,0x00,0x43,0x08,0x2a, ++0x14,0x20,0xff,0xf9,0x00,0x00,0x00,0x00,0x3c,0x0a,0x80,0x00,0x25,0x4a,0x6b,0xd8, ++0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x3c,0x1c,0x80,0x01,0x27,0x9c,0x7f,0xf0, ++0x27,0x9d,0x95,0x20,0x00,0x00,0x00,0x00,0x27,0x9d,0x99,0x08,0x3c,0x0a,0x80,0x00, ++0x25,0x4a,0x6b,0xfc,0x3c,0x0b,0xb0,0x03,0xad,0x6a,0x00,0x20,0x40,0x80,0x68,0x00, ++0x40,0x08,0x60,0x00,0x00,0x00,0x00,0x00,0x35,0x08,0xff,0x01,0x40,0x88,0x60,0x00, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x1d,0x15,0x00,0x00,0x00,0x00,0x24,0x84,0xf8,0x00, ++0x30,0x87,0x00,0x03,0x00,0x04,0x30,0x40,0x00,0xc7,0x20,0x23,0x3c,0x02,0xb0,0x0a, ++0x27,0xbd,0xff,0xe0,0x24,0x03,0xff,0xff,0x00,0x82,0x20,0x21,0xaf,0xb1,0x00,0x14, ++0xac,0x83,0x10,0x00,0xaf,0xbf,0x00,0x18,0xaf,0xb0,0x00,0x10,0x00,0xa0,0x88,0x21, ++0x24,0x03,0x00,0x01,0x8c,0x82,0x10,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x00,0xc7,0x10,0x23,0x3c,0x03,0xb0,0x0a,0x00,0x43,0x10,0x21,0x8c,0x50,0x00,0x00, ++0x0c,0x00,0x1b,0x63,0x02,0x20,0x20,0x21,0x02,0x11,0x80,0x24,0x00,0x50,0x80,0x06, ++0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x20,0x27,0xbd,0xff,0xd8,0xaf,0xb2,0x00,0x18,0x00,0xa0,0x90,0x21, ++0x24,0x05,0xff,0xff,0xaf,0xb3,0x00,0x1c,0xaf,0xbf,0x00,0x20,0xaf,0xb1,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0x00,0xc0,0x98,0x21,0x12,0x45,0x00,0x23,0x24,0x84,0xf8,0x00, ++0x30,0x83,0x00,0x03,0x00,0x04,0x10,0x40,0x00,0x40,0x88,0x21,0x00,0x60,0x20,0x21, ++0x00,0x43,0x10,0x23,0x3c,0x03,0xb0,0x0a,0x00,0x43,0x10,0x21,0xac,0x45,0x10,0x00, ++0x00,0x40,0x18,0x21,0x24,0x05,0x00,0x01,0x8c,0x62,0x10,0x00,0x00,0x00,0x00,0x00, ++0x14,0x45,0xff,0xfd,0x3c,0x02,0xb0,0x0a,0x02,0x24,0x88,0x23,0x02,0x22,0x88,0x21, ++0x8e,0x30,0x00,0x00,0x0c,0x00,0x1b,0x63,0x02,0x40,0x20,0x21,0x00,0x12,0x18,0x27, ++0x02,0x03,0x80,0x24,0x00,0x53,0x10,0x04,0x02,0x02,0x80,0x25,0xae,0x30,0x00,0x00, ++0x24,0x03,0x00,0x01,0x8e,0x22,0x10,0x00,0x00,0x00,0x00,0x00,0x14,0x43,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x30,0x82,0x00,0x03,0x00,0x04,0x18,0x40, ++0x00,0x62,0x18,0x23,0x3c,0x04,0xb0,0x0a,0x00,0x64,0x18,0x21,0xac,0x66,0x00,0x00, ++0x24,0x04,0x00,0x01,0x8c,0x62,0x10,0x00,0x00,0x00,0x00,0x00,0x14,0x44,0xff,0xfd, ++0x00,0x00,0x00,0x00,0x08,0x00,0x1b,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x21, ++0x00,0x64,0x10,0x06,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00, ++0x24,0x63,0x00,0x01,0x2c,0x62,0x00,0x20,0x14,0x40,0xff,0xf9,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21,0x27,0xbd,0xff,0xe0,0x3c,0x03,0xb0,0x05, ++0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x1c, ++0x00,0x80,0x90,0x21,0x00,0xa0,0x80,0x21,0x00,0xc0,0x88,0x21,0x34,0x63,0x02,0x2e, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0xff,0xfc, ++0x24,0x04,0x08,0x24,0x3c,0x05,0x00,0xc0,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x03, ++0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0xc0,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x03, ++0x3c,0x02,0xc0,0x00,0x00,0x10,0x1c,0x00,0x34,0x42,0x04,0x00,0x3c,0x04,0xb0,0x05, ++0x3c,0x05,0xb0,0x05,0x24,0x63,0x16,0x09,0x02,0x22,0x10,0x21,0x34,0x84,0x04,0x20, ++0x34,0xa5,0x04,0x24,0x3c,0x06,0xb0,0x05,0xac,0x83,0x00,0x00,0x24,0x07,0x00,0x01, ++0xac,0xa2,0x00,0x00,0x34,0xc6,0x02,0x28,0x24,0x02,0x00,0x20,0xae,0x47,0x00,0x3c, ++0x24,0x04,0x08,0x24,0xa0,0xc2,0x00,0x00,0x3c,0x05,0x00,0xc0,0xa2,0x47,0x00,0x11, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x01,0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0xc0, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x01,0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x24,0x02,0x00,0x06, ++0xac,0x82,0x00,0x0c,0xa0,0x80,0x00,0x50,0xac,0x80,0x00,0x00,0xac,0x80,0x00,0x04, ++0xac,0x80,0x00,0x08,0xac,0x80,0x00,0x14,0xac,0x80,0x00,0x18,0xac,0x80,0x00,0x1c, ++0xa4,0x80,0x00,0x20,0xac,0x80,0x00,0x24,0xac,0x80,0x00,0x28,0xac,0x80,0x00,0x2c, ++0xa0,0x80,0x00,0x30,0xa0,0x80,0x00,0x31,0xac,0x80,0x00,0x34,0xac,0x80,0x00,0x38, ++0xa0,0x80,0x00,0x3c,0xac,0x82,0x00,0x10,0xa0,0x80,0x00,0x44,0xac,0x80,0x00,0x48, ++0x03,0xe0,0x00,0x08,0xac,0x80,0x00,0x4c,0x3c,0x04,0xb0,0x06,0x34,0x84,0x80,0x00, ++0x8c,0x83,0x00,0x00,0x3c,0x02,0x12,0x00,0x3c,0x05,0xb0,0x03,0x00,0x62,0x18,0x25, ++0x34,0xa5,0x00,0x8b,0x24,0x02,0xff,0x80,0xac,0x83,0x00,0x00,0x03,0xe0,0x00,0x08, ++0xa0,0xa2,0x00,0x00,0x3c,0x04,0xb0,0x03,0x34,0x84,0x00,0x0b,0x24,0x02,0x00,0x22, ++0x3c,0x05,0xb0,0x01,0x3c,0x06,0x45,0x67,0x3c,0x0a,0xb0,0x09,0xa0,0x82,0x00,0x00, ++0x34,0xa5,0x00,0x04,0x34,0xc6,0x89,0xaa,0x35,0x4a,0x00,0x04,0x24,0x02,0x01,0x23, ++0x3c,0x0b,0xb0,0x09,0x3c,0x07,0x01,0x23,0x3c,0x0c,0xb0,0x09,0x3c,0x01,0xb0,0x01, ++0xac,0x20,0x00,0x00,0x27,0xbd,0xff,0xe0,0xac,0xa0,0x00,0x00,0x35,0x6b,0x00,0x08, ++0x3c,0x01,0xb0,0x09,0xac,0x26,0x00,0x00,0x34,0xe7,0x45,0x66,0xa5,0x42,0x00,0x00, ++0x35,0x8c,0x00,0x0c,0x24,0x02,0xcd,0xef,0x3c,0x0d,0xb0,0x09,0x3c,0x08,0xcd,0xef, ++0x3c,0x0e,0xb0,0x09,0xad,0x67,0x00,0x00,0xaf,0xb7,0x00,0x1c,0xa5,0x82,0x00,0x00, ++0xaf,0xb6,0x00,0x18,0xaf,0xb5,0x00,0x14,0xaf,0xb4,0x00,0x10,0xaf,0xb3,0x00,0x0c, ++0xaf,0xb2,0x00,0x08,0xaf,0xb1,0x00,0x04,0xaf,0xb0,0x00,0x00,0x35,0xad,0x00,0x10, ++0x35,0x08,0x01,0x22,0x35,0xce,0x00,0x14,0x24,0x02,0x89,0xab,0x3c,0x0f,0xb0,0x09, ++0x3c,0x09,0x89,0xab,0x3c,0x10,0xb0,0x09,0x3c,0x11,0xb0,0x09,0x3c,0x12,0xb0,0x09, ++0x3c,0x13,0xb0,0x09,0x3c,0x14,0xb0,0x09,0x3c,0x15,0xb0,0x09,0x3c,0x16,0xb0,0x09, ++0x3c,0x17,0xb0,0x09,0xad,0xa8,0x00,0x00,0x24,0x03,0xff,0xff,0xa5,0xc2,0x00,0x00, ++0x35,0xef,0x00,0x18,0x35,0x29,0xcd,0xee,0x36,0x10,0x00,0x1c,0x36,0x31,0x00,0x20, ++0x36,0x52,0x00,0x24,0x36,0x73,0x00,0x28,0x36,0x94,0x00,0x2c,0x36,0xb5,0x00,0x30, ++0x36,0xd6,0x00,0x34,0x36,0xf7,0x00,0x38,0x24,0x02,0x45,0x67,0xad,0xe9,0x00,0x00, ++0xa6,0x02,0x00,0x00,0xae,0x23,0x00,0x00,0x8f,0xb0,0x00,0x00,0xa6,0x43,0x00,0x00, ++0x8f,0xb1,0x00,0x04,0xae,0x63,0x00,0x00,0x8f,0xb2,0x00,0x08,0xa6,0x83,0x00,0x00, ++0x8f,0xb3,0x00,0x0c,0xae,0xa3,0x00,0x00,0x8f,0xb4,0x00,0x10,0xa6,0xc3,0x00,0x00, ++0x8f,0xb5,0x00,0x14,0xae,0xe3,0x00,0x00,0x7b,0xb6,0x00,0xfc,0x3c,0x18,0xb0,0x09, ++0x37,0x18,0x00,0x3c,0xa7,0x03,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x00,0x34,0x63,0x00,0x20,0x24,0x42,0x70,0x70, ++0xac,0x62,0x00,0x00,0x8c,0x83,0x00,0x34,0x34,0x02,0xff,0xff,0x00,0x43,0x10,0x2a, ++0x14,0x40,0x00,0xed,0x00,0x80,0x28,0x21,0x8c,0x84,0x00,0x08,0x24,0x02,0x00,0x03, ++0x10,0x82,0x00,0xe0,0x00,0x00,0x00,0x00,0x8c,0xa2,0x00,0x2c,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x47,0x24,0x02,0x00,0x06,0x3c,0x03,0xb0,0x05,0x34,0x63,0x04,0x50, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x14,0x40,0x00,0xc6, ++0xac,0xa2,0x00,0x2c,0x24,0x02,0x00,0x01,0x10,0x82,0x00,0xc5,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x02,0x10,0x82,0x00,0xb3,0x00,0x00,0x00,0x00,0x8c,0xa6,0x00,0x04, ++0x24,0x02,0x00,0x02,0x10,0xc2,0x00,0xa9,0x00,0x00,0x00,0x00,0x8c,0xa2,0x00,0x14, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x09,0x24,0x02,0x00,0x01,0x3c,0x03,0xb0,0x09, ++0x34,0x63,0x01,0x60,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0x10,0x40,0x00,0x05,0xac,0xa2,0x00,0x14,0x24,0x02,0x00,0x01,0xac,0xa2,0x00,0x00, ++0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x14,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0, ++0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x61,0x00,0x16,0x3c,0x03,0xb0,0x05, ++0x34,0x63,0x02,0x2e,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x10,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x42,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x0b,0x00,0x00,0x00,0x00,0x80,0xa2,0x00,0x50, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x07,0x00,0x00,0x00,0x00,0x14,0x80,0x00,0x05, ++0x24,0x02,0x00,0x0e,0x24,0x03,0x00,0x01,0xac,0xa2,0x00,0x00,0x03,0xe0,0x00,0x08, ++0xa0,0xa3,0x00,0x50,0x80,0xa2,0x00,0x31,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0a, ++0x3c,0x02,0xb0,0x06,0x34,0x42,0x80,0x18,0x8c,0x43,0x00,0x00,0x3c,0x04,0xf0,0x00, ++0x3c,0x02,0x80,0x00,0x00,0x64,0x18,0x24,0x10,0x62,0x00,0x03,0x24,0x02,0x00,0x09, ++0x03,0xe0,0x00,0x08,0xac,0xa2,0x00,0x00,0x8c,0xa2,0x00,0x40,0x00,0x00,0x00,0x00, ++0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x00,0x09,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2c,0x8c,0x43,0x00,0x00,0x3c,0x04,0x00,0x02, ++0x00,0x64,0x18,0x24,0x14,0x60,0xff,0xf2,0x24,0x02,0x00,0x10,0x3c,0x03,0xb0,0x03, ++0x34,0x63,0x02,0x01,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x80, ++0x10,0x40,0x00,0x0e,0x00,0x00,0x00,0x00,0x8c,0xa3,0x00,0x0c,0x00,0x00,0x00,0x00, ++0xac,0xa3,0x00,0x10,0x3c,0x02,0xb0,0x03,0x90,0x42,0x02,0x01,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x0f,0xac,0xa2,0x00,0x0c,0x90,0xa3,0x00,0x0f,0x24,0x02,0x00,0x0d, ++0x3c,0x01,0xb0,0x03,0x08,0x00,0x1c,0x74,0xa0,0x23,0x02,0x01,0x3c,0x02,0xb0,0x09, ++0x34,0x42,0x01,0x80,0x90,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x1e,0x00, ++0x00,0x03,0x1e,0x03,0x10,0x60,0x00,0x15,0xa0,0xa4,0x00,0x44,0x24,0x02,0x00,0x01, ++0x10,0x62,0x00,0x0b,0x24,0x02,0x00,0x02,0x10,0x62,0x00,0x03,0x24,0x03,0x00,0x0d, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8c,0xa2,0x00,0x0c,0xac,0xa3,0x00,0x00, ++0x24,0x03,0x00,0x04,0xac,0xa2,0x00,0x10,0x03,0xe0,0x00,0x08,0xac,0xa3,0x00,0x0c, ++0x24,0x02,0x00,0x0d,0xac,0xa2,0x00,0x00,0x24,0x03,0x00,0x04,0x24,0x02,0x00,0x06, ++0xac,0xa3,0x00,0x10,0x03,0xe0,0x00,0x08,0xac,0xa2,0x00,0x0c,0x8c,0xa3,0x00,0x38, ++0x24,0x04,0x00,0x01,0x10,0x64,0x00,0x2d,0x24,0x02,0x00,0x02,0x10,0x60,0x00,0x19, ++0x00,0x00,0x00,0x00,0x10,0x62,0x00,0x10,0x24,0x02,0x00,0x04,0x10,0x62,0x00,0x04, ++0x00,0x00,0x00,0x00,0xac,0xa0,0x00,0x38,0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x00, ++0x10,0xc4,0x00,0x07,0x24,0x02,0x00,0x03,0x80,0xa2,0x00,0x30,0x00,0x00,0x00,0x00, ++0x00,0x02,0x18,0x0b,0xac,0xa3,0x00,0x00,0x03,0xe0,0x00,0x08,0xac,0xa0,0x00,0x38, ++0x08,0x00,0x1c,0xc6,0xac,0xa2,0x00,0x00,0x10,0xc4,0x00,0x02,0x24,0x02,0x00,0x03, ++0x24,0x02,0x00,0x0c,0xac,0xa2,0x00,0x00,0x24,0x02,0x00,0x04,0x03,0xe0,0x00,0x08, ++0xac,0xa2,0x00,0x38,0x10,0xc4,0x00,0x0e,0x3c,0x03,0xb0,0x06,0x34,0x63,0x80,0x24, ++0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x10,0x40,0x00,0x06, ++0xac,0xa2,0x00,0x18,0x24,0x02,0x00,0x02,0xac,0xa2,0x00,0x00,0xac,0xa0,0x00,0x18, ++0x08,0x00,0x1c,0xcf,0x24,0x02,0x00,0x01,0x08,0x00,0x1c,0xdc,0xac,0xa0,0x00,0x00, ++0x24,0x02,0x00,0x03,0x08,0x00,0x1c,0xdc,0xac,0xa2,0x00,0x00,0x24,0x03,0x00,0x0b, ++0xac,0xa2,0x00,0x38,0x03,0xe0,0x00,0x08,0xac,0xa3,0x00,0x00,0x80,0xa2,0x00,0x30, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x55,0x24,0x02,0x00,0x04,0x08,0x00,0x1c,0x74, ++0x00,0x00,0x00,0x00,0x84,0xa2,0x00,0x20,0x00,0x00,0x00,0x00,0x10,0x40,0xff,0x84, ++0x24,0x02,0x00,0x06,0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff,0x00,0x60,0x10,0x21, ++0x14,0x40,0xff,0x42,0xa4,0xa3,0x00,0x20,0x08,0x00,0x1c,0x74,0x24,0x02,0x00,0x06, ++0x8c,0xa2,0x00,0x1c,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0x75,0x24,0x02,0x00,0x05, ++0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2c,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0x10,0x40,0xff,0x32,0xac,0xa2,0x00,0x1c,0x08,0x00,0x1c,0x74, ++0x24,0x02,0x00,0x05,0x3c,0x02,0xb0,0x05,0x8c,0x42,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x02,0x17,0x42,0x30,0x42,0x00,0x01,0x14,0x40,0xff,0x65,0x24,0x02,0x00,0x06, ++0x08,0x00,0x1c,0x2a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x0a,0x03,0xe0,0x00,0x08, ++0xac,0x82,0x00,0x00,0x27,0xbd,0xff,0xc8,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0x27,0x91,0x91,0xf8,0x27,0x90,0x8f,0x38,0xaf,0xbf,0x00,0x30,0xaf,0xb7,0x00,0x2c, ++0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24,0xaf,0xb4,0x00,0x20,0xaf,0xb3,0x00,0x1c, ++0x0c,0x00,0x2d,0x21,0xaf,0xb2,0x00,0x18,0x0c,0x00,0x07,0x90,0x00,0x00,0x00,0x00, ++0xaf,0x91,0x95,0x10,0xaf,0x90,0x99,0x20,0x48,0x02,0x00,0x00,0x0c,0x00,0x1b,0xba, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x1f,0x97,0x02,0x00,0x20,0x21,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x00,0x3a,0x94,0x43,0x00,0x00,0x3a,0x54,0xff,0xff,0xa3,0x83,0x99,0x24, ++0x0c,0x00,0x00,0x34,0x02,0x80,0xa8,0x21,0x0c,0x00,0x1b,0xc5,0x02,0x80,0xb0,0x21, ++0x27,0x84,0x8d,0x78,0x0c,0x00,0x32,0x44,0x02,0x80,0xb8,0x21,0x93,0x84,0x80,0x10, ++0x0c,0x00,0x28,0xb0,0x00,0x00,0x00,0x00,0x0c,0x00,0x0e,0x84,0x02,0x20,0x20,0x21, ++0x0c,0x00,0x01,0x39,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x20,0x0c,0x00,0x1b,0xa3, ++0x00,0x00,0x00,0x00,0x27,0x82,0x92,0x2c,0xaf,0x82,0x8d,0x60,0x0c,0x00,0x00,0x5f, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x01,0x08,0x3c,0x04,0xb0,0x09, ++0x3c,0x05,0xb0,0x09,0x8c,0x66,0x00,0x00,0x34,0x84,0x01,0x68,0x24,0x02,0xc8,0x80, ++0x34,0xa5,0x01,0x40,0x24,0x03,0x00,0x0a,0xa4,0x82,0x00,0x00,0xa4,0xa3,0x00,0x00, ++0x3c,0x04,0xb0,0x03,0x8c,0x82,0x00,0x00,0xaf,0x86,0x8d,0x18,0x34,0x42,0x00,0x20, ++0xac,0x82,0x00,0x00,0x0c,0x00,0x07,0xa1,0x00,0x00,0x00,0x00,0x3c,0x04,0xb0,0x05, ++0x0c,0x00,0x2d,0x39,0x34,0x84,0x00,0x04,0x8f,0x83,0x8d,0x20,0x00,0x00,0x00,0x00, ++0x2c,0x62,0x00,0x11,0x10,0x40,0xff,0xf7,0x00,0x03,0x10,0x80,0x3c,0x03,0x80,0x01, ++0x24,0x63,0x08,0xac,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x78,0x0c,0x00,0x31,0x79, ++0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x20,0x0c,0x00,0x1c,0x1c,0x00,0x00,0x00,0x00, ++0x93,0x83,0x88,0x6d,0x24,0x02,0x00,0x01,0x10,0x62,0x00,0x07,0x00,0x00,0x00,0x00, ++0x8f,0x82,0x8d,0x54,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x01,0xaf,0x82,0x8d,0x54, ++0x08,0x00,0x1d,0x55,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x78,0x0c,0x00,0x31,0xf8, ++0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x78, ++0x0c,0x00,0x33,0xda,0x00,0x00,0x00,0x00,0xa3,0x82,0x8d,0x51,0xaf,0x80,0x8d,0x20, ++0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x27,0x84,0x8f,0x38,0x0c,0x00,0x20,0xd3, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0x14,0x40,0x00,0x05,0x3c,0x03,0xb0,0x05, ++0xaf,0x80,0x8d,0x20,0xaf,0x80,0x8d,0x24,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00, ++0x34,0x63,0x04,0x50,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0xaf,0x82,0x8d,0x4c,0x14,0x40,0x00,0x1e,0x24,0x02,0x00,0x01,0x8f,0x84,0x8d,0x28, ++0x00,0x00,0x00,0x00,0x10,0x82,0x00,0x1d,0x3c,0x03,0xb0,0x09,0x34,0x63,0x01,0x60, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0xaf,0x82,0x8d,0x34, ++0x14,0x40,0x00,0x13,0x24,0x02,0x00,0x01,0x24,0x02,0x00,0x02,0x10,0x82,0x00,0x07, ++0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x01,0x24,0x03,0x00,0x03,0xaf,0x82,0x8d,0x24, ++0xaf,0x83,0x8d,0x20,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x34,0x42,0x02,0x2e, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff, ++0x00,0x60,0x10,0x21,0xa7,0x83,0x8d,0x40,0x14,0x40,0xff,0xf3,0x24,0x02,0x00,0x01, ++0xaf,0x82,0x8d,0x24,0x08,0x00,0x1d,0x7f,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x05, ++0x34,0x63,0x02,0x2c,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0xaf,0x82,0x8d,0x3c,0x14,0x40,0xff,0xf6,0x24,0x02,0x00,0x01,0x08,0x00,0x1d,0x97, ++0x3c,0x03,0xb0,0x09,0x27,0x84,0x8f,0x38,0x0c,0x00,0x22,0x4c,0x00,0x00,0x00,0x00, ++0x83,0x82,0x8d,0x50,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xed,0x24,0x02,0x00,0x02, ++0x3c,0x03,0xb0,0x05,0x34,0x63,0x04,0x50,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0xff,0xaf,0x82,0x8d,0x4c,0x14,0x40,0xff,0xe5,0x24,0x02,0x00,0x02, ++0x8f,0x84,0x8d,0x28,0x24,0x02,0x00,0x01,0x10,0x82,0x00,0x12,0x24,0x02,0x00,0x02, ++0x10,0x82,0x00,0x05,0x3c,0x02,0xb0,0x05,0x24,0x02,0x00,0x02,0xaf,0x82,0x8d,0x24, ++0x08,0x00,0x1d,0xa4,0x24,0x03,0x00,0x04,0x34,0x42,0x02,0x2e,0x90,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff,0x00,0x60,0x10,0x21, ++0xa7,0x83,0x8d,0x40,0x14,0x40,0xff,0xf4,0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0xb0, ++0x24,0x02,0x00,0x02,0x3c,0x03,0xb0,0x05,0x34,0x63,0x02,0x2c,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff,0xaf,0x82,0x8d,0x3c,0x14,0x40,0xff,0xf7, ++0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0xd0,0x24,0x02,0x00,0x02,0x27,0x84,0x91,0xf8, ++0x0c,0x00,0x12,0xe2,0x00,0x00,0x00,0x00,0x8f,0x83,0x8d,0x24,0xaf,0x82,0x8d,0x3c, ++0x38,0x64,0x00,0x02,0x00,0x04,0x18,0x0a,0xaf,0x83,0x8d,0x24,0x14,0x40,0x00,0x08, ++0x24,0x02,0x00,0x05,0x8f,0x82,0x92,0x38,0xaf,0x80,0x8d,0x20,0x10,0x40,0xff,0x78, ++0x24,0x04,0x00,0x01,0xaf,0x84,0x8d,0x28,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00, ++0xaf,0x82,0x8d,0x20,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x83,0x82,0x8d,0x70, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x02,0x24,0x02,0x00,0x20,0xaf,0x82,0x8d,0x3c, ++0x8f,0x85,0x8d,0x3c,0x27,0x84,0x91,0xf8,0x0c,0x00,0x14,0xbd,0x00,0x00,0x00,0x00, ++0x00,0x02,0x1e,0x00,0xa3,0x82,0x8d,0x50,0xaf,0x80,0x8d,0x3c,0x10,0x60,0xff,0x73, ++0x3c,0x02,0xb0,0x05,0x34,0x42,0x02,0x2e,0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x63,0x00,0x01,0x30,0x63,0x00,0xff,0x00,0x60,0x10,0x21,0xa7,0x83,0x8d,0x40, ++0x10,0x40,0xff,0xe7,0x24,0x02,0x00,0x06,0x24,0x04,0x00,0x02,0xaf,0x84,0x8d,0x28, ++0x08,0x00,0x1d,0x7f,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x20,0x27,0x85,0x91,0xf8, ++0x0c,0x00,0x15,0x83,0x00,0x00,0x00,0x00,0x8f,0x82,0x8d,0x44,0xaf,0x80,0x8d,0x4c, ++0x14,0x40,0x00,0x18,0x00,0x40,0x18,0x21,0x8f,0x82,0x8d,0x48,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x14,0x24,0x02,0x00,0x02,0x8f,0x83,0x8d,0x28,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x09,0x24,0x02,0x00,0x01,0x8f,0x83,0x8d,0x24,0x00,0x00,0x00,0x00, ++0x10,0x62,0x00,0x02,0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x06,0xaf,0x82,0x8d,0x20, ++0x08,0x00,0x1d,0xf9,0x24,0x04,0x00,0x03,0x3c,0x02,0x40,0x00,0x34,0x42,0x00,0x14, ++0x3c,0x01,0xb0,0x05,0xac,0x22,0x00,0x00,0xaf,0x80,0x8d,0x20,0x08,0x00,0x1d,0xf9, ++0x24,0x04,0x00,0x03,0x10,0x60,0x00,0x10,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x20, ++0x27,0x85,0x91,0xf8,0x0c,0x00,0x15,0xa7,0x00,0x00,0x00,0x00,0x8f,0x83,0x8d,0x24, ++0x24,0x02,0x00,0x01,0xa3,0x80,0x8d,0x50,0xaf,0x80,0x8d,0x28,0x10,0x62,0x00,0x02, ++0x24,0x02,0x00,0x03,0x24,0x02,0x00,0x04,0xaf,0x82,0x8d,0x20,0xaf,0x80,0x8d,0x44, ++0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x83,0x82,0x8d,0x70,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x27,0x84,0x91,0xf8,0x0c,0x00,0x17,0xef, ++0x00,0x00,0x00,0x00,0x8f,0x82,0x8d,0x24,0xa3,0x80,0x8d,0x50,0xaf,0x80,0x8d,0x20, ++0xaf,0x80,0x8d,0x28,0x14,0x40,0x00,0x02,0x24,0x02,0x00,0x02,0xaf,0x82,0x8d,0x24, ++0xaf,0x80,0x8d,0x48,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x20, ++0x27,0x85,0x91,0xf8,0x0c,0x00,0x15,0xa7,0x00,0x00,0x00,0x00,0x8f,0x82,0x8d,0x24, ++0xa3,0x80,0x8d,0x50,0xaf,0x80,0x8d,0x20,0xaf,0x80,0x8d,0x28,0x14,0x40,0xff,0x0c, ++0x24,0x02,0x00,0x02,0xaf,0x82,0x8d,0x24,0x08,0x00,0x1d,0x70,0x00,0x00,0x00,0x00, ++0x27,0x84,0x91,0xf8,0x0c,0x00,0x17,0xef,0x00,0x00,0x00,0x00,0x08,0x00,0x1e,0x5f, ++0x00,0x00,0x00,0x00,0x27,0x84,0x8d,0x78,0x0c,0x00,0x34,0x70,0x00,0x00,0x00,0x00, ++0x08,0x00,0x1d,0x7e,0x00,0x00,0x00,0x00,0x0c,0x00,0x2b,0x15,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x31,0xea,0x00,0x00,0x00,0x00,0x0c,0x00,0x1f,0x89,0x00,0x00,0x00,0x00, ++0x93,0x83,0xc5,0x58,0x00,0x00,0x00,0x00,0x14,0x60,0x00,0x1c,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x08,0x8c,0x44,0x00,0x00,0x8f,0x83,0xc5,0x50,0x8f,0x82,0xc5,0x54, ++0x00,0x83,0x18,0x23,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x14,0x2e,0xa3,0x00,0x01, ++0x2e,0x82,0x00,0x01,0x00,0x43,0x10,0x25,0x2e,0xc4,0x00,0x01,0x00,0x44,0x10,0x25, ++0x2e,0xe3,0x00,0x01,0x3c,0x05,0xb0,0x03,0x00,0x43,0x10,0x25,0x34,0xa5,0x01,0x18, ++0x8c,0xa3,0x00,0x00,0x14,0x40,0x00,0x02,0x24,0x04,0x00,0x02,0x00,0x00,0x20,0x21, ++0x0c,0x00,0x0b,0x7e,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08, ++0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x83,0xc5,0x50,0x0c,0x00,0x01,0xe9, ++0x00,0x00,0x00,0x00,0xaf,0x80,0x8d,0x20,0xaf,0x80,0x8d,0x54,0x08,0x00,0x1d,0x55, ++0x00,0x00,0x00,0x00,0x27,0x90,0xbd,0x40,0x24,0x11,0x00,0x12,0x8e,0x04,0x00,0x00, ++0x00,0x00,0x00,0x00,0x90,0x82,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x20,0x48,0x00,0x00,0x00,0x00,0x26,0x31,0xff,0xff, ++0x06,0x21,0xff,0xf6,0x26,0x10,0x00,0x04,0x08,0x00,0x1d,0x7f,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x01,0x08,0x8c,0x44,0x00,0x00,0x8f,0x82,0x8d,0x18, ++0x00,0x04,0x19,0xc2,0x00,0x02,0x11,0xc2,0x10,0x62,0xfe,0xcc,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x02,0x90,0x43,0x00,0x00,0x3c,0x12,0xb0,0x05,0xaf,0x84,0x8d,0x18, ++0x30,0x63,0x00,0xff,0x00,0x03,0x11,0x40,0x00,0x43,0x10,0x23,0x00,0x02,0x10,0x80, ++0x00,0x43,0x10,0x21,0x00,0x02,0x99,0x00,0x00,0x00,0x88,0x21,0x36,0x52,0x02,0x2c, ++0x27,0x90,0xbd,0x40,0x8e,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x83,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x62,0x00,0x03,0x10,0x40,0x00,0x06,0x30,0x62,0x00,0x1c, ++0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x8f,0x85,0x8d,0x18,0x0c,0x00,0x26,0x05, ++0x02,0x60,0x30,0x21,0x8e,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xff, ++0x14,0x40,0xfe,0xae,0x00,0x00,0x00,0x00,0x26,0x31,0x00,0x01,0x2a,0x22,0x00,0x13, ++0x14,0x40,0xff,0xec,0x26,0x10,0x00,0x04,0x08,0x00,0x1d,0x7f,0x00,0x00,0x00,0x00, ++0x8f,0x84,0x8d,0x2c,0x27,0x85,0x91,0xf8,0x0c,0x00,0x1f,0x1c,0x00,0x00,0x00,0x00, ++0x8f,0x83,0x8d,0x2c,0x24,0x02,0x00,0x04,0x14,0x62,0xfe,0xa0,0x24,0x02,0x00,0x05, ++0x08,0x00,0x1d,0xfc,0x00,0x00,0x00,0x00,0x27,0x84,0x91,0xf8,0x0c,0x00,0x2b,0x3c, ++0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0xa4,0x24,0x03,0x00,0x05,0x8f,0x82,0x92,0x2c, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0d,0x00,0x00,0x00,0x00,0x8f,0x84,0xbd,0x80, ++0xaf,0x80,0x92,0x2c,0x94,0x85,0x00,0x14,0x0c,0x00,0x22,0xe1,0x00,0x00,0x00,0x00, ++0x93,0x82,0x94,0x51,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x02,0x10,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x01,0x57,0x00,0x00,0x20,0x21,0x8f,0x84,0xbd,0x80, ++0x0c,0x00,0x20,0x48,0x00,0x00,0x00,0x00,0x08,0x00,0x1d,0x7f,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xff,0x90,0x27,0xbd,0xff,0xe8,0x00,0x80,0x18,0x21,0x34,0x42,0x00,0x01, ++0x27,0x84,0x91,0xf8,0x10,0x62,0x00,0x05,0xaf,0xbf,0x00,0x10,0x8f,0xbf,0x00,0x10, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x0e,0x84, ++0x00,0x00,0x00,0x00,0x27,0x84,0x8f,0x38,0x0c,0x00,0x1f,0x97,0x00,0x00,0x00,0x00, ++0x27,0x84,0x8d,0x20,0x0c,0x00,0x1b,0xa3,0x00,0x00,0x00,0x00,0x08,0x00,0x1f,0x03, ++0x00,0x00,0x00,0x00,0x8f,0x82,0x92,0x38,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05, ++0x00,0x00,0x18,0x21,0x8f,0x82,0x8d,0x28,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x02, ++0x00,0x00,0x00,0x00,0x24,0x03,0x00,0x01,0x03,0xe0,0x00,0x08,0x00,0x60,0x10,0x21, ++0x27,0xbd,0xff,0xe0,0x3c,0x06,0xb0,0x03,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0x34,0xc6,0x00,0x5f,0xaf,0xbf,0x00,0x18,0x90,0xc3,0x00,0x00,0x3c,0x07,0xb0,0x03, ++0x34,0xe7,0x00,0x5d,0x34,0x63,0x00,0x01,0x3c,0x09,0xb0,0x03,0x24,0x02,0x00,0x01, ++0xa0,0xc3,0x00,0x00,0x00,0x80,0x80,0x21,0xa0,0xe2,0x00,0x00,0x00,0xa0,0x88,0x21, ++0x35,0x29,0x00,0x5e,0x00,0xe0,0x40,0x21,0x24,0x04,0x00,0x01,0x91,0x22,0x00,0x00, ++0x91,0x03,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x83,0x00,0x03,0x30,0x42,0x00,0x01, ++0x14,0x40,0xff,0xfa,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x04,0x12,0x02,0x00,0x2c, ++0x24,0x05,0x0f,0x00,0x24,0x02,0x00,0x06,0x12,0x02,0x00,0x08,0x24,0x05,0x00,0x0f, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x02,0x00,0xa0,0x50,0x00,0x00,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x24,0x04,0x0c,0x04, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x0f,0x24,0x04,0x0d,0x04,0x24,0x05,0x00,0x0f, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x80,0x24,0x05,0x1e,0x00, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x8c,0x24,0x05,0x0f,0x00, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x0f,0x24,0x04,0x08,0x24,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x2c,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x34,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x02,0x24,0x04,0x08,0x3c,0x3c,0x05,0x00,0x30, ++0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x02,0x08,0x00,0x1f,0x3d,0x3c,0x02,0xb0,0x03, ++0x24,0x04,0x08,0x8c,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x04,0x24,0x04,0x08,0x80, ++0x24,0x05,0x1e,0x00,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x04,0x24,0x04,0x0c,0x04, ++0x24,0x05,0x00,0x0f,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x04,0x24,0x04,0x0d,0x04, ++0x24,0x05,0x00,0x0f,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x04,0x24,0x04,0x08,0x24, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x03,0x24,0x04,0x08,0x2c, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x03,0x24,0x04,0x08,0x34, ++0x3c,0x05,0x00,0x30,0x0c,0x00,0x1b,0x29,0x24,0x06,0x00,0x02,0x3c,0x05,0x00,0x30, ++0x24,0x06,0x00,0x03,0x0c,0x00,0x1b,0x29,0x24,0x04,0x08,0x3c,0x02,0x20,0x20,0x21, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x1b,0x6e,0x24,0x06,0x01,0x07,0x08,0x00,0x1f,0x3d, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x73,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x02,0x14,0x40,0x00,0x04,0x00,0x00,0x00,0x00, ++0xa3,0x80,0x87,0x6d,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0xa3,0x82,0x87,0x6d,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x00,0x00,0x80,0x70,0x21,0x34,0x63,0x00,0x20,0x24,0x42,0x7e,0x5c, ++0x3c,0x04,0xb0,0x03,0xac,0x62,0x00,0x00,0x34,0x84,0x00,0x30,0xad,0xc0,0x02,0xb8, ++0x8c,0x83,0x00,0x00,0x24,0x02,0x00,0xff,0xa5,0xc0,0x00,0x0a,0x00,0x00,0x30,0x21, ++0xa7,0x82,0x99,0x30,0x27,0x88,0x99,0x40,0xa5,0xc3,0x00,0x08,0x3c,0x07,0xb0,0x08, ++0x30,0xc2,0xff,0xff,0x00,0x02,0x20,0xc0,0x24,0xc3,0x00,0x01,0x00,0x82,0x10,0x21, ++0x00,0x60,0x30,0x21,0x00,0x02,0x10,0x80,0x30,0x63,0xff,0xff,0x00,0x48,0x10,0x21, ++0x00,0x87,0x20,0x21,0x28,0xc5,0x00,0xff,0xac,0x83,0x00,0x00,0x14,0xa0,0xff,0xf4, ++0xa4,0x43,0x00,0x00,0x3c,0x02,0xb0,0x08,0x34,0x03,0xff,0xff,0x25,0xc4,0x00,0x0c, ++0x24,0x0a,0x00,0x02,0x34,0x42,0x07,0xf8,0x3c,0x06,0xb0,0x03,0xa7,0x83,0xbd,0x1c, ++0xac,0x43,0x00,0x00,0xaf,0x84,0xbd,0x40,0x34,0xc6,0x00,0x64,0xa0,0x8a,0x00,0x18, ++0x94,0xc5,0x00,0x00,0x8f,0x82,0xbd,0x40,0x25,0xc4,0x00,0x30,0x24,0x08,0x00,0x03, ++0x3c,0x03,0xb0,0x03,0xa0,0x45,0x00,0x21,0x34,0x63,0x00,0x66,0xaf,0x84,0xbd,0x44, ++0xa0,0x88,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xbd,0x44,0x25,0xc4,0x00,0x54, ++0x25,0xc7,0x00,0x78,0xa0,0x45,0x00,0x21,0xaf,0x84,0xbd,0x48,0xa0,0x88,0x00,0x18, ++0x94,0x65,0x00,0x00,0x8f,0x82,0xbd,0x48,0x25,0xc8,0x00,0x9c,0x24,0x09,0x00,0x01, ++0xa0,0x45,0x00,0x21,0xaf,0x87,0xbd,0x4c,0xa0,0xea,0x00,0x18,0x94,0xc4,0x00,0x00, ++0x8f,0x82,0xbd,0x4c,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x62,0xa0,0x44,0x00,0x21, ++0xaf,0x88,0xbd,0x50,0xa1,0x09,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xbd,0x50, ++0x25,0xc4,0x00,0xc0,0x3c,0x06,0xb0,0x03,0xa0,0x45,0x00,0x21,0xaf,0x84,0xbd,0x54, ++0xa0,0x89,0x00,0x18,0x94,0x65,0x00,0x00,0x8f,0x82,0xbd,0x54,0x25,0xc4,0x00,0xe4, ++0x34,0xc6,0x00,0x60,0xa0,0x45,0x00,0x21,0xaf,0x84,0xbd,0x58,0xa0,0x80,0x00,0x18, ++0x94,0xc5,0x00,0x00,0x8f,0x82,0xbd,0x58,0x25,0xc3,0x01,0x08,0x25,0xc7,0x01,0x2c, ++0xa0,0x45,0x00,0x21,0xaf,0x83,0xbd,0x5c,0xa0,0x60,0x00,0x18,0x94,0xc8,0x00,0x00, ++0x8f,0x82,0xbd,0x5c,0x25,0xc4,0x01,0x50,0x25,0xc5,0x01,0x74,0xa0,0x48,0x00,0x21, ++0x25,0xc6,0x01,0x98,0x25,0xc9,0x01,0xbc,0x25,0xca,0x01,0xe0,0x25,0xcb,0x02,0x04, ++0x25,0xcc,0x02,0x28,0x25,0xcd,0x02,0x4c,0x24,0x02,0x00,0x10,0x3c,0x03,0xb0,0x03, ++0xaf,0x87,0xbd,0x60,0x34,0x63,0x00,0x38,0xa0,0xe0,0x00,0x18,0xaf,0x84,0xbd,0x64, ++0xa0,0x80,0x00,0x18,0xaf,0x85,0xbd,0x68,0xa0,0xa0,0x00,0x18,0xaf,0x86,0xbd,0x6c, ++0xa0,0xc0,0x00,0x18,0xaf,0x89,0xbd,0x70,0xa1,0x20,0x00,0x18,0xaf,0x8a,0xbd,0x74, ++0xa1,0x40,0x00,0x18,0xaf,0x8b,0xbd,0x78,0xa1,0x60,0x00,0x18,0xaf,0x8c,0xbd,0x7c, ++0xa1,0x80,0x00,0x18,0xaf,0x8d,0xbd,0x80,0xa1,0xa2,0x00,0x18,0x94,0x64,0x00,0x00, ++0x8f,0x82,0xbd,0x80,0x25,0xc5,0x02,0x70,0x3c,0x03,0xb0,0x03,0xa0,0x44,0x00,0x21, ++0x24,0x02,0x00,0x11,0xaf,0x85,0xbd,0x84,0x34,0x63,0x00,0x6e,0xa0,0xa2,0x00,0x18, ++0x94,0x64,0x00,0x00,0x8f,0x82,0xbd,0x84,0x25,0xc5,0x02,0x94,0x3c,0x03,0xb0,0x03, ++0xa0,0x44,0x00,0x21,0x24,0x02,0x00,0x12,0xaf,0x85,0xbd,0x88,0x34,0x63,0x00,0x6c, ++0xa0,0xa2,0x00,0x18,0x94,0x64,0x00,0x00,0x8f,0x82,0xbd,0x88,0x24,0x05,0xff,0xff, ++0x24,0x07,0x00,0x01,0xa0,0x44,0x00,0x21,0x24,0x06,0x00,0x12,0x27,0x84,0xbd,0x40, ++0x8c,0x82,0x00,0x00,0x24,0xc6,0xff,0xff,0xa0,0x40,0x00,0x04,0x8c,0x83,0x00,0x00, ++0xa4,0x45,0x00,0x00,0xa4,0x45,0x00,0x02,0xa0,0x60,0x00,0x0a,0x8c,0x82,0x00,0x00, ++0xa4,0x65,0x00,0x06,0xa4,0x65,0x00,0x08,0xa0,0x40,0x00,0x10,0x8c,0x83,0x00,0x00, ++0xa4,0x45,0x00,0x0c,0xa4,0x45,0x00,0x0e,0xa0,0x60,0x00,0x12,0x8c,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0xa0,0x40,0x00,0x16,0x8c,0x83,0x00,0x00,0xa4,0x45,0x00,0x14, ++0xa0,0x67,0x00,0x17,0x8c,0x82,0x00,0x00,0x24,0x84,0x00,0x04,0xa0,0x40,0x00,0x20, ++0x04,0xc1,0xff,0xe7,0xac,0x40,0x00,0x1c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x34,0x42,0x00,0x20,0x24,0x63,0x81,0x20, ++0xac,0x43,0x00,0x00,0x90,0x82,0x00,0x10,0x00,0x80,0x60,0x21,0x10,0x40,0x00,0x56, ++0x00,0x00,0x70,0x21,0x97,0x82,0x99,0x30,0x94,0x8a,0x00,0x0c,0x27,0x87,0x99,0x40, ++0x00,0x02,0x40,0xc0,0x01,0x02,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21, ++0x90,0x8b,0x00,0x18,0xa4,0x4a,0x00,0x00,0x94,0x83,0x00,0x0e,0x39,0x64,0x00,0x10, ++0x2c,0x84,0x00,0x01,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x34,0x85,0x00,0x02, ++0x39,0x63,0x00,0x11,0x00,0x83,0x28,0x0b,0x34,0xa3,0x00,0x08,0x39,0x64,0x00,0x12, ++0x00,0x02,0x10,0x80,0x00,0xa4,0x18,0x0b,0x00,0x47,0x10,0x21,0x94,0x49,0x00,0x04, ++0x34,0x64,0x00,0x20,0x00,0x6b,0x20,0x0b,0x34,0x83,0x00,0x40,0x39,0x62,0x00,0x01, ++0x00,0x82,0x18,0x0b,0x00,0x09,0x30,0xc0,0x34,0x64,0x00,0x80,0x00,0xc9,0x28,0x21, ++0x39,0x62,0x00,0x02,0x00,0x60,0x68,0x21,0x00,0x82,0x68,0x0a,0x00,0x05,0x28,0x80, ++0x3c,0x02,0xb0,0x08,0x00,0xa7,0x28,0x21,0x00,0xc2,0x30,0x21,0x01,0x02,0x40,0x21, ++0x34,0x03,0xff,0xff,0x35,0xa4,0x01,0x00,0x39,0x62,0x00,0x03,0x2d,0x67,0x00,0x13, ++0xad,0x0a,0x00,0x00,0xa4,0xa3,0x00,0x00,0xac,0xc3,0x00,0x00,0xa7,0x89,0x99,0x30, ++0x10,0xe0,0x00,0x0f,0x00,0x82,0x68,0x0a,0x3c,0x03,0x80,0x01,0x00,0x0b,0x10,0x80, ++0x24,0x63,0x08,0xf0,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x60, ++0x94,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x14,0x00,0x00,0x02,0x74,0x03, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0x3a,0x94,0x44,0x00,0x00,0x93,0x83,0x99,0x24, ++0x91,0x82,0x00,0x21,0x01,0xc4,0x20,0x21,0x91,0x85,0x00,0x10,0x00,0x04,0x24,0x00, ++0x00,0x62,0x18,0x21,0x00,0x04,0x74,0x03,0x00,0x6e,0x18,0x23,0x00,0x65,0x10,0x2a, ++0x00,0xa2,0x18,0x0a,0x00,0x0d,0x24,0x00,0x3c,0x02,0xb0,0x06,0x24,0x05,0xff,0xff, ++0x00,0x64,0x18,0x25,0x34,0x42,0x80,0x20,0xac,0x43,0x00,0x00,0xa5,0x85,0x00,0x0e, ++0xa1,0x80,0x00,0x10,0xa5,0x85,0x00,0x0c,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x08,0x00,0x20,0x8c,0x34,0x63,0x00,0x62,0x3c,0x03,0xb0,0x03, ++0x08,0x00,0x20,0x8c,0x34,0x63,0x00,0x64,0x3c,0x03,0xb0,0x03,0x08,0x00,0x20,0x8c, ++0x34,0x63,0x00,0x66,0x3c,0x03,0xb0,0x03,0x08,0x00,0x20,0x8c,0x34,0x63,0x00,0x38, ++0x3c,0x03,0xb0,0x03,0x08,0x00,0x20,0x8c,0x34,0x63,0x00,0x6e,0x3c,0x03,0xb0,0x03, ++0x08,0x00,0x20,0x8c,0x34,0x63,0x00,0x6c,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01, ++0x34,0x63,0x00,0x20,0x24,0x42,0x82,0xe8,0x00,0x05,0x28,0x40,0xac,0x62,0x00,0x00, ++0x00,0xa6,0x28,0x21,0x2c,0xe2,0x00,0x10,0x14,0x80,0x00,0x06,0x00,0x00,0x18,0x21, ++0x10,0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0xe0,0x18,0x21,0x03,0xe0,0x00,0x08, ++0x00,0x60,0x10,0x21,0x24,0x02,0x00,0x20,0x10,0xe2,0x00,0x06,0x2c,0xe4,0x00,0x10, ++0x24,0xa2,0x00,0x01,0x10,0x80,0xff,0xf9,0x00,0x02,0x11,0x00,0x08,0x00,0x20,0xc7, ++0x00,0x47,0x18,0x21,0x08,0x00,0x20,0xc7,0x24,0xa3,0x00,0x50,0x27,0xbd,0xff,0xc8, ++0xaf,0xb4,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xbf,0x00,0x30,0xaf,0xb7,0x00,0x2c,0xaf,0xb6,0x00,0x28,0xaf,0xb5,0x00,0x24, ++0xaf,0xb0,0x00,0x10,0x00,0x80,0x90,0x21,0x84,0x84,0x00,0x08,0x3c,0x05,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x34,0xa5,0x00,0x20,0x24,0x42,0x83,0x4c,0x3c,0x03,0xb0,0x06, ++0x00,0x04,0x20,0x80,0xac,0xa2,0x00,0x00,0x00,0x83,0x20,0x21,0x3c,0x06,0xb0,0x06, ++0x8c,0x82,0x00,0x00,0x34,0xc6,0x80,0x24,0x8c,0x88,0x00,0x00,0x8c,0xc4,0x00,0x00, ++0x96,0x45,0x00,0x08,0x30,0x53,0xff,0xff,0x00,0x08,0x44,0x02,0x34,0x84,0x01,0x00, ++0x3c,0x02,0xb0,0x00,0x00,0x08,0x18,0xc0,0x00,0x13,0x3a,0x00,0xac,0xc4,0x00,0x00, ++0x00,0xe2,0x38,0x21,0xae,0x53,0x02,0xb8,0x00,0x68,0x18,0x21,0x24,0xa5,0x00,0x02, ++0x8c,0xf6,0x00,0x00,0x30,0xa5,0x01,0xff,0x8c,0xf5,0x00,0x04,0x27,0x86,0x99,0x40, ++0x00,0x03,0x18,0x80,0x00,0x13,0xa0,0xc0,0xa6,0x45,0x00,0x08,0x00,0x66,0x18,0x21, ++0x02,0x93,0x10,0x21,0x00,0x02,0x48,0x80,0x94,0x65,0x00,0x00,0x01,0x26,0x30,0x21, ++0x24,0x02,0xff,0xff,0x00,0x15,0x1a,0x02,0x27,0x84,0x99,0x50,0xa4,0xc2,0x00,0x02, ++0x30,0x63,0x00,0x1f,0x24,0x02,0x00,0x10,0x01,0x24,0x20,0x21,0xa4,0xc8,0x00,0x04, ++0x8c,0xf0,0x00,0x08,0xa6,0x43,0x00,0x06,0xa6,0x45,0x00,0x0a,0xa0,0x82,0x00,0x06, ++0x86,0x43,0x00,0x06,0x27,0x82,0x99,0x44,0x01,0x22,0x88,0x21,0x24,0x02,0x00,0x13, ++0x10,0x62,0x00,0xee,0xae,0x27,0x00,0x18,0x3c,0x03,0xb0,0x03,0x34,0x63,0x01,0x00, ++0xa6,0x40,0x00,0x02,0x3c,0x02,0xb0,0x03,0x90,0x64,0x00,0x00,0x34,0x42,0x01,0x08, ++0x8c,0x45,0x00,0x00,0x00,0x10,0x1b,0xc2,0x00,0x04,0x20,0x82,0x30,0x63,0x00,0x01, ++0xac,0xc5,0x00,0x08,0x10,0x60,0x00,0xc7,0x30,0x97,0x00,0x01,0x00,0x10,0x16,0x82, ++0x30,0x46,0x00,0x01,0x00,0x10,0x12,0x02,0x00,0x10,0x19,0xc2,0x00,0x10,0x26,0x02, ++0x00,0x10,0x2e,0x42,0x30,0x48,0x00,0x7f,0x24,0x02,0x00,0x01,0x30,0x71,0x00,0x01, ++0x30,0x84,0x00,0x01,0x10,0xc2,0x00,0xb3,0x30,0xa3,0x00,0x01,0x00,0x60,0x28,0x21, ++0x0c,0x00,0x20,0xba,0x01,0x00,0x38,0x21,0x02,0x93,0x18,0x21,0x00,0x03,0x18,0x80, ++0x2c,0x46,0x00,0x54,0x27,0x85,0x99,0x50,0x27,0x84,0x99,0x48,0x00,0x06,0x10,0x0a, ++0x00,0x65,0x28,0x21,0x26,0x26,0x00,0x02,0x00,0x64,0x18,0x21,0xa0,0xa2,0x00,0x02, ++0xa0,0x66,0x00,0x06,0xa0,0x62,0x00,0x07,0xa0,0xa2,0x00,0x01,0x02,0x93,0x28,0x21, ++0x00,0x05,0x28,0x80,0x27,0x82,0x99,0x44,0x00,0xa2,0x58,0x21,0x8d,0x64,0x00,0x18, ++0x00,0x10,0x15,0xc2,0x30,0x42,0x00,0x01,0x8c,0x83,0x00,0x0c,0x27,0x84,0x99,0x60, ++0x00,0xa4,0x48,0x21,0xa6,0x42,0x00,0x00,0xa6,0x56,0x00,0x04,0x8d,0x26,0x00,0x00, ++0x00,0x03,0x19,0x42,0x3c,0x02,0xff,0xef,0x34,0x42,0xff,0xff,0x30,0x63,0x00,0x01, ++0x00,0xc2,0x40,0x24,0x00,0x03,0x1d,0x00,0x01,0x03,0x40,0x25,0x00,0x08,0x15,0x02, ++0x00,0x10,0x34,0x42,0x00,0x10,0x3c,0x82,0x00,0x15,0x19,0x82,0x00,0x15,0x25,0x82, ++0x00,0x10,0x2c,0x02,0x30,0x42,0x00,0x01,0x30,0xcd,0x00,0x01,0x30,0x6c,0x00,0x01, ++0x30,0xe6,0x00,0x01,0x30,0x8a,0x00,0x03,0x32,0xb1,0x00,0x07,0x30,0xa5,0x00,0x01, ++0xad,0x28,0x00,0x00,0x10,0x40,0x00,0x0b,0x32,0x07,0x00,0x7f,0x8d,0x64,0x00,0x18, ++0x3c,0x03,0xff,0xf0,0x34,0x63,0xff,0xff,0x8c,0x82,0x00,0x0c,0x01,0x03,0x18,0x24, ++0x00,0x02,0x13,0x82,0x30,0x42,0x00,0x0f,0x00,0x02,0x14,0x00,0x00,0x62,0x18,0x25, ++0xad,0x23,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xc2,0x00,0x6a,0x00,0x00,0x00,0x00, ++0x15,0x80,0x00,0x03,0x00,0x00,0x00,0x00,0x15,0x40,0x00,0x5b,0x24,0x02,0x00,0x01, ++0x96,0x42,0x00,0x04,0x00,0x00,0x00,0x00,0x24,0x42,0x00,0x04,0xa6,0x42,0x00,0x04, ++0x00,0xa0,0x20,0x21,0x0c,0x00,0x20,0xba,0x01,0xa0,0x28,0x21,0x02,0x93,0x18,0x21, ++0x00,0x03,0x40,0x80,0x2c,0x45,0x00,0x54,0x27,0x84,0x99,0x50,0x01,0x04,0x20,0x21, ++0x00,0x05,0x10,0x0a,0xa0,0x82,0x00,0x00,0xa0,0x80,0x00,0x04,0xa0,0x80,0x00,0x05, ++0x96,0x43,0x00,0x04,0x27,0x82,0x99,0x40,0x01,0x02,0x10,0x21,0xa4,0x43,0x00,0x06, ++0x27,0x82,0x99,0x44,0x92,0x46,0x00,0x01,0x01,0x02,0x10,0x21,0x8c,0x45,0x00,0x18, ++0x27,0x83,0x99,0x60,0x01,0x03,0x18,0x21,0xa0,0x60,0x00,0x00,0xa0,0x86,0x00,0x07, ++0x94,0xa2,0x00,0x10,0x24,0x03,0x00,0x04,0x30,0x42,0x00,0x0f,0x10,0x43,0x00,0x36, ++0x24,0xa5,0x00,0x10,0x94,0xa3,0x00,0x16,0x27,0x87,0x99,0x58,0x01,0x07,0x10,0x21, ++0xa4,0x43,0x00,0x02,0x94,0xa2,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01, ++0x14,0x40,0x00,0x24,0x02,0x93,0x20,0x21,0x94,0xa2,0x00,0x00,0x24,0x03,0x00,0xa4, ++0x30,0x42,0x00,0xff,0x10,0x43,0x00,0x1f,0x00,0x00,0x00,0x00,0x94,0xa2,0x00,0x00, ++0x24,0x03,0x00,0x88,0x30,0x42,0x00,0x88,0x10,0x43,0x00,0x14,0x02,0x93,0x18,0x21, ++0x27,0x84,0x99,0x60,0x00,0x03,0x18,0x80,0x00,0x64,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x3c,0x04,0x00,0x80,0x00,0x44,0x10,0x25,0xac,0x62,0x00,0x00,0x02,0x93,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21,0xa0,0x51,0x00,0x00,0x8f,0xbf,0x00,0x30, ++0x7b,0xb6,0x01,0x7c,0x7b,0xb4,0x01,0x3c,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0x94,0xa2,0x00,0x18, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x60,0x10,0x40,0xff,0xe9,0x02,0x93,0x18,0x21, ++0x02,0x93,0x20,0x21,0x27,0x82,0x99,0x60,0x00,0x04,0x20,0x80,0x00,0x82,0x20,0x21, ++0x8c,0x83,0x00,0x00,0x3c,0x02,0xff,0x7f,0x34,0x42,0xff,0xff,0x00,0x62,0x18,0x24, ++0x08,0x00,0x21,0xaf,0xac,0x83,0x00,0x00,0x27,0x87,0x99,0x58,0x01,0x07,0x10,0x21, ++0x08,0x00,0x21,0x99,0xa4,0x40,0x00,0x02,0x11,0x42,0x00,0x07,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x02,0x14,0x40,0xff,0xa7,0x00,0xa0,0x20,0x21,0x96,0x42,0x00,0x04, ++0x08,0x00,0x21,0x77,0x24,0x42,0x00,0x0c,0x96,0x42,0x00,0x04,0x08,0x00,0x21,0x77, ++0x24,0x42,0x00,0x08,0x16,0xe6,0xff,0x96,0x3c,0x02,0xff,0xfb,0x8d,0x63,0x00,0x18, ++0x34,0x42,0xff,0xff,0x02,0x02,0x10,0x24,0xac,0x62,0x00,0x08,0x08,0x00,0x21,0x70, ++0x00,0x00,0x30,0x21,0x16,0xe6,0xff,0x4e,0x00,0x60,0x28,0x21,0x3c,0x02,0xfb,0xff, ++0x34,0x42,0xff,0xff,0x02,0x02,0x10,0x24,0xac,0xe2,0x00,0x08,0x08,0x00,0x21,0x2f, ++0x00,0x00,0x30,0x21,0x93,0x87,0xc4,0x54,0x00,0x10,0x1e,0x42,0x00,0x10,0x26,0x82, ++0x27,0x82,0x99,0x48,0x2c,0xe5,0x00,0x0c,0x01,0x22,0x48,0x21,0x30,0x63,0x00,0x01, ++0x30,0x86,0x00,0x01,0x14,0xa0,0x00,0x06,0x00,0xe0,0x40,0x21,0x00,0x03,0x10,0x40, ++0x00,0x46,0x10,0x21,0x00,0x02,0x11,0x00,0x00,0xe2,0x10,0x21,0x24,0x48,0x00,0x04, ++0x02,0x93,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x84,0x99,0x50,0x27,0x83,0x99,0x48, ++0x00,0x44,0x20,0x21,0x00,0x43,0x10,0x21,0xa1,0x28,0x00,0x07,0xa0,0x40,0x00,0x06, ++0xa0,0x80,0x00,0x02,0x08,0x00,0x21,0x3f,0xa0,0x80,0x00,0x01,0x24,0x02,0x00,0x01, ++0x00,0xe0,0x20,0x21,0x0c,0x00,0x01,0xc2,0xa6,0x42,0x00,0x02,0x8e,0x24,0x00,0x18, ++0x0c,0x00,0x05,0x39,0x00,0x00,0x00,0x00,0x08,0x00,0x21,0xb3,0x00,0x00,0x00,0x00, ++0x30,0xa7,0xff,0xff,0x00,0x07,0x18,0xc0,0x00,0x67,0x18,0x21,0x3c,0x06,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x24,0x42,0x88,0x30,0x27,0x85,0x99,0x50,0x00,0x03,0x18,0x80, ++0x34,0xc6,0x00,0x20,0x00,0x65,0x18,0x21,0xac,0xc2,0x00,0x00,0x80,0x62,0x00,0x07, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x29,0x00,0x80,0x28,0x21,0x90,0x82,0x00,0x16, ++0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02,0x30,0x43,0x00,0x01,0x14,0x60,0x00,0x02, ++0xa0,0x82,0x00,0x16,0xa0,0x80,0x00,0x17,0x90,0xa2,0x00,0x04,0x3c,0x03,0xb0,0x03, ++0x27,0x86,0x99,0x40,0x14,0x40,0x00,0x06,0x34,0x63,0x00,0x20,0x24,0x02,0x00,0x01, ++0xa0,0xa2,0x00,0x04,0xa4,0xa7,0x00,0x02,0x03,0xe0,0x00,0x08,0xa4,0xa7,0x00,0x00, ++0x94,0xa4,0x00,0x02,0x3c,0x02,0x80,0x01,0x24,0x42,0xa0,0x30,0xac,0x62,0x00,0x00, ++0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21, ++0x94,0x62,0x00,0x04,0xa4,0x67,0x00,0x02,0x3c,0x03,0xb0,0x08,0x00,0x02,0x20,0xc0, ++0x00,0x82,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x46,0x10,0x21,0x00,0x83,0x20,0x21, ++0xa4,0x47,0x00,0x00,0xac,0x87,0x00,0x00,0x90,0xa2,0x00,0x04,0xa4,0xa7,0x00,0x02, ++0x24,0x42,0x00,0x01,0x03,0xe0,0x00,0x08,0xa0,0xa2,0x00,0x04,0x90,0x82,0x00,0x16, ++0x24,0x85,0x00,0x06,0x34,0x42,0x00,0x01,0x30,0x43,0x00,0x02,0x14,0x60,0xff,0xda, ++0xa0,0x82,0x00,0x16,0x24,0x02,0x00,0x01,0x08,0x00,0x22,0x22,0xa0,0x82,0x00,0x17, ++0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x00,0x80,0x38,0x21,0x84,0x84,0x00,0x02, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x3c,0x0a,0xb0,0x06,0x34,0x63,0x00,0x20, ++0x24,0x42,0x89,0x30,0x3c,0x0b,0xb0,0x08,0x27,0x89,0x99,0x40,0x34,0x0c,0xff,0xff, ++0x35,0x4a,0x80,0x20,0x10,0x80,0x00,0x30,0xac,0x62,0x00,0x00,0x97,0x82,0x99,0x30, ++0x94,0xe6,0x02,0xba,0x00,0x02,0x18,0xc0,0x00,0x6b,0x28,0x21,0xac,0xa6,0x00,0x00, ++0x8c,0xe4,0x02,0xb8,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x04,0x10,0xc0, ++0x00,0x44,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x49,0x10,0x21,0x94,0x48,0x00,0x04, ++0x00,0x69,0x18,0x21,0xa4,0x66,0x00,0x00,0x00,0x08,0x28,0xc0,0x00,0xab,0x10,0x21, ++0xac,0x4c,0x00,0x00,0x8c,0xe4,0x02,0xb8,0x27,0x82,0x99,0x44,0x00,0xa8,0x28,0x21, ++0x00,0x04,0x18,0xc0,0x00,0x64,0x18,0x21,0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21, ++0x8c,0x46,0x00,0x18,0x27,0x84,0x99,0x50,0x00,0x64,0x18,0x21,0x8c,0xc2,0x00,0x00, ++0x80,0x67,0x00,0x06,0x00,0x05,0x28,0x80,0x30,0x42,0xff,0xff,0x00,0x47,0x10,0x21, ++0x30,0x43,0x00,0xff,0x00,0x03,0x18,0x2b,0x00,0x02,0x12,0x02,0x00,0x43,0x10,0x21, ++0x3c,0x04,0x00,0x04,0x00,0xa9,0x28,0x21,0x00,0x44,0x10,0x25,0xa4,0xac,0x00,0x00, ++0xad,0x42,0x00,0x00,0xa7,0x88,0x99,0x30,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x84,0xe3,0x00,0x06,0x27,0x82,0xbd,0x40, ++0x94,0xe5,0x02,0xba,0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x8c,0x64,0x00,0x00, ++0x0c,0x00,0x22,0x0c,0x00,0x00,0x00,0x00,0x08,0x00,0x22,0x86,0x00,0x00,0x00,0x00, ++0x94,0x88,0x00,0x00,0x00,0x80,0x58,0x21,0x27,0x8a,0x99,0x40,0x00,0x08,0x18,0xc0, ++0x00,0x68,0x18,0x21,0x3c,0x04,0xb0,0x03,0x00,0x03,0x18,0x80,0x3c,0x02,0x80,0x01, ++0x00,0x6a,0x18,0x21,0x34,0x84,0x00,0x20,0x24,0x42,0x8a,0x50,0x30,0xa5,0xff,0xff, ++0xac,0x82,0x00,0x00,0x94,0x67,0x00,0x02,0x11,0x05,0x00,0x35,0x24,0x04,0x00,0x01, ++0x91,0x66,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x86,0x10,0x2a,0x10,0x40,0x00,0x10, ++0x00,0xc0,0x48,0x21,0x3c,0x0d,0xb0,0x03,0x01,0x40,0x60,0x21,0x35,0xad,0x00,0x20, ++0x10,0xe5,0x00,0x0d,0x24,0x84,0x00,0x01,0x00,0x07,0x10,0xc0,0x00,0x47,0x10,0x21, ++0x00,0x02,0x10,0x80,0x01,0x20,0x30,0x21,0x00,0x4a,0x10,0x21,0x00,0x86,0x18,0x2a, ++0x00,0xe0,0x40,0x21,0x94,0x47,0x00,0x02,0x14,0x60,0xff,0xf5,0x00,0x00,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x10,0x21,0x00,0x08,0x20,0xc0,0x00,0x88,0x20,0x21, ++0x24,0xc2,0xff,0xff,0x00,0x04,0x20,0x80,0xa1,0x62,0x00,0x04,0x00,0x8c,0x20,0x21, ++0x94,0x83,0x00,0x04,0x00,0x07,0x10,0xc0,0x00,0x47,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x4c,0x10,0x21,0x00,0x03,0x28,0xc0,0x94,0x46,0x00,0x02,0x00,0xa3,0x18,0x21, ++0x00,0x03,0x18,0x80,0x00,0x6c,0x18,0x21,0xa4,0x66,0x00,0x00,0xa4,0x86,0x00,0x02, ++0x95,0x64,0x00,0x02,0x3c,0x03,0xb0,0x08,0x3c,0x02,0x80,0x01,0x00,0xa3,0x28,0x21, ++0x24,0x42,0xa0,0x30,0xad,0xa2,0x00,0x00,0x10,0x87,0x00,0x03,0xac,0xa6,0x00,0x00, ++0x03,0xe0,0x00,0x08,0x24,0x02,0x00,0x01,0x08,0x00,0x22,0xd4,0xa5,0x68,0x00,0x02, ++0x91,0x62,0x00,0x04,0xa5,0x67,0x00,0x00,0x24,0x42,0xff,0xff,0x30,0x43,0x00,0xff, ++0x14,0x60,0xff,0xf7,0xa1,0x62,0x00,0x04,0x24,0x02,0xff,0xff,0x08,0x00,0x22,0xd4, ++0xa5,0x62,0x00,0x02,0x00,0x05,0x40,0xc0,0x01,0x05,0x30,0x21,0x27,0xbd,0xff,0xd8, ++0x00,0x06,0x30,0x80,0x27,0x82,0x99,0x44,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14, ++0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c,0xaf,0xb0,0x00,0x10,0x00,0xc2,0x10,0x21, ++0x8c,0x47,0x00,0x18,0x00,0xa0,0x90,0x21,0x3c,0x02,0x80,0x01,0x3c,0x05,0xb0,0x03, ++0x34,0xa5,0x00,0x20,0x24,0x42,0x8b,0x84,0xac,0xa2,0x00,0x00,0x27,0x83,0x99,0x50, ++0x00,0xc3,0x30,0x21,0x8c,0xe2,0x00,0x00,0x80,0xc5,0x00,0x06,0x00,0x80,0x88,0x21, ++0x30,0x42,0xff,0xff,0x00,0x45,0x10,0x21,0x30,0x43,0x00,0xff,0x10,0x60,0x00,0x02, ++0x00,0x02,0x12,0x02,0x24,0x42,0x00,0x01,0x30,0x53,0x00,0xff,0x01,0x12,0x10,0x21, ++0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x50,0x00,0x43,0x10,0x21,0x80,0x44,0x00,0x07, ++0x00,0x00,0x00,0x00,0x10,0x80,0x00,0x4b,0x26,0x24,0x00,0x06,0x32,0x50,0xff,0xff, ++0x02,0x20,0x20,0x21,0x0c,0x00,0x22,0x94,0x02,0x00,0x28,0x21,0x92,0x22,0x00,0x10, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x2e,0x3c,0x03,0xb0,0x08,0x3c,0x09,0x80,0x01, ++0x27,0x88,0x99,0x40,0xa6,0x32,0x00,0x0c,0x00,0x10,0x20,0xc0,0x00,0x90,0x20,0x21, ++0x00,0x04,0x20,0x80,0x00,0x88,0x20,0x21,0x94,0x82,0x00,0x04,0x3c,0x03,0xb0,0x08, ++0x3c,0x07,0xb0,0x03,0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x48,0x10,0x21,0x00,0xa3,0x28,0x21,0x25,0x26,0xa0,0x30,0x34,0x03,0xff,0xff, ++0x34,0xe7,0x00,0x20,0xac,0xe6,0x00,0x00,0xa4,0x83,0x00,0x02,0xa4,0x43,0x00,0x00, ++0xac,0xa3,0x00,0x00,0x92,0x22,0x00,0x10,0x92,0x23,0x00,0x0a,0xa6,0x32,0x00,0x0e, ++0x02,0x62,0x10,0x21,0x14,0x60,0x00,0x05,0xa2,0x22,0x00,0x10,0x92,0x22,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfe,0xa2,0x22,0x00,0x16,0x92,0x22,0x00,0x04, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x05,0x00,0x00,0x00,0x00,0x92,0x22,0x00,0x16, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfd,0xa2,0x22,0x00,0x16,0x8f,0xbf,0x00,0x20, ++0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28, ++0x96,0x22,0x00,0x0e,0x27,0x88,0x99,0x40,0x00,0x02,0x20,0xc0,0x00,0x82,0x20,0x21, ++0x00,0x04,0x20,0x80,0x00,0x88,0x20,0x21,0x94,0x82,0x00,0x04,0x3c,0x06,0xb0,0x03, ++0x3c,0x09,0x80,0x01,0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0xa3,0x28,0x21,0x00,0x48,0x10,0x21,0x34,0xc6,0x00,0x20,0x25,0x23,0xa0,0x30, ++0xac,0xc3,0x00,0x00,0xa4,0x50,0x00,0x00,0xac,0xb0,0x00,0x00,0x08,0x00,0x23,0x12, ++0xa4,0x90,0x00,0x02,0x08,0x00,0x23,0x09,0x32,0x50,0xff,0xff,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x24,0x42,0x8d,0x4c,0x34,0x63,0x00,0x20,0xac,0x62,0x00,0x00, ++0x90,0x82,0x00,0x04,0x97,0xaa,0x00,0x12,0x00,0x80,0x60,0x21,0x30,0xa8,0xff,0xff, ++0x00,0x4a,0x20,0x23,0x34,0x09,0xff,0xff,0x30,0xcf,0xff,0xff,0x30,0xee,0xff,0xff, ++0x11,0x09,0x00,0x73,0xa1,0x84,0x00,0x04,0x00,0x0e,0xc0,0xc0,0x00,0x08,0x10,0xc0, ++0x00,0x48,0x10,0x21,0x03,0x0e,0x20,0x21,0x27,0x8d,0x99,0x40,0x00,0x04,0x20,0x80, ++0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21,0x00,0x8d,0x20,0x21,0x94,0x86,0x00,0x02, ++0x94,0x43,0x00,0x04,0x3c,0x19,0x80,0x01,0xa4,0x46,0x00,0x02,0x00,0x03,0x28,0xc0, ++0x00,0xa3,0x18,0x21,0x94,0x87,0x00,0x02,0x3c,0x02,0xb0,0x08,0x00,0x03,0x18,0x80, ++0x00,0xa2,0x28,0x21,0x00,0x6d,0x18,0x21,0x27,0x22,0xa0,0x30,0x3c,0x01,0xb0,0x03, ++0xac,0x22,0x00,0x20,0xa4,0x66,0x00,0x00,0x10,0xe9,0x00,0x57,0xac,0xa6,0x00,0x00, ++0x01,0xe0,0x30,0x21,0x11,0x40,0x00,0x1d,0x00,0x00,0x48,0x21,0x01,0x40,0x38,0x21, ++0x27,0x8b,0x99,0x44,0x27,0x8a,0x99,0x50,0x00,0x06,0x40,0xc0,0x01,0x06,0x18,0x21, ++0x00,0x03,0x18,0x80,0x00,0x6b,0x10,0x21,0x8c,0x44,0x00,0x18,0x00,0x6a,0x18,0x21, ++0x80,0x65,0x00,0x06,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0xff,0xff, ++0x00,0x45,0x10,0x21,0x30,0x44,0x00,0xff,0x00,0x02,0x12,0x02,0x01,0x22,0x18,0x21, ++0x24,0x62,0x00,0x01,0x14,0x80,0x00,0x02,0x30,0x49,0x00,0xff,0x30,0x69,0x00,0xff, ++0x01,0x06,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21,0x24,0xe7,0xff,0xff, ++0x94,0x46,0x00,0x02,0x14,0xe0,0xff,0xe9,0x00,0x06,0x40,0xc0,0x91,0x82,0x00,0x10, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x20,0x3c,0x06,0xb0,0x03,0xa5,0x8f,0x00,0x0c, ++0x03,0x0e,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x8d,0x20,0x21,0x94,0x82,0x00,0x04, ++0x3c,0x03,0xb0,0x08,0x3c,0x07,0xb0,0x03,0x00,0x02,0x28,0xc0,0x00,0xa2,0x10,0x21, ++0x00,0x02,0x10,0x80,0x00,0x4d,0x10,0x21,0x00,0xa3,0x28,0x21,0x27,0x26,0xa0,0x30, ++0x34,0x03,0xff,0xff,0x34,0xe7,0x00,0x20,0xac,0xe6,0x00,0x00,0xa4,0x83,0x00,0x02, ++0xa4,0x43,0x00,0x00,0xac,0xa3,0x00,0x00,0x91,0x82,0x00,0x10,0x91,0x83,0x00,0x04, ++0xa5,0x8e,0x00,0x0e,0x01,0x22,0x10,0x21,0x14,0x60,0x00,0x05,0xa1,0x82,0x00,0x10, ++0x91,0x82,0x00,0x16,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0xfd,0xa1,0x82,0x00,0x16, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x95,0x82,0x00,0x0e,0x3c,0x03,0xb0,0x08, ++0x00,0x02,0x20,0xc0,0x00,0x82,0x20,0x21,0x00,0x04,0x20,0x80,0x00,0x8d,0x20,0x21, ++0x94,0x82,0x00,0x04,0x34,0xc6,0x00,0x20,0x27,0x27,0xa0,0x30,0x00,0x02,0x28,0xc0, ++0x00,0xa2,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0xa3,0x28,0x21,0x00,0x4d,0x10,0x21, ++0xac,0xc7,0x00,0x00,0xa4,0x8f,0x00,0x02,0xa4,0x4f,0x00,0x00,0xac,0xaf,0x00,0x00, ++0x08,0x00,0x23,0xa1,0x03,0x0e,0x20,0x21,0x08,0x00,0x23,0x7c,0xa5,0x88,0x00,0x02, ++0x00,0x0e,0xc0,0xc0,0x03,0x0e,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x8d,0x99,0x40, ++0x00,0x4d,0x10,0x21,0x94,0x43,0x00,0x02,0x30,0x84,0x00,0xff,0x14,0x80,0x00,0x05, ++0xa5,0x83,0x00,0x00,0x24,0x02,0xff,0xff,0x3c,0x19,0x80,0x01,0x08,0x00,0x23,0x7c, ++0xa5,0x82,0x00,0x02,0x08,0x00,0x23,0x7c,0x3c,0x19,0x80,0x01,0x3c,0x08,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x27,0xbd,0xff,0x78,0x35,0x08,0x00,0x20,0x24,0x42,0x8f,0x8c, ++0xaf,0xb2,0x00,0x68,0xaf,0xb1,0x00,0x64,0xaf,0xb0,0x00,0x60,0xad,0x02,0x00,0x00, ++0xaf,0xbf,0x00,0x84,0xaf,0xbe,0x00,0x80,0xaf,0xb7,0x00,0x7c,0xaf,0xb6,0x00,0x78, ++0xaf,0xb5,0x00,0x74,0xaf,0xb4,0x00,0x70,0xaf,0xb3,0x00,0x6c,0xaf,0xa4,0x00,0x88, ++0x90,0x83,0x00,0x0a,0x27,0x82,0xbd,0x40,0xaf,0xa6,0x00,0x90,0x00,0x03,0x18,0x80, ++0x00,0x62,0x18,0x21,0x8c,0x63,0x00,0x00,0xaf,0xa7,0x00,0x94,0x27,0x86,0x99,0x44, ++0xaf,0xa3,0x00,0x1c,0x94,0x63,0x00,0x14,0x30,0xb1,0xff,0xff,0x24,0x08,0x00,0x01, ++0x00,0x03,0x20,0xc0,0xaf,0xa3,0x00,0x18,0x00,0x83,0x18,0x21,0xaf,0xa4,0x00,0x54, ++0x00,0x03,0x18,0x80,0x27,0x84,0x99,0x50,0x00,0x64,0x20,0x21,0x80,0x82,0x00,0x06, ++0x00,0x66,0x18,0x21,0x8c,0x66,0x00,0x18,0x24,0x42,0x00,0x02,0x00,0x02,0x1f,0xc2, ++0x8c,0xc4,0x00,0x08,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43,0x00,0x02,0x10,0x40, ++0x00,0x04,0x2f,0xc2,0x00,0x04,0x1c,0x82,0x00,0xc2,0x38,0x21,0x00,0x04,0x24,0x42, ++0x8f,0xa2,0x00,0x1c,0x30,0x63,0x00,0x01,0x30,0x84,0x00,0x01,0xaf,0xa5,0x00,0x3c, ++0xaf,0xa3,0x00,0x34,0xaf,0xa4,0x00,0x38,0xaf,0xa0,0x00,0x40,0xaf,0xa0,0x00,0x44, ++0xaf,0xa0,0x00,0x50,0xaf,0xa8,0x00,0x20,0x80,0x42,0x00,0x12,0x8f,0xb2,0x00,0x18, ++0xaf,0xa2,0x00,0x28,0x8c,0xd0,0x00,0x0c,0x14,0xa0,0x01,0xda,0x00,0x60,0x30,0x21, ++0x00,0x10,0x10,0x82,0x30,0x45,0x00,0x07,0x10,0xa0,0x00,0x11,0xaf,0xa0,0x00,0x30, ++0x8f,0xa4,0x00,0x98,0x27,0x82,0x86,0x30,0x00,0x04,0x18,0x40,0x00,0x62,0x18,0x21, ++0x24,0xa2,0x00,0x05,0x8f,0xa5,0x00,0x20,0x94,0x64,0x00,0x00,0x00,0x45,0x10,0x04, ++0x00,0x44,0x00,0x1a,0x14,0x80,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d, ++0x00,0x00,0x10,0x12,0x24,0x42,0x00,0x10,0x30,0x42,0xff,0xfc,0xaf,0xa2,0x00,0x30, ++0x8f,0xa3,0x00,0x18,0x8f,0xa4,0x00,0x28,0x34,0x02,0xff,0xff,0xaf,0xa0,0x00,0x2c, ++0xaf,0xa2,0x00,0x48,0xaf,0xa3,0x00,0x4c,0x00,0x60,0xf0,0x21,0x00,0x00,0xb8,0x21, ++0x18,0x80,0x00,0x4e,0xaf,0xa0,0x00,0x24,0x00,0x11,0x89,0x02,0xaf,0xb1,0x00,0x58, ++0x00,0x80,0xa8,0x21,0x00,0x12,0x10,0xc0,0x00,0x52,0x20,0x21,0x00,0x04,0x20,0x80, ++0x00,0x40,0xa0,0x21,0x27,0x82,0x99,0x58,0x00,0x82,0x10,0x21,0x94,0x43,0x00,0x02, ++0x8f,0xa6,0x00,0x58,0x27,0x85,0x99,0x40,0x00,0x03,0x19,0x02,0x00,0x66,0x18,0x23, ++0x30,0x63,0x0f,0xff,0x00,0x85,0x20,0x21,0x28,0x62,0x00,0x20,0x94,0x96,0x00,0x02, ++0x10,0x40,0x01,0xa1,0x28,0x62,0x00,0x40,0x8f,0xa8,0x00,0x90,0x00,0x00,0x00,0x00, ++0x00,0x68,0x10,0x06,0x30,0x43,0x00,0x01,0x24,0x02,0x00,0x01,0x10,0x62,0x01,0x7b, ++0x3c,0x02,0xb0,0x03,0x8f,0xa6,0x00,0x88,0x34,0x42,0x01,0x04,0x84,0xc5,0x00,0x0c, ++0x02,0x92,0x18,0x21,0x94,0x46,0x00,0x00,0x00,0x05,0x20,0xc0,0x00,0x85,0x20,0x21, ++0x00,0x03,0x18,0x80,0x27,0x82,0x99,0x50,0x27,0x85,0x99,0x48,0x00,0x65,0x28,0x21, ++0x00,0x62,0x18,0x21,0x80,0x71,0x00,0x05,0x80,0x73,0x00,0x04,0x8f,0xa3,0x00,0x88, ++0x30,0xd0,0xff,0xff,0x00,0x10,0x3a,0x03,0x32,0x08,0x00,0xff,0x27,0x82,0x99,0x60, ++0x00,0x04,0x20,0x80,0x80,0xa6,0x00,0x06,0x00,0x82,0x20,0x21,0xa4,0x67,0x00,0x44, ++0xa4,0x68,0x00,0x46,0x8c,0x84,0x00,0x00,0x38,0xc6,0x00,0x00,0x01,0x00,0x80,0x21, ++0x00,0x04,0x15,0x02,0x30,0x42,0x00,0x01,0x10,0x40,0x00,0x03,0x00,0xe6,0x80,0x0a, ++0x00,0x04,0x14,0x02,0x30,0x50,0x00,0x0f,0x12,0x20,0x01,0x50,0x02,0x40,0x20,0x21, ++0x02,0x71,0x10,0x21,0x00,0x50,0x10,0x2a,0x14,0x40,0x00,0xed,0x02,0x92,0x10,0x21, ++0x93,0x82,0x94,0x51,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0xe0, ++0x02,0x92,0x28,0x21,0x26,0xe2,0x00,0x01,0x30,0x57,0xff,0xff,0x02,0x40,0xf0,0x21, ++0x26,0xb5,0xff,0xff,0x16,0xa0,0xff,0xb7,0x02,0xc0,0x90,0x21,0x16,0xe0,0x00,0xd0, ++0x00,0x00,0x00,0x00,0x8f,0xa3,0x00,0x98,0x00,0x00,0x00,0x00,0x2c,0x62,0x00,0x10, ++0x10,0x40,0x00,0x2e,0x00,0x00,0x00,0x00,0x8f,0xa4,0x00,0x24,0x00,0x00,0x00,0x00, ++0x18,0x80,0x00,0x2a,0x24,0x03,0x00,0x01,0x8f,0xa5,0x00,0x1c,0x27,0x84,0x99,0x44, ++0x94,0xb2,0x00,0x14,0xa0,0xa3,0x00,0x12,0x8f,0xa6,0x00,0x3c,0x00,0x12,0x10,0xc0, ++0x00,0x52,0x10,0x21,0x00,0x02,0x80,0x80,0x27,0x82,0x99,0x50,0x02,0x02,0x10,0x21, ++0x80,0x43,0x00,0x06,0x02,0x04,0x20,0x21,0x8c,0x85,0x00,0x18,0x24,0x63,0x00,0x02, ++0x00,0x03,0x17,0xc2,0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x43,0x00,0x03,0x18,0x40, ++0x14,0xc0,0x00,0x0e,0x00,0xa3,0x38,0x21,0x27,0x82,0x99,0x40,0x02,0x02,0x10,0x21, ++0x94,0x43,0x00,0x06,0x8f,0xa8,0x00,0x1c,0x24,0x02,0x00,0x01,0xa5,0x03,0x00,0x1a, ++0x7b,0xbe,0x04,0x3c,0x7b,0xb6,0x03,0xfc,0x7b,0xb4,0x03,0xbc,0x7b,0xb2,0x03,0x7c, ++0x7b,0xb0,0x03,0x3c,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x88,0x8f,0xa4,0x00,0x98, ++0x8f,0xa5,0x00,0x38,0x8f,0xa6,0x00,0x34,0xaf,0xa0,0x00,0x10,0x0c,0x00,0x10,0x97, ++0xaf,0xa0,0x00,0x14,0x08,0x00,0x24,0xae,0x00,0x00,0x00,0x00,0x8f,0xa3,0x00,0x44, ++0x93,0x82,0x87,0x6d,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x61,0x30,0x69,0x00,0x03, ++0x8f,0xa4,0x00,0x24,0x8f,0xa5,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x85,0x10,0x2a, ++0x10,0x40,0x00,0x8f,0x00,0x00,0x00,0x00,0x8f,0xa6,0x00,0x1c,0x00,0x00,0x00,0x00, ++0x90,0xc4,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x83,0x00,0xff,0x00,0xa3,0x10,0x2a, ++0x10,0x40,0x00,0x87,0x00,0x00,0x00,0x00,0x8f,0xa8,0x00,0x24,0x00,0x00,0x00,0x00, ++0x11,0x00,0x00,0x83,0x00,0x65,0x10,0x23,0x00,0xa8,0x18,0x23,0x00,0x62,0x10,0x2a, ++0x14,0x40,0x00,0x7d,0x30,0x63,0x00,0xff,0x00,0x85,0x10,0x23,0x30,0x42,0x00,0xff, ++0xaf,0xa2,0x00,0x50,0x8f,0xa2,0x00,0x50,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x73, ++0x00,0x00,0xa8,0x21,0x27,0x8c,0x99,0x40,0x3c,0x0b,0x80,0xff,0x24,0x10,0x00,0x04, ++0x27,0x91,0x99,0x44,0x35,0x6b,0xff,0xff,0x3c,0x0d,0x7f,0x00,0x27,0x8e,0x99,0x50, ++0x01,0x80,0x78,0x21,0x00,0x12,0x30,0xc0,0x00,0xd2,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x4c,0x10,0x21,0x94,0x42,0x00,0x06,0x8f,0xa3,0x00,0x2c,0x8f,0xa4,0x00,0x30, ++0xaf,0xa2,0x00,0x44,0x8f,0xa5,0x00,0x44,0x30,0x49,0x00,0x03,0x02,0x09,0x10,0x23, ++0x30,0x42,0x00,0x03,0x00,0xa2,0x10,0x21,0x8f,0xa8,0x00,0x30,0x24,0x42,0x00,0x04, ++0x30,0x42,0xff,0xff,0x00,0x64,0x38,0x21,0x01,0x02,0x28,0x23,0x00,0x62,0x18,0x21, ++0x00,0x48,0x10,0x2b,0x10,0x40,0x00,0x52,0x00,0x00,0x20,0x21,0x30,0xe7,0xff,0xff, ++0x30,0xa4,0xff,0xff,0xaf,0xa7,0x00,0x2c,0x00,0xd2,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x51,0x18,0x21,0x8c,0x65,0x00,0x18,0x00,0x04,0x25,0x80,0x00,0x8d,0x20,0x24, ++0x8c,0xa8,0x00,0x04,0x00,0x4e,0x18,0x21,0x00,0x4f,0x50,0x21,0x01,0x0b,0x40,0x24, ++0x01,0x04,0x40,0x25,0xac,0xa8,0x00,0x04,0x8f,0xa4,0x00,0x98,0x8f,0xa2,0x00,0x50, ++0x26,0xb5,0x00,0x01,0xa0,0x64,0x00,0x00,0x8c,0xa4,0x00,0x08,0x00,0x00,0x00,0x00, ++0x04,0x81,0x00,0x0c,0x02,0xa2,0x30,0x2a,0x80,0x62,0x00,0x06,0x00,0x00,0x00,0x00, ++0x24,0x42,0x00,0x02,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x00,0x02,0x10,0x40,0x00,0xa2,0x38,0x21,0x8f,0xa5,0x00,0x40,0x00,0x00,0x00,0x00, ++0xa4,0xe5,0x00,0x00,0x95,0x52,0x00,0x02,0x14,0xc0,0xff,0xc7,0x00,0x12,0x30,0xc0, ++0x8f,0xa4,0x00,0x24,0x8f,0xa5,0x00,0x50,0x8f,0xa6,0x00,0x1c,0x8f,0xa3,0x00,0x2c, ++0x00,0x85,0x80,0x21,0xa0,0xd0,0x00,0x12,0x00,0x09,0x10,0x23,0x30,0x42,0x00,0x03, ++0x8f,0xa8,0x00,0x88,0x00,0x62,0x10,0x23,0xa4,0xc2,0x00,0x1a,0x85,0x03,0x00,0x0c, ++0x00,0x00,0x00,0x00,0x00,0x03,0x10,0xc0,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x80, ++0x27,0x83,0x99,0x44,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x18,0x00,0x00,0x00,0x00, ++0x8c,0x83,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x10,0x14,0x60,0xff,0x74, ++0x02,0x00,0x10,0x21,0x8f,0xa3,0x00,0x54,0x8f,0xa4,0x00,0x18,0x8f,0xa5,0x00,0x24, ++0x00,0x64,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x83,0x99,0x58,0x00,0x43,0x10,0x21, ++0x90,0x44,0x00,0x00,0x10,0xa0,0x00,0x03,0x00,0x00,0x30,0x21,0x08,0x00,0x24,0xb4, ++0x02,0x00,0x10,0x21,0x93,0x82,0x80,0x10,0x00,0x00,0x28,0x21,0x00,0x00,0x38,0x21, ++0x0c,0x00,0x29,0x0b,0xaf,0xa2,0x00,0x10,0x08,0x00,0x24,0xb4,0x02,0x00,0x10,0x21, ++0x30,0x63,0xff,0xff,0x08,0x00,0x25,0x06,0xaf,0xa3,0x00,0x2c,0x8f,0xa8,0x00,0x44, ++0x08,0x00,0x25,0x28,0x31,0x09,0x00,0x03,0x08,0x00,0x24,0xe1,0xaf,0xa3,0x00,0x50, ++0x8f,0xa6,0x00,0x44,0xaf,0xa0,0x00,0x50,0x08,0x00,0x25,0x28,0x30,0xc9,0x00,0x03, ++0x8f,0xa5,0x00,0x48,0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x1c,0x03,0xc0,0x38,0x21, ++0x0c,0x00,0x23,0x53,0xaf,0xb7,0x00,0x10,0x08,0x00,0x24,0x91,0x00,0x00,0x00,0x00, ++0x00,0x05,0x28,0x80,0x27,0x82,0x99,0x40,0x00,0xa2,0x28,0x21,0x00,0x00,0x20,0x21, ++0x0c,0x00,0x01,0x49,0x00,0x00,0x00,0x00,0x08,0x00,0x24,0x8a,0x26,0xe2,0x00,0x01, ++0x00,0x02,0x80,0x80,0x27,0x83,0x99,0x50,0x8f,0xa4,0x00,0x1c,0x02,0x03,0x18,0x21, ++0x26,0x31,0x00,0x01,0x02,0x40,0x28,0x21,0x0c,0x00,0x26,0x5b,0xa0,0x71,0x00,0x05, ++0x14,0x40,0xff,0x13,0x00,0x00,0x00,0x00,0x16,0xe0,0x00,0x4d,0x03,0xc0,0x38,0x21, ++0x8f,0xa4,0x00,0x24,0x8f,0xa5,0x00,0x20,0x24,0x02,0x00,0x01,0x24,0x84,0x00,0x01, ++0xaf,0xb2,0x00,0x48,0xaf,0xb6,0x00,0x4c,0x02,0xc0,0xf0,0x21,0x10,0xa2,0x00,0x41, ++0xaf,0xa4,0x00,0x24,0x27,0x82,0x99,0x40,0x02,0x02,0x10,0x21,0x94,0x42,0x00,0x06, ++0x8f,0xa4,0x00,0x30,0xaf,0xa0,0x00,0x20,0xaf,0xa2,0x00,0x44,0x30,0x49,0x00,0x03, ++0x8f,0xa8,0x00,0x44,0x00,0x09,0x10,0x23,0x30,0x42,0x00,0x03,0x01,0x02,0x10,0x21, ++0x24,0x42,0x00,0x04,0x30,0x42,0xff,0xff,0x00,0x44,0x18,0x2b,0x10,0x60,0x00,0x2b, ++0x00,0x00,0x00,0x00,0x8f,0xa5,0x00,0x2c,0x00,0x82,0x10,0x23,0x00,0xa4,0x18,0x21, ++0x30,0x63,0xff,0xff,0x30,0x44,0xff,0xff,0xaf,0xa3,0x00,0x2c,0x02,0x92,0x28,0x21, ++0x00,0x05,0x28,0x80,0x27,0x82,0x99,0x44,0x00,0xa2,0x10,0x21,0x8c,0x46,0x00,0x18, ++0x3c,0x03,0x80,0xff,0x3c,0x02,0x7f,0x00,0x8c,0xc8,0x00,0x04,0x00,0x04,0x25,0x80, ++0x34,0x63,0xff,0xff,0x00,0x82,0x20,0x24,0x01,0x03,0x40,0x24,0x01,0x04,0x40,0x25, ++0xac,0xc8,0x00,0x04,0x8f,0xa8,0x00,0x98,0x27,0x82,0x99,0x50,0x00,0xa2,0x10,0x21, ++0xa0,0x48,0x00,0x00,0x8c,0xc4,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x27,0xc2, ++0x10,0x80,0xfe,0xdb,0xaf,0xa4,0x00,0x3c,0x80,0x42,0x00,0x06,0x00,0x00,0x00,0x00, ++0x24,0x42,0x00,0x02,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x00,0x02,0x10,0x40,0x00,0xc2,0x38,0x21,0x8f,0xa2,0x00,0x40,0x00,0x00,0x00,0x00, ++0xa4,0xe2,0x00,0x00,0x08,0x00,0x24,0x8d,0x26,0xb5,0xff,0xff,0x8f,0xa6,0x00,0x2c, ++0x00,0x00,0x20,0x21,0x00,0xc2,0x10,0x21,0x30,0x42,0xff,0xff,0x08,0x00,0x25,0x9b, ++0xaf,0xa2,0x00,0x2c,0x8f,0xa6,0x00,0x1c,0x08,0x00,0x25,0x85,0xa4,0xd2,0x00,0x14, ++0x8f,0xa5,0x00,0x48,0x8f,0xa6,0x00,0x4c,0x8f,0xa4,0x00,0x1c,0x0c,0x00,0x23,0x53, ++0xaf,0xb7,0x00,0x10,0x08,0x00,0x25,0x7c,0x00,0x00,0xb8,0x21,0x0c,0x00,0x1a,0x11, ++0x00,0x00,0x28,0x21,0x94,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x63,0x08,0x00, ++0xa4,0x43,0x00,0x00,0x08,0x00,0x24,0x81,0x02,0x71,0x10,0x21,0x02,0x92,0x18,0x21, ++0x00,0x03,0x80,0x80,0x27,0x82,0x99,0x44,0x02,0x02,0x10,0x21,0x8c,0x44,0x00,0x18, ++0x00,0x00,0x00,0x00,0x8c,0x83,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x10, ++0x10,0x60,0x00,0x09,0x24,0x06,0x00,0x01,0x93,0x82,0x94,0x51,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x01,0x10,0x40,0xfe,0xa3,0x3c,0x04,0x00,0x80,0x27,0x85,0x99,0x40, ++0x08,0x00,0x25,0x6c,0x02,0x05,0x28,0x21,0x27,0x83,0x99,0x58,0x27,0x82,0x99,0x50, ++0x02,0x03,0x18,0x21,0x02,0x02,0x10,0x21,0x90,0x64,0x00,0x00,0x90,0x45,0x00,0x05, ++0x93,0x83,0x80,0x10,0x00,0x00,0x38,0x21,0x0c,0x00,0x29,0x0b,0xaf,0xa3,0x00,0x10, ++0x08,0x00,0x25,0xe2,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x04,0x00,0x00,0x00,0x00, ++0x8f,0xa4,0x00,0x94,0x08,0x00,0x24,0x59,0x00,0x64,0x10,0x06,0x08,0x00,0x24,0x5a, ++0x00,0x00,0x18,0x21,0x8f,0xa4,0x00,0x98,0x8f,0xa5,0x00,0x38,0xaf,0xa0,0x00,0x10, ++0x0c,0x00,0x10,0x97,0xaf,0xa8,0x00,0x14,0x30,0x42,0xff,0xff,0x08,0x00,0x24,0x24, ++0xaf,0xa2,0x00,0x40,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe0, ++0x34,0x42,0x00,0x20,0x24,0x63,0x98,0x14,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x18,0xac,0x43,0x00,0x00,0x90,0x82,0x00,0x0a,0x00,0x80,0x80,0x21, ++0x14,0x40,0x00,0x45,0x00,0x00,0x88,0x21,0x92,0x02,0x00,0x04,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x3c,0x00,0x00,0x00,0x00,0x12,0x20,0x00,0x18,0x00,0x00,0x00,0x00, ++0x92,0x02,0x00,0x16,0x92,0x05,0x00,0x0a,0x30,0x42,0x00,0xfc,0x10,0xa0,0x00,0x03, ++0xa2,0x02,0x00,0x16,0x34,0x42,0x00,0x01,0xa2,0x02,0x00,0x16,0x92,0x04,0x00,0x04, ++0x00,0x00,0x00,0x00,0x30,0x83,0x00,0xff,0x10,0x60,0x00,0x05,0x00,0x00,0x00,0x00, ++0x92,0x02,0x00,0x16,0x00,0x00,0x00,0x00,0x34,0x42,0x00,0x02,0xa2,0x02,0x00,0x16, ++0x10,0x60,0x00,0x0a,0x00,0x00,0x00,0x00,0x14,0xa0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x96,0x02,0x00,0x00,0xa2,0x00,0x00,0x17,0xa6,0x02,0x00,0x14,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x14,0x80,0x00,0x05, ++0x24,0x02,0x00,0x01,0x96,0x03,0x00,0x06,0xa2,0x02,0x00,0x17,0x08,0x00,0x26,0x2f, ++0xa6,0x03,0x00,0x14,0x96,0x04,0x00,0x00,0x96,0x05,0x00,0x06,0x27,0x86,0x99,0x40, ++0x00,0x04,0x10,0xc0,0x00,0x05,0x18,0xc0,0x00,0x44,0x10,0x21,0x00,0x65,0x18,0x21, ++0x00,0x02,0x10,0x80,0x00,0x03,0x18,0x80,0x00,0x66,0x18,0x21,0x00,0x46,0x10,0x21, ++0x8c,0x65,0x00,0x08,0x8c,0x44,0x00,0x08,0x0c,0x00,0x1a,0x02,0x00,0x00,0x00,0x00, ++0x30,0x43,0x00,0xff,0x10,0x60,0x00,0x04,0xa2,0x02,0x00,0x17,0x96,0x02,0x00,0x06, ++0x08,0x00,0x26,0x2f,0xa6,0x02,0x00,0x14,0x96,0x02,0x00,0x00,0x08,0x00,0x26,0x2f, ++0xa6,0x02,0x00,0x14,0x96,0x05,0x00,0x00,0x0c,0x00,0x26,0x5b,0x02,0x00,0x20,0x21, ++0x08,0x00,0x26,0x16,0x02,0x22,0x88,0x21,0x94,0x85,0x00,0x06,0x0c,0x00,0x26,0x5b, ++0x00,0x00,0x00,0x00,0x08,0x00,0x26,0x12,0x00,0x40,0x88,0x21,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20,0x24,0x42,0x99,0x6c,0x27,0xbd,0xff,0xf0, ++0xac,0x62,0x00,0x00,0x00,0x00,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x10, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20,0x24,0x42,0x99,0x90, ++0xac,0x62,0x00,0x00,0x90,0x89,0x00,0x0a,0x00,0x80,0x30,0x21,0x11,0x20,0x00,0x05, ++0x00,0xa0,0x50,0x21,0x90,0x82,0x00,0x17,0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x1b, ++0x00,0x00,0x00,0x00,0x90,0xc7,0x00,0x04,0x00,0x00,0x00,0x00,0x10,0xe0,0x00,0x1b, ++0x00,0x00,0x00,0x00,0x94,0xc8,0x00,0x00,0x27,0x83,0x99,0x40,0x93,0x85,0x94,0x50, ++0x00,0x08,0x10,0xc0,0x00,0x48,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x08,0x00,0xe5,0x28,0x2b,0x10,0xa0,0x00,0x06,0x01,0x44,0x18,0x23, ++0x8f,0x82,0x94,0x68,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x2b,0x10,0x40,0x00,0x05, ++0x00,0x00,0x00,0x00,0x24,0x03,0x00,0x10,0xa4,0xc8,0x00,0x14,0x03,0xe0,0x00,0x08, ++0x00,0x60,0x10,0x21,0x11,0x20,0x00,0x05,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x06, ++0x24,0x03,0x00,0x08,0x08,0x00,0x26,0x87,0xa4,0xc2,0x00,0x14,0x08,0x00,0x26,0x87, ++0x00,0x00,0x18,0x21,0x27,0xbd,0xff,0xc8,0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28, ++0xaf,0xb3,0x00,0x24,0xaf,0xb0,0x00,0x18,0xaf,0xbf,0x00,0x30,0xaf,0xb2,0x00,0x20, ++0xaf,0xb1,0x00,0x1c,0x94,0x91,0x00,0x06,0x00,0x80,0xa0,0x21,0x3c,0x02,0x80,0x01, ++0x3c,0x04,0xb0,0x03,0x00,0x11,0xa8,0xc0,0x34,0x84,0x00,0x20,0x24,0x42,0x9a,0x44, ++0x02,0xb1,0x48,0x21,0xac,0x82,0x00,0x00,0x00,0x09,0x48,0x80,0x24,0x03,0x00,0x01, ++0x27,0x82,0x99,0x50,0xa2,0x83,0x00,0x12,0x01,0x22,0x10,0x21,0x27,0x84,0x99,0x44, ++0x01,0x24,0x20,0x21,0x80,0x48,0x00,0x06,0x8c,0x8a,0x00,0x18,0x27,0x83,0x99,0x60, ++0x01,0x23,0x48,0x21,0x8d,0x24,0x00,0x00,0x25,0x08,0x00,0x02,0x8d,0x42,0x00,0x00, ++0x8d,0x49,0x00,0x04,0x00,0x08,0x17,0xc2,0x8d,0x43,0x00,0x08,0x01,0x02,0x40,0x21, ++0x00,0x04,0x25,0xc2,0x00,0x08,0x40,0x43,0x30,0x84,0x00,0x01,0x00,0x03,0x1f,0xc2, ++0x00,0x08,0x40,0x40,0x00,0xe0,0x80,0x21,0x00,0x64,0x18,0x24,0x00,0x09,0x49,0x42, ++0x01,0x48,0x10,0x21,0x00,0xa0,0x98,0x21,0x00,0xa0,0x20,0x21,0x00,0x40,0x38,0x21, ++0x02,0x00,0x28,0x21,0x14,0x60,0x00,0x19,0x31,0x29,0x00,0x01,0x94,0x42,0x00,0x00, ++0x02,0xb1,0x88,0x21,0x02,0x00,0x28,0x21,0x00,0x11,0x88,0x80,0x27,0x90,0x99,0x40, ++0x02,0x30,0x80,0x21,0x96,0x03,0x00,0x06,0x30,0x52,0xff,0xff,0x02,0x60,0x20,0x21, ++0x00,0x60,0x30,0x21,0xa6,0x83,0x00,0x1a,0x27,0x82,0x99,0x48,0x0c,0x00,0x10,0x70, ++0x02,0x22,0x88,0x21,0x00,0x52,0x10,0x21,0x96,0x03,0x00,0x06,0xa6,0x22,0x00,0x04, ++0x8f,0xbf,0x00,0x30,0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc, ++0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x38,0xaf,0xa9,0x00,0x10, ++0x0c,0x00,0x10,0x97,0xaf,0xa0,0x00,0x14,0x08,0x00,0x26,0xc5,0x02,0xb1,0x88,0x21, ++0x27,0xbd,0xff,0xc0,0xaf,0xbe,0x00,0x38,0xaf,0xb7,0x00,0x34,0xaf,0xb6,0x00,0x30, ++0xaf,0xb5,0x00,0x2c,0xaf,0xb3,0x00,0x24,0xaf,0xb1,0x00,0x1c,0xaf,0xbf,0x00,0x3c, ++0xaf,0xb4,0x00,0x28,0xaf,0xb2,0x00,0x20,0xaf,0xb0,0x00,0x18,0x94,0x90,0x00,0x00, ++0x3c,0x08,0xb0,0x03,0x35,0x08,0x00,0x20,0x00,0x10,0x10,0xc0,0x00,0x50,0x18,0x21, ++0x00,0x40,0x88,0x21,0x3c,0x02,0x80,0x01,0x00,0x03,0x48,0x80,0x24,0x42,0x9b,0x80, ++0x00,0x80,0x98,0x21,0x27,0x84,0x99,0x50,0x01,0x24,0x20,0x21,0x93,0xb7,0x00,0x53, ++0xad,0x02,0x00,0x00,0x80,0x83,0x00,0x06,0x27,0x82,0x99,0x44,0x01,0x22,0x10,0x21, ++0x8c,0x44,0x00,0x18,0x24,0x63,0x00,0x02,0x00,0x03,0x17,0xc2,0x8c,0x88,0x00,0x08, ++0x00,0x62,0x18,0x21,0x00,0x03,0x18,0x43,0x00,0x03,0x18,0x40,0xaf,0xa7,0x00,0x4c, ++0x2c,0xa2,0x00,0x10,0x00,0xa0,0xa8,0x21,0x00,0x83,0x50,0x21,0x00,0x08,0x47,0xc2, ++0x00,0xc0,0x58,0x21,0x00,0x00,0xb0,0x21,0x8c,0x92,0x00,0x0c,0x14,0x40,0x00,0x13, ++0x00,0x00,0xf0,0x21,0x92,0x67,0x00,0x04,0x24,0x14,0x00,0x01,0x12,0x87,0x00,0x10, ++0x02,0x30,0x10,0x21,0x27,0x83,0x99,0x58,0x01,0x23,0x18,0x21,0x80,0x64,0x00,0x00, ++0x27,0x83,0xbe,0xb0,0x00,0x04,0x11,0x00,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80, ++0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x04, ++0x00,0x00,0x00,0x00,0x10,0x80,0x00,0x23,0x00,0x00,0x00,0x00,0x02,0x30,0x10,0x21, ++0x00,0x02,0x80,0x80,0x24,0x04,0x00,0x01,0x27,0x83,0x99,0x60,0xa2,0x64,0x00,0x12, ++0x02,0x03,0x18,0x21,0x8c,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15,0xc2, ++0x30,0x42,0x00,0x01,0x01,0x02,0x10,0x24,0x14,0x40,0x00,0x0e,0x02,0xa0,0x20,0x21, ++0x27,0x82,0x99,0x40,0x02,0x02,0x10,0x21,0x94,0x43,0x00,0x06,0x00,0x00,0x00,0x00, ++0xa6,0x63,0x00,0x1a,0x94,0x42,0x00,0x06,0x7b,0xbe,0x01,0xfc,0x7b,0xb6,0x01,0xbc, ++0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c,0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x40,0x8f,0xa5,0x00,0x4c,0x01,0x60,0x30,0x21,0x01,0x40,0x38,0x21, ++0xaf,0xa0,0x00,0x10,0x0c,0x00,0x10,0x97,0xaf,0xa0,0x00,0x14,0x08,0x00,0x27,0x2c, ++0x00,0x00,0x00,0x00,0x27,0x83,0x99,0x60,0x01,0x23,0x18,0x21,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x15,0xc2,0x30,0x42,0x00,0x01,0x01,0x02,0x10,0x24, ++0x14,0x40,0x00,0xaf,0x00,0xa0,0x20,0x21,0x32,0x4f,0x00,0x03,0x00,0x12,0x10,0x82, ++0x25,0xe3,0x00,0x0d,0x30,0x45,0x00,0x07,0x00,0x74,0x78,0x04,0x10,0xa0,0x00,0x0e, ++0x00,0x00,0x90,0x21,0x27,0x82,0x86,0x30,0x00,0x15,0x18,0x40,0x00,0x62,0x18,0x21, ++0x94,0x64,0x00,0x00,0x24,0xa2,0x00,0x05,0x00,0x54,0x10,0x04,0x00,0x44,0x00,0x1a, ++0x14,0x80,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d,0x00,0x00,0x10,0x12, ++0x24,0x42,0x00,0x10,0x30,0x52,0xff,0xfc,0x02,0x30,0x10,0x21,0x27,0x83,0x99,0x50, ++0x00,0x02,0x10,0x80,0x00,0x43,0x10,0x21,0x90,0x44,0x00,0x03,0x00,0x00,0x00,0x00, ++0x30,0x83,0x00,0xff,0x2c,0x62,0x00,0x0c,0x14,0x40,0x00,0x04,0x2c,0x62,0x00,0x19, ++0x30,0x82,0x00,0x0f,0x24,0x43,0x00,0x0c,0x2c,0x62,0x00,0x19,0x10,0x40,0x00,0x19, ++0x24,0x0e,0x00,0x20,0x24,0x62,0xff,0xe9,0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x15, ++0x24,0x0e,0x00,0x10,0x24,0x62,0xff,0xeb,0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x11, ++0x24,0x0e,0x00,0x08,0x24,0x02,0x00,0x14,0x10,0x62,0x00,0x0e,0x24,0x0e,0x00,0x02, ++0x24,0x62,0xff,0xef,0x2c,0x42,0x00,0x03,0x14,0x40,0x00,0x0a,0x24,0x0e,0x00,0x10, ++0x24,0x62,0xff,0xf1,0x2c,0x42,0x00,0x02,0x14,0x40,0x00,0x06,0x24,0x0e,0x00,0x08, ++0x24,0x62,0xff,0xf3,0x2c,0x42,0x00,0x02,0x24,0x0e,0x00,0x04,0x24,0x03,0x00,0x02, ++0x00,0x62,0x70,0x0a,0x30,0xe2,0x00,0xff,0x00,0x00,0x48,0x21,0x00,0x00,0x68,0x21, ++0x10,0x40,0x00,0x6d,0x00,0x00,0x58,0x21,0x3c,0x14,0x80,0xff,0x27,0x99,0x99,0x40, ++0x01,0xf2,0xc0,0x23,0x36,0x94,0xff,0xff,0x01,0xc9,0x10,0x2a,0x14,0x40,0x00,0x64, ++0x24,0x03,0x00,0x04,0x00,0x10,0x28,0xc0,0x00,0xb0,0x10,0x21,0x00,0x02,0x10,0x80, ++0x00,0x59,0x10,0x21,0x94,0x56,0x00,0x06,0x00,0x00,0x00,0x00,0x32,0xcc,0x00,0x03, ++0x00,0x6c,0x10,0x23,0x30,0x42,0x00,0x03,0x02,0xc2,0x10,0x21,0x24,0x42,0x00,0x04, ++0x30,0x51,0xff,0xff,0x02,0x32,0x18,0x2b,0x10,0x60,0x00,0x4d,0x01,0xf1,0x10,0x23, ++0x02,0x51,0x10,0x23,0x01,0x78,0x18,0x2b,0x10,0x60,0x00,0x34,0x30,0x44,0xff,0xff, ++0x29,0x22,0x00,0x40,0x10,0x40,0x00,0x31,0x01,0x72,0x18,0x21,0x25,0x22,0x00,0x01, ++0x00,0x02,0x16,0x00,0x00,0x02,0x4e,0x03,0x00,0xb0,0x10,0x21,0x00,0x02,0x30,0x80, ++0x27,0x82,0x99,0x44,0x30,0x6b,0xff,0xff,0x00,0xc2,0x18,0x21,0x8c,0x67,0x00,0x18, ++0x00,0x04,0x25,0x80,0x3c,0x03,0x7f,0x00,0x8c,0xe2,0x00,0x04,0x00,0x83,0x20,0x24, ++0x27,0x83,0x99,0x50,0x00,0x54,0x10,0x24,0x00,0xc3,0x28,0x21,0x00,0x44,0x10,0x25, ++0xac,0xe2,0x00,0x04,0x16,0xe0,0x00,0x02,0xa0,0xb5,0x00,0x00,0xa0,0xb5,0x00,0x03, ++0x27,0x84,0x99,0x60,0x00,0xc4,0x18,0x21,0x8c,0x62,0x00,0x00,0x8c,0xe8,0x00,0x08, ++0x00,0x02,0x15,0xc2,0x00,0x08,0x47,0xc2,0x30,0x42,0x00,0x01,0x01,0x02,0x10,0x24, ++0x10,0x40,0x00,0x0a,0x00,0x00,0x00,0x00,0x80,0xa2,0x00,0x06,0x00,0x00,0x00,0x00, ++0x24,0x42,0x00,0x02,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x00,0x02,0x10,0x40,0x00,0xe2,0x50,0x21,0xa5,0x5e,0x00,0x00,0x92,0x62,0x00,0x04, ++0x25,0xad,0x00,0x01,0x27,0x84,0x99,0x40,0x00,0xc4,0x18,0x21,0x01,0xa2,0x10,0x2a, ++0x94,0x70,0x00,0x02,0x14,0x40,0xff,0xb8,0x00,0x00,0x00,0x00,0x96,0x63,0x00,0x14, ++0x00,0x0c,0x10,0x23,0xa2,0x69,0x00,0x12,0x30,0x42,0x00,0x03,0x01,0x62,0x10,0x23, ++0x00,0x03,0x80,0xc0,0x8f,0xa5,0x00,0x4c,0x30,0x4b,0xff,0xff,0x02,0x03,0x80,0x21, ++0x27,0x82,0x99,0x48,0x00,0x10,0x80,0x80,0xa6,0x6b,0x00,0x1a,0x02,0xa0,0x20,0x21, ++0x01,0x60,0x30,0x21,0x01,0x60,0x88,0x21,0x0c,0x00,0x10,0x70,0x02,0x02,0x80,0x21, ++0x00,0x5e,0x10,0x21,0xa6,0x02,0x00,0x04,0x08,0x00,0x27,0x32,0x02,0x20,0x10,0x21, ++0x01,0x62,0x10,0x2b,0x10,0x40,0xff,0xe9,0x00,0x00,0x20,0x21,0x29,0x22,0x00,0x40, ++0x10,0x40,0xff,0xe6,0x01,0x71,0x18,0x21,0x08,0x00,0x27,0xa8,0x25,0x22,0x00,0x01, ++0x08,0x00,0x27,0xd7,0x32,0xcc,0x00,0x03,0x08,0x00,0x27,0xd7,0x00,0x00,0x60,0x21, ++0x8f,0xa5,0x00,0x4c,0x01,0x40,0x38,0x21,0xaf,0xa0,0x00,0x10,0x0c,0x00,0x10,0x97, ++0xaf,0xb4,0x00,0x14,0x92,0x67,0x00,0x04,0x08,0x00,0x27,0x4a,0x30,0x5e,0xff,0xff, ++0x30,0x84,0xff,0xff,0x00,0x04,0x30,0xc0,0x00,0xc4,0x20,0x21,0x00,0x04,0x20,0x80, ++0x27,0x82,0x99,0x40,0x3c,0x03,0xb0,0x08,0x30,0xa5,0xff,0xff,0x00,0x82,0x20,0x21, ++0x00,0xc3,0x30,0x21,0xac,0xc5,0x00,0x00,0x03,0xe0,0x00,0x08,0xa4,0x85,0x00,0x00, ++0x30,0x84,0xff,0xff,0x00,0x04,0x30,0xc0,0x00,0xc4,0x30,0x21,0x27,0x88,0x99,0x40, ++0x00,0x06,0x30,0x80,0x00,0xc8,0x30,0x21,0x94,0xc3,0x00,0x04,0x3c,0x02,0xb0,0x08, ++0x3c,0x07,0xb0,0x03,0x00,0x03,0x20,0xc0,0x00,0x83,0x18,0x21,0x00,0x03,0x18,0x80, ++0x00,0x82,0x20,0x21,0x3c,0x02,0x80,0x01,0x30,0xa5,0xff,0xff,0x00,0x68,0x18,0x21, ++0x34,0xe7,0x00,0x20,0x24,0x42,0xa0,0x30,0xac,0xe2,0x00,0x00,0xa4,0xc5,0x00,0x02, ++0xa4,0x65,0x00,0x00,0x03,0xe0,0x00,0x08,0xac,0x85,0x00,0x00,0x30,0x84,0xff,0xff, ++0x00,0x04,0x10,0xc0,0x00,0x44,0x10,0x21,0x27,0x89,0x99,0x40,0x00,0x02,0x10,0x80, ++0x00,0x49,0x10,0x21,0x97,0x83,0x99,0x30,0x94,0x4a,0x00,0x04,0x3c,0x02,0xb0,0x08, ++0x00,0x03,0x38,0xc0,0x00,0x0a,0x40,0xc0,0x00,0xe3,0x18,0x21,0x01,0x0a,0x28,0x21, ++0x00,0xe2,0x38,0x21,0x01,0x02,0x40,0x21,0x00,0x03,0x18,0x80,0x00,0x05,0x28,0x80, ++0x3c,0x06,0xb0,0x03,0x3c,0x02,0x80,0x01,0x00,0xa9,0x28,0x21,0x00,0x69,0x18,0x21, ++0x34,0xc6,0x00,0x20,0x34,0x09,0xff,0xff,0x24,0x42,0xa0,0x8c,0xac,0xc2,0x00,0x00, ++0xa4,0x64,0x00,0x00,0xac,0xe4,0x00,0x00,0xa4,0xa9,0x00,0x00,0xad,0x09,0x00,0x00, ++0xa7,0x8a,0x99,0x30,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20,0x24,0x42,0xa1,0x0c,0x3c,0x04,0xb0,0x03, ++0xac,0x62,0x00,0x00,0x34,0x84,0x01,0x10,0x8c,0x82,0x00,0x00,0x97,0x83,0x87,0x74, ++0x30,0x42,0xff,0xff,0x10,0x62,0x00,0x16,0x24,0x0a,0x00,0x01,0xa7,0x82,0x87,0x74, ++0xaf,0x80,0xbd,0x90,0x00,0x40,0x28,0x21,0x24,0x06,0x00,0x01,0x27,0x84,0xbd,0x94, ++0x25,0x43,0xff,0xff,0x00,0x66,0x10,0x04,0x00,0xa2,0x10,0x24,0x14,0x40,0x00,0x07, ++0x00,0x00,0x00,0x00,0x8c,0x83,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x66,0x10,0x04, ++0x00,0xa2,0x10,0x24,0x38,0x42,0x00,0x00,0x01,0x42,0x18,0x0a,0x25,0x4a,0x00,0x01, ++0x2d,0x42,0x00,0x14,0xac,0x83,0x00,0x00,0x14,0x40,0xff,0xf1,0x24,0x84,0x00,0x04, ++0x3c,0x0b,0xb0,0x03,0x00,0x00,0x50,0x21,0x3c,0x0c,0x80,0x00,0x27,0x89,0xbd,0xe0, ++0x35,0x6b,0x01,0x20,0x8d,0x68,0x00,0x00,0x8d,0x23,0x00,0x04,0x01,0x0c,0x10,0x24, ++0x00,0x02,0x17,0xc2,0x11,0x03,0x00,0x37,0xa1,0x22,0x00,0xdc,0xa1,0x20,0x00,0xd5, ++0xa1,0x20,0x00,0xd6,0x01,0x20,0x30,0x21,0x00,0x00,0x38,0x21,0x00,0x00,0x28,0x21, ++0x01,0x20,0x20,0x21,0x00,0xa8,0x10,0x06,0x30,0x42,0x00,0x01,0x10,0xe0,0x00,0x10, ++0xa0,0x82,0x00,0x0a,0x90,0x82,0x00,0x07,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x31, ++0x24,0xa2,0xff,0xff,0xa0,0x82,0x00,0x08,0x90,0x82,0x00,0x0a,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x09,0x00,0x00,0x00,0x00,0x90,0x83,0x00,0x08,0x00,0x00,0x00,0x00, ++0x00,0x03,0x10,0x40,0x00,0x43,0x10,0x21,0x00,0x46,0x10,0x21,0xa0,0x45,0x00,0x09, ++0x90,0x82,0x00,0x0a,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x07,0x00,0x00,0x00,0x00, ++0x14,0xe0,0x00,0x04,0x00,0x00,0x00,0x00,0xa0,0xc5,0x00,0xd5,0x24,0x07,0x00,0x01, ++0xa0,0x85,0x00,0x08,0xa0,0xc5,0x00,0xd6,0x24,0xa5,0x00,0x01,0x2c,0xa2,0x00,0x1c, ++0x14,0x40,0xff,0xe0,0x24,0x84,0x00,0x03,0x90,0xc4,0x00,0xd5,0x00,0x00,0x28,0x21, ++0x00,0xa4,0x10,0x2b,0x10,0x40,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0xc0,0x18,0x21, ++0xa0,0x64,0x00,0x08,0x90,0xc2,0x00,0xd5,0x24,0xa5,0x00,0x01,0xa0,0x62,0x00,0x09, ++0x90,0xc4,0x00,0xd5,0x00,0x00,0x00,0x00,0x00,0xa4,0x10,0x2b,0x14,0x40,0xff,0xf8, ++0x24,0x63,0x00,0x03,0x25,0x4a,0x00,0x01,0x2d,0x42,0x00,0x08,0xad,0x28,0x00,0x04, ++0x25,0x6b,0x00,0x04,0x14,0x40,0xff,0xbf,0x25,0x29,0x00,0xec,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x90,0x82,0x00,0x05,0x08,0x00,0x28,0x7e,0xa0,0x82,0x00,0x08, ++0x97,0x85,0x94,0x5a,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x27,0xbd,0xff,0xe8, ++0x34,0x63,0x00,0x20,0x24,0x42,0xa2,0xc0,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14, ++0xac,0x62,0x00,0x00,0x30,0x90,0x00,0xff,0x00,0x05,0x28,0x42,0x00,0x00,0x48,0x21, ++0x27,0x8f,0xbd,0xe4,0x00,0x00,0x50,0x21,0x00,0x00,0x58,0x21,0x27,0x98,0xbe,0xc4, ++0x27,0x99,0xbe,0xc0,0x27,0x8e,0xbe,0xbe,0x27,0x8c,0xbd,0xe8,0x27,0x8d,0xbe,0x40, ++0x27,0x88,0xbe,0xb8,0x00,0x0a,0x18,0x80,0x01,0x6f,0x10,0x21,0xac,0x40,0x00,0x00, ++0xac,0x45,0x00,0x58,0x00,0x6e,0x20,0x21,0x00,0x78,0x10,0x21,0xa1,0x00,0xff,0xfc, ++0xad,0x00,0x00,0x00,0xa1,0x00,0x00,0x04,0xa1,0x00,0x00,0x05,0xad,0x00,0xff,0xf8, ++0x00,0x79,0x18,0x21,0x24,0x06,0x00,0x01,0x24,0xc6,0xff,0xff,0xa0,0x80,0x00,0x00, ++0xa4,0x60,0x00,0x00,0xac,0x40,0x00,0x00,0x24,0x63,0x00,0x02,0x24,0x42,0x00,0x04, ++0x04,0xc1,0xff,0xf9,0x24,0x84,0x00,0x01,0x00,0x0a,0x10,0x80,0x00,0x4d,0x20,0x21, ++0x00,0x00,0x30,0x21,0x00,0x4c,0x18,0x21,0x27,0x87,0x87,0x78,0x8c,0xe2,0x00,0x00, ++0x24,0xe7,0x00,0x04,0xac,0x82,0x00,0x00,0xa0,0x66,0x00,0x00,0xa0,0x66,0x00,0x01, ++0x24,0xc6,0x00,0x01,0x28,0xc2,0x00,0x1c,0xa0,0x60,0x00,0x02,0x24,0x84,0x00,0x04, ++0x14,0x40,0xff,0xf6,0x24,0x63,0x00,0x03,0x25,0x29,0x00,0x01,0x29,0x22,0x00,0x08, ++0x25,0x4a,0x00,0x3b,0x25,0x08,0x00,0xec,0x14,0x40,0xff,0xd6,0x25,0x6b,0x00,0xec, ++0xa7,0x80,0x87,0x74,0x00,0x00,0x48,0x21,0x27,0x83,0xbd,0x90,0xac,0x69,0x00,0x00, ++0x25,0x29,0x00,0x01,0x29,0x22,0x00,0x0c,0x14,0x40,0xff,0xfc,0x24,0x63,0x00,0x04, ++0x0c,0x00,0x28,0x43,0x00,0x00,0x00,0x00,0x2e,0x04,0x00,0x14,0x27,0x83,0xbd,0xe0, ++0x24,0x09,0x00,0x07,0x10,0x80,0x00,0x0a,0x00,0x00,0x00,0x00,0x90,0x62,0x00,0xd5, ++0x25,0x29,0xff,0xff,0xa0,0x62,0x00,0x00,0x05,0x21,0xff,0xfa,0x24,0x63,0x00,0xec, ++0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x90,0x62,0x00,0xd6,0x08,0x00,0x29,0x01,0x25,0x29,0xff,0xff,0x30,0x84,0x00,0xff, ++0x00,0x04,0x11,0x00,0x00,0x44,0x10,0x23,0x00,0x02,0x10,0x80,0x00,0x44,0x10,0x23, ++0x00,0x02,0x10,0x80,0x27,0x83,0xbd,0xe0,0x00,0x43,0x60,0x21,0x3c,0x04,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x34,0x84,0x00,0x20,0x24,0x42,0xa4,0x2c,0x30,0xc6,0x00,0xff, ++0x93,0xaa,0x00,0x13,0x30,0xa5,0x00,0xff,0x30,0xe7,0x00,0xff,0xac,0x82,0x00,0x00, ++0x10,0xc0,0x00,0xb8,0x25,0x8f,0x00,0xd0,0x91,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x24,0x42,0xff,0xfc,0x2c,0x43,0x00,0x18,0x10,0x60,0x00,0x9b,0x3c,0x03,0x80,0x01, ++0x00,0x02,0x10,0x80,0x24,0x63,0x09,0x3c,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2c, ++0x14,0x40,0x00,0x1c,0x00,0x00,0x00,0x00,0x10,0xa0,0x00,0x17,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x11,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0x00,0x0c,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x06, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x00,0x00,0x00,0x00,0x24,0x42,0xff,0xe0, ++0x03,0xe0,0x00,0x08,0xad,0x82,0x00,0xd0,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c, ++0x24,0x42,0xff,0xe8,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x29,0x3c,0x24,0x42,0x00,0x01,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c, ++0x24,0x42,0x00,0x02,0x10,0xa0,0xff,0xf9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xec,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xe9, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c,0x24,0x42,0xff,0xd0, ++0x10,0xa0,0xff,0xf1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xeb, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xe6,0x24,0x02,0x00,0x03, ++0x14,0xa2,0xff,0xe1,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c, ++0x24,0x42,0xff,0xf8,0x2d,0x42,0x00,0x24,0x14,0x40,0x00,0x0e,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xe1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xdb, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xd6,0x24,0x02,0x00,0x03, ++0x10,0xa2,0xff,0xf1,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c, ++0x24,0x42,0xff,0xf0,0x10,0xa0,0xff,0xd1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xcc,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xf7,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xd7,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x39, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x24,0x10,0x40,0xff,0xe5,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xc2,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x14,0xa2,0xff,0xca, ++0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x5e,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x29, ++0x10,0x40,0xff,0xdb,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x49,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x24,0x14,0x40,0x00,0x0e,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xb6, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xb0,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xab,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xc6, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c,0x24,0x42,0xff,0xfa, ++0x10,0xa0,0xff,0xa9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xa1, ++0x24,0x02,0x00,0x02,0x14,0xa2,0xff,0x94,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x5e, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x24,0x10,0x40,0xff,0xe8,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x9a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x95, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x90,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x51, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2c,0x14,0x40,0xff,0xcd,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x91,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x8b, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x86,0x00,0x00,0x00,0x00, ++0x08,0x00,0x29,0x5e,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0x87,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x81,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x7c,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0x97,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x29,0x3c,0x24,0x42,0xff,0xfc,0x2d,0x42,0x00,0x24, ++0x14,0x40,0xff,0xa4,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x54,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x24,0x14,0x40,0xff,0x9f,0x00,0x00,0x00,0x00,0x08,0x00,0x29,0x2e, ++0x00,0x00,0x00,0x00,0x91,0x86,0x00,0x00,0x91,0x83,0x00,0xd4,0x25,0x8d,0x00,0x5c, ++0x30,0xc4,0x00,0xff,0x00,0x04,0x10,0x40,0x00,0x44,0x10,0x21,0x00,0x04,0x48,0x80, ++0x01,0x82,0x58,0x21,0x01,0x89,0x40,0x21,0x25,0x78,0x00,0x08,0x10,0x60,0x00,0x36, ++0x25,0x0e,0x00,0x60,0x10,0xa0,0x00,0x25,0x00,0x00,0x00,0x00,0x91,0x82,0x00,0xdd, ++0x00,0x00,0x00,0x00,0x14,0x40,0x00,0x1e,0x00,0x00,0x00,0x00,0x27,0x87,0x87,0x78, ++0x01,0x27,0x10,0x21,0x8c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0xad,0x03,0x00,0x60, ++0x91,0x62,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x40,0x30,0x21,0xa1,0x82,0x00,0x00, ++0x30,0xc2,0x00,0xff,0x00,0x02,0x10,0x80,0x00,0x47,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x03,0x18,0x42,0xad,0xa3,0x00,0x00,0x91,0x84,0x00,0x00, ++0x8d,0xc5,0x00,0x00,0x00,0x04,0x20,0x80,0x00,0x87,0x10,0x21,0x8c,0x43,0x00,0x00, ++0x00,0x05,0x28,0x40,0x00,0x8c,0x20,0x21,0x00,0x03,0x1a,0x80,0x00,0xa3,0x10,0x2b, ++0x00,0x62,0x28,0x0a,0xac,0x85,0x00,0x60,0x03,0xe0,0x00,0x08,0xa1,0x80,0x00,0xd4, ++0x27,0x87,0x87,0x78,0x08,0x00,0x29,0xf0,0xa1,0x80,0x00,0xdd,0x27,0x82,0x87,0xe8, ++0x8d,0x83,0x00,0xd8,0x00,0x82,0x10,0x21,0x90,0x44,0x00,0x00,0x24,0x63,0x00,0x01, ++0x00,0x64,0x20,0x2b,0x14,0x80,0xff,0x33,0xad,0x83,0x00,0xd8,0x8d,0x02,0x00,0x60, ++0xa1,0x80,0x00,0xd4,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x03,0xe0,0x00,0x08,0xad,0x82,0x00,0x5c,0x10,0xe0,0x00,0x1d,0x24,0x83,0xff,0xfc, ++0x2c,0x62,0x00,0x18,0x10,0x40,0x00,0xe4,0x00,0x03,0x10,0x80,0x3c,0x03,0x80,0x01, ++0x24,0x63,0x09,0x9c,0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2c,0x14,0x40,0x00,0x65, ++0x00,0x00,0x00,0x00,0x10,0xa0,0x00,0x60,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0x00,0x5a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x08, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x51,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x00,0x00,0x00,0x00,0x24,0x42,0xff,0xe0,0xad,0x82,0x00,0xd0, ++0x8d,0xe3,0x00,0x00,0x8d,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x21, ++0xad,0xa2,0x00,0x00,0xad,0xe0,0x00,0x00,0x8d,0xa3,0x00,0x00,0x8d,0xc4,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x83,0x10,0x2a,0x10,0x40,0x00,0x22,0x00,0x00,0x00,0x00, ++0x93,0x05,0x00,0x01,0x91,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x45,0x00,0x05, ++0x24,0x02,0x00,0x01,0xa1,0x85,0x00,0x00,0xa1,0x82,0x00,0xd4,0x03,0xe0,0x00,0x08, ++0xad,0x80,0x00,0xd8,0x91,0x82,0x00,0xdd,0x24,0x03,0x00,0x01,0x10,0x43,0x00,0x05, ++0x00,0x00,0x00,0x00,0xa1,0x83,0x00,0xd4,0xad,0x80,0x00,0xd8,0x03,0xe0,0x00,0x08, ++0xa1,0x83,0x00,0xdd,0x00,0x04,0x17,0xc2,0x00,0x82,0x10,0x21,0x00,0x02,0x10,0x43, ++0xad,0xa2,0x00,0x00,0x91,0x83,0x00,0x00,0x27,0x82,0x87,0x78,0x8d,0xc5,0x00,0x00, ++0x00,0x03,0x18,0x80,0x00,0x62,0x18,0x21,0x8c,0x64,0x00,0x00,0x00,0x05,0x28,0x40, ++0x00,0x04,0x1a,0x80,0x00,0xa3,0x10,0x2b,0x00,0x62,0x28,0x0a,0x08,0x00,0x2a,0x02, ++0xad,0xc5,0x00,0x00,0x97,0x82,0x94,0x5c,0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x2a, ++0x10,0x40,0xfe,0xdc,0x00,0x00,0x00,0x00,0x91,0x82,0x00,0xdd,0x00,0x00,0x00,0x00, ++0x14,0x40,0x00,0x15,0x00,0x00,0x00,0x00,0x91,0x83,0x00,0x00,0x27,0x82,0x87,0x78, ++0x00,0x03,0x18,0x80,0x00,0x62,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x6c,0x18,0x21, ++0xac,0x64,0x00,0x60,0x93,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x10,0x80, ++0x01,0x82,0x10,0x21,0x24,0x4e,0x00,0x60,0xa1,0x85,0x00,0x00,0x8d,0xc2,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x02,0x1f,0xc2,0x00,0x43,0x10,0x21,0x00,0x02,0x10,0x43, ++0x03,0xe0,0x00,0x08,0xad,0xa2,0x00,0x00,0x08,0x00,0x2a,0x77,0xa1,0x80,0x00,0xdd, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33,0x24,0x42,0xff,0xe8,0x8d,0x82,0x00,0xd0, ++0x08,0x00,0x2a,0x33,0x24,0x42,0x00,0x01,0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33, ++0x24,0x42,0x00,0x02,0x10,0xa0,0xff,0xf9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0xa3,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xa0, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33,0x24,0x42,0xff,0xd0, ++0x10,0xa0,0xff,0xf1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xeb, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x99,0x24,0x02,0x00,0x03, ++0x14,0xa2,0xff,0xe3,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33, ++0x24,0x42,0xff,0xf8,0x2d,0x42,0x00,0x24,0x14,0x40,0x00,0x0e,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xe1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xdb, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x89,0x24,0x02,0x00,0x03, ++0x10,0xa2,0xff,0xf1,0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33, ++0x24,0x42,0xff,0xf0,0x10,0xa0,0xff,0xd1,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01, ++0x10,0xa2,0xff,0x7f,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0xf7,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xd7,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x30, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x24,0x10,0x40,0xff,0xe5,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0xc2,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x14,0xa2,0xff,0xca, ++0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x9e,0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x29, ++0x10,0x40,0xff,0xdb,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x89,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x24,0x14,0x40,0x00,0x0e,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0xb6, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0xb0,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x5e,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0xc6, ++0x00,0x00,0x00,0x00,0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33,0x24,0x42,0xff,0xfa, ++0x10,0xa0,0xff,0xa9,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x54, ++0x24,0x02,0x00,0x02,0x14,0xa2,0xff,0x4b,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x9e, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x24,0x10,0x40,0xff,0xe8,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x9a,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x48, ++0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x92,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x91, ++0x00,0x00,0x00,0x00,0x2d,0x42,0x00,0x2c,0x14,0x40,0xff,0xcd,0x00,0x00,0x00,0x00, ++0x10,0xa0,0xff,0x91,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x8b, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x10,0xa2,0xff,0x39,0x00,0x00,0x00,0x00, ++0x08,0x00,0x2a,0x9e,0x00,0x00,0x00,0x00,0x10,0xa0,0xff,0x87,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0x10,0xa2,0xff,0x81,0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02, ++0x10,0xa2,0xff,0x2f,0x24,0x02,0x00,0x03,0x14,0xa2,0xff,0x97,0x00,0x00,0x00,0x00, ++0x8d,0x82,0x00,0xd0,0x08,0x00,0x2a,0x33,0x24,0x42,0xff,0xfc,0x2d,0x42,0x00,0x24, ++0x14,0x40,0xff,0xa4,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x94,0x00,0x00,0x00,0x00, ++0x2d,0x42,0x00,0x24,0x14,0x40,0xff,0x9f,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x25, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe8,0x3c,0x02,0xb0,0x03,0xaf,0xbf,0x00,0x14, ++0xaf,0xb0,0x00,0x10,0x34,0x42,0x01,0x18,0x3c,0x03,0xb0,0x03,0x8c,0x50,0x00,0x00, ++0x34,0x63,0x01,0x2c,0x90,0x62,0x00,0x00,0x32,0x05,0x00,0x01,0xa3,0x82,0x80,0x10, ++0x14,0xa0,0x00,0x14,0x30,0x44,0x00,0xff,0x32,0x02,0x01,0x00,0x14,0x40,0x00,0x09, ++0x00,0x00,0x00,0x00,0x32,0x02,0x08,0x00,0x10,0x40,0x00,0x02,0x24,0x02,0x00,0x01, ++0xa3,0x82,0xc5,0x58,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x0c,0x00,0x0b,0x3e,0x00,0x00,0x00,0x00,0x26,0x02,0xff,0x00, ++0xa3,0x80,0xc5,0x58,0x3c,0x01,0xb0,0x03,0xac,0x22,0x01,0x18,0x08,0x00,0x2b,0x26, ++0x32,0x02,0x08,0x00,0x0c,0x00,0x28,0xb0,0x00,0x00,0x00,0x00,0x26,0x02,0xff,0xff, ++0x3c,0x01,0xb0,0x03,0xac,0x22,0x01,0x18,0x08,0x00,0x2b,0x23,0x32,0x02,0x01,0x00, ++0x27,0xbd,0xff,0xe0,0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xd0,0xaf,0xbf,0x00,0x18, ++0x8c,0x43,0x00,0x00,0x3c,0x02,0x00,0x40,0x24,0x07,0x0f,0xff,0x00,0x03,0x33,0x02, ++0x00,0x03,0x2d,0x02,0x00,0x03,0x43,0x02,0x30,0x69,0x0f,0xff,0x00,0x62,0x18,0x24, ++0x30,0xa5,0x00,0x03,0x30,0xc6,0x00,0xff,0x10,0x60,0x00,0x08,0x31,0x08,0x00,0xff, ++0x01,0x00,0x30,0x21,0x0c,0x00,0x2b,0xe7,0xaf,0xa9,0x00,0x10,0x8f,0xbf,0x00,0x18, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x2c,0x39, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0xd4,0x08,0x00,0x2b,0x4f, ++0xac,0x62,0x00,0x00,0x27,0xbd,0xff,0xc0,0xaf,0xb6,0x00,0x30,0xaf,0xb3,0x00,0x24, ++0xaf,0xb1,0x00,0x1c,0xaf,0xb0,0x00,0x18,0xaf,0xbf,0x00,0x3c,0xaf,0xbe,0x00,0x38, ++0xaf,0xb7,0x00,0x34,0xaf,0xb5,0x00,0x2c,0xaf,0xb4,0x00,0x28,0xaf,0xb2,0x00,0x20, ++0x0c,0x00,0x1f,0x11,0x00,0x80,0x80,0x21,0x00,0x00,0xb0,0x21,0x00,0x00,0x88,0x21, ++0x10,0x40,0x00,0x12,0x00,0x00,0x98,0x21,0x3c,0x02,0xb0,0x03,0x3c,0x03,0xb0,0x03, ++0x3c,0x04,0xb0,0x03,0x24,0x05,0x00,0x01,0x34,0x42,0x00,0xbc,0x34,0x63,0x00,0xbb, ++0x34,0x84,0x00,0xba,0xa4,0x40,0x00,0x00,0xa0,0x65,0x00,0x00,0xa0,0x85,0x00,0x00, ++0x7b,0xbe,0x01,0xfc,0x7b,0xb6,0x01,0xbc,0x7b,0xb4,0x01,0x7c,0x7b,0xb2,0x01,0x3c, ++0x7b,0xb0,0x00,0xfc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x40,0x3c,0x02,0xb0,0x03, ++0x34,0x42,0x01,0x47,0x90,0x44,0x00,0x00,0x00,0x10,0x1a,0x02,0x3c,0x15,0xfd,0xff, ++0x30,0x84,0x00,0xff,0xa0,0x50,0x00,0x00,0x30,0x74,0x00,0x0f,0xaf,0xa4,0x00,0x10, ++0x00,0x00,0x90,0x21,0x3c,0x17,0x02,0x00,0x36,0xb5,0xff,0xff,0x3c,0x1e,0xb0,0x03, ++0x0c,0x00,0x0e,0x71,0x24,0x04,0x00,0x78,0x00,0x57,0x10,0x25,0x00,0x40,0x28,0x21, ++0x0c,0x00,0x0e,0x64,0x24,0x04,0x00,0x78,0x00,0x00,0x80,0x21,0x0c,0x00,0x2d,0x0a, ++0x00,0x00,0x00,0x00,0x26,0x03,0x00,0x01,0x30,0x70,0x00,0xff,0x10,0x40,0x00,0x47, ++0x2e,0x03,0x00,0x02,0x14,0x60,0xff,0xf9,0x00,0x00,0x00,0x00,0x0c,0x00,0x0e,0x71, ++0x24,0x04,0x00,0x78,0x00,0x55,0x10,0x24,0x00,0x40,0x28,0x21,0x0c,0x00,0x0e,0x64, ++0x24,0x04,0x00,0x78,0x24,0x02,0x00,0x01,0x12,0x82,0x00,0x38,0x24,0x04,0x00,0xe0, ++0x12,0x80,0x00,0x36,0x24,0x04,0x00,0xe4,0x32,0x22,0x00,0x60,0x32,0x23,0x0c,0x00, ++0x00,0x03,0x1a,0x02,0x3c,0x05,0x00,0x60,0x00,0x02,0x11,0x42,0x02,0x25,0x20,0x24, ++0x00,0x43,0x10,0x25,0x3c,0x03,0x04,0x00,0x02,0x23,0x28,0x24,0x00,0x04,0x24,0x42, ++0x00,0x44,0x10,0x25,0x00,0x05,0x2d,0x02,0x00,0x45,0x88,0x25,0x12,0x20,0x00,0x05, ++0x26,0x42,0x00,0x01,0x26,0xc2,0x00,0x01,0x30,0x56,0x00,0xff,0x02,0x71,0x98,0x21, ++0x26,0x42,0x00,0x01,0x02,0x5e,0x20,0x21,0x30,0x52,0x00,0xff,0x2e,0x43,0x00,0x05, ++0xa0,0x91,0x00,0xd8,0x14,0x60,0xff,0xce,0x3c,0x02,0xb0,0x03,0x8f,0xa5,0x00,0x10, ++0x34,0x42,0x01,0x47,0xa0,0x45,0x00,0x00,0x12,0x60,0x00,0x0e,0x3c,0x02,0xb0,0x03, ++0x12,0xc0,0x00,0x0d,0x34,0x42,0x00,0xbc,0x00,0x13,0x10,0x40,0x00,0x53,0x10,0x21, ++0x00,0x02,0x10,0xc0,0x00,0x53,0x10,0x21,0x00,0x02,0x98,0x80,0x02,0x76,0x00,0x1b, ++0x16,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d,0x00,0x00,0x98,0x12, ++0x3c,0x02,0xb0,0x03,0x34,0x42,0x00,0xbc,0x3c,0x03,0xb0,0x03,0x3c,0x04,0xb0,0x03, ++0xa4,0x53,0x00,0x00,0x34,0x63,0x00,0xbb,0x34,0x84,0x00,0xba,0x24,0x02,0x00,0x01, ++0xa0,0x60,0x00,0x00,0x08,0x00,0x2b,0x74,0xa0,0x82,0x00,0x00,0x0c,0x00,0x0e,0x71, ++0x00,0x00,0x00,0x00,0x08,0x00,0x2b,0xa2,0x00,0x40,0x88,0x21,0x3c,0x03,0xb0,0x03, ++0x34,0x63,0x00,0xbc,0x3c,0x04,0xb0,0x03,0x3c,0x05,0xb0,0x03,0xa4,0x60,0x00,0x00, ++0x34,0x84,0x00,0xbb,0x34,0xa5,0x00,0xba,0x24,0x02,0x00,0x02,0x24,0x03,0x00,0x01, ++0xa0,0x82,0x00,0x00,0x08,0x00,0x2b,0x74,0xa0,0xa3,0x00,0x00,0x27,0xbd,0xff,0xd8, ++0xaf,0xb0,0x00,0x10,0x30,0xd0,0x00,0xff,0x2e,0x02,0x00,0x2e,0xaf,0xb2,0x00,0x18, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x20,0xaf,0xb3,0x00,0x1c,0x30,0xb1,0x00,0xff, ++0x14,0x40,0x00,0x06,0x00,0x80,0x90,0x21,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x2e,0x13,0x00,0x10, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x1b,0x6e,0x24,0x06,0x01,0x07,0x12,0x60,0x00,0x38, ++0x02,0x00,0x30,0x21,0x8f,0xa2,0x00,0x38,0x30,0xc3,0x00,0x3f,0x3c,0x04,0xb0,0x09, ++0x00,0x02,0x14,0x00,0x00,0x43,0x30,0x25,0x34,0x84,0x01,0x60,0x90,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfd,0x24,0x02,0x00,0x01,0x12,0x22,0x00,0x2a, ++0x2a,0x22,0x00,0x02,0x14,0x40,0x00,0x24,0x24,0x02,0x00,0x02,0x12,0x22,0x00,0x20, ++0x24,0x02,0x00,0x03,0x12,0x22,0x00,0x19,0x00,0x00,0x00,0x00,0x16,0x60,0xff,0xe2, ++0x24,0x02,0x00,0x01,0x12,0x22,0x00,0x13,0x2a,0x22,0x00,0x02,0x14,0x40,0x00,0x0d, ++0x24,0x02,0x00,0x02,0x12,0x22,0x00,0x09,0x24,0x02,0x00,0x03,0x16,0x22,0xff,0xda, ++0x00,0x00,0x00,0x00,0x24,0x04,0x08,0x4c,0x24,0x05,0xff,0xff,0x0c,0x00,0x1b,0x29, ++0x3c,0x06,0x0c,0xb8,0x08,0x00,0x2b,0xf2,0x00,0x00,0x00,0x00,0x08,0x00,0x2c,0x1a, ++0x24,0x04,0x08,0x48,0x16,0x20,0xff,0xd0,0x00,0x00,0x00,0x00,0x08,0x00,0x2c,0x1a, ++0x24,0x04,0x08,0x40,0x08,0x00,0x2c,0x1a,0x24,0x04,0x08,0x44,0x24,0x04,0x08,0x4c, ++0x0c,0x00,0x1b,0x29,0x24,0x05,0xff,0xff,0x08,0x00,0x2c,0x0f,0x00,0x00,0x00,0x00, ++0x08,0x00,0x2c,0x28,0x24,0x04,0x08,0x48,0x16,0x20,0xff,0xe0,0x00,0x00,0x00,0x00, ++0x08,0x00,0x2c,0x28,0x24,0x04,0x08,0x40,0x08,0x00,0x2c,0x28,0x24,0x04,0x08,0x44, ++0x02,0x40,0x20,0x21,0x0c,0x00,0x2c,0x75,0x02,0x20,0x28,0x21,0x08,0x00,0x2b,0xfd, ++0x00,0x40,0x30,0x21,0x27,0xbd,0xff,0xd8,0x2c,0xc2,0x00,0x2e,0xaf,0xb3,0x00,0x1c, ++0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x20,0xaf,0xb2,0x00,0x18, ++0x00,0xc0,0x88,0x21,0x30,0xb0,0x00,0xff,0x00,0x80,0x98,0x21,0x14,0x40,0x00,0x07, ++0x00,0x00,0x18,0x21,0x8f,0xbf,0x00,0x20,0x7b,0xb2,0x00,0xfc,0x7b,0xb0,0x00,0xbc, ++0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x28,0x2e,0x32,0x00,0x10, ++0x24,0x05,0x00,0x14,0x0c,0x00,0x1b,0x6e,0x24,0x06,0x01,0x07,0x12,0x40,0x00,0x1f, ++0x02,0x20,0x10,0x21,0x30,0x45,0x00,0x3f,0x0c,0x00,0x2c,0xb2,0x02,0x00,0x20,0x21, ++0x16,0x40,0x00,0x0a,0x00,0x40,0x88,0x21,0x24,0x02,0x00,0x01,0x12,0x02,0x00,0x15, ++0x2a,0x02,0x00,0x02,0x14,0x40,0x00,0x0f,0x24,0x02,0x00,0x02,0x12,0x02,0x00,0x0b, ++0x24,0x02,0x00,0x03,0x12,0x02,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x00,0x2c,0x45, ++0x02,0x20,0x18,0x21,0x24,0x04,0x08,0x4c,0x24,0x05,0xff,0xff,0x0c,0x00,0x1b,0x29, ++0x3c,0x06,0x0c,0xb8,0x08,0x00,0x2c,0x45,0x02,0x20,0x18,0x21,0x08,0x00,0x2c,0x62, ++0x24,0x04,0x08,0x48,0x16,0x00,0xff,0xf5,0x00,0x00,0x00,0x00,0x08,0x00,0x2c,0x62, ++0x24,0x04,0x08,0x40,0x08,0x00,0x2c,0x62,0x24,0x04,0x08,0x44,0x02,0x60,0x20,0x21, ++0x02,0x20,0x30,0x21,0x0c,0x00,0x2c,0x75,0x02,0x00,0x28,0x21,0x08,0x00,0x2c,0x52, ++0x30,0x45,0x00,0x3f,0x27,0xbd,0xff,0xe8,0x2c,0xc2,0x00,0x1f,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x14,0x00,0xc0,0x80,0x21,0x14,0x40,0x00,0x1d,0x30,0xa5,0x00,0xff, ++0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x18,0x28,0xa2,0x00,0x02,0x14,0x40,0x00,0x12, ++0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x0e,0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x07, ++0x24,0x04,0x08,0x4c,0x26,0x10,0xff,0xe2,0x02,0x00,0x10,0x21,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x24,0x05,0xff,0xff, ++0x0c,0x00,0x1b,0x29,0x3c,0x06,0x0d,0xf8,0x08,0x00,0x2c,0x86,0x26,0x10,0xff,0xe2, ++0x08,0x00,0x2c,0x8b,0x24,0x04,0x08,0x48,0x14,0xa0,0xff,0xf2,0x24,0x04,0x08,0x40, ++0x08,0x00,0x2c,0x8c,0x24,0x05,0xff,0xff,0x08,0x00,0x2c,0x8b,0x24,0x04,0x08,0x44, ++0x2c,0xc2,0x00,0x10,0x14,0x40,0xff,0xec,0x24,0x02,0x00,0x01,0x10,0xa2,0x00,0x14, ++0x28,0xa2,0x00,0x02,0x14,0x40,0x00,0x0e,0x24,0x02,0x00,0x02,0x10,0xa2,0x00,0x0a, ++0x24,0x02,0x00,0x03,0x10,0xa2,0x00,0x03,0x24,0x04,0x08,0x4c,0x08,0x00,0x2c,0x86, ++0x26,0x10,0xff,0xf1,0x24,0x05,0xff,0xff,0x0c,0x00,0x1b,0x29,0x3c,0x06,0x0d,0xb8, ++0x08,0x00,0x2c,0x86,0x26,0x10,0xff,0xf1,0x08,0x00,0x2c,0xa5,0x24,0x04,0x08,0x48, ++0x14,0xa0,0xff,0xf6,0x24,0x04,0x08,0x40,0x08,0x00,0x2c,0xa6,0x24,0x05,0xff,0xff, ++0x08,0x00,0x2c,0xa5,0x24,0x04,0x08,0x44,0x27,0xbd,0xff,0xe0,0x00,0x80,0x10,0x21, ++0x24,0x04,0x00,0x50,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x18, ++0x00,0xa0,0x88,0x21,0x0c,0x00,0x01,0x31,0x30,0x50,0x00,0xff,0x24,0x03,0x00,0x01, ++0x12,0x03,0x00,0x3e,0x02,0x20,0x30,0x21,0x2a,0x02,0x00,0x02,0x14,0x40,0x00,0x2a, ++0x00,0x00,0x00,0x00,0x24,0x02,0x00,0x02,0x12,0x02,0x00,0x19,0x24,0x04,0x08,0x34, ++0x24,0x02,0x00,0x03,0x12,0x02,0x00,0x05,0x24,0x04,0x08,0x3c,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x0c,0x00,0x1b,0x29, ++0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x3c,0x3c,0x05,0x80,0x00,0x0c,0x00,0x1b,0x29, ++0x00,0x00,0x30,0x21,0x3c,0x05,0x80,0x00,0x24,0x06,0x00,0x01,0x0c,0x00,0x1b,0x29, ++0x24,0x04,0x08,0x3c,0x0c,0x00,0x01,0x31,0x24,0x04,0x00,0x28,0x24,0x04,0x08,0xac, ++0x0c,0x00,0x1b,0x0b,0x24,0x05,0x0f,0xff,0x08,0x00,0x2c,0xc7,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x1b,0x29,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x34,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x1b,0x29,0x00,0x00,0x30,0x21,0x3c,0x05,0x80,0x00,0x24,0x06,0x00,0x01, ++0x0c,0x00,0x1b,0x29,0x24,0x04,0x08,0x34,0x0c,0x00,0x01,0x31,0x24,0x04,0x00,0x28, ++0x08,0x00,0x2c,0xd8,0x24,0x04,0x08,0xa8,0x16,0x00,0xff,0xdc,0x02,0x20,0x30,0x21, ++0x24,0x04,0x08,0x24,0x0c,0x00,0x1b,0x29,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x24, ++0x3c,0x05,0x80,0x00,0x0c,0x00,0x1b,0x29,0x00,0x00,0x30,0x21,0x3c,0x05,0x80,0x00, ++0x24,0x06,0x00,0x01,0x0c,0x00,0x1b,0x29,0x24,0x04,0x08,0x24,0x0c,0x00,0x01,0x31, ++0x24,0x04,0x00,0x28,0x08,0x00,0x2c,0xd8,0x24,0x04,0x08,0xa0,0x24,0x04,0x08,0x2c, ++0x0c,0x00,0x1b,0x29,0x3c,0x05,0x3f,0x00,0x24,0x04,0x08,0x2c,0x3c,0x05,0x80,0x00, ++0x0c,0x00,0x1b,0x29,0x00,0x00,0x30,0x21,0x3c,0x05,0x80,0x00,0x24,0x06,0x00,0x01, ++0x0c,0x00,0x1b,0x29,0x24,0x04,0x08,0x2c,0x0c,0x00,0x01,0x31,0x24,0x04,0x00,0x28, ++0x08,0x00,0x2c,0xd8,0x24,0x04,0x08,0xa4,0x3c,0x05,0x00,0x14,0x3c,0x02,0xb0,0x05, ++0x34,0x42,0x04,0x20,0x3c,0x06,0xc0,0x00,0x3c,0x03,0xb0,0x05,0x3c,0x04,0xb0,0x05, ++0x34,0xa5,0x17,0x09,0xac,0x45,0x00,0x00,0x34,0xc6,0x05,0x07,0x34,0x63,0x04,0x24, ++0x34,0x84,0x02,0x28,0x3c,0x07,0xb0,0x05,0x24,0x02,0x00,0x20,0xac,0x66,0x00,0x00, ++0x34,0xe7,0x04,0x50,0xa0,0x82,0x00,0x00,0x90,0xe2,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x03,0x10,0x40,0xff,0xfc,0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe8,0xaf,0xbf,0x00,0x10,0x0c,0x00,0x2d,0xcf, ++0x00,0x00,0x00,0x00,0x0c,0x00,0x2d,0xd1,0x00,0x00,0x00,0x00,0x0c,0x00,0x2d,0xf8, ++0x00,0x00,0x00,0x00,0x3c,0x04,0xb0,0x05,0x34,0x84,0x00,0x04,0x0c,0x00,0x2d,0xd8, ++0x34,0x05,0x9c,0x40,0x8f,0xbf,0x00,0x10,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x24,0x02,0x00,0x01,0x03,0xe0,0x00,0x08, ++0x24,0x02,0x00,0x01,0x97,0x82,0x88,0x10,0x00,0x00,0x00,0x00,0x2c,0x43,0x00,0x64, ++0x24,0x42,0x00,0x01,0xa7,0x82,0x88,0x10,0x14,0x60,0x00,0x28,0x00,0x80,0x30,0x21, ++0x8c,0x82,0x00,0x00,0x3c,0x03,0x20,0x00,0xa7,0x80,0x88,0x10,0x00,0x43,0x10,0x24, ++0x10,0x40,0x00,0x22,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x00,0x3c,0x03,0x80,0x00, ++0x00,0x43,0x10,0x25,0x97,0x83,0x88,0x04,0xac,0x82,0x00,0x00,0x8c,0x85,0x00,0x00, ++0x24,0x63,0x00,0x01,0x3c,0x02,0x40,0x64,0x34,0x42,0x64,0x00,0x00,0x03,0x24,0x00, ++0x00,0xa2,0x28,0x25,0x00,0x04,0x24,0x03,0x24,0x02,0x00,0x64,0xac,0xc5,0x00,0x00, ++0xa7,0x83,0x88,0x04,0x10,0x82,0x00,0x2b,0x00,0x00,0x00,0x00,0x87,0x82,0x88,0x06, ++0x24,0x03,0x00,0x3c,0x10,0x43,0x00,0x21,0x00,0x00,0x00,0x00,0x87,0x82,0x88,0x08, ++0x00,0x00,0x00,0x00,0x10,0x43,0x00,0x17,0x00,0x00,0x00,0x00,0x87,0x83,0x88,0x0a, ++0x24,0x02,0x00,0x18,0x10,0x62,0x00,0x0d,0x00,0x00,0x00,0x00,0x87,0x83,0x88,0x0c, ++0x24,0x02,0x01,0x6d,0x10,0x62,0x00,0x03,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x97,0x82,0x88,0x0e,0xa7,0x80,0x88,0x0c,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x88,0x0e,0x08,0x00,0x2d,0x67,0x00,0x00,0x00,0x00,0x97,0x82,0x88,0x0c, ++0xa7,0x80,0x88,0x0a,0x24,0x42,0x00,0x01,0xa7,0x82,0x88,0x0c,0x08,0x00,0x2d,0x63, ++0x00,0x00,0x00,0x00,0x97,0x82,0x88,0x0a,0xa7,0x80,0x88,0x08,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x88,0x0a,0x08,0x00,0x2d,0x5f,0x00,0x00,0x00,0x00,0x97,0x82,0x88,0x08, ++0xa7,0x80,0x88,0x06,0x24,0x42,0x00,0x01,0xa7,0x82,0x88,0x08,0x08,0x00,0x2d,0x5b, ++0x00,0x00,0x00,0x00,0x97,0x82,0x88,0x06,0xa7,0x80,0x88,0x04,0x24,0x42,0x00,0x01, ++0xa7,0x82,0x88,0x06,0x08,0x00,0x2d,0x57,0x00,0x00,0x00,0x00,0x00,0x04,0x24,0x00, ++0x3c,0x03,0xb0,0x07,0x00,0x04,0x24,0x03,0x34,0x63,0x00,0x28,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x40,0x10,0x40,0xff,0xfc,0x00,0x00,0x00,0x00, ++0x3c,0x01,0xb0,0x07,0xa0,0x24,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x10,0x21, ++0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x28,0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x63,0x00,0x01,0x10,0x60,0x00,0x06,0x24,0x02,0xff,0xff,0x3c,0x02,0xb0,0x07, ++0x90,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x16,0x00,0x00,0x02,0x16,0x03, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x27,0xbd,0xff,0xe0,0xaf,0xb0,0x00,0x10, ++0x3c,0x10,0x04,0xc4,0x00,0x04,0x11,0x00,0x36,0x10,0xb4,0x00,0x02,0x02,0x00,0x1b, ++0xaf,0xb1,0x00,0x14,0x3c,0x11,0xb0,0x07,0x36,0x31,0x00,0x18,0x24,0x04,0x00,0x0a, ++0xaf,0xbf,0x00,0x18,0x14,0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0d, ++0x00,0x00,0x80,0x12,0x0c,0x00,0x2e,0x24,0x00,0x00,0x00,0x00,0x92,0x22,0x00,0x00, ++0x24,0x03,0xff,0x80,0x24,0x04,0x00,0x0a,0x00,0x43,0x10,0x25,0x0c,0x00,0x2e,0x24, ++0xa2,0x22,0x00,0x00,0x24,0x04,0x00,0x0a,0x3c,0x01,0xb0,0x07,0xa0,0x30,0x00,0x00, ++0x0c,0x00,0x2e,0x24,0x00,0x10,0x82,0x03,0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x08, ++0xa0,0x50,0x00,0x00,0x0c,0x00,0x2e,0x24,0x24,0x04,0x00,0x0a,0x92,0x22,0x00,0x00, ++0x8f,0xbf,0x00,0x18,0x8f,0xb0,0x00,0x10,0x30,0x42,0x00,0x7f,0xa2,0x22,0x00,0x00, ++0x8f,0xb1,0x00,0x14,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x58,0x8c,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x34,0x42,0x07,0xa4,0x03,0xe0,0x00,0x08,0xac,0x62,0x00,0x00, ++0x27,0xbd,0xff,0xf8,0x00,0x80,0x38,0x21,0x00,0xa0,0x30,0x21,0x00,0x00,0x18,0x21, ++0x00,0x63,0x00,0x18,0x00,0x00,0x10,0x12,0x00,0xc2,0x10,0x2b,0x14,0x40,0x00,0x05, ++0x00,0x00,0x00,0x00,0x24,0x63,0x00,0x01,0x2c,0x62,0x01,0x00,0x14,0x40,0xff,0xf9, ++0x00,0x63,0x00,0x18,0x24,0x63,0xff,0xff,0x00,0x63,0x00,0x18,0x30,0x63,0x00,0xff, ++0x8c,0xe4,0x00,0x00,0x00,0x03,0x2a,0x00,0x00,0x03,0x1c,0x00,0x00,0x00,0x10,0x12, ++0x00,0xc2,0x10,0x23,0x30,0x42,0x00,0xff,0x00,0x45,0x10,0x21,0x00,0x43,0x10,0x21, ++0x00,0x82,0x20,0x25,0xac,0xe4,0x00,0x00,0x8c,0xe2,0x00,0x00,0x3c,0x03,0x40,0x00, ++0x00,0x43,0x10,0x25,0xac,0xe2,0x00,0x00,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x08, ++0x27,0xbd,0xff,0xe0,0xaf,0xbf,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0x3c,0x04,0xb0,0x03,0x8c,0x82,0x00,0x00,0x3c,0x06,0xb0,0x03,0x34,0xc6,0x00,0x08, ++0x34,0x42,0x40,0x00,0xac,0x82,0x00,0x00,0x8c,0x83,0x00,0x00,0x24,0x02,0xcf,0xff, ++0x3c,0x11,0xb0,0x07,0x00,0x62,0x18,0x24,0xac,0x83,0x00,0x00,0x8c,0xc5,0x00,0x00, ++0x3c,0x02,0x00,0xff,0x24,0x04,0x00,0x0a,0x00,0xa2,0x28,0x25,0xac,0xc5,0x00,0x00, ++0x0c,0x00,0x2e,0x24,0x36,0x31,0x00,0x18,0x24,0x02,0xff,0x83,0x3c,0x04,0x00,0x01, ++0xa2,0x22,0x00,0x00,0x0c,0x00,0x2d,0xa2,0x34,0x84,0xc2,0x00,0x0c,0x00,0x2e,0x24, ++0x24,0x04,0x00,0x0a,0x24,0x02,0x00,0x03,0xa2,0x22,0x00,0x00,0x24,0x04,0x00,0x0a, ++0x0c,0x00,0x2e,0x24,0x3c,0x10,0xb0,0x07,0x36,0x10,0x00,0x10,0x24,0x02,0x00,0x06, ++0xa2,0x02,0x00,0x00,0x0c,0x00,0x2e,0x24,0x24,0x04,0x00,0x0a,0xa2,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x18,0x7b,0xb0,0x00,0xbc,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x10,0x80,0x00,0x05,0x00,0x00,0x18,0x21,0x24,0x63,0x00,0x01,0x00,0x64,0x10,0x2b, ++0x14,0x40,0xff,0xfd,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x27,0xbd,0xff,0xc0,0xaf,0xb5,0x00,0x34,0xaf,0xb2,0x00,0x28,0xaf,0xb0,0x00,0x20, ++0xaf,0xbf,0x00,0x38,0xaf,0xb4,0x00,0x30,0xaf,0xb3,0x00,0x2c,0xaf,0xb1,0x00,0x24, ++0xaf,0xa5,0x00,0x44,0x90,0xa7,0x00,0x00,0x00,0x80,0xa8,0x21,0x00,0xc0,0x90,0x21, ++0x00,0x07,0x1e,0x00,0x10,0x60,0x00,0x0f,0x00,0x80,0x80,0x21,0x00,0x03,0x1e,0x03, ++0x24,0x02,0x00,0x25,0x10,0x62,0x00,0x13,0x00,0x00,0x88,0x21,0xa2,0x07,0x00,0x00, ++0x8f,0xa5,0x00,0x44,0x26,0x10,0x00,0x01,0x24,0xa5,0x00,0x01,0xaf,0xa5,0x00,0x44, ++0x90,0xa7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x1e,0x00,0x14,0x60,0xff,0xf3, ++0x00,0x00,0x00,0x00,0x02,0x15,0x10,0x23,0xa2,0x00,0x00,0x00,0x8f,0xbf,0x00,0x38, ++0x7b,0xb4,0x01,0xbc,0x7b,0xb2,0x01,0x7c,0x7b,0xb0,0x01,0x3c,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x40,0x24,0xa5,0x00,0x01,0xaf,0xa5,0x00,0x44,0x80,0xa3,0x00,0x00, ++0x00,0x00,0x00,0x00,0x24,0x63,0xff,0xe0,0x2c,0x62,0x00,0x11,0x10,0x40,0x00,0x11, ++0x00,0xa0,0x38,0x21,0x00,0x03,0x10,0x80,0x3c,0x03,0x80,0x01,0x24,0x63,0x09,0xfc, ++0x00,0x43,0x10,0x21,0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08, ++0x00,0x00,0x00,0x00,0x08,0x00,0x2e,0x51,0x36,0x31,0x00,0x10,0x08,0x00,0x2e,0x51, ++0x36,0x31,0x00,0x08,0x08,0x00,0x2e,0x51,0x36,0x31,0x00,0x20,0x08,0x00,0x2e,0x51, ++0x36,0x31,0x00,0x04,0x90,0xe4,0x00,0x00,0x3c,0x02,0x80,0x01,0x24,0x42,0x02,0x1c, ++0x00,0x44,0x10,0x21,0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x04, ++0x14,0x60,0x00,0xfd,0x24,0x14,0xff,0xff,0x00,0x04,0x16,0x00,0x00,0x02,0x16,0x03, ++0x24,0x03,0x00,0x2a,0x10,0x43,0x00,0xee,0x26,0x42,0x00,0x03,0x80,0xa3,0x00,0x00, ++0x24,0x02,0x00,0x2e,0x10,0x62,0x00,0xcc,0x24,0x08,0xff,0xff,0x80,0xa3,0x00,0x00, ++0x24,0x02,0x00,0x68,0x10,0x62,0x00,0xc4,0x24,0x06,0xff,0xff,0x24,0x02,0x00,0x6c, ++0x10,0x62,0x00,0xc1,0x24,0x02,0x00,0x4c,0x10,0x62,0x00,0xbf,0x24,0x02,0x00,0x5a, ++0x10,0x62,0x00,0xbd,0x00,0x00,0x00,0x00,0x80,0xa3,0x00,0x00,0x00,0x00,0x00,0x00, ++0x24,0x63,0xff,0xdb,0x2c,0x62,0x00,0x54,0x10,0x40,0x00,0xaa,0x24,0x09,0x00,0x0a, ++0x00,0x03,0x10,0x80,0x3c,0x03,0x80,0x01,0x24,0x63,0x0a,0x40,0x00,0x43,0x10,0x21, ++0x8c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x00,0x00,0x00, ++0x32,0x22,0x00,0x10,0x14,0x40,0x00,0x09,0x24,0x02,0xff,0xfc,0x26,0x94,0xff,0xff, ++0x1a,0x80,0x00,0x05,0x24,0x02,0x00,0x20,0x26,0x94,0xff,0xff,0xa2,0x02,0x00,0x00, ++0x1e,0x80,0xff,0xfd,0x26,0x10,0x00,0x01,0x24,0x02,0xff,0xfc,0x26,0x44,0x00,0x03, ++0x00,0x82,0x90,0x24,0x92,0x42,0x00,0x03,0x26,0x94,0xff,0xff,0x26,0x52,0x00,0x04, ++0xa2,0x02,0x00,0x00,0x1a,0x80,0x00,0x06,0x26,0x10,0x00,0x01,0x24,0x02,0x00,0x20, ++0x26,0x94,0xff,0xff,0xa2,0x02,0x00,0x00,0x1e,0x80,0xff,0xfd,0x26,0x10,0x00,0x01, ++0x8f,0xa5,0x00,0x44,0x08,0x00,0x2e,0x43,0x24,0xa5,0x00,0x01,0x24,0x02,0x00,0x25, ++0x08,0x00,0x2e,0x40,0xa2,0x02,0x00,0x00,0x36,0x31,0x00,0x40,0x24,0x09,0x00,0x10, ++0x24,0x02,0x00,0x4c,0x10,0xc2,0x00,0x2a,0x24,0x02,0x00,0x6c,0x10,0xc2,0x00,0x05, ++0x24,0x02,0x00,0x5a,0x10,0xc2,0x00,0x1f,0x24,0x02,0x00,0x68,0x10,0xc2,0x00,0x13, ++0x24,0x02,0xff,0xfc,0x24,0x02,0xff,0xfc,0x26,0x43,0x00,0x03,0x00,0x62,0x90,0x24, ++0x32,0x22,0x00,0x02,0x8e,0x47,0x00,0x00,0x00,0x00,0x30,0x21,0x10,0x40,0x00,0x03, ++0x26,0x52,0x00,0x04,0x00,0xe0,0x10,0x21,0x00,0x02,0x37,0xc3,0x02,0x00,0x20,0x21, ++0xaf,0xa9,0x00,0x10,0xaf,0xb4,0x00,0x14,0xaf,0xa8,0x00,0x18,0x0c,0x00,0x2f,0x91, ++0xaf,0xb1,0x00,0x1c,0x08,0x00,0x2e,0xac,0x00,0x40,0x80,0x21,0x26,0x43,0x00,0x03, ++0x00,0x62,0x90,0x24,0x32,0x22,0x00,0x02,0x96,0x47,0x00,0x02,0x00,0x00,0x30,0x21, ++0x10,0x40,0xff,0xf2,0x26,0x52,0x00,0x04,0x00,0x07,0x14,0x00,0x08,0x00,0x2e,0xc6, ++0x00,0x02,0x3c,0x03,0x26,0x42,0x00,0x03,0x24,0x03,0xff,0xfc,0x00,0x43,0x90,0x24, ++0x8e,0x47,0x00,0x00,0x00,0x00,0x30,0x21,0x08,0x00,0x2e,0xc7,0x26,0x52,0x00,0x04, ++0x26,0x42,0x00,0x07,0x24,0x03,0xff,0xf8,0x00,0x43,0x90,0x24,0x8e,0x46,0x00,0x00, ++0x8e,0x47,0x00,0x04,0x08,0x00,0x2e,0xc7,0x26,0x52,0x00,0x08,0x08,0x00,0x2e,0xb4, ++0x36,0x31,0x00,0x02,0x26,0x44,0x00,0x03,0x24,0x02,0xff,0xfc,0x00,0x82,0x90,0x24, ++0x8e,0x44,0x00,0x00,0x02,0x15,0x10,0x23,0x26,0x52,0x00,0x04,0x08,0x00,0x2e,0x42, ++0xac,0x82,0x00,0x00,0x08,0x00,0x2e,0xb4,0x24,0x09,0x00,0x08,0x24,0x02,0xff,0xff, ++0x12,0x82,0x00,0x11,0x00,0x00,0x00,0x00,0x26,0x43,0x00,0x03,0x24,0x02,0xff,0xfc, ++0x00,0x62,0x90,0x24,0x8e,0x47,0x00,0x00,0x02,0x00,0x20,0x21,0x24,0x02,0x00,0x10, ++0x00,0x00,0x30,0x21,0xaf,0xa2,0x00,0x10,0xaf,0xb4,0x00,0x14,0xaf,0xa8,0x00,0x18, ++0x0c,0x00,0x2f,0x91,0xaf,0xb1,0x00,0x1c,0x8f,0xa5,0x00,0x44,0x00,0x40,0x80,0x21, ++0x08,0x00,0x2e,0x42,0x26,0x52,0x00,0x04,0x24,0x14,0x00,0x08,0x08,0x00,0x2e,0xf6, ++0x36,0x31,0x00,0x01,0x26,0x42,0x00,0x03,0x24,0x03,0xff,0xfc,0x00,0x43,0x90,0x24, ++0x8e,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x60,0x00,0x23,0x26,0x52,0x00,0x04, ++0x02,0x60,0x20,0x21,0x0c,0x00,0x30,0x5f,0x01,0x00,0x28,0x21,0x00,0x40,0x20,0x21, ++0x32,0x22,0x00,0x10,0x14,0x40,0x00,0x09,0x00,0x94,0x10,0x2a,0x10,0x40,0x00,0x07, ++0x26,0x94,0xff,0xff,0x24,0x03,0x00,0x20,0x00,0x94,0x10,0x2a,0xa2,0x03,0x00,0x00, ++0x26,0x94,0xff,0xff,0x14,0x40,0xff,0xfc,0x26,0x10,0x00,0x01,0x18,0x80,0x00,0x07, ++0x00,0x80,0x18,0x21,0x92,0x62,0x00,0x00,0x24,0x63,0xff,0xff,0x26,0x73,0x00,0x01, ++0xa2,0x02,0x00,0x00,0x14,0x60,0xff,0xfb,0x26,0x10,0x00,0x01,0x00,0x94,0x10,0x2a, ++0x10,0x40,0xff,0x83,0x26,0x94,0xff,0xff,0x24,0x03,0x00,0x20,0x00,0x94,0x10,0x2a, ++0xa2,0x03,0x00,0x00,0x26,0x94,0xff,0xff,0x14,0x40,0xff,0xfc,0x26,0x10,0x00,0x01, ++0x08,0x00,0x2e,0xac,0x00,0x00,0x00,0x00,0x3c,0x02,0x80,0x01,0x08,0x00,0x2f,0x10, ++0x24,0x53,0x08,0x04,0x24,0x02,0x00,0x25,0xa2,0x02,0x00,0x00,0x8f,0xa5,0x00,0x44, ++0x00,0x00,0x00,0x00,0x80,0xa2,0x00,0x00,0x90,0xa3,0x00,0x00,0x10,0x40,0x00,0x03, ++0x26,0x10,0x00,0x01,0x08,0x00,0x2e,0x40,0xa2,0x03,0x00,0x00,0x24,0xa5,0xff,0xff, ++0x08,0x00,0x2e,0x42,0xaf,0xa5,0x00,0x44,0x80,0xa6,0x00,0x00,0x24,0xa5,0x00,0x01, ++0x08,0x00,0x2e,0x86,0xaf,0xa5,0x00,0x44,0x24,0xa5,0x00,0x01,0xaf,0xa5,0x00,0x44, ++0x90,0xa4,0x00,0x00,0x3c,0x02,0x80,0x01,0x24,0x42,0x02,0x1c,0x00,0x44,0x10,0x21, ++0x90,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x63,0x00,0x04,0x14,0x60,0x00,0x0f, ++0x00,0x04,0x16,0x00,0x00,0x02,0x16,0x03,0x24,0x03,0x00,0x2a,0x10,0x43,0x00,0x04, ++0x26,0x42,0x00,0x03,0x29,0x02,0x00,0x00,0x08,0x00,0x2e,0x7b,0x00,0x02,0x40,0x0b, ++0x24,0x03,0xff,0xfc,0x00,0x43,0x90,0x24,0x24,0xa5,0x00,0x01,0x8e,0x48,0x00,0x00, ++0xaf,0xa5,0x00,0x44,0x08,0x00,0x2f,0x55,0x26,0x52,0x00,0x04,0x0c,0x00,0x2f,0x75, ++0x27,0xa4,0x00,0x44,0x8f,0xa5,0x00,0x44,0x08,0x00,0x2f,0x55,0x00,0x40,0x40,0x21, ++0x24,0x03,0xff,0xfc,0x00,0x43,0x90,0x24,0x8e,0x54,0x00,0x00,0x24,0xe5,0x00,0x01, ++0xaf,0xa5,0x00,0x44,0x06,0x81,0xff,0x0d,0x26,0x52,0x00,0x04,0x00,0x14,0xa0,0x23, ++0x08,0x00,0x2e,0x77,0x36,0x31,0x00,0x10,0x0c,0x00,0x2f,0x75,0x27,0xa4,0x00,0x44, ++0x8f,0xa5,0x00,0x44,0x08,0x00,0x2e,0x77,0x00,0x40,0xa0,0x21,0x08,0x00,0x2e,0x51, ++0x36,0x31,0x00,0x01,0x8c,0x86,0x00,0x00,0x3c,0x02,0x80,0x01,0x00,0x80,0x48,0x21, ++0x90,0xc3,0x00,0x00,0x24,0x44,0x02,0x1c,0x00,0x64,0x18,0x21,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x04,0x10,0x40,0x00,0x10,0x00,0x00,0x38,0x21, ++0x00,0x80,0x40,0x21,0x24,0xc2,0x00,0x01,0x80,0xc5,0x00,0x00,0xad,0x22,0x00,0x00, ++0x90,0x43,0x00,0x00,0x00,0x40,0x30,0x21,0x00,0x07,0x10,0x80,0x00,0x68,0x18,0x21, ++0x90,0x64,0x00,0x00,0x00,0x47,0x10,0x21,0x00,0x02,0x10,0x40,0x00,0x45,0x10,0x21, ++0x30,0x84,0x00,0x04,0x14,0x80,0xff,0xf3,0x24,0x47,0xff,0xd0,0x03,0xe0,0x00,0x08, ++0x00,0xe0,0x10,0x21,0x27,0xbd,0xff,0x98,0xaf,0xb2,0x00,0x50,0x8f,0xb2,0x00,0x84, ++0x3c,0x02,0x80,0x01,0xaf,0xb4,0x00,0x58,0x32,0x43,0x00,0x40,0xaf,0xb1,0x00,0x4c, ++0xaf,0xb0,0x00,0x48,0xaf,0xb7,0x00,0x64,0xaf,0xb6,0x00,0x60,0xaf,0xb5,0x00,0x5c, ++0xaf,0xb3,0x00,0x54,0x00,0x80,0x68,0x21,0x00,0xc0,0x70,0x21,0x00,0xe0,0x78,0x21, ++0x8f,0xb0,0x00,0x78,0x8f,0xb8,0x00,0x7c,0x8f,0xb1,0x00,0x80,0x10,0x60,0x00,0x03, ++0x24,0x54,0x08,0x0c,0x3c,0x02,0x80,0x01,0x24,0x54,0x08,0x34,0x32,0x42,0x00,0x10, ++0x10,0x40,0x00,0x04,0x26,0x02,0xff,0xfe,0x24,0x02,0xff,0xfe,0x02,0x42,0x90,0x24, ++0x26,0x02,0xff,0xfe,0x2c,0x42,0x00,0x23,0x10,0x40,0x00,0x5d,0x00,0x00,0x18,0x21, ++0x32,0x42,0x00,0x01,0x24,0x15,0x00,0x30,0x24,0x03,0x00,0x20,0x32,0x44,0x00,0x02, ++0x00,0x62,0xa8,0x0a,0x10,0x80,0x00,0x07,0x00,0x00,0xb8,0x21,0x05,0xc0,0x00,0x96, ++0x32,0x42,0x00,0x04,0x10,0x40,0x00,0x90,0x32,0x42,0x00,0x08,0x24,0x17,0x00,0x2b, ++0x27,0x18,0xff,0xff,0x32,0x56,0x00,0x20,0x12,0xc0,0x00,0x07,0x01,0xcf,0x10,0x25, ++0x24,0x02,0x00,0x10,0x12,0x02,0x00,0x86,0x27,0x03,0xff,0xff,0x3a,0x02,0x00,0x08, ++0x00,0x62,0xc0,0x0a,0x01,0xcf,0x10,0x25,0x14,0x40,0x00,0x55,0x00,0x00,0xc8,0x21, ++0x24,0x02,0x00,0x30,0x24,0x19,0x00,0x01,0xa3,0xa2,0x00,0x00,0x02,0x39,0x10,0x2a, ++0x03,0x22,0x88,0x0b,0x32,0x43,0x00,0x11,0x14,0x60,0x00,0x0a,0x03,0x11,0xc0,0x23, ++0x03,0x00,0x10,0x21,0x18,0x40,0x00,0x07,0x27,0x18,0xff,0xff,0x24,0x03,0x00,0x20, ++0x03,0x00,0x10,0x21,0xa1,0xa3,0x00,0x00,0x27,0x18,0xff,0xff,0x1c,0x40,0xff,0xfc, ++0x25,0xad,0x00,0x01,0x12,0xe0,0x00,0x03,0x00,0x00,0x00,0x00,0xa1,0xb7,0x00,0x00, ++0x25,0xad,0x00,0x01,0x12,0xc0,0x00,0x07,0x32,0x42,0x00,0x10,0x24,0x02,0x00,0x08, ++0x12,0x02,0x00,0x38,0x24,0x02,0x00,0x10,0x12,0x02,0x00,0x30,0x24,0x02,0x00,0x30, ++0x32,0x42,0x00,0x10,0x14,0x40,0x00,0x0a,0x03,0x31,0x10,0x2a,0x03,0x00,0x10,0x21, ++0x18,0x40,0x00,0x06,0x27,0x18,0xff,0xff,0x03,0x00,0x10,0x21,0xa1,0xb5,0x00,0x00, ++0x27,0x18,0xff,0xff,0x1c,0x40,0xff,0xfc,0x25,0xad,0x00,0x01,0x03,0x31,0x10,0x2a, ++0x10,0x40,0x00,0x07,0x26,0x31,0xff,0xff,0x24,0x03,0x00,0x30,0x03,0x31,0x10,0x2a, ++0xa1,0xa3,0x00,0x00,0x26,0x31,0xff,0xff,0x14,0x40,0xff,0xfc,0x25,0xad,0x00,0x01, ++0x03,0x20,0x10,0x21,0x18,0x40,0x00,0x08,0x27,0x39,0xff,0xff,0x03,0xb9,0x10,0x21, ++0x90,0x43,0x00,0x00,0x03,0x20,0x20,0x21,0x27,0x39,0xff,0xff,0xa1,0xa3,0x00,0x00, ++0x1c,0x80,0xff,0xfa,0x25,0xad,0x00,0x01,0x03,0x00,0x10,0x21,0x18,0x40,0x00,0x07, ++0x27,0x18,0xff,0xff,0x24,0x03,0x00,0x20,0x03,0x00,0x10,0x21,0xa1,0xa3,0x00,0x00, ++0x27,0x18,0xff,0xff,0x1c,0x40,0xff,0xfc,0x25,0xad,0x00,0x01,0x01,0xa0,0x18,0x21, ++0x7b,0xb6,0x03,0x3c,0x7b,0xb4,0x02,0xfc,0x7b,0xb2,0x02,0xbc,0x7b,0xb0,0x02,0x7c, ++0x00,0x60,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x68,0xa1,0xa2,0x00,0x00, ++0x92,0x83,0x00,0x21,0x25,0xad,0x00,0x01,0xa1,0xa3,0x00,0x00,0x08,0x00,0x2f,0xe4, ++0x25,0xad,0x00,0x01,0x24,0x02,0x00,0x30,0x08,0x00,0x30,0x17,0xa1,0xa2,0x00,0x00, ++0x01,0xcf,0x10,0x25,0x10,0x40,0xff,0xad,0x00,0x00,0x60,0x21,0x00,0x0e,0x18,0x02, ++0x03,0x3d,0x98,0x21,0x00,0x60,0x20,0x21,0x01,0xe0,0x38,0x21,0x10,0x60,0x00,0x04, ++0x27,0x39,0x00,0x01,0x00,0x70,0x00,0x1b,0x00,0x00,0x20,0x12,0x00,0x00,0x18,0x10, ++0x00,0x80,0x48,0x21,0x00,0xe0,0x30,0x21,0x01,0x80,0x70,0x21,0x01,0x80,0x28,0x21, ++0x10,0x00,0x00,0x06,0x24,0x04,0x00,0x21,0x00,0x03,0x08,0x40,0x00,0x03,0x2f,0xc2, ++0x00,0x22,0x18,0x25,0x00,0x06,0x30,0x40,0x00,0x0e,0x70,0x40,0x14,0xa0,0x00,0x02, ++0x00,0x70,0x10,0x2b,0x14,0x40,0x00,0x03,0x24,0x84,0xff,0xff,0x00,0x70,0x18,0x23, ++0x25,0xce,0x00,0x01,0x14,0x80,0xff,0xf4,0x00,0x06,0x17,0xc2,0x02,0x83,0x18,0x21, ++0x01,0xc0,0x38,0x21,0x00,0x00,0x50,0x21,0x00,0x09,0x20,0x00,0x00,0x00,0x28,0x21, ++0x90,0x66,0x00,0x00,0x00,0x8a,0x70,0x25,0x00,0xa7,0x78,0x25,0x01,0xcf,0x10,0x25, ++0x14,0x40,0xff,0xda,0xa2,0x66,0x00,0x00,0x08,0x00,0x2f,0xcc,0x02,0x39,0x10,0x2a, ++0x08,0x00,0x2f,0xc5,0x27,0x18,0xff,0xfe,0x10,0x40,0xff,0x73,0x32,0x56,0x00,0x20, ++0x08,0x00,0x2f,0xbc,0x24,0x17,0x00,0x20,0x00,0x0f,0x78,0x23,0x00,0x0e,0x70,0x23, ++0x00,0x0f,0x10,0x2b,0x01,0xc2,0x70,0x23,0x08,0x00,0x2f,0xbc,0x24,0x17,0x00,0x2d, ++0x80,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x06,0x00,0x80,0x18,0x21, ++0x24,0x63,0x00,0x01,0x80,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfc, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x64,0x10,0x23,0x24,0xa5,0xff,0xff, ++0x24,0x02,0xff,0xff,0x10,0xa2,0x00,0x0d,0x00,0x80,0x18,0x21,0x80,0x82,0x00,0x00, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x09,0x00,0x00,0x00,0x00,0x24,0x06,0xff,0xff, ++0x24,0xa5,0xff,0xff,0x10,0xa6,0x00,0x05,0x24,0x63,0x00,0x01,0x80,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x40,0xff,0xfa,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x64,0x10,0x23,0x80,0x82,0x00,0x00,0x90,0x88,0x00,0x00,0x10,0x40,0x00,0x17, ++0x00,0x00,0x48,0x21,0x90,0xa3,0x00,0x00,0x00,0xa0,0x30,0x21,0x10,0x60,0x00,0x0b, ++0x00,0x60,0x38,0x21,0x00,0x08,0x16,0x00,0x00,0x02,0x46,0x03,0x00,0x07,0x16,0x00, ++0x00,0x02,0x16,0x03,0x11,0x02,0x00,0x05,0x24,0xc6,0x00,0x01,0x90,0xc3,0x00,0x00, ++0x00,0x00,0x00,0x00,0x14,0x60,0xff,0xf9,0x00,0x60,0x38,0x21,0x00,0x03,0x16,0x00, ++0x10,0x40,0x00,0x06,0x00,0x00,0x00,0x00,0x24,0x84,0x00,0x01,0x90,0x82,0x00,0x00, ++0x25,0x29,0x00,0x01,0x14,0x40,0xff,0xeb,0x00,0x40,0x40,0x21,0x03,0xe0,0x00,0x08, ++0x01,0x20,0x10,0x21,0x80,0x82,0x00,0x00,0x90,0x87,0x00,0x00,0x10,0x40,0x00,0x17, ++0x00,0x00,0x18,0x21,0x90,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x1e,0x00, ++0x10,0x60,0x00,0x0c,0x00,0xa0,0x30,0x21,0x00,0x07,0x16,0x00,0x00,0x02,0x3e,0x03, ++0x00,0x03,0x16,0x03,0x10,0xe2,0x00,0x0d,0x00,0x80,0x18,0x21,0x24,0xc6,0x00,0x01, ++0x90,0xc2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x1e,0x00,0x14,0x60,0xff,0xf9, ++0x00,0x03,0x16,0x03,0x24,0x84,0x00,0x01,0x90,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x14,0x40,0xff,0xec,0x00,0x40,0x38,0x21,0x00,0x00,0x18,0x21,0x03,0xe0,0x00,0x08, ++0x00,0x60,0x10,0x21,0x27,0xbd,0xff,0xe0,0xaf,0xb0,0x00,0x10,0x8f,0x90,0xc5,0x5c, ++0xaf,0xb1,0x00,0x14,0xaf,0xbf,0x00,0x18,0x00,0x84,0x80,0x0b,0x00,0x00,0x30,0x21, ++0x12,0x00,0x00,0x0a,0x00,0xa0,0x88,0x21,0x0c,0x00,0x30,0x71,0x02,0x00,0x20,0x21, ++0x02,0x02,0x80,0x21,0x82,0x02,0x00,0x00,0x02,0x20,0x28,0x21,0x02,0x00,0x20,0x21, ++0x14,0x40,0x00,0x07,0x00,0x00,0x30,0x21,0xaf,0x80,0xc5,0x5c,0x8f,0xbf,0x00,0x18, ++0x7b,0xb0,0x00,0xbc,0x00,0xc0,0x10,0x21,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x0c,0x00,0x30,0x8d,0x00,0x00,0x00,0x00,0x00,0x40,0x18,0x21,0x10,0x40,0x00,0x07, ++0x02,0x00,0x30,0x21,0x80,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x03, ++0x00,0x00,0x00,0x00,0xa0,0x60,0x00,0x00,0x24,0x63,0x00,0x01,0xaf,0x83,0xc5,0x5c, ++0x08,0x00,0x30,0xbb,0x00,0x00,0x00,0x00,0x24,0xc6,0xff,0xff,0x24,0x02,0xff,0xff, ++0x10,0xc2,0x00,0x05,0x00,0x80,0x18,0x21,0x24,0xc6,0xff,0xff,0xa0,0x65,0x00,0x00, ++0x14,0xc2,0xff,0xfd,0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21, ++0x24,0xc6,0xff,0xff,0x24,0x02,0xff,0xff,0x10,0xc2,0x00,0x08,0x00,0x80,0x18,0x21, ++0x24,0x07,0xff,0xff,0x90,0xa2,0x00,0x00,0x24,0xc6,0xff,0xff,0x24,0xa5,0x00,0x01, ++0xa0,0x62,0x00,0x00,0x14,0xc7,0xff,0xfb,0x24,0x63,0x00,0x01,0x03,0xe0,0x00,0x08, ++0x00,0x80,0x10,0x21,0x00,0x80,0x18,0x21,0x90,0xa2,0x00,0x00,0x24,0xa5,0x00,0x01, ++0xa0,0x82,0x00,0x00,0x14,0x40,0xff,0xfc,0x24,0x84,0x00,0x01,0x03,0xe0,0x00,0x08, ++0x00,0x60,0x10,0x21,0x90,0x83,0x00,0x00,0x90,0xa2,0x00,0x00,0x24,0x84,0x00,0x01, ++0x00,0x62,0x10,0x23,0x00,0x02,0x16,0x00,0x00,0x02,0x16,0x03,0x14,0x40,0x00,0x03, ++0x24,0xa5,0x00,0x01,0x14,0x60,0xff,0xf7,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x10,0x21,0x93,0x85,0x88,0x6d, ++0x24,0x02,0x00,0x01,0x14,0xa2,0x00,0x53,0x00,0x80,0x40,0x21,0x8c,0x89,0x00,0x04, ++0x3c,0x02,0xb0,0x01,0x01,0x22,0x30,0x21,0x8c,0xc3,0x00,0x04,0x3c,0x02,0x01,0x00, ++0x00,0x62,0x10,0x24,0x10,0x40,0x00,0x4b,0x30,0x62,0x00,0x08,0x10,0x45,0x00,0x59, ++0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x38,0x24,0x03,0x00,0xb4,0x30,0x44,0x00,0xff, ++0x10,0x83,0x00,0x61,0x24,0x02,0x00,0xc4,0x10,0x82,0x00,0x54,0x24,0x02,0x00,0x94, ++0x10,0x82,0x00,0x45,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x38,0x00,0x00,0x00,0x00, ++0x30,0x47,0xff,0xff,0x30,0xe3,0x40,0xff,0x24,0x02,0x40,0x88,0x14,0x62,0x00,0x39, ++0x30,0xe3,0x03,0x00,0x24,0x02,0x03,0x00,0x10,0x62,0x00,0x38,0x00,0x00,0x00,0x00, ++0x94,0xc2,0x00,0x56,0x00,0x00,0x00,0x00,0x30,0x47,0xff,0xff,0x30,0xe2,0x00,0x80, ++0x14,0x40,0x00,0x30,0x3c,0x02,0xb0,0x01,0x01,0x22,0x30,0x21,0x94,0xc3,0x00,0x60, ++0x24,0x02,0x00,0x08,0x14,0x43,0x00,0x3b,0x00,0x00,0x00,0x00,0x90,0xc2,0x00,0x62, ++0x24,0x03,0x00,0x04,0x00,0x02,0x39,0x02,0x10,0xe3,0x00,0x15,0x24,0x02,0x00,0x06, ++0x14,0xe2,0x00,0x34,0x00,0x00,0x00,0x00,0x8d,0x05,0x01,0xac,0x94,0xc4,0x00,0x66, ++0x27,0x82,0x92,0x48,0x00,0x05,0x28,0x80,0x30,0x87,0xff,0xff,0x00,0xa2,0x28,0x21, ++0x00,0x07,0x1a,0x00,0x8c,0xa4,0x00,0x00,0x00,0x07,0x12,0x02,0x00,0x43,0x10,0x25, ++0x24,0x42,0x00,0x5e,0x24,0x03,0xc0,0x00,0x30,0x47,0xff,0xff,0x00,0x83,0x20,0x24, ++0x00,0x87,0x20,0x25,0xac,0xa4,0x00,0x00,0x08,0x00,0x31,0x61,0xad,0x07,0x00,0x10, ++0x8d,0x05,0x01,0xac,0x94,0xc4,0x00,0x64,0x27,0x82,0x92,0x48,0x00,0x05,0x28,0x80, ++0x30,0x87,0xff,0xff,0x00,0xa2,0x28,0x21,0x00,0x07,0x1a,0x00,0x8c,0xa4,0x00,0x00, ++0x00,0x07,0x12,0x02,0x00,0x43,0x10,0x25,0x24,0x42,0x00,0x36,0x3c,0x03,0xff,0xff, ++0x30,0x47,0xff,0xff,0x00,0x83,0x20,0x24,0x00,0x87,0x20,0x25,0xac,0xa4,0x00,0x00, ++0xad,0x07,0x00,0x10,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x94,0xc2,0x00,0x50, ++0x08,0x00,0x31,0x1f,0x30,0x47,0xff,0xff,0x8d,0x04,0x01,0xac,0x27,0x83,0x92,0x48, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00,0x3c,0x03,0xff,0xff, ++0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x2e,0xac,0x82,0x00,0x00,0x24,0x03,0x00,0x2e, ++0xad,0x03,0x00,0x10,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8d,0x04,0x01,0xac, ++0x27,0x83,0x92,0x48,0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00, ++0x3c,0x03,0xff,0xff,0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x0e,0x24,0x03,0x00,0x0e, ++0x08,0x00,0x31,0x60,0xac,0x82,0x00,0x00,0x8d,0x04,0x01,0xac,0x27,0x83,0x92,0x48, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00,0x3c,0x03,0xff,0xff, ++0x00,0x43,0x10,0x24,0x34,0x42,0x00,0x14,0x24,0x03,0x00,0x14,0x08,0x00,0x31,0x60, ++0xac,0x82,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x30,0xc6,0x00,0xff, ++0x00,0x06,0x48,0x40,0x01,0x26,0x10,0x21,0x00,0x02,0x10,0x80,0x27,0x8b,0xc5,0x70, ++0x27,0x83,0xc5,0x76,0x00,0x4b,0x40,0x21,0x00,0x43,0x10,0x21,0x94,0x47,0x00,0x00, ++0x30,0xa2,0x3f,0xff,0x10,0xe2,0x00,0x29,0x30,0x8a,0xff,0xff,0x95,0x02,0x00,0x02, ++0x24,0x03,0x00,0x01,0x00,0x02,0x11,0x82,0x30,0x42,0x00,0x01,0x10,0x43,0x00,0x18, ++0x00,0x00,0x00,0x00,0x01,0x26,0x10,0x21,0x00,0x02,0x10,0x80,0x00,0x4b,0x30,0x21, ++0x94,0xc4,0x00,0x02,0x27,0x83,0xc5,0x76,0x27,0x85,0xc5,0x74,0x00,0x45,0x28,0x21, ++0x30,0x84,0xff,0xdf,0x00,0x43,0x10,0x21,0xa4,0xc4,0x00,0x02,0xa4,0x40,0x00,0x00, ++0xa4,0xa0,0x00,0x00,0x94,0xc3,0x00,0x02,0x3c,0x04,0xb0,0x01,0x01,0x44,0x20,0x21, ++0x30,0x63,0xff,0xbf,0xa4,0xc3,0x00,0x02,0xa0,0xc0,0x00,0x00,0x8c,0x82,0x00,0x04, ++0x24,0x03,0xf0,0xff,0x00,0x43,0x10,0x24,0x03,0xe0,0x00,0x08,0xac,0x82,0x00,0x04, ++0x24,0x02,0xc0,0x00,0x91,0x04,0x00,0x01,0x00,0xa2,0x10,0x24,0x00,0x47,0x28,0x25, ++0x3c,0x03,0xb0,0x01,0x24,0x02,0x00,0x02,0x14,0x82,0xff,0xe2,0x01,0x43,0x18,0x21, ++0xac,0x65,0x00,0x00,0x08,0x00,0x31,0x8e,0x01,0x26,0x10,0x21,0x08,0x00,0x31,0x8e, ++0x01,0x26,0x10,0x21,0x93,0x83,0x88,0x6d,0x24,0x02,0x00,0x01,0x14,0x62,0x00,0x0d, ++0x3c,0x02,0xb0,0x01,0x8c,0x84,0x00,0x04,0x3c,0x06,0xb0,0x09,0x00,0x82,0x20,0x21, ++0x8c,0x85,0x00,0x08,0x8c,0x83,0x00,0x04,0x3c,0x02,0x01,0x00,0x34,0xc6,0x01,0x00, ++0x00,0x62,0x18,0x24,0x14,0x60,0x00,0x05,0x30,0xa5,0x20,0x00,0x24,0x02,0x00,0x06, ++0xa0,0xc2,0x00,0x00,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x09, ++0x10,0xa0,0xff,0xfc,0x34,0x63,0x01,0x00,0x24,0x02,0x00,0x0e,0x08,0x00,0x31,0xc1, ++0xa0,0x62,0x00,0x00,0x3c,0x02,0xb0,0x01,0x30,0xa5,0xff,0xff,0x00,0xa2,0x28,0x21, ++0x8c,0xa3,0x00,0x00,0x3c,0x02,0x10,0x00,0x00,0x80,0x30,0x21,0x00,0x62,0x18,0x24, ++0x8c,0xa2,0x00,0x04,0x10,0x60,0x00,0x04,0x00,0x00,0x00,0x00,0x30,0x42,0x80,0x00, ++0x10,0x40,0x00,0x13,0x00,0x00,0x00,0x00,0x8c,0xc2,0x01,0xa8,0x00,0x00,0x00,0x00, ++0x24,0x44,0x00,0x01,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40,0x00,0x83,0x10,0x0a, ++0x93,0x83,0x88,0x6c,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x82,0x20,0x23, ++0x24,0x63,0xff,0xff,0xac,0xc4,0x01,0xa8,0xa3,0x83,0x88,0x6c,0x8c,0xc4,0x01,0xac, ++0x8c,0xc2,0x01,0xa8,0x00,0x00,0x00,0x00,0x00,0x44,0x10,0x26,0x00,0x02,0x10,0x2b, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x3c,0x03,0xb0,0x03,0x34,0x63,0x00,0x73, ++0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x01,0x14,0x40,0x00,0x04, ++0x00,0x00,0x00,0x00,0xa3,0x80,0x88,0x6d,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x24,0x02,0x00,0x01,0xa3,0x82,0x88,0x6d,0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00, ++0x8c,0x82,0x00,0x04,0x3c,0x05,0xb0,0x01,0x00,0x80,0x50,0x21,0x00,0x45,0x10,0x21, ++0x8c,0x43,0x00,0x04,0x24,0x02,0x00,0x05,0x00,0x03,0x1a,0x02,0x30,0x69,0x00,0x0f, ++0x11,0x22,0x00,0x0b,0x24,0x02,0x00,0x07,0x11,0x22,0x00,0x09,0x24,0x02,0x00,0x0a, ++0x11,0x22,0x00,0x07,0x24,0x02,0x00,0x0b,0x11,0x22,0x00,0x05,0x24,0x02,0x00,0x01, ++0x93,0x83,0x88,0x6c,0x3c,0x04,0xb0,0x06,0x10,0x62,0x00,0x03,0x34,0x84,0x80,0x18, ++0x03,0xe0,0x00,0x08,0x00,0x00,0x00,0x00,0x8c,0x82,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x02,0x17,0x02,0x14,0x40,0xff,0xfa,0x00,0x00,0x00,0x00,0x8d,0x43,0x01,0xa8, ++0x27,0x82,0x92,0x48,0x00,0x03,0x18,0x80,0x00,0x6a,0x20,0x21,0x8c,0x87,0x00,0xa8, ++0x00,0x62,0x18,0x21,0x8c,0x68,0x00,0x00,0x00,0xe5,0x28,0x21,0x8c,0xa9,0x00,0x00, ++0x3c,0x02,0xff,0xff,0x27,0x83,0x93,0x48,0x01,0x22,0x10,0x24,0x00,0x48,0x10,0x25, ++0xac,0xa2,0x00,0x00,0x8d,0x44,0x01,0xa8,0x00,0x07,0x30,0xc2,0x3c,0x02,0x00,0x80, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x00,0x06,0x32,0x00,0x8c,0xa9,0x00,0x04, ++0x00,0xc2,0x30,0x25,0x8c,0x82,0x00,0x00,0x3c,0x03,0x80,0x00,0x01,0x22,0x10,0x25, ++0x00,0x43,0x10,0x25,0xac,0xa2,0x00,0x04,0xaf,0x87,0xc5,0x60,0x8c,0xa2,0x00,0x00, ++0x00,0x00,0x00,0x00,0xaf,0x82,0xc5,0x68,0x8c,0xa3,0x00,0x04,0x3c,0x01,0xb0,0x07, ++0xac,0x26,0x80,0x18,0x8d,0x42,0x01,0xa8,0xaf,0x83,0xc5,0x64,0x93,0x85,0x88,0x6c, ++0x24,0x44,0x00,0x01,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40,0x00,0x83,0x10,0x0a, ++0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x24,0xa5,0xff,0xff,0x00,0x82,0x20,0x23, ++0xad,0x44,0x01,0xa8,0xa3,0x85,0x88,0x6c,0x08,0x00,0x32,0x0c,0x00,0x00,0x00,0x00, ++0x3c,0x05,0xb0,0x03,0x3c,0x02,0x80,0x01,0x34,0xa5,0x00,0x20,0x24,0x42,0xc9,0x10, ++0xac,0xa2,0x00,0x00,0x24,0x02,0x00,0x02,0x24,0x03,0x00,0x20,0xac,0x82,0x00,0x64, ++0x3c,0x02,0x80,0x01,0xac,0x83,0x00,0x60,0xac,0x80,0x00,0x00,0xac,0x80,0x00,0x04, ++0xac,0x80,0x00,0x08,0xac,0x80,0x00,0x4c,0xac,0x80,0x00,0x50,0xac,0x80,0x00,0x54, ++0xac,0x80,0x00,0x0c,0xac,0x80,0x00,0x58,0xa0,0x80,0x00,0x5c,0x24,0x42,0xc9,0xd4, ++0x24,0x83,0x00,0x68,0x24,0x05,0x00,0x0f,0x24,0xa5,0xff,0xff,0xac,0x62,0x00,0x00, ++0x04,0xa1,0xff,0xfd,0x24,0x63,0x00,0x04,0x3c,0x02,0x80,0x01,0x24,0x42,0xcb,0x04, ++0xac,0x82,0x00,0x78,0x3c,0x03,0x80,0x01,0x3c,0x02,0x80,0x01,0x24,0x63,0xcc,0x90, ++0x24,0x42,0xcb,0xfc,0xac,0x83,0x00,0x88,0xac,0x82,0x00,0x98,0x3c,0x03,0x80,0x01, ++0x3c,0x02,0x80,0x01,0x24,0x63,0xcd,0x38,0x24,0x42,0xce,0x50,0xac,0x83,0x00,0xa0, ++0xac,0x82,0x00,0xa4,0xa0,0x80,0x01,0xba,0xac,0x80,0x01,0xa8,0xac,0x80,0x01,0xac, ++0xac,0x80,0x01,0xb0,0xac,0x80,0x01,0xb4,0xa0,0x80,0x01,0xb8,0x03,0xe0,0x00,0x08, ++0xa0,0x80,0x01,0xb9,0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20, ++0x24,0x42,0xc9,0xd4,0x03,0xe0,0x00,0x08,0xac,0x62,0x00,0x00,0x3c,0x03,0xb0,0x03, ++0x3c,0x02,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x63,0x00,0x20,0x24,0x42,0xc9,0xec, ++0xaf,0xb0,0x00,0x10,0xac,0x62,0x00,0x00,0xaf,0xbf,0x00,0x14,0x8c,0x83,0x00,0x10, ++0x8f,0x82,0x94,0xe8,0x00,0x80,0x80,0x21,0x3c,0x04,0x80,0x01,0x30,0x46,0x00,0x01, ++0x10,0x60,0x00,0x11,0x24,0x84,0x08,0x64,0x8e,0x02,0x00,0x14,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x0d,0x00,0x00,0x00,0x00,0x8e,0x05,0x00,0x10,0x8e,0x03,0x00,0x14, ++0x8e,0x02,0x00,0x04,0x00,0xa3,0x28,0x21,0x00,0x45,0x10,0x21,0x30,0x43,0x00,0xff, ++0x00,0x03,0x18,0x2b,0x00,0x02,0x12,0x02,0x00,0x43,0x10,0x21,0x00,0x02,0x12,0x00, ++0x30,0x42,0x3f,0xff,0xae,0x02,0x00,0x04,0x14,0xc0,0x00,0x0a,0x00,0x00,0x00,0x00, ++0xae,0x00,0x00,0x00,0xae,0x00,0x00,0x4c,0xae,0x00,0x00,0x50,0xae,0x00,0x00,0x54, ++0xae,0x00,0x00,0x0c,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x18,0x8e,0x05,0x00,0x10,0x8e,0x07,0x00,0x04,0x8e,0x06,0x00,0x14, ++0x0c,0x00,0x1a,0x6b,0x00,0x00,0x00,0x00,0x08,0x00,0x32,0x9d,0xae,0x00,0x00,0x00, ++0x3c,0x03,0xb0,0x03,0x3c,0x02,0x80,0x01,0x34,0x63,0x00,0x20,0x24,0x42,0xca,0xb0, ++0xac,0x62,0x00,0x00,0x8c,0x86,0x00,0x04,0x3c,0x02,0xb0,0x01,0x24,0x03,0x00,0x01, ++0x00,0xc2,0x10,0x21,0x8c,0x45,0x00,0x00,0xac,0x83,0x00,0x4c,0x00,0x05,0x14,0x02, ++0x30,0xa3,0x3f,0xff,0x30,0x42,0x00,0xff,0xac,0x83,0x00,0x10,0xac,0x82,0x00,0x14, ++0x8c,0x83,0x00,0x14,0xac,0x85,0x00,0x40,0x00,0xc3,0x30,0x21,0x03,0xe0,0x00,0x08, ++0xac,0x86,0x00,0x08,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8, ++0x34,0x42,0x00,0x20,0x24,0x63,0xcb,0x04,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14, ++0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x4c,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x0a, ++0x00,0x80,0x80,0x21,0xae,0x00,0x00,0x00,0xae,0x00,0x00,0x4c,0xae,0x00,0x00,0x50, ++0xae,0x00,0x00,0x54,0xae,0x00,0x00,0x0c,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x32,0xac,0x00,0x00,0x00,0x00, ++0x08,0x00,0x32,0xce,0xae,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01, ++0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xcb,0x68,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x4c,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x16,0x00,0x80,0x80,0x21,0x8e,0x03,0x00,0x08,0x3c,0x02,0xb0,0x01, ++0x8e,0x04,0x00,0x44,0x00,0x62,0x18,0x21,0x90,0x65,0x00,0x00,0x24,0x02,0x00,0x01, ++0xae,0x02,0x00,0x50,0x30,0xa3,0x00,0xff,0x00,0x03,0x10,0x82,0x00,0x04,0x23,0x02, ++0x30,0x84,0x00,0x0f,0x30,0x42,0x00,0x03,0x00,0x03,0x19,0x02,0xae,0x04,0x00,0x34, ++0xae,0x02,0x00,0x2c,0xae,0x03,0x00,0x30,0xa2,0x05,0x00,0x48,0x8f,0xbf,0x00,0x14, ++0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x32,0xac, ++0x00,0x00,0x00,0x00,0x08,0x00,0x32,0xe6,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03, ++0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xcb,0xfc, ++0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x50, ++0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x16,0x00,0x80,0x80,0x21,0x92,0x03,0x00,0x44, ++0x8e,0x02,0x00,0x40,0x83,0x85,0x95,0x14,0x92,0x04,0x00,0x41,0x30,0x63,0x00,0x01, ++0x00,0x02,0x16,0x02,0xae,0x04,0x00,0x14,0x00,0x00,0x30,0x21,0xae,0x02,0x00,0x18, ++0x10,0xa0,0x00,0x04,0xae,0x03,0x00,0x3c,0x10,0x60,0x00,0x03,0x24,0x02,0x00,0x01, ++0x24,0x06,0x00,0x01,0x24,0x02,0x00,0x01,0xa3,0x86,0x95,0x14,0x8f,0xbf,0x00,0x14, ++0xae,0x02,0x00,0x54,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x0c,0x00,0x32,0xda,0x00,0x00,0x00,0x00,0x08,0x00,0x33,0x0b,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20, ++0x24,0x63,0xcc,0x90,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00, ++0x8c,0x82,0x00,0x50,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x1b,0x00,0x80,0x80,0x21, ++0x3c,0x02,0xb0,0x03,0x8c,0x42,0x00,0x00,0x92,0x04,0x00,0x44,0x8e,0x03,0x00,0x40, ++0x83,0x86,0x95,0x14,0x92,0x05,0x00,0x41,0x30,0x42,0x08,0x00,0x30,0x84,0x00,0x01, ++0x00,0x02,0x12,0xc2,0x00,0x03,0x1e,0x02,0x00,0x82,0x20,0x25,0xae,0x05,0x00,0x14, ++0x00,0x00,0x38,0x21,0xae,0x03,0x00,0x18,0x10,0xc0,0x00,0x04,0xae,0x04,0x00,0x3c, ++0x10,0x80,0x00,0x03,0x24,0x02,0x00,0x01,0x24,0x07,0x00,0x01,0x24,0x02,0x00,0x01, ++0xa3,0x87,0x95,0x14,0x8f,0xbf,0x00,0x14,0xae,0x02,0x00,0x54,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x32,0xda,0x00,0x00,0x00,0x00, ++0x08,0x00,0x33,0x30,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01, ++0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20,0x24,0x63,0xcd,0x38,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00,0x8c,0x82,0x00,0x54,0x00,0x00,0x00,0x00, ++0x10,0x40,0x00,0x37,0x00,0x80,0x80,0x21,0x8e,0x04,0x00,0x04,0x8e,0x03,0x00,0x44, ++0x3c,0x02,0x80,0x00,0x3c,0x05,0xb0,0x01,0x34,0x42,0x00,0x10,0x00,0x85,0x20,0x21, ++0x00,0x62,0x18,0x25,0xac,0x83,0x00,0x04,0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac, ++0x02,0x00,0x20,0x21,0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x00,0x00,0x03,0x18,0x80, ++0x27,0x82,0x92,0x48,0x00,0x62,0x18,0x21,0xac,0x66,0x00,0x00,0x8e,0x02,0x00,0x04, ++0x8e,0x03,0x01,0xac,0x00,0x45,0x10,0x21,0x8c,0x46,0x00,0x04,0x00,0x03,0x18,0x80, ++0x27,0x82,0x93,0x48,0x00,0x62,0x18,0x21,0x0c,0x00,0x30,0xfb,0xac,0x66,0x00,0x00, ++0x8e,0x03,0x01,0xac,0x8e,0x07,0x00,0x04,0x3c,0x06,0xb0,0x03,0x24,0x65,0x00,0x01, ++0x28,0xa4,0x00,0x00,0x24,0x62,0x00,0x40,0x00,0xa4,0x10,0x0a,0x00,0x02,0x11,0x83, ++0x00,0x02,0x11,0x80,0x00,0x03,0x18,0x80,0x00,0xa2,0x28,0x23,0x00,0x70,0x18,0x21, ++0xae,0x05,0x01,0xac,0xac,0x67,0x00,0xa8,0x34,0xc6,0x00,0x30,0x8c,0xc3,0x00,0x00, ++0x93,0x82,0x88,0x6c,0x02,0x00,0x20,0x21,0x24,0x63,0x00,0x01,0x24,0x42,0x00,0x01, ++0xac,0xc3,0x00,0x00,0xa3,0x82,0x88,0x6c,0x0c,0x00,0x32,0x7b,0x00,0x00,0x00,0x00, ++0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18, ++0x0c,0x00,0x33,0x24,0x00,0x00,0x00,0x00,0x08,0x00,0x33,0x5a,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x27,0xbd,0xff,0xe8,0x34,0x42,0x00,0x20, ++0x24,0x63,0xce,0x50,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14,0xac,0x43,0x00,0x00, ++0x8c,0x82,0x00,0x54,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x37,0x00,0x80,0x80,0x21, ++0x8e,0x04,0x00,0x04,0x8e,0x03,0x00,0x44,0x3c,0x02,0x80,0x00,0x3c,0x05,0xb0,0x01, ++0x34,0x42,0x00,0x10,0x00,0x85,0x20,0x21,0x00,0x62,0x18,0x25,0xac,0x83,0x00,0x04, ++0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac,0x02,0x00,0x20,0x21,0x00,0x45,0x10,0x21, ++0x8c,0x46,0x00,0x00,0x00,0x03,0x18,0x80,0x27,0x82,0x92,0x48,0x00,0x62,0x18,0x21, ++0xac,0x66,0x00,0x00,0x8e,0x02,0x00,0x04,0x8e,0x03,0x01,0xac,0x00,0x45,0x10,0x21, ++0x8c,0x46,0x00,0x04,0x00,0x03,0x18,0x80,0x27,0x82,0x93,0x48,0x00,0x62,0x18,0x21, ++0x0c,0x00,0x30,0xfb,0xac,0x66,0x00,0x00,0x8e,0x03,0x01,0xac,0x8e,0x07,0x00,0x04, ++0x3c,0x06,0xb0,0x03,0x24,0x65,0x00,0x01,0x28,0xa4,0x00,0x00,0x24,0x62,0x00,0x40, ++0x00,0xa4,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x03,0x18,0x80, ++0x00,0xa2,0x28,0x23,0x00,0x70,0x18,0x21,0xae,0x05,0x01,0xac,0xac,0x67,0x00,0xa8, ++0x34,0xc6,0x00,0x30,0x8c,0xc3,0x00,0x00,0x93,0x82,0x88,0x6c,0x02,0x00,0x20,0x21, ++0x24,0x63,0x00,0x01,0x24,0x42,0x00,0x01,0xac,0xc3,0x00,0x00,0xa3,0x82,0x88,0x6c, ++0x0c,0x00,0x32,0x7b,0x00,0x00,0x00,0x00,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x0c,0x00,0x33,0x24,0x00,0x00,0x00,0x00, ++0x08,0x00,0x33,0xa0,0x00,0x00,0x00,0x00,0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01, ++0x34,0x42,0x00,0x20,0x24,0x63,0xcf,0x68,0x27,0xbd,0xff,0xe0,0xac,0x43,0x00,0x00, ++0x3c,0x02,0x80,0x01,0xaf,0xb2,0x00,0x18,0xaf,0xb1,0x00,0x14,0xaf,0xb0,0x00,0x10, ++0xaf,0xbf,0x00,0x1c,0x00,0x80,0x80,0x21,0x24,0x52,0xc9,0xd4,0x00,0x00,0x88,0x21, ++0x3c,0x03,0xb0,0x09,0x34,0x63,0x00,0x06,0x8e,0x06,0x00,0x04,0x90,0x62,0x00,0x00, ++0x00,0x06,0x22,0x02,0x00,0x44,0x10,0x23,0x24,0x44,0x00,0x40,0x28,0x83,0x00,0x00, ++0x24,0x42,0x00,0x7f,0x00,0x83,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80, ++0x24,0x84,0xff,0xff,0x10,0x44,0x00,0x68,0x00,0x00,0x28,0x21,0x3c,0x02,0xb0,0x01, ++0x00,0xc2,0x10,0x21,0x8c,0x44,0x00,0x04,0x3c,0x03,0x7c,0x00,0x34,0x63,0x00,0xf0, ++0x00,0x83,0x18,0x24,0xae,0x04,0x00,0x44,0x8c,0x44,0x00,0x00,0x10,0x60,0x00,0x69, ++0x00,0x00,0x38,0x21,0x3c,0x09,0xb0,0x03,0x3c,0x06,0x7c,0x00,0x35,0x29,0x00,0x99, ++0x3c,0x0a,0xb0,0x01,0x24,0x08,0x00,0x40,0x34,0xc6,0x00,0xf0,0x3c,0x0b,0xff,0xff, ++0x3c,0x0c,0x28,0x38,0x16,0x20,0x00,0x06,0x24,0xa5,0x00,0x01,0x93,0x82,0x88,0xa0, ++0x24,0x11,0x00,0x01,0x24,0x42,0x00,0x01,0xa1,0x22,0x00,0x00,0xa3,0x82,0x88,0xa0, ++0x8e,0x02,0x00,0x04,0x24,0x07,0x00,0x01,0x24,0x42,0x01,0x00,0x30,0x42,0x3f,0xff, ++0xae,0x02,0x00,0x04,0x00,0x4a,0x10,0x21,0x8c,0x43,0x00,0x04,0x00,0x00,0x00,0x00, ++0xae,0x03,0x00,0x44,0x8c,0x44,0x00,0x00,0x10,0xa8,0x00,0x2d,0x00,0x66,0x18,0x24, ++0x14,0x60,0xff,0xec,0x00,0x8b,0x10,0x24,0x14,0x4c,0xff,0xea,0x24,0x02,0x00,0x01, ++0x10,0xe2,0x00,0x2f,0x3c,0x03,0xb0,0x09,0x8e,0x02,0x00,0x44,0x8e,0x04,0x00,0x60, ++0x00,0x02,0x1e,0x42,0x00,0x02,0x12,0x02,0x30,0x42,0x00,0x0f,0x30,0x63,0x00,0x01, ++0xae,0x02,0x00,0x00,0x10,0x44,0x00,0x1a,0xae,0x03,0x00,0x58,0x8e,0x02,0x00,0x64, ++0x8e,0x04,0x00,0x58,0x00,0x00,0x00,0x00,0x10,0x82,0x00,0x05,0x00,0x00,0x00,0x00, ++0xae,0x00,0x00,0x4c,0xae,0x00,0x00,0x50,0xae,0x00,0x00,0x54,0xae,0x00,0x00,0x0c, ++0x8e,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x10,0x80,0x00,0x50,0x10,0x21, ++0x8c,0x42,0x00,0x68,0x00,0x00,0x00,0x00,0x10,0x52,0x00,0x06,0x00,0x00,0x00,0x00, ++0x00,0x40,0xf8,0x09,0x02,0x00,0x20,0x21,0x8e,0x04,0x00,0x58,0x8e,0x03,0x00,0x00, ++0x00,0x00,0x00,0x00,0xae,0x03,0x00,0x60,0x08,0x00,0x33,0xe8,0xae,0x04,0x00,0x64, ++0x8e,0x02,0x00,0x64,0x00,0x00,0x00,0x00,0x14,0x62,0xff,0xe5,0x00,0x00,0x00,0x00, ++0x7a,0x02,0x0d,0x7c,0x8f,0xbf,0x00,0x1c,0x8f,0xb2,0x00,0x18,0x7b,0xb0,0x00,0xbc, ++0x00,0x43,0x10,0x26,0x00,0x02,0x10,0x2b,0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x20, ++0x34,0x63,0x00,0x06,0x8e,0x04,0x00,0x04,0x90,0x62,0x00,0x00,0x00,0x04,0x22,0x02, ++0x00,0x44,0x10,0x23,0x24,0x44,0x00,0x40,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x7f, ++0x00,0x83,0x10,0x0a,0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x82,0x20,0x23, ++0x14,0x87,0xff,0xc5,0x00,0x00,0x00,0x00,0x8e,0x03,0x00,0x00,0x00,0x00,0x00,0x00, ++0x2c,0x62,0x00,0x03,0x14,0x40,0x00,0x05,0x24,0x02,0x00,0x0d,0x10,0x62,0x00,0x03, ++0x24,0x02,0x00,0x01,0x08,0x00,0x34,0x48,0xa2,0x02,0x00,0x5c,0x08,0x00,0x34,0x48, ++0xa2,0x00,0x00,0x5c,0x3c,0x02,0xff,0xff,0x00,0x82,0x10,0x24,0x3c,0x03,0x28,0x38, ++0x14,0x43,0xff,0x94,0x24,0x02,0x00,0x01,0x08,0x00,0x34,0x20,0x00,0x00,0x00,0x00, ++0x3c,0x02,0xb0,0x03,0x3c,0x03,0x80,0x01,0x34,0x42,0x00,0x20,0x24,0x63,0xd1,0xc0, ++0xac,0x43,0x00,0x00,0x8c,0x83,0x01,0xa8,0x8c,0x82,0x01,0xac,0x00,0x80,0x40,0x21, ++0x10,0x62,0x00,0x20,0x00,0x00,0x20,0x21,0x93,0x82,0x88,0x6d,0x00,0x03,0x28,0x80, ++0x3c,0x07,0xb0,0x06,0x00,0xa8,0x18,0x21,0x24,0x04,0x00,0x01,0x8c,0x66,0x00,0xa8, ++0x10,0x44,0x00,0x1c,0x34,0xe7,0x80,0x18,0x3c,0x05,0xb0,0x01,0xaf,0x86,0xc5,0x60, ++0x00,0xc5,0x28,0x21,0x8c,0xa3,0x00,0x00,0x00,0x06,0x20,0xc2,0x3c,0x02,0x00,0x80, ++0x00,0x04,0x22,0x00,0x00,0x82,0x20,0x25,0xaf,0x83,0xc5,0x68,0x8c,0xa2,0x00,0x04, ++0xac,0xe4,0x00,0x00,0x8d,0x03,0x01,0xa8,0xaf,0x82,0xc5,0x64,0x24,0x64,0x00,0x01, ++0x04,0x80,0x00,0x0a,0x00,0x80,0x10,0x21,0x00,0x02,0x11,0x83,0x8d,0x03,0x01,0xac, ++0x00,0x02,0x11,0x80,0x00,0x82,0x10,0x23,0x00,0x43,0x18,0x26,0xad,0x02,0x01,0xa8, ++0x00,0x03,0x20,0x2b,0x03,0xe0,0x00,0x08,0x00,0x80,0x10,0x21,0x08,0x00,0x34,0x92, ++0x24,0x62,0x00,0x40,0x27,0x82,0x92,0x48,0x00,0x06,0x20,0xc2,0x00,0x04,0x22,0x00, ++0x00,0xa2,0x48,0x21,0x3c,0x02,0x00,0x80,0x00,0x82,0x58,0x25,0x93,0x82,0x88,0x6c, ++0x3c,0x0a,0xb0,0x06,0x3c,0x03,0xb0,0x01,0x2c,0x42,0x00,0x02,0x00,0xc3,0x38,0x21, ++0x35,0x4a,0x80,0x18,0x14,0x40,0xff,0xef,0x00,0x00,0x20,0x21,0x8c,0xe5,0x00,0x00, ++0x8d,0x23,0x00,0x00,0x24,0x02,0xc0,0x00,0x00,0xa2,0x10,0x24,0x00,0x43,0x10,0x25, ++0xac,0xe2,0x00,0x00,0x8d,0x04,0x01,0xa8,0x27,0x83,0x93,0x48,0x8c,0xe5,0x00,0x04, ++0x00,0x04,0x20,0x80,0x00,0x83,0x20,0x21,0x8c,0x82,0x00,0x00,0x3c,0x03,0x80,0x00, ++0x00,0xa2,0x10,0x25,0x00,0x43,0x10,0x25,0xac,0xe2,0x00,0x04,0xaf,0x86,0xc5,0x60, ++0x8c,0xe2,0x00,0x00,0x93,0x85,0x88,0x6c,0xaf,0x82,0xc5,0x68,0x8c,0xe3,0x00,0x04, ++0xad,0x4b,0x00,0x00,0x8d,0x02,0x01,0xa8,0xaf,0x83,0xc5,0x64,0x24,0xa5,0xff,0xff, ++0x24,0x44,0x00,0x01,0x28,0x83,0x00,0x00,0x24,0x42,0x00,0x40,0x00,0x83,0x10,0x0a, ++0x00,0x02,0x11,0x83,0x00,0x02,0x11,0x80,0x00,0x82,0x20,0x23,0xad,0x04,0x01,0xa8, ++0xa3,0x85,0x88,0x6c,0x79,0x02,0x0d,0x7c,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x26, ++0x08,0x00,0x34,0x99,0x00,0x02,0x20,0x2b,0x90,0x87,0x00,0x00,0x3c,0x02,0x80,0x01, ++0x27,0xbd,0xff,0xe8,0x24,0x48,0x02,0x1c,0xaf,0xb0,0x00,0x10,0xaf,0xbf,0x00,0x14, ++0x01,0x07,0x18,0x21,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x20, ++0x10,0x40,0x00,0x0a,0x00,0x00,0x80,0x21,0x24,0x84,0x00,0x01,0x90,0x87,0x00,0x00, ++0x00,0x00,0x00,0x00,0x01,0x07,0x18,0x21,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x20,0x14,0x40,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x07,0x16,0x00, ++0x00,0x02,0x16,0x03,0x24,0x03,0x00,0x2d,0x10,0x43,0x00,0x0f,0x00,0x00,0x00,0x00, ++0x0c,0x00,0x34,0xfd,0x00,0x00,0x00,0x00,0x00,0x40,0x18,0x21,0x00,0x02,0x10,0x23, ++0x04,0x61,0x00,0x05,0x00,0x70,0x10,0x0a,0x16,0x00,0x00,0x03,0x3c,0x02,0x80,0x00, ++0x3c,0x02,0x7f,0xff,0x34,0x42,0xff,0xff,0x8f,0xbf,0x00,0x14,0x8f,0xb0,0x00,0x10, ++0x03,0xe0,0x00,0x08,0x27,0xbd,0x00,0x18,0x24,0x10,0xff,0xff,0x08,0x00,0x34,0xec, ++0x24,0x84,0x00,0x01,0x00,0x80,0x38,0x21,0x90,0x84,0x00,0x00,0x3c,0x02,0x80,0x01, ++0x24,0x48,0x02,0x1c,0x01,0x04,0x18,0x21,0x90,0x62,0x00,0x00,0x00,0x00,0x00,0x00, ++0x30,0x42,0x00,0x20,0x10,0x40,0x00,0x0a,0x00,0x00,0x50,0x21,0x24,0xe7,0x00,0x01, ++0x90,0xe4,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x18,0x21,0x90,0x62,0x00,0x00, ++0x00,0x00,0x00,0x00,0x30,0x42,0x00,0x20,0x14,0x40,0xff,0xf8,0x00,0x00,0x00,0x00, ++0x00,0x04,0x16,0x00,0x00,0x02,0x16,0x03,0x38,0x42,0x00,0x2b,0x24,0xe3,0x00,0x01, ++0x24,0x04,0x00,0x10,0x10,0xc4,0x00,0x38,0x00,0x62,0x38,0x0a,0x90,0xe4,0x00,0x00, ++0x14,0xc0,0x00,0x07,0x00,0x80,0x18,0x21,0x00,0x04,0x16,0x00,0x00,0x02,0x16,0x03, ++0x24,0x03,0x00,0x30,0x10,0x43,0x00,0x25,0x24,0x06,0x00,0x0a,0x00,0x80,0x18,0x21, ++0x00,0x03,0x16,0x00,0x10,0x40,0x00,0x1a,0x30,0x64,0x00,0xff,0x24,0x82,0xff,0xa9, ++0x2c,0x83,0x00,0x61,0x30,0x48,0x00,0xff,0x10,0x60,0x00,0x09,0x2c,0x89,0x00,0x41, ++0x24,0x82,0xff,0xc9,0x30,0x48,0x00,0xff,0x11,0x20,0x00,0x05,0x2c,0x83,0x00,0x3a, ++0x24,0x82,0xff,0xd0,0x14,0x60,0x00,0x02,0x30,0x48,0x00,0xff,0x24,0x08,0x00,0xff, ++0x01,0x06,0x10,0x2a,0x10,0x40,0x00,0x0a,0x01,0x46,0x00,0x18,0x24,0xe7,0x00,0x01, ++0x00,0x00,0x18,0x12,0x00,0x6a,0x10,0x2b,0x14,0x40,0x00,0x0a,0x00,0x68,0x50,0x21, ++0x80,0xe2,0x00,0x00,0x90,0xe3,0x00,0x00,0x14,0x40,0xff,0xe8,0x30,0x64,0x00,0xff, ++0x10,0xa0,0x00,0x02,0x00,0x00,0x00,0x00,0xac,0xa7,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x01,0x40,0x10,0x21,0x03,0xe0,0x00,0x08,0x24,0x02,0xff,0xff,0x24,0x06,0x00,0x08, ++0x80,0xe3,0x00,0x01,0x24,0x02,0x00,0x78,0x10,0x62,0x00,0x03,0x24,0x02,0x00,0x58, ++0x14,0x62,0xff,0xd7,0x00,0x80,0x18,0x21,0x24,0xe7,0x00,0x02,0x90,0xe4,0x00,0x00, ++0x08,0x00,0x35,0x1f,0x24,0x06,0x00,0x10,0x80,0xe3,0x00,0x00,0x24,0x02,0x00,0x30, ++0x90,0xe4,0x00,0x00,0x10,0x62,0xff,0xf2,0x00,0x00,0x00,0x00,0x08,0x00,0x35,0x18, ++0x00,0x00,0x00,0x00,0x3c,0x04,0xb0,0x03,0x3c,0x06,0xb0,0x07,0x3c,0x02,0x80,0x01, ++0x34,0xc6,0x00,0x18,0x34,0x84,0x00,0x20,0x24,0x42,0xd5,0x54,0x24,0x03,0xff,0x83, ++0xac,0x82,0x00,0x00,0xa0,0xc3,0x00,0x00,0x90,0xc4,0x00,0x00,0x27,0xbd,0xff,0xf8, ++0x3c,0x03,0xb0,0x07,0x24,0x02,0xff,0x82,0xa3,0xa4,0x00,0x00,0xa0,0x62,0x00,0x00, ++0x90,0x64,0x00,0x00,0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x08,0xa3,0xa4,0x00,0x01, ++0xa0,0x40,0x00,0x00,0x90,0x43,0x00,0x00,0x24,0x02,0x00,0x03,0x3c,0x05,0xb0,0x07, ++0xa3,0xa3,0x00,0x00,0xa0,0xc2,0x00,0x00,0x90,0xc4,0x00,0x00,0x34,0xa5,0x00,0x10, ++0x24,0x02,0x00,0x06,0x3c,0x03,0xb0,0x07,0xa3,0xa4,0x00,0x00,0x34,0x63,0x00,0x38, ++0xa0,0xa2,0x00,0x00,0x90,0x64,0x00,0x00,0x3c,0x02,0xb0,0x07,0x34,0x42,0x00,0x20, ++0xa3,0xa4,0x00,0x00,0xa0,0xa0,0x00,0x00,0x90,0xa3,0x00,0x00,0xaf,0x82,0xc8,0x70, ++0xa3,0xa3,0x00,0x00,0xa0,0x40,0x00,0x00,0x90,0x43,0x00,0x00,0x03,0xe0,0x00,0x08, ++0x27,0xbd,0x00,0x08,}; ++ ++u8 rtl8190_fwdata_array[] = { ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x0a,0x0d,0x5b,0x43,0x4d,0x50,0x4b,0x5d,0x00,0x00,0x00,0x00, ++0x80,0x01,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08, ++0x08,0x08,0x08,0x08,0x08,0x28,0x28,0x28,0x28,0x28,0x08,0x08,0x08,0x08,0x08,0x08, ++0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0xa0,0x10,0x10,0x10, ++0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x04,0x04,0x04,0x04, ++0x04,0x04,0x04,0x04,0x04,0x04,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x41,0x41,0x41, ++0x41,0x41,0x41,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, ++0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x42,0x42,0x42, ++0x42,0x42,0x42,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, ++0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x08,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x10,0x10,0x10, ++0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, ++0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x01, ++0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, ++0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02, ++0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, ++0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20,0x09,0x0d,0x0a, ++0x00,0x00,0x00,0x00,0x80,0x01,0x03,0x1c,0x00,0x00,0x00,0x00,0x43,0x6e,0x73,0x64, ++0x31,0x00,0x00,0x00,0x68,0x65,0x6c,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x72,0x34,0x00,0x00,0x77,0x34,0x00,0x00,0x64,0x62,0x67,0x00,0x72,0x61,0x63,0x74, ++0x72,0x6c,0x00,0x00,0x73,0x79,0x73,0x64,0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x63, ++0x74,0x72,0x6c,0x00,0x74,0x78,0x74,0x62,0x6c,0x00,0x00,0x00,0x70,0x72,0x61,0x6e, ++0x67,0x65,0x00,0x00,0x64,0x6d,0x00,0x00,0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x00,0x00, ++0x80,0x01,0x03,0x34,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01, ++0x00,0x00,0x00,0x00,0x80,0x00,0x24,0x5c,0x80,0x01,0x03,0x40,0x80,0x01,0x03,0x3c, ++0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x25,0xbc, ++0x80,0x01,0x03,0x44,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01, ++0x00,0x00,0x00,0x00,0x80,0x00,0x27,0x38,0x80,0x01,0x03,0x48,0x80,0x01,0x03,0x3c, ++0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x29,0x04, ++0x80,0x01,0x03,0x4c,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01, ++0x00,0x00,0x00,0x00,0x80,0x00,0x29,0xdc,0x80,0x01,0x03,0x54,0x80,0x01,0x03,0x3c, ++0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x29,0xe4, ++0x80,0x01,0x03,0x5c,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01, ++0x00,0x00,0x00,0x00,0x80,0x00,0x29,0xec,0x80,0x01,0x03,0x64,0x80,0x01,0x03,0x3c, ++0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x29,0xf4, ++0x80,0x01,0x03,0x6c,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01, ++0x00,0x00,0x00,0x00,0x80,0x00,0x2b,0x80,0x80,0x01,0x03,0x74,0x80,0x01,0x03,0x3c, ++0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x2b,0xf4, ++0x80,0x01,0x03,0x78,0x80,0x01,0x03,0x3c,0x80,0x01,0x03,0x3c,0x00,0x00,0x00,0x0f, ++0x00,0x00,0x00,0x01,0x80,0x00,0x2c,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x0a,0x0d,0x52,0x54,0x4c,0x38,0x31,0x39,0x58,0x2d,0x25,0x64,0x3e,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x52,0x54,0x4c,0x38,0x31,0x39,0x58,0x2d,0x25,0x64,0x3e,0x0a, ++0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x0a,0x0d,0x45,0x72, ++0x72,0x20,0x44,0x49,0x52,0x00,0x00,0x00,0x0a,0x0d,0x44,0x42,0x47,0x20,0x43,0x4d, ++0x44,0x73,0x3a,0x00,0x0a,0x0d,0x5b,0x00,0x5d,0x2d,0x00,0x00,0x0a,0x0d,0x3c,0x31, ++0x2e,0x43,0x4d,0x4e,0x3e,0x20,0x3c,0x32,0x2e,0x3f,0x3e,0x00,0x0a,0x0d,0x20,0x79, ++0x65,0x61,0x72,0x2d,0x64,0x61,0x79,0x2d,0x68,0x6f,0x75,0x72,0x2d,0x6d,0x69,0x6e, ++0x2d,0x73,0x65,0x63,0x2d,0x31,0x30,0x6d,0x73,0x3d,0x00,0x00,0x25,0x64,0x2d,0x00, ++0x0a,0x0d,0x09,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x20,0x20,0x20,0x20,0x20,0x20, ++0x20,0x30,0x34,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x38,0x20,0x20,0x20,0x20, ++0x20,0x20,0x20,0x30,0x43,0x00,0x00,0x00,0x0a,0x0d,0x09,0x20,0x20,0x20,0x20,0x20, ++0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d, ++0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d, ++0x3d,0x3d,0x3d,0x00,0x0d,0x0a,0x20,0x30,0x78,0x25,0x30,0x38,0x58,0x20,0x20,0x00, ++0x09,0x00,0x00,0x00,0x25,0x30,0x38,0x58,0x20,0x00,0x00,0x00,0x0a,0x0d,0x44,0x62, ++0x67,0x5f,0x46,0x6c,0x61,0x67,0x25,0x64,0x3d,0x30,0x78,0x25,0x30,0x38,0x78,0x00, ++0x0a,0x0d,0x54,0x58,0x4c,0x4c,0x54,0x09,0x09,0x4e,0x45,0x58,0x54,0x20,0x20,0x20, ++0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x45,0x58,0x54,0x0a,0x0d,0x00, ++0x0a,0x0d,0x20,0x50,0x61,0x67,0x65,0x25,0x33,0x64,0x09,0x00,0x25,0x34,0x64,0x20, ++0x20,0x20,0x20,0x00,0x25,0x34,0x64,0x20,0x20,0x20,0x20,0x09,0x00,0x00,0x00,0x00, ++0x0a,0x0d,0x54,0x58,0x4f,0x51,0x54,0x09,0x09,0x48,0x65,0x61,0x64,0x20,0x20,0x20, ++0x20,0x54,0x61,0x69,0x6c,0x20,0x20,0x20,0x20,0x48,0x65,0x61,0x64,0x20,0x20,0x20, ++0x20,0x54,0x61,0x69,0x6c,0x0a,0x0d,0x00,0x0a,0x0d,0x55,0x6e,0x6b,0x6e,0x6f,0x77, ++0x20,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x00,0x00,0x00,0x00,0x0a,0x0d,0x45,0x72, ++0x72,0x20,0x41,0x72,0x67,0x0a,0x0d,0x55,0x53,0x41,0x47,0x45,0x3a,0x00,0x00,0x00, ++0x10,0x00,0x08,0x00,0x02,0xe9,0x01,0x74,0x02,0xab,0x01,0xc7,0x01,0x55,0x00,0xe4, ++0x00,0xab,0x00,0x72,0x00,0x55,0x00,0x4c,0x00,0x4c,0x00,0x4c,0x00,0x4c,0x00,0x4c, ++0x02,0x76,0x01,0x3b,0x00,0xd2,0x00,0x9e,0x00,0x69,0x00,0x4f,0x00,0x46,0x00,0x3f, ++0x01,0x3b,0x00,0x9e,0x00,0x69,0x00,0x4f,0x00,0x35,0x00,0x27,0x00,0x23,0x00,0x20, ++0x01,0x2f,0x00,0x98,0x00,0x65,0x00,0x4c,0x00,0x33,0x00,0x26,0x00,0x22,0x00,0x1e, ++0x00,0x98,0x00,0x4c,0x00,0x33,0x00,0x26,0x00,0x19,0x00,0x13,0x00,0x11,0x00,0x0f, ++0x02,0x39,0x01,0x1c,0x00,0xbd,0x00,0x8e,0x00,0x5f,0x00,0x47,0x00,0x3f,0x00,0x39, ++0x01,0x1c,0x00,0x8e,0x00,0x5f,0x00,0x47,0x00,0x2f,0x00,0x23,0x00,0x20,0x00,0x1c, ++0x01,0x11,0x00,0x89,0x00,0x5b,0x00,0x44,0x00,0x2e,0x00,0x22,0x00,0x1e,0x00,0x1b, ++0x00,0x89,0x00,0x44,0x00,0x2e,0x00,0x22,0x00,0x17,0x00,0x11,0x00,0x0f,0x00,0x0e, ++0x02,0xab,0x02,0xab,0x02,0x66,0x02,0x66,0x07,0x06,0x06,0x06,0x05,0x06,0x07,0x08, ++0x04,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0b,0x49,0x6e,0x74,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x54,0x4c,0x42,0x4d,0x4f,0x44,0x00,0x00,0x00,0x00,0x54,0x4c,0x42,0x4c, ++0x5f,0x64,0x61,0x74,0x61,0x00,0x54,0x4c,0x42,0x53,0x00,0x00,0x00,0x00,0x00,0x00, ++0x41,0x64,0x45,0x4c,0x5f,0x64,0x61,0x74,0x61,0x00,0x41,0x64,0x45,0x53,0x00,0x00, ++0x00,0x00,0x00,0x00,0x45,0x78,0x63,0x43,0x6f,0x64,0x65,0x36,0x00,0x00,0x45,0x78, ++0x63,0x43,0x6f,0x64,0x65,0x37,0x00,0x00,0x53,0x79,0x73,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x42,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x49,0x00,0x00, ++0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x70,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x4f,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x80,0x01,0x14,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x10, ++0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x48, ++0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0xc0,0x00,0x00,0x01,0x20, ++0x00,0x00,0x01,0x20,0x00,0x00,0x01,0x20,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0xd0, ++0x00,0x00,0x01,0x38,0x00,0x00,0x01,0xa0,0x00,0x00,0x02,0x70,0x00,0x00,0x03,0x40, ++0x00,0x00,0x03,0xa8,0x00,0x00,0x04,0x10,0x00,0x00,0x00,0xd0,0x00,0x00,0x01,0xa0, ++0x00,0x00,0x02,0x70,0x00,0x00,0x03,0x40,0x00,0x00,0x04,0xe0,0x00,0x00,0x06,0x80, ++0x00,0x00,0x07,0x50,0x00,0x00,0x08,0x20,0x01,0x01,0x01,0x02,0x01,0x01,0x02,0x02, ++0x03,0x03,0x04,0x04,0x01,0x02,0x02,0x04,0x04,0x06,0x07,0x08,0x02,0x04,0x04,0x07, ++0x07,0x0b,0x0d,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x3c,0x4e,0x55,0x4c,0x4c,0x3e,0x00,0x00,0x30,0x31,0x32,0x33, ++0x34,0x35,0x36,0x37,0x38,0x39,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a, ++0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a, ++0x00,0x00,0x00,0x00,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42, ++0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52, ++0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++0x00,0x00,0x00,0x00,0x5b,0x52,0x58,0x5d,0x20,0x70,0x6b,0x74,0x5f,0x6c,0x65,0x6e, ++0x3d,0x25,0x64,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x25,0x64,0x20,0x73,0x74, ++0x61,0x72,0x74,0x5f,0x61,0x64,0x64,0x72,0x3d,0x25,0x30,0x38,0x78,0x0a,0x0d,0x00, ++0x00,0x00,0x00,0x00,0x80,0x00,0x07,0x6c,0x80,0x00,0x07,0x80,0x80,0x00,0x07,0x80, ++0x80,0x00,0x07,0x70,0x80,0x00,0x07,0x70,0x80,0x00,0x07,0x94,0x80,0x00,0x75,0x98, ++0x80,0x00,0x75,0xec,0x80,0x00,0x76,0x08,0x80,0x00,0x76,0xf4,0x80,0x00,0x77,0xac, ++0x80,0x00,0x77,0xfc,0x80,0x00,0x78,0x68,0x80,0x00,0x79,0x6c,0x80,0x00,0x79,0xa0, ++0x80,0x00,0x79,0xb4,0x80,0x00,0x79,0xc8,0x80,0x00,0x7a,0x74,0x80,0x00,0x7a,0xb0, ++0x80,0x00,0x7b,0x60,0x80,0x00,0x7b,0x88,0x80,0x00,0x75,0x54,0x80,0x00,0x7b,0x9c, ++0x80,0x00,0x82,0x28,0x80,0x00,0x82,0xa0,0x80,0x00,0x82,0xac,0x80,0x00,0x82,0xb8, ++0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40, ++0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40, ++0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40,0x80,0x00,0x82,0x40, ++0x80,0x00,0x82,0xc4,0x80,0x00,0x82,0xd0,0x80,0x00,0x82,0xdc,0x80,0x00,0xa5,0x50, ++0x80,0x00,0xa5,0x50,0x80,0x00,0xa5,0x50,0x80,0x00,0xa5,0x50,0x80,0x00,0xa5,0x50, ++0x80,0x00,0xa5,0x84,0x80,0x00,0xa5,0xf4,0x80,0x00,0xa6,0x1c,0x80,0x00,0xa6,0xf8, ++0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xf8, ++0x80,0x00,0xa6,0x30,0x80,0x00,0xa6,0x94,0x80,0x00,0xa6,0xc4,0x80,0x00,0xa6,0xf8, ++0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xf8,0x80,0x00,0xa6,0xd0, ++0x80,0x00,0xa7,0x2c,0x80,0x00,0xa7,0x40,0x80,0x00,0xa4,0xac,0x80,0x00,0xaa,0x50, ++0x80,0x00,0xaa,0x50,0x80,0x00,0xaa,0x50,0x80,0x00,0xaa,0x50,0x80,0x00,0xaa,0x50, ++0x80,0x00,0xaa,0x84,0x80,0x00,0xaa,0xf4,0x80,0x00,0xab,0x1c,0x80,0x00,0xab,0xf8, ++0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xf8, ++0x80,0x00,0xab,0x30,0x80,0x00,0xab,0x94,0x80,0x00,0xab,0xc4,0x80,0x00,0xab,0xf8, ++0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xf8,0x80,0x00,0xab,0xd0, ++0x80,0x00,0xac,0x2c,0x80,0x00,0xac,0x40,0x80,0x00,0xa8,0x88,0x80,0x00,0xb9,0x8c, ++0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0x94,0x80,0x00,0xb9,0xa4, ++0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4, ++0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0x9c,0x80,0x00,0xb9,0xa4, ++0x80,0x00,0xb9,0x84,0x80,0x00,0xb9,0xa4,0x80,0x00,0xb9,0xa4,0x80,0x00,0xbd,0xcc, ++0x80,0x00,0xba,0xbc,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xba,0xc8, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xba,0x50,0x80,0x00,0xbb,0x9c, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbb,0x9c,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbb,0xa4,0x80,0x00,0xbb,0xc4,0x80,0x00,0xbb,0xcc, ++0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0x24,0x80,0x00,0xbc,0xd4, ++0x80,0x00,0xba,0xd0,0x80,0x00,0xbc,0xd4,0x80,0x00,0xbc,0xd4,0x80,0x00,0xba,0xcc, ++}; ++ ++#endif //__INC_R819XU_FIRMWARE_IMG_H diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt2860-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt2860-wireless-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt2860-wireless-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt2860-wireless-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt2870-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt2870-wireless-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt2870-wireless-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt2870-wireless-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt3070-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt3070-wireless-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-rt3070-wireless-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-rt3070-wireless-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-rtl8187se-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-rtl8187se-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-rtl8187se-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-rtl8187se-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-at76_usb-wireless-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-at76_usb-wireless-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-at76_usb-wireless-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-at76_usb-wireless-driver.patch diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-a-todo-file.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-a-todo-file.patch new file mode 100644 index 000000000..6234eff10 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-a-todo-file.patch @@ -0,0 +1,35 @@ +From foo@baz Wed Jul 15 10:21:36 PDT 2009 +Date: Wed, 15 Jul 2009 10:21:36 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: add a TODO file + +From: Greg Kroah-Hartman + +First cut at what needs to be done to this codebase. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/TODO | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- /dev/null ++++ b/drivers/staging/hv/TODO +@@ -0,0 +1,15 @@ ++TODO: ++ - fix checkpatch warnings/errors ++ - fix sparse issues ++ - remove compatibility layer ++ - fix HANDLE usage to be "real" pointers ++ - audit the vmbus to verify it is working properly with the ++ driver model ++ - see if the vmbus can be merged with the other virtual busses ++ in the kernel ++ - audit the network driver ++ - audit the block driver ++ - audit the scsi driver ++ ++Please send patches for this code to Greg Kroah-Hartman ++and Hank Janssen diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-api-header-files.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-api-header-files.patch new file mode 100644 index 000000000..e0581bb8d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-api-header-files.patch @@ -0,0 +1,4039 @@ +From 50626ba62379de1e1c92abe1e630138bfd096fd0 Mon Sep 17 00:00:00 2001 +From: Hank Janssen +Date: Mon, 13 Jul 2009 15:15:47 -0700 +Subject: Staging: hv: add the Hyper-V api header files + +From: Hank Janssen + +These are the header files for the API to talk to the Hyper-V +core. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/hv/include/ChannelMessages.h | 312 +++++++ + drivers/staging/hv/include/HvHalApi.h | 32 + drivers/staging/hv/include/HvHcApi.h | 60 + + drivers/staging/hv/include/HvPtApi.h | 86 ++ + drivers/staging/hv/include/HvStatus.h | 718 ++++++++++++++++++ + drivers/staging/hv/include/HvSynicApi.h | 490 ++++++++++++ + drivers/staging/hv/include/HvTypes.h | 31 + drivers/staging/hv/include/HvVpApi.h | 51 + + drivers/staging/hv/include/List.h | 269 ++++++ + drivers/staging/hv/include/VmbusChannelInterface.h | 131 +++ + drivers/staging/hv/include/VmbusPacketFormat.h | 322 ++++++++ + drivers/staging/hv/include/nvspprotocol.h | 306 +++++++ + drivers/staging/hv/include/rndis.h | 836 +++++++++++++++++++++ + drivers/staging/hv/include/vstorage.h | 309 +++++++ + 14 files changed, 3953 insertions(+) + create mode 100644 drivers/staging/hv/include/ChannelMessages.h + create mode 100644 drivers/staging/hv/include/HvHalApi.h + create mode 100644 drivers/staging/hv/include/HvHcApi.h + create mode 100644 drivers/staging/hv/include/HvPtApi.h + create mode 100644 drivers/staging/hv/include/HvStatus.h + create mode 100644 drivers/staging/hv/include/HvSynicApi.h + create mode 100644 drivers/staging/hv/include/HvTypes.h + create mode 100644 drivers/staging/hv/include/HvVpApi.h + create mode 100644 drivers/staging/hv/include/List.h + create mode 100644 drivers/staging/hv/include/VmbusChannelInterface.h + create mode 100644 drivers/staging/hv/include/VmbusPacketFormat.h + create mode 100644 drivers/staging/hv/include/nvspprotocol.h + create mode 100644 drivers/staging/hv/include/rndis.h + create mode 100644 drivers/staging/hv/include/vstorage.h + +--- /dev/null ++++ b/drivers/staging/hv/include/ChannelMessages.h +@@ -0,0 +1,312 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++#include ++ ++#define C_ASSERT(x) ++typedef UINT32 NTSTATUS; ++ ++#pragma pack(push,1) ++ ++// ++// Version 1 messages ++// ++ ++typedef enum _VMBUS_CHANNEL_MESSAGE_TYPE ++{ ++ ChannelMessageInvalid = 0, ++ ChannelMessageOfferChannel = 1, ++ ChannelMessageRescindChannelOffer = 2, ++ ChannelMessageRequestOffers = 3, ++ ChannelMessageAllOffersDelivered = 4, ++ ChannelMessageOpenChannel = 5, ++ ChannelMessageOpenChannelResult = 6, ++ ChannelMessageCloseChannel = 7, ++ ChannelMessageGpadlHeader = 8, ++ ChannelMessageGpadlBody = 9, ++ ChannelMessageGpadlCreated = 10, ++ ChannelMessageGpadlTeardown = 11, ++ ChannelMessageGpadlTorndown = 12, ++ ChannelMessageRelIdReleased = 13, ++ ChannelMessageInitiateContact = 14, ++ ChannelMessageVersionResponse = 15, ++ ChannelMessageUnload = 16, ++#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD ++ ChannelMessageViewRangeAdd = 17, ++ ChannelMessageViewRangeRemove = 18, ++#endif ++ ChannelMessageCount ++} VMBUS_CHANNEL_MESSAGE_TYPE, *PVMBUS_CHANNEL_MESSAGE_TYPE; ++ ++// begin_wpp config ++// CUSTOM_TYPE(ChannelMessageType, ItemEnum(_VMBUS_CHANNEL_MESSAGE_TYPE)); ++// end_wpp ++ ++typedef struct _VMBUS_CHANNEL_MESSAGE_HEADER ++{ ++ VMBUS_CHANNEL_MESSAGE_TYPE MessageType; ++ UINT32 Padding; ++} VMBUS_CHANNEL_MESSAGE_HEADER, *PVMBUS_CHANNEL_MESSAGE_HEADER; ++ ++// Query VMBus Version parameters ++typedef struct _VMBUS_CHANNEL_QUERY_VMBUS_VERSION ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 Version; ++} VMBUS_CHANNEL_QUERY_VMBUS_VERSION, *PVMBUS_CHANNEL_QUERY_VMBUS_VERSION; ++ ++// VMBus Version Supported parameters ++typedef struct _VMBUS_CHANNEL_VERSION_SUPPORTED ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ BOOLEAN VersionSupported; ++} VMBUS_CHANNEL_VERSION_SUPPORTED, *PVMBUS_CHANNEL_VERSION_SUPPORTED; ++ ++// Offer Channel parameters ++typedef struct _VMBUS_CHANNEL_OFFER_CHANNEL ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ VMBUS_CHANNEL_OFFER Offer; ++ UINT32 ChildRelId; ++ UINT8 MonitorId; ++ BOOLEAN MonitorAllocated; ++} VMBUS_CHANNEL_OFFER_CHANNEL, *PVMBUS_CHANNEL_OFFER_CHANNEL; ++ ++// ++// Make sure VMBUS_CHANNEL_OFFER_CHANNEL fits into Synic message. ++// ++C_ASSERT(sizeof(VMBUS_CHANNEL_OFFER_CHANNEL) <= MAXIMUM_SYNIC_MESSAGE_BYTES); ++ ++// Rescind Offer parameters ++typedef struct _VMBUS_CHANNEL_RESCIND_OFFER ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++} VMBUS_CHANNEL_RESCIND_OFFER, *PVMBUS_CHANNEL_RESCIND_OFFER; ++ ++// Request Offer -- no parameters, SynIC message contains the partition ID ++// Set Snoop -- no parameters, SynIC message contains the partition ID ++// Clear Snoop -- no parameters, SynIC message contains the partition ID ++// All Offers Delivered -- no parameters, SynIC message contains the partition ID ++// Flush Client -- no parameters, SynIC message contains the partition ID ++ ++// Open Channel parameters ++typedef struct _VMBUS_CHANNEL_OPEN_CHANNEL ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ ++ // ++ // Identifies the specific VMBus channel that is being opened. ++ // ++ UINT32 ChildRelId; ++ ++ // ++ // ID making a particular open request at a channel offer unique. ++ // ++ UINT32 OpenId; ++ ++ // ++ // GPADL for the channel's ring buffer. ++ // ++ GPADL_HANDLE RingBufferGpadlHandle; ++ ++ // ++ // GPADL for the channel's server context save area. ++ // ++ GPADL_HANDLE ServerContextAreaGpadlHandle; ++ ++ // ++ // The upstream ring buffer begins at offset zero in the memory described ++ // by RingBufferGpadlHandle. The downstream ring buffer follows it at this ++ // offset (in pages). ++ // ++ UINT32 DownstreamRingBufferPageOffset; ++ ++ // ++ // User-specific data to be passed along to the server endpoint. ++ // ++ UCHAR UserData[MAX_USER_DEFINED_BYTES]; ++ ++} VMBUS_CHANNEL_OPEN_CHANNEL, *PVMBUS_CHANNEL_OPEN_CHANNEL; ++ ++// Reopen Channel parameters; ++typedef VMBUS_CHANNEL_OPEN_CHANNEL VMBUS_CHANNEL_REOPEN_CHANNEL, *PVMBUS_CHANNEL_REOPEN_CHANNEL; ++ ++// Open Channel Result parameters ++typedef struct _VMBUS_CHANNEL_OPEN_RESULT ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++ UINT32 OpenId; ++ NTSTATUS Status; ++} VMBUS_CHANNEL_OPEN_RESULT, *PVMBUS_CHANNEL_OPEN_RESULT; ++ ++// Close channel parameters; ++typedef struct _VMBUS_CHANNEL_CLOSE_CHANNEL ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++} VMBUS_CHANNEL_CLOSE_CHANNEL, *PVMBUS_CHANNEL_CLOSE_CHANNEL; ++ ++// Channel Message GPADL ++#define GPADL_TYPE_RING_BUFFER 1 ++#define GPADL_TYPE_SERVER_SAVE_AREA 2 ++#define GPADL_TYPE_TRANSACTION 8 ++ ++// ++// The number of PFNs in a GPADL message is defined by the number of pages ++// that would be spanned by ByteCount and ByteOffset. If the implied number ++// of PFNs won't fit in this packet, there will be a follow-up packet that ++// contains more. ++// ++ ++typedef struct _VMBUS_CHANNEL_GPADL_HEADER ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++ UINT32 Gpadl; ++ UINT16 RangeBufLen; ++ UINT16 RangeCount; ++ GPA_RANGE Range[0]; ++} VMBUS_CHANNEL_GPADL_HEADER, *PVMBUS_CHANNEL_GPADL_HEADER; ++ ++ ++// ++// This is the followup packet that contains more PFNs. ++// ++ ++typedef struct _VMBUS_CHANNEL_GPADL_BODY ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 MessageNumber; ++ UINT32 Gpadl; ++ UINT64 Pfn[0]; ++} VMBUS_CHANNEL_GPADL_BODY, *PVMBUS_CHANNEL_GPADL_BODY; ++ ++ ++typedef struct _VMBUS_CHANNEL_GPADL_CREATED ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++ UINT32 Gpadl; ++ UINT32 CreationStatus; ++} VMBUS_CHANNEL_GPADL_CREATED, *PVMBUS_CHANNEL_GPADL_CREATED; ++ ++typedef struct _VMBUS_CHANNEL_GPADL_TEARDOWN ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++ UINT32 Gpadl; ++} VMBUS_CHANNEL_GPADL_TEARDOWN, *PVMBUS_CHANNEL_GPADL_TEARDOWN; ++ ++typedef struct _VMBUS_CHANNEL_GPADL_TORNDOWN ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 Gpadl; ++} VMBUS_CHANNEL_GPADL_TORNDOWN, *PVMBUS_CHANNEL_GPADL_TORNDOWN; ++ ++#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD ++typedef struct _VMBUS_CHANNEL_VIEW_RANGE_ADD ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ PHYSICAL_ADDRESS ViewRangeBase; ++ UINT64 ViewRangeLength; ++ UINT32 ChildRelId; ++} VMBUS_CHANNEL_VIEW_RANGE_ADD, *PVMBUS_CHANNEL_VIEW_RANGE_ADD; ++ ++typedef struct _VMBUS_CHANNEL_VIEW_RANGE_REMOVE ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ PHYSICAL_ADDRESS ViewRangeBase; ++ UINT32 ChildRelId; ++} VMBUS_CHANNEL_VIEW_RANGE_REMOVE, *PVMBUS_CHANNEL_VIEW_RANGE_REMOVE; ++#endif ++ ++typedef struct _VMBUS_CHANNEL_RELID_RELEASED ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 ChildRelId; ++} VMBUS_CHANNEL_RELID_RELEASED, *PVMBUS_CHANNEL_RELID_RELEASED; ++ ++typedef struct _VMBUS_CHANNEL_INITIATE_CONTACT ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ UINT32 VMBusVersionRequested; ++ UINT32 Padding2; ++ UINT64 InterruptPage; ++ UINT64 MonitorPage1; ++ UINT64 MonitorPage2; ++} VMBUS_CHANNEL_INITIATE_CONTACT, *PVMBUS_CHANNEL_INITIATE_CONTACT; ++ ++typedef struct _VMBUS_CHANNEL_VERSION_RESPONSE ++{ ++ VMBUS_CHANNEL_MESSAGE_HEADER Header; ++ BOOLEAN VersionSupported; ++} VMBUS_CHANNEL_VERSION_RESPONSE, *PVMBUS_CHANNEL_VERSION_RESPONSE; ++ ++typedef VMBUS_CHANNEL_MESSAGE_HEADER VMBUS_CHANNEL_UNLOAD, *PVMBUS_CHANNEL_UNLOAD; ++ ++// ++// Kind of a table to use the preprocessor to get us the right type for a ++// specified message ID. Used with ChAllocateSendMessage() ++// ++#define ChannelMessageQueryVmbusVersion_TYPE VMBUS_CHANNEL_MESSAGE_HEADER ++#define ChannelMessageVmbusVersionSupported_TYPE VMBUS_CHANNEL_VERSION_SUPPORTED ++#define ChannelMessageOfferChannel_TYPE VMBUS_CHANNEL_OFFER_CHANNEL ++#define ChannelMessageRescindChannelOffer_TYPE VMBUS_CHANNEL_RESCIND_OFFER ++#define ChannelMessageRequestOffers_TYPE VMBUS_CHANNEL_MESSAGE_HEADER ++#define ChannelMessageAllOffersDelivered_TYPE VMBUS_CHANNEL_MESSAGE_HEADER ++#define ChannelMessageOpenChannel_TYPE VMBUS_CHANNEL_OPEN_CHANNEL ++#define ChannelMessageOpenChannelResult_TYPE VMBUS_CHANNEL_OPEN_RESULT ++#define ChannelMessageCloseChannel_TYPE VMBUS_CHANNEL_CLOSE_CHANNEL ++#define ChannelMessageAllGpadlsUnmapped_TYPE VMBUS_CHANNEL_CLOSE_CHANNEL ++#define ChannelMessageGpadlHeader_TYPE VMBUS_CHANNEL_GPADL_HEADER ++#define ChannelMessageGpadlBody_TYPE VMBUS_CHANNEL_GPADL_BODY ++#define ChannelMessageGpadlCreated_TYPE VMBUS_CHANNEL_GPADL_CREATED ++#define ChannelMessageGpadlTeardown_TYPE VMBUS_CHANNEL_GPADL_TEARDOWN ++#define ChannelMessageGpadlTorndown_TYPE VMBUS_CHANNEL_GPADL_TORNDOWN ++#define ChannelMessageViewRangeAdd_TYPE VMBUS_CHANNEL_VIEW_RANGE_ADD ++#define ChannelMessageViewRangeRemove_TYPE VMBUS_CHANNEL_VIEW_RANGE_REMOVE ++#define ChannelMessageRelIdReleased_TYPE VMBUS_CHANNEL_RELID_RELEASED ++#define ChannelMessageInitiateContact_TYPE VMBUS_CHANNEL_INITIATE_CONTACT ++#define ChannelMessageVersionResponse_TYPE VMBUS_CHANNEL_VERSION_RESPONSE ++#define ChannelMessageUnload_TYPE VMBUS_CHANNEL_UNLOAD ++ ++// ++// Preprocessor wrapper to ChAllocateSendMessageSize() converting the return ++// value to the correct pointer and calculate the needed size. ++// ++// Argument: ++// ++// Id - the numberic ID (type VMBUS_CHANNEL_MESSAGE_TYPE) of the message to ++// send. ++// ++#define ChAllocateSendMessage(Id, Fn, Context) \ ++ (Id##_TYPE*)ChAllocateSendMessageSized(sizeof(Id##_TYPE), Id, Fn, Context) ++ ++ ++#pragma pack(pop) ++ +--- /dev/null ++++ b/drivers/staging/hv/include/HvHalApi.h +@@ -0,0 +1,32 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++ ++// ++// Time in the hypervisor is measured in 100 nanosecond units ++// ++typedef UINT64 HV_NANO100_TIME, *PHV_NANO100_TIME; ++typedef UINT64 HV_NANO100_DURATION, *PHV_NANO100_DURATION; +--- /dev/null ++++ b/drivers/staging/hv/include/HvHcApi.h +@@ -0,0 +1,60 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++// ++// Declare the various hypercall operations. ++// ++typedef enum _HV_CALL_CODE ++{ ++ ++ HvCallPostMessage = 0x005c, ++ HvCallSignalEvent = 0x005d, ++ ++} HV_CALL_CODE, *PHV_CALL_CODE; ++// ++// Definition of the HvPostMessage hypercall input structure. ++// ++ ++typedef struct _HV_INPUT_POST_MESSAGE ++{ ++ HV_CONNECTION_ID ConnectionId; ++ UINT32 Reserved; ++ HV_MESSAGE_TYPE MessageType; ++ UINT32 PayloadSize; ++ UINT64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; ++} HV_INPUT_POST_MESSAGE, *PHV_INPUT_POST_MESSAGE; ++ ++ ++// ++// Definition of the HvSignalEvent hypercall input structure. ++// ++ ++typedef struct _HV_INPUT_SIGNAL_EVENT ++{ ++ HV_CONNECTION_ID ConnectionId; ++ UINT16 FlagNumber; ++ UINT16 RsvdZ; ++} HV_INPUT_SIGNAL_EVENT, *PHV_INPUT_SIGNAL_EVENT; +--- /dev/null ++++ b/drivers/staging/hv/include/HvPtApi.h +@@ -0,0 +1,86 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++// ++// Versioning definitions used for guests reporting themselves to the ++// hypervisor, and visa versa. ++// ================================================================== ++// ++ ++// ++// Version info reported by guest OS's ++// ++typedef enum _HV_GUEST_OS_VENDOR ++{ ++ HvGuestOsVendorMicrosoft = 0x0001 ++ ++} HV_GUEST_OS_VENDOR, *PHV_GUEST_OS_VENDOR; ++ ++typedef enum _HV_GUEST_OS_MICROSOFT_IDS ++{ ++ HvGuestOsMicrosoftUndefined = 0x00, ++ HvGuestOsMicrosoftMSDOS = 0x01, ++ HvGuestOsMicrosoftWindows3x = 0x02, ++ HvGuestOsMicrosoftWindows9x = 0x03, ++ HvGuestOsMicrosoftWindowsNT = 0x04, ++ HvGuestOsMicrosoftWindowsCE = 0x05 ++ ++} HV_GUEST_OS_MICROSOFT_IDS, *PHV_GUEST_OS_MICROSOFT_IDS; ++ ++// ++// Declare the MSR used to identify the guest OS. ++// ++#define HV_X64_MSR_GUEST_OS_ID 0x40000000 ++ ++typedef union _HV_X64_MSR_GUEST_OS_ID_CONTENTS ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 BuildNumber : 16; ++ UINT64 ServiceVersion : 8; // Service Pack, etc. ++ UINT64 MinorVersion : 8; ++ UINT64 MajorVersion : 8; ++ UINT64 OsId : 8; // HV_GUEST_OS_MICROSOFT_IDS (If Vendor=MS) ++ UINT64 VendorId : 16; // HV_GUEST_OS_VENDOR ++ }; ++} HV_X64_MSR_GUEST_OS_ID_CONTENTS, *PHV_X64_MSR_GUEST_OS_ID_CONTENTS; ++ ++// ++// Declare the MSR used to setup pages used to communicate with the hypervisor. ++// ++#define HV_X64_MSR_HYPERCALL 0x40000001 ++ ++typedef union _HV_X64_MSR_HYPERCALL_CONTENTS ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 Enable : 1; ++ UINT64 Reserved : 11; ++ UINT64 GuestPhysicalAddress : 52; ++ }; ++} HV_X64_MSR_HYPERCALL_CONTENTS, *PHV_X64_MSR_HYPERCALL_CONTENTS; +--- /dev/null ++++ b/drivers/staging/hv/include/HvStatus.h +@@ -0,0 +1,718 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++// begin_hvgdk ++// ++// Status codes for hypervisor operations. ++// ++typedef UINT16 HV_STATUS, *PHV_STATUS; ++ ++// ++// MessageId: HV_STATUS_SUCCESS ++// ++// MessageText: ++// ++// The specified hypercall succeeded ++// ++#define HV_STATUS_SUCCESS ((HV_STATUS)0x0000) ++ ++// ++// MessageId: HV_STATUS_INVALID_HYPERCALL_CODE ++// ++// MessageText: ++// ++// The hypervisor does not support the operation because the specified hypercall code is not supported. ++// ++#define HV_STATUS_INVALID_HYPERCALL_CODE ((HV_STATUS)0x0002) ++ ++// ++// MessageId: HV_STATUS_INVALID_HYPERCALL_INPUT ++// ++// MessageText: ++// ++// The hypervisor does not support the operation because the encoding for the hypercall input register is not supported. ++// ++#define HV_STATUS_INVALID_HYPERCALL_INPUT ((HV_STATUS)0x0003) ++ ++// ++// MessageId: HV_STATUS_INVALID_ALIGNMENT ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation beacuse a parameter has an invalid alignment. ++// ++#define HV_STATUS_INVALID_ALIGNMENT ((HV_STATUS)0x0004) ++ ++// ++// MessageId: HV_STATUS_INVALID_PARAMETER ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation beacuse an invalid parameter was specified. ++// ++#define HV_STATUS_INVALID_PARAMETER ((HV_STATUS)0x0005) ++ ++// ++// MessageId: HV_STATUS_ACCESS_DENIED ++// ++// MessageText: ++// ++// Access to the specified object was denied. ++// ++#define HV_STATUS_ACCESS_DENIED ((HV_STATUS)0x0006) ++ ++// ++// MessageId: HV_STATUS_INVALID_PARTITION_STATE ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation because the partition is entering or in an invalid state. ++// ++#define HV_STATUS_INVALID_PARTITION_STATE ((HV_STATUS)0x0007) ++ ++// ++// MessageId: HV_STATUS_OPERATION_DENIED ++// ++// MessageText: ++// ++// The operation is not allowed in the current state. ++// ++#define HV_STATUS_OPERATION_DENIED ((HV_STATUS)0x0008) ++ ++// ++// MessageId: HV_STATUS_UNKNOWN_PROPERTY ++// ++// MessageText: ++// ++// The hypervisor does not recognize the specified partition property. ++// ++#define HV_STATUS_UNKNOWN_PROPERTY ((HV_STATUS)0x0009) ++ ++// ++// MessageId: HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE ++// ++// MessageText: ++// ++// The specified value of a partition property is out of range or violates an invariant. ++// ++#define HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE ((HV_STATUS)0x000A) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_MEMORY ++// ++// MessageText: ++// ++// There is not enough memory in the hypervisor pool to complete the operation. ++// ++#define HV_STATUS_INSUFFICIENT_MEMORY ((HV_STATUS)0x000B) ++ ++// ++// MessageId: HV_STATUS_PARTITION_TOO_DEEP ++// ++// MessageText: ++// ++// The maximum partition depth has been exceeded for the partition hierarchy. ++// ++#define HV_STATUS_PARTITION_TOO_DEEP ((HV_STATUS)0x000C) ++ ++// ++// MessageId: HV_STATUS_INVALID_PARTITION_ID ++// ++// MessageText: ++// ++// A partition with the specified partition Id does not exist. ++// ++#define HV_STATUS_INVALID_PARTITION_ID ((HV_STATUS)0x000D) ++ ++// ++// MessageId: HV_STATUS_INVALID_VP_INDEX ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation because the specified VP index is invalid. ++// ++#define HV_STATUS_INVALID_VP_INDEX ((HV_STATUS)0x000E) ++ ++// ++// MessageId: HV_STATUS_NOT_FOUND ++// ++// MessageText: ++// ++// The iteration is complete; no addition items in the iteration could be found. ++// ++#define HV_STATUS_NOT_FOUND ((HV_STATUS)0x0010) ++ ++// ++// MessageId: HV_STATUS_INVALID_PORT_ID ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation because the specified port identifier is invalid. ++// ++#define HV_STATUS_INVALID_PORT_ID ((HV_STATUS)0x0011) ++ ++// ++// MessageId: HV_STATUS_INVALID_CONNECTION_ID ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation because the specified connection identifier is invalid. ++// ++#define HV_STATUS_INVALID_CONNECTION_ID ((HV_STATUS)0x0012) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_BUFFERS ++// ++// MessageText: ++// ++// You did not supply enough message buffers to send a message. ++// ++#define HV_STATUS_INSUFFICIENT_BUFFERS ((HV_STATUS)0x0013) ++ ++// ++// MessageId: HV_STATUS_NOT_ACKNOWLEDGED ++// ++// MessageText: ++// ++// The previous virtual interrupt has not been acknowledged. ++// ++#define HV_STATUS_NOT_ACKNOWLEDGED ((HV_STATUS)0x0014) ++ ++// ++// MessageId: HV_STATUS_INVALID_VP_STATE ++// ++// MessageText: ++// ++// A virtual processor is not in the correct state for the performance of the indicated operation. ++// ++#define HV_STATUS_INVALID_VP_STATE ((HV_STATUS)0x0015) ++ ++// ++// MessageId: HV_STATUS_ACKNOWLEDGED ++// ++// MessageText: ++// ++// The previous virtual interrupt has already been acknowledged. ++// ++#define HV_STATUS_ACKNOWLEDGED ((HV_STATUS)0x0016) ++ ++// ++// MessageId: HV_STATUS_INVALID_SAVE_RESTORE_STATE ++// ++// MessageText: ++// ++// The indicated partition is not in a valid state for saving or restoring. ++// ++#define HV_STATUS_INVALID_SAVE_RESTORE_STATE ((HV_STATUS)0x0017) ++ ++// ++// MessageId: HV_STATUS_INVALID_SYNIC_STATE ++// ++// MessageText: ++// ++// The hypervisor could not complete the operation because a required feature of the synthetic interrupt controller (SynIC) was disabled. ++// ++#define HV_STATUS_INVALID_SYNIC_STATE ((HV_STATUS)0x0018) ++ ++// ++// MessageId: HV_STATUS_OBJECT_IN_USE ++// ++// MessageText: ++// ++// The hypervisor could not perform the operation because the object or value was either already in use or being used for a purpose that would not permit completing the operation. ++// ++#define HV_STATUS_OBJECT_IN_USE ((HV_STATUS)0x0019) ++ ++// ++// MessageId: HV_STATUS_INVALID_PROXIMITY_DOMAIN_INFO ++// ++// MessageText: ++// ++// The proximity domain information is invalid. ++// ++#define HV_STATUS_INVALID_PROXIMITY_DOMAIN_INFO ((HV_STATUS)0x001A) ++ ++// ++// MessageId: HV_STATUS_NO_DATA ++// ++// MessageText: ++// ++// An attempt to retrieve debugging data failed because none was available. ++// ++#define HV_STATUS_NO_DATA ((HV_STATUS)0x001B) ++ ++// ++// MessageId: HV_STATUS_INACTIVE ++// ++// MessageText: ++// ++// The physical connection being used for debuggging has not recorded any receive activity since the last operation. ++// ++#define HV_STATUS_INACTIVE ((HV_STATUS)0x001C) ++ ++// ++// MessageId: HV_STATUS_NO_RESOURCES ++// ++// MessageText: ++// ++// There are not enough resources to complete the operation. ++// ++#define HV_STATUS_NO_RESOURCES ((HV_STATUS)0x001D) ++ ++// ++// MessageId: HV_STATUS_FEATURE_UNAVAILABLE ++// ++// MessageText: ++// ++// A hypervisor feature is not available to the user. ++// ++#define HV_STATUS_FEATURE_UNAVAILABLE ((HV_STATUS)0x001E) ++ ++// end_hvgdk ++ ++// ++// MessageId: HV_STATUS_UNSUCCESSFUL ++// ++// MessageText: ++// ++// {Operation Failed} ++// The requested operation was unsuccessful. ++// ++#define HV_STATUS_UNSUCCESSFUL ((HV_STATUS)0x1001) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_BUFFER ++// ++// MessageText: ++// ++// The specified buffer was too small to contain all of the requested data. ++// ++#define HV_STATUS_INSUFFICIENT_BUFFER ((HV_STATUS)0x1002) ++ ++// ++// MessageId: HV_STATUS_GPA_NOT_PRESENT ++// ++// MessageText: ++// ++// The guest physical address is not currently associated with a system physical address. ++// ++#define HV_STATUS_GPA_NOT_PRESENT ((HV_STATUS)0x1003) ++ ++// ++// MessageId: HV_STATUS_GUEST_PAGE_FAULT ++// ++// MessageText: ++// ++// The operation would have resulted in a page fault in the guest. ++// ++#define HV_STATUS_GUEST_PAGE_FAULT ((HV_STATUS)0x1004) ++ ++// ++// MessageId: HV_STATUS_RUNDOWN_DISABLED ++// ++// MessageText: ++// ++// The operation cannot proceed as the rundown object was marked disabled. ++// ++#define HV_STATUS_RUNDOWN_DISABLED ((HV_STATUS)0x1005) ++ ++// ++// MessageId: HV_STATUS_KEY_ALREADY_EXISTS ++// ++// MessageText: ++// ++// The entry cannot be added as another entry with the same key already exists. ++// ++#define HV_STATUS_KEY_ALREADY_EXISTS ((HV_STATUS)0x1006) ++ ++// ++// MessageId: HV_STATUS_GPA_INTERCEPT ++// ++// MessageText: ++// ++// The operation resulted an intercept on a region of guest physical memory. ++// ++#define HV_STATUS_GPA_INTERCEPT ((HV_STATUS)0x1007) ++ ++// ++// MessageId: HV_STATUS_GUEST_GENERAL_PROTECTION_FAULT ++// ++// MessageText: ++// ++// The operation would have resulted in a general protection fault in the guest. ++// ++#define HV_STATUS_GUEST_GENERAL_PROTECTION_FAULT ((HV_STATUS)0x1008) ++ ++// ++// MessageId: HV_STATUS_GUEST_STACK_FAULT ++// ++// MessageText: ++// ++// The operation would have resulted in a stack fault in the guest. ++// ++#define HV_STATUS_GUEST_STACK_FAULT ((HV_STATUS)0x1009) ++ ++// ++// MessageId: HV_STATUS_GUEST_INVALID_OPCODE_FAULT ++// ++// MessageText: ++// ++// The operation would have resulted in an invalid opcode fault in the guest. ++// ++#define HV_STATUS_GUEST_INVALID_OPCODE_FAULT ((HV_STATUS)0x100A) ++ ++// ++// MessageId: HV_STATUS_FINALIZE_INCOMPLETE ++// ++// MessageText: ++// ++// The partition is not completely finalized. ++// ++#define HV_STATUS_FINALIZE_INCOMPLETE ((HV_STATUS)0x100B) ++ ++// ++// MessageId: HV_STATUS_GUEST_MACHINE_CHECK_ABORT ++// ++// MessageText: ++// ++// The operation would have resulted in an machine check abort in the guest. ++// ++#define HV_STATUS_GUEST_MACHINE_CHECK_ABORT ((HV_STATUS)0x100C) ++ ++// ++// MessageId: HV_STATUS_ILLEGAL_OVERLAY_ACCESS ++// ++// MessageText: ++// ++// An illegal access was attempted to an overlay page. ++// ++#define HV_STATUS_ILLEGAL_OVERLAY_ACCESS ((HV_STATUS)0x100D) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_SYSTEM_VA ++// ++// MessageText: ++// ++// There is not enough system VA space available to satisfy the request, ++// ++#define HV_STATUS_INSUFFICIENT_SYSTEM_VA ((HV_STATUS)0x100E) ++ ++// ++// MessageId: HV_STATUS_VIRTUAL_ADDRESS_NOT_MAPPED ++// ++// MessageText: ++// ++// The passed virtual address was not mapped in the hypervisor address space. ++// ++#define HV_STATUS_VIRTUAL_ADDRESS_NOT_MAPPED ((HV_STATUS)0x100F) ++ ++// ++// MessageId: HV_STATUS_NOT_IMPLEMENTED ++// ++// MessageText: ++// ++// The requested operation is not implemented in this version of the hypervisor. ++// ++#define HV_STATUS_NOT_IMPLEMENTED ((HV_STATUS)0x1010) ++ ++// ++// MessageId: HV_STATUS_VMX_INSTRUCTION_FAILED ++// ++// MessageText: ++// ++// The requested VMX instruction failed to complete succesfully. ++// ++#define HV_STATUS_VMX_INSTRUCTION_FAILED ((HV_STATUS)0x1011) ++ ++// ++// MessageId: HV_STATUS_VMX_INSTRUCTION_FAILED_WITH_STATUS ++// ++// MessageText: ++// ++// The requested VMX instruction failed to complete succesfully indicating status. ++// ++#define HV_STATUS_VMX_INSTRUCTION_FAILED_WITH_STATUS ((HV_STATUS)0x1012) ++ ++// ++// MessageId: HV_STATUS_MSR_ACCESS_FAILED ++// ++// MessageText: ++// ++// The requested access to the model specific register failed. ++// ++#define HV_STATUS_MSR_ACCESS_FAILED ((HV_STATUS)0x1013) ++ ++// ++// MessageId: HV_STATUS_CR_ACCESS_FAILED ++// ++// MessageText: ++// ++// The requested access to the control register failed. ++// ++#define HV_STATUS_CR_ACCESS_FAILED ((HV_STATUS)0x1014) ++ ++// ++// MessageId: HV_STATUS_TIMEOUT ++// ++// MessageText: ++// ++// The specified timeout expired before the operation completed. ++// ++#define HV_STATUS_TIMEOUT ((HV_STATUS)0x1016) ++ ++// ++// MessageId: HV_STATUS_MSR_INTERCEPT ++// ++// MessageText: ++// ++// The requested access to the model specific register generated an intercept. ++// ++#define HV_STATUS_MSR_INTERCEPT ((HV_STATUS)0x1017) ++ ++// ++// MessageId: HV_STATUS_CPUID_INTERCEPT ++// ++// MessageText: ++// ++// The CPUID instruction generated an intercept. ++// ++#define HV_STATUS_CPUID_INTERCEPT ((HV_STATUS)0x1018) ++ ++// ++// MessageId: HV_STATUS_REPEAT_INSTRUCTION ++// ++// MessageText: ++// ++// The current instruction should be repeated and the instruction pointer not advanced. ++// ++#define HV_STATUS_REPEAT_INSTRUCTION ((HV_STATUS)0x1019) ++ ++// ++// MessageId: HV_STATUS_PAGE_PROTECTION_VIOLATION ++// ++// MessageText: ++// ++// The current instruction should be repeated and the instruction pointer not advanced. ++// ++#define HV_STATUS_PAGE_PROTECTION_VIOLATION ((HV_STATUS)0x101A) ++ ++// ++// MessageId: HV_STATUS_PAGE_TABLE_INVALID ++// ++// MessageText: ++// ++// The current instruction should be repeated and the instruction pointer not advanced. ++// ++#define HV_STATUS_PAGE_TABLE_INVALID ((HV_STATUS)0x101B) ++ ++// ++// MessageId: HV_STATUS_PAGE_NOT_PRESENT ++// ++// MessageText: ++// ++// The current instruction should be repeated and the instruction pointer not advanced. ++// ++#define HV_STATUS_PAGE_NOT_PRESENT ((HV_STATUS)0x101C) ++ ++// ++// MessageId: HV_STATUS_IO_INTERCEPT ++// ++// MessageText: ++// ++// The requested access to the I/O port generated an intercept. ++// ++#define HV_STATUS_IO_INTERCEPT ((HV_STATUS)0x101D) ++ ++// ++// MessageId: HV_STATUS_NOTHING_TO_DO ++// ++// MessageText: ++// ++// There is nothing to do. ++// ++#define HV_STATUS_NOTHING_TO_DO ((HV_STATUS)0x101E) ++ ++// ++// MessageId: HV_STATUS_THREAD_TERMINATING ++// ++// MessageText: ++// ++// The requested thread is terminating. ++// ++#define HV_STATUS_THREAD_TERMINATING ((HV_STATUS)0x101F) ++ ++// ++// MessageId: HV_STATUS_SECTION_ALREADY_CONSTRUCTED ++// ++// MessageText: ++// ++// The specified section was already constructed. ++// ++#define HV_STATUS_SECTION_ALREADY_CONSTRUCTED ((HV_STATUS)0x1020) ++ ++// ++// MessageId: HV_STATUS_SECTION_NOT_ALREADY_CONSTRUCTED ++// ++// MessageText: ++// ++// The specified section was not already constructed. ++// ++#define HV_STATUS_SECTION_NOT_ALREADY_CONSTRUCTED ((HV_STATUS)0x1021) ++ ++// ++// MessageId: HV_STATUS_PAGE_ALREADY_COMMITTED ++// ++// MessageText: ++// ++// The specified virtual address was already backed by physical memory. ++// ++#define HV_STATUS_PAGE_ALREADY_COMMITTED ((HV_STATUS)0x1022) ++ ++// ++// MessageId: HV_STATUS_PAGE_NOT_ALREADY_COMMITTED ++// ++// MessageText: ++// ++// The specified virtual address was not already backed by physical memory. ++// ++#define HV_STATUS_PAGE_NOT_ALREADY_COMMITTED ((HV_STATUS)0x1023) ++ ++// ++// MessageId: HV_STATUS_COMMITTED_PAGES_REMAIN ++// ++// MessageText: ++// ++// Committed pages remain in the section. ++// ++#define HV_STATUS_COMMITTED_PAGES_REMAIN ((HV_STATUS)0x1024) ++ ++// ++// MessageId: HV_STATUS_NO_REMAINING_COMMITTED_PAGES ++// ++// MessageText: ++// ++// No additional committed pages beyond the specified page exist in the section. ++// ++#define HV_STATUS_NO_REMAINING_COMMITTED_PAGES ((HV_STATUS)0x1025) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_COMPARTMENT_VA ++// ++// MessageText: ++// ++// The VA space of the compartment is exhausted. ++// ++#define HV_STATUS_INSUFFICIENT_COMPARTMENT_VA ((HV_STATUS)0x1026) ++ ++// ++// MessageId: HV_STATUS_DEREF_SPA_LIST_FULL ++// ++// MessageText: ++// ++// The SPA dereference list is full, and there are additional entries ++// to be added to it. ++// ++#define HV_STATUS_DEREF_SPA_LIST_FULL ((HV_STATUS)0x1027) ++ ++// ++// MessageId: HV_STATUS_GPA_OUT_OF_RANGE ++// ++// MessageText: ++// ++// The supplied GPA is out of range. ++// ++#define HV_STATUS_GPA_OUT_OF_RANGE ((HV_STATUS)0x1027) ++ ++// ++// MessageId: HV_STATUS_NONVOLATILE_XMM_STALE ++// ++// MessageText: ++// ++// The XMM register that was being accessed is stale. ++// ++#define HV_STATUS_NONVOLATILE_XMM_STALE ((HV_STATUS)0x1028) ++ ++// ++// MessageId: HV_STATUS_UNSUPPORTED_PROCESSOR ++// ++// MessageText: ++// ++// The hypervisor does not support the processors in this system. ++// ++#define HV_STATUS_UNSUPPORTED_PROCESSOR ((HV_STATUS)0x1029) ++ ++// ++// MessageId: HV_STATUS_INSUFFICIENT_CROM_SPACE ++// ++// MessageText: ++// ++// Insufficient space existed for copying over the CROM contents. ++// ++#define HV_STATUS_INSUFFICIENT_CROM_SPACE ((HV_STATUS)0x2000) ++ ++// ++// MessageId: HV_STATUS_BAD_CROM_FORMAT ++// ++// MessageText: ++// ++// The contents of the CROM failed validation attempts. ++// ++#define HV_STATUS_BAD_CROM_FORMAT ((HV_STATUS)0x2001) ++ ++// ++// MessageId: HV_STATUS_UNSUPPORTED_CROM_FORMAT ++// ++// MessageText: ++// ++// The contents of the CROM contain contents the parser doesn't support. ++// ++#define HV_STATUS_UNSUPPORTED_CROM_FORMAT ((HV_STATUS)0x2002) ++ ++// ++// MessageId: HV_STATUS_UNSUPPORTED_CONTROLLER ++// ++// MessageText: ++// ++// The register format of the OHCI controller specified for debugging is not supported. ++// ++#define HV_STATUS_UNSUPPORTED_CONTROLLER ((HV_STATUS)0x2003) ++ ++// ++// MessageId: HV_STATUS_CROM_TOO_LARGE ++// ++// MessageText: ++// ++// The CROM contents were to large to copy over. ++// ++#define HV_STATUS_CROM_TOO_LARGE ((HV_STATUS)0x2004) ++ ++// ++// MessageId: HV_STATUS_CONTROLLER_IN_USE ++// ++// MessageText: ++// ++// The OHCI controller specified for debugging cannot be used as it is already in use. ++// ++#define HV_STATUS_CONTROLLER_IN_USE ((HV_STATUS)0x2005) ++ +--- /dev/null ++++ b/drivers/staging/hv/include/HvSynicApi.h +@@ -0,0 +1,490 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++#pragma once ++ ++// ++// Define the virtual APIC registers ++// ++#define HV_X64_MSR_EOI (0x40000070) ++#define HV_X64_MSR_ICR (0x40000071) ++#define HV_X64_MSR_TPR (0x40000072) ++#define HV_X64_MSR_APIC_ASSIST_PAGE (0x40000073) ++ ++// ++// Define version of the synthetic interrupt controller. ++// ++ ++#define HV_SYNIC_VERSION (1) ++ ++ ++// ++// Define synthetic interrupt controller model specific registers. ++// ++ ++#define HV_X64_MSR_SCONTROL (0x40000080) ++#define HV_X64_MSR_SVERSION (0x40000081) ++#define HV_X64_MSR_SIEFP (0x40000082) ++#define HV_X64_MSR_SIMP (0x40000083) ++#define HV_X64_MSR_EOM (0x40000084) ++#define HV_X64_MSR_SINT0 (0x40000090) ++#define HV_X64_MSR_SINT1 (0x40000091) ++#define HV_X64_MSR_SINT2 (0x40000092) ++#define HV_X64_MSR_SINT3 (0x40000093) ++#define HV_X64_MSR_SINT4 (0x40000094) ++#define HV_X64_MSR_SINT5 (0x40000095) ++#define HV_X64_MSR_SINT6 (0x40000096) ++#define HV_X64_MSR_SINT7 (0x40000097) ++#define HV_X64_MSR_SINT8 (0x40000098) ++#define HV_X64_MSR_SINT9 (0x40000099) ++#define HV_X64_MSR_SINT10 (0x4000009A) ++#define HV_X64_MSR_SINT11 (0x4000009B) ++#define HV_X64_MSR_SINT12 (0x4000009C) ++#define HV_X64_MSR_SINT13 (0x4000009D) ++#define HV_X64_MSR_SINT14 (0x4000009E) ++#define HV_X64_MSR_SINT15 (0x4000009F) ++ ++// ++// Define the expected SynIC version. ++// ++#define HV_SYNIC_VERSION_1 (0x1) ++ ++// ++// Define synthetic interrupt controller message constants. ++// ++ ++#define HV_MESSAGE_SIZE (256) ++#define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240) ++#define HV_MESSAGE_PAYLOAD_QWORD_COUNT (30) ++#define HV_ANY_VP (0xFFFFFFFF) ++ ++// ++// Define synthetic interrupt controller flag constants. ++// ++ ++#define HV_EVENT_FLAGS_COUNT (256 * 8) ++#define HV_EVENT_FLAGS_BYTE_COUNT (256) ++#define HV_EVENT_FLAGS_DWORD_COUNT (256 / sizeof(UINT32)) ++ ++// ++// Define hypervisor message types. ++// ++typedef enum _HV_MESSAGE_TYPE ++{ ++ HvMessageTypeNone = 0x00000000, ++ ++ // ++ // Memory access messages. ++ // ++ HvMessageTypeUnmappedGpa = 0x80000000, ++ HvMessageTypeGpaIntercept = 0x80000001, ++ ++ // ++ // Timer notification messages. ++ // ++ HvMessageTimerExpired = 0x80000010, ++ ++ // ++ // Error messages. ++ // ++ HvMessageTypeInvalidVpRegisterValue = 0x80000020, ++ HvMessageTypeUnrecoverableException = 0x80000021, ++ HvMessageTypeUnsupportedFeature = 0x80000022, ++ ++ // ++ // Trace buffer complete messages. ++ // ++ HvMessageTypeEventLogBufferComplete = 0x80000040, ++ ++ // ++ // Platform-specific processor intercept messages. ++ // ++ HvMessageTypeX64IoPortIntercept = 0x80010000, ++ HvMessageTypeX64MsrIntercept = 0x80010001, ++ HvMessageTypeX64CpuidIntercept = 0x80010002, ++ HvMessageTypeX64ExceptionIntercept = 0x80010003, ++ HvMessageTypeX64ApicEoi = 0x80010004, ++ HvMessageTypeX64LegacyFpError = 0x80010005 ++ ++} HV_MESSAGE_TYPE, *PHV_MESSAGE_TYPE; ++ ++// ++// Define the number of synthetic interrupt sources. ++// ++ ++#define HV_SYNIC_SINT_COUNT (16) ++#define HV_SYNIC_STIMER_COUNT (4) ++ ++// ++// Define the synthetic interrupt source index type. ++// ++ ++typedef UINT32 HV_SYNIC_SINT_INDEX, *PHV_SYNIC_SINT_INDEX; ++ ++// ++// Define partition identifier type. ++// ++ ++typedef UINT64 HV_PARTITION_ID, *PHV_PARTITION_ID; ++ ++// ++// Define invalid partition identifier. ++// ++#define HV_PARTITION_ID_INVALID ((HV_PARTITION_ID) 0x0) ++ ++// ++// Define connection identifier type. ++// ++ ++typedef union _HV_CONNECTION_ID ++{ ++ UINT32 AsUINT32; ++ ++ struct ++ { ++ UINT32 Id:24; ++ UINT32 Reserved:8; ++ } u; ++ ++} HV_CONNECTION_ID, *PHV_CONNECTION_ID; ++ ++// ++// Define port identifier type. ++// ++ ++typedef union _HV_PORT_ID ++{ ++ UINT32 AsUINT32; ++ ++ struct ++ { ++ UINT32 Id:24; ++ UINT32 Reserved:8; ++ } u ; ++ ++} HV_PORT_ID, *PHV_PORT_ID; ++ ++// ++// Define port type. ++// ++ ++typedef enum _HV_PORT_TYPE ++{ ++ HvPortTypeMessage = 1, ++ HvPortTypeEvent = 2, ++ HvPortTypeMonitor = 3 ++} HV_PORT_TYPE, *PHV_PORT_TYPE; ++ ++// ++// Define port information structure. ++// ++ ++typedef struct _HV_PORT_INFO ++{ ++ HV_PORT_TYPE PortType; ++ UINT32 Padding; ++ ++ union ++ { ++ struct ++ { ++ HV_SYNIC_SINT_INDEX TargetSint; ++ HV_VP_INDEX TargetVp; ++ UINT64 RsvdZ; ++ } MessagePortInfo; ++ ++ struct ++ { ++ HV_SYNIC_SINT_INDEX TargetSint; ++ HV_VP_INDEX TargetVp; ++ UINT16 BaseFlagNumber; ++ UINT16 FlagCount; ++ UINT32 RsvdZ; ++ } EventPortInfo; ++ ++ struct ++ { ++ HV_GPA MonitorAddress; ++ UINT64 RsvdZ; ++ } MonitorPortInfo; ++ }; ++} HV_PORT_INFO, *PHV_PORT_INFO; ++ ++typedef const HV_PORT_INFO *PCHV_PORT_INFO; ++ ++typedef struct _HV_CONNECTION_INFO ++{ ++ HV_PORT_TYPE PortType; ++ UINT32 Padding; ++ ++ union ++ { ++ struct ++ { ++ UINT64 RsvdZ; ++ } MessageConnectionInfo; ++ ++ struct ++ { ++ UINT64 RsvdZ; ++ } EventConnectionInfo; ++ ++ struct ++ { ++ HV_GPA MonitorAddress; ++ } MonitorConnectionInfo; ++ }; ++} HV_CONNECTION_INFO, *PHV_CONNECTION_INFO; ++ ++typedef const HV_CONNECTION_INFO *PCHV_CONNECTION_INFO; ++ ++// ++// Define synthetic interrupt controller message flags. ++// ++ ++typedef union _HV_MESSAGE_FLAGS ++{ ++ UINT8 AsUINT8; ++ struct ++ { ++ UINT8 MessagePending:1; ++ UINT8 Reserved:7; ++ }; ++} HV_MESSAGE_FLAGS, *PHV_MESSAGE_FLAGS; ++ ++ ++// ++// Define synthetic interrupt controller message header. ++// ++ ++typedef struct _HV_MESSAGE_HEADER ++{ ++ HV_MESSAGE_TYPE MessageType; ++ UINT8 PayloadSize; ++ HV_MESSAGE_FLAGS MessageFlags; ++ UINT8 Reserved[2]; ++ union ++ { ++ HV_PARTITION_ID Sender; ++ HV_PORT_ID Port; ++ }; ++ ++} HV_MESSAGE_HEADER, *PHV_MESSAGE_HEADER; ++ ++// ++// Define timer message payload structure. ++// ++typedef struct _HV_TIMER_MESSAGE_PAYLOAD ++{ ++ UINT32 TimerIndex; ++ UINT32 Reserved; ++ HV_NANO100_TIME ExpirationTime; // When the timer expired ++ HV_NANO100_TIME DeliveryTime; // When the message was delivered ++} HV_TIMER_MESSAGE_PAYLOAD, *PHV_TIMER_MESSAGE_PAYLOAD; ++ ++// ++// Define synthetic interrupt controller message format. ++// ++ ++typedef struct _HV_MESSAGE ++{ ++ HV_MESSAGE_HEADER Header; ++ union ++ { ++ UINT64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; ++ } u ; ++} HV_MESSAGE, *PHV_MESSAGE; ++ ++// ++// Define the number of message buffers associated with each port. ++// ++ ++#define HV_PORT_MESSAGE_BUFFER_COUNT (16) ++ ++// ++// Define the synthetic interrupt message page layout. ++// ++ ++typedef struct _HV_MESSAGE_PAGE ++{ ++ volatile HV_MESSAGE SintMessage[HV_SYNIC_SINT_COUNT]; ++} HV_MESSAGE_PAGE, *PHV_MESSAGE_PAGE; ++ ++ ++// ++// Define the synthetic interrupt controller event flags format. ++// ++ ++typedef union _HV_SYNIC_EVENT_FLAGS ++{ ++ UINT8 Flags8[HV_EVENT_FLAGS_BYTE_COUNT]; ++ UINT32 Flags32[HV_EVENT_FLAGS_DWORD_COUNT]; ++} HV_SYNIC_EVENT_FLAGS, *PHV_SYNIC_EVENT_FLAGS; ++ ++ ++// ++// Define the synthetic interrupt flags page layout. ++// ++ ++typedef struct _HV_SYNIC_EVENT_FLAGS_PAGE ++{ ++ volatile HV_SYNIC_EVENT_FLAGS SintEventFlags[HV_SYNIC_SINT_COUNT]; ++} HV_SYNIC_EVENT_FLAGS_PAGE, *PHV_SYNIC_EVENT_FLAGS_PAGE; ++ ++ ++// ++// Define SynIC control register. ++// ++typedef union _HV_SYNIC_SCONTROL ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 Enable:1; ++ UINT64 Reserved:63; ++ }; ++} HV_SYNIC_SCONTROL, *PHV_SYNIC_SCONTROL; ++ ++// ++// Define synthetic interrupt source. ++// ++ ++typedef union _HV_SYNIC_SINT ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 Vector :8; ++ UINT64 Reserved1 :8; ++ UINT64 Masked :1; ++ UINT64 AutoEoi :1; ++ UINT64 Reserved2 :46; ++ }; ++} HV_SYNIC_SINT, *PHV_SYNIC_SINT; ++ ++// ++// Define the format of the SIMP register ++// ++ ++typedef union _HV_SYNIC_SIMP ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 SimpEnabled : 1; ++ UINT64 Preserved : 11; ++ UINT64 BaseSimpGpa : 52; ++ }; ++} HV_SYNIC_SIMP, *PHV_SYNIC_SIMP; ++ ++// ++// Define the format of the SIEFP register ++// ++ ++typedef union _HV_SYNIC_SIEFP ++{ ++ UINT64 AsUINT64; ++ struct ++ { ++ UINT64 SiefpEnabled : 1; ++ UINT64 Preserved : 11; ++ UINT64 BaseSiefpGpa : 52; ++ }; ++} HV_SYNIC_SIEFP, *PHV_SYNIC_SIEFP; ++ ++// ++// Definitions for the monitored notification facility ++// ++ ++typedef union _HV_MONITOR_TRIGGER_GROUP ++{ ++ UINT64 AsUINT64; ++ ++ struct ++ { ++ UINT32 Pending; ++ UINT32 Armed; ++ }; ++ ++} HV_MONITOR_TRIGGER_GROUP, *PHV_MONITOR_TRIGGER_GROUP; ++ ++typedef struct _HV_MONITOR_PARAMETER ++{ ++ HV_CONNECTION_ID ConnectionId; ++ UINT16 FlagNumber; ++ UINT16 RsvdZ; ++} HV_MONITOR_PARAMETER, *PHV_MONITOR_PARAMETER; ++ ++typedef union _HV_MONITOR_TRIGGER_STATE ++{ ++ UINT32 AsUINT32; ++ ++ struct ++ { ++ UINT32 GroupEnable : 4; ++ UINT32 RsvdZ : 28; ++ }; ++ ++} HV_MONITOR_TRIGGER_STATE, *PHV_MONITOR_TRIGGER_STATE; ++ ++// ++// HV_MONITOR_PAGE Layout ++// ------------------------------------------------------ ++// | 0 | TriggerState (4 bytes) | Rsvd1 (4 bytes) | ++// | 8 | TriggerGroup[0] | ++// | 10 | TriggerGroup[1] | ++// | 18 | TriggerGroup[2] | ++// | 20 | TriggerGroup[3] | ++// | 28 | Rsvd2[0] | ++// | 30 | Rsvd2[1] | ++// | 38 | Rsvd2[2] | ++// | 40 | NextCheckTime[0][0] | NextCheckTime[0][1] | ++// | ... | ++// | 240 | Latency[0][0..3] | ++// | 340 | Rsvz3[0] | ++// | 440 | Parameter[0][0] | ++// | 448 | Parameter[0][1] | ++// | ... | ++// | 840 | Rsvd4[0] | ++// ------------------------------------------------------ ++ ++typedef struct _HV_MONITOR_PAGE ++{ ++ HV_MONITOR_TRIGGER_STATE TriggerState; ++ UINT32 RsvdZ1; ++ ++ HV_MONITOR_TRIGGER_GROUP TriggerGroup[4]; ++ UINT64 RsvdZ2[3]; ++ ++ INT32 NextCheckTime[4][32]; ++ ++ UINT16 Latency[4][32]; ++ UINT64 RsvdZ3[32]; ++ ++ HV_MONITOR_PARAMETER Parameter[4][32]; ++ ++ UINT8 RsvdZ4[1984]; ++ ++} HV_MONITOR_PAGE, *PHV_MONITOR_PAGE; ++ ++typedef volatile HV_MONITOR_PAGE* PVHV_MONITOR_PAGE; +--- /dev/null ++++ b/drivers/staging/hv/include/HvTypes.h +@@ -0,0 +1,31 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++typedef UINT64 HV_GPA, *PHV_GPA; ++ ++#define HV_X64_PAGE_SIZE (4096) ++#define HV_PAGE_SIZE HV_X64_PAGE_SIZE ++ +--- /dev/null ++++ b/drivers/staging/hv/include/HvVpApi.h +@@ -0,0 +1,51 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++// ++// Virtual Processor Indices ++// ++typedef UINT32 HV_VP_INDEX, *PHV_VP_INDEX; ++ ++// ++// The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent ++// is set by CPUID(HvCpuIdFunctionVersionAndFeatures). ++// ========================================================================== ++// ++ ++typedef enum _HV_CPUID_FUNCTION ++{ ++ HvCpuIdFunctionVersionAndFeatures = 0x00000001, ++ HvCpuIdFunctionHvVendorAndMaxFunction = 0x40000000, ++ HvCpuIdFunctionHvInterface = 0x40000001, ++ ++ // ++ // The remaining functions depend on the value of HvCpuIdFunctionInterface ++ // ++ HvCpuIdFunctionMsHvVersion = 0x40000002, ++ HvCpuIdFunctionMsHvFeatures = 0x40000003, ++ HvCpuIdFunctionMsHvEnlightenmentInformation = 0x40000004, ++ HvCpuIdFunctionMsHvImplementationLimits = 0x40000005 ++ ++} HV_CPUID_FUNCTION, *PHV_CPUID_FUNCTION; +--- /dev/null ++++ b/drivers/staging/hv/include/List.h +@@ -0,0 +1,269 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _LIST_H_ ++#define _LIST_H_ ++ ++#include "osd.h" ++/* ++ * ++ * Doubly-linked list manipulation routines. Implemented as macros ++ * but logically these are procedures. ++ * ++ */ ++ ++typedef DLIST_ENTRY LIST_ENTRY; ++typedef DLIST_ENTRY *PLIST_ENTRY; ++ ++//typedef struct LIST_ENTRY { ++// struct LIST_ENTRY * volatile Flink; ++// struct LIST_ENTRY * volatile Blink; ++//} LIST_ENTRY, *PLIST_ENTRY; ++ ++ ++ ++/* ++ * VOID ++ * InitializeListHead( ++ * PLIST_ENTRY ListHead ++ * ); ++ */ ++#define INITIALIZE_LIST_HEAD InitializeListHead ++ ++#define InitializeListHead(ListHead) (\ ++ (ListHead)->Flink = (ListHead)->Blink = (ListHead)) ++ ++ ++/* ++ * BOOLEAN ++ * IsListEmpty( ++ * PLIST_ENTRY ListHead ++ * ); ++ */ ++#define IS_LIST_EMPTY IsListEmpty ++ ++#define IsListEmpty(ListHead) \ ++ ((ListHead)->Flink == (ListHead)) ++ ++ ++/* ++ * PLIST_ENTRY ++ * NextListEntry( ++ * PLIST_ENTRY Entry ++ * ); ++ */ ++#define NEXT_LIST_ENTRY NextListEntry ++ ++#define NextListEntry(Entry) \ ++ (Entry)->Flink ++ ++ ++/* ++ * PLIST_ENTRY ++ * PrevListEntry( ++ * PLIST_ENTRY Entry ++ * ); ++ */ ++#define PREV_LIST_ENTRY PrevListEntry ++ ++#define PrevListEntry(Entry) \ ++ (Entry)->Blink ++ ++ ++/* ++ * PLIST_ENTRY ++ * TopListEntry( ++ * PLIST_ENTRY ListHead ++ * ); ++ */ ++#define TOP_LIST_ENTRY TopListEntry ++ ++#define TopListEntry(ListHead) \ ++ (ListHead)->Flink ++ ++ ++ ++/* ++ * PLIST_ENTRY ++ * RemoveHeadList( ++ * PLIST_ENTRY ListHead ++ * ); ++ */ ++ ++#define REMOVE_HEAD_LIST RemoveHeadList ++ ++#define RemoveHeadList(ListHead) \ ++ (ListHead)->Flink;\ ++ {RemoveEntryList((ListHead)->Flink)} ++ ++ ++/* ++ * PLIST_ENTRY ++ * RemoveTailList( ++ * PLIST_ENTRY ListHead ++ * ); ++ */ ++#define REMOVE_TAIL_LIST RemoveTailList ++ ++#define RemoveTailList(ListHead) \ ++ (ListHead)->Blink;\ ++ {RemoveEntryList((ListHead)->Blink)} ++ ++ ++/* ++ * VOID ++ * RemoveEntryList( ++ * PLIST_ENTRY Entry ++ * ); ++ */ ++#define REMOVE_ENTRY_LIST RemoveEntryList ++ ++#define RemoveEntryList(Entry) {\ ++ PLIST_ENTRY _EX_Flink = (Entry)->Flink;\ ++ PLIST_ENTRY _EX_Blink = (Entry)->Blink;\ ++ _EX_Blink->Flink = _EX_Flink;\ ++ _EX_Flink->Blink = _EX_Blink;\ ++ } ++ ++ ++/* ++ * VOID ++ * AttachList( ++ * PLIST_ENTRY ListHead, ++ * PLIST_ENTRY ListEntry ++ * ); ++ */ ++#define ATTACH_LIST AttachList ++ ++#define AttachList(ListHead,ListEntry) {\ ++ PLIST_ENTRY _EX_ListHead = (ListHead);\ ++ PLIST_ENTRY _EX_Blink = (ListHead)->Blink;\ ++ (ListEntry)->Blink->Flink = _EX_ListHead;\ ++ _EX_Blink->Flink = (ListEntry);\ ++ _EX_ListHead->Blink = (ListEntry)->Blink;\ ++ (ListEntry)->Blink = _EX_Blink;\ ++ } ++ ++ ++ ++/* ++ * VOID ++ * InsertTailList( ++ * PLIST_ENTRY ListHead, ++ * PLIST_ENTRY Entry ++ * ); ++ */ ++ ++#define INSERT_TAIL_LIST InsertTailList ++ ++#define InsertTailList(ListHead,Entry) {\ ++ PLIST_ENTRY _EX_ListHead = (ListHead);\ ++ PLIST_ENTRY _EX_Blink = (ListHead)->Blink;\ ++ (Entry)->Flink = _EX_ListHead;\ ++ (Entry)->Blink = _EX_Blink;\ ++ _EX_Blink->Flink = (Entry);\ ++ _EX_ListHead->Blink = (Entry);\ ++ } ++ ++ ++/* ++ * VOID ++ * InsertHeadList( ++ * PLIST_ENTRY ListHead, ++ * PLIST_ENTRY Entry ++ * ); ++ */ ++#define INSERT_HEAD_LIST InsertHeadList ++ ++#define InsertHeadList(ListHead,Entry) {\ ++ PLIST_ENTRY _EX_ListHead = (ListHead);\ ++ PLIST_ENTRY _EX_Flink = (ListHead)->Flink;\ ++ (Entry)->Flink = _EX_Flink;\ ++ (Entry)->Blink = _EX_ListHead;\ ++ _EX_Flink->Blink = (Entry);\ ++ _EX_ListHead->Flink = (Entry);\ ++ } ++ ++ ++/* ++ * VOID ++ * IterateListEntries( ++ * PLIST_ENTRY anchor, ++ * PLIST_ENTRY index, ++ * PLIST_ENTRY listp ++ * ); ++ */ ++ ++#define ITERATE_LIST_ENTRIES IterateListEntries ++ ++#define IterateListEntries(anchor, index, listp) \ ++ (anchor) = (LIST_ENTRY *)(listp); \ ++ for((index) = (anchor)->Flink; (index) != (anchor); (index) = (index)->Flink) ++ ++ ++ ++/* ++ * PSINGLE_LIST_ENTRY ++ * PopEntryList( ++ * PSINGLE_LIST_ENTRY ListHead ++ * ); ++ */ ++ ++#define POP_ENTRY_LIST PopEntryList ++ ++#define PopEntryList(ListHead) \ ++ (ListHead)->Next;\ ++ {\ ++ PSINGLE_LIST_ENTRY FirstEntry;\ ++ FirstEntry = (ListHead)->Next;\ ++ if (FirstEntry != NULL) { \ ++ (ListHead)->Next = FirstEntry->Next;\ ++ } \ ++ } ++ ++ ++ ++/* ++ * VOID ++ * PushEntryList( ++ * PSINGLE_LIST_ENTRY ListHead, ++ * PSINGLE_LIST_ENTRY Entry ++ * ); ++ */ ++ ++#define PUSH_ENTRY_LIST PushEntryList ++ ++#define PushEntryList(ListHead,Entry) \ ++ (Entry)->Next = (ListHead)->Next; \ ++ (ListHead)->Next = (Entry) ++ ++#ifndef CONTAINING_RECORD ++#define CONTAINING_RECORD(address, type, field) ((type *)( \ ++ (PCHAR)(address) - \ ++ (PCHAR)(&((type *)0)->field))) ++#endif /* CONTAINING_RECORD */ ++ ++#endif /* _LIST_H_ */ ++ ++/* EOF */ +--- /dev/null ++++ b/drivers/staging/hv/include/nvspprotocol.h +@@ -0,0 +1,306 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++#include ++ ++#define NVSP_INVALID_PROTOCOL_VERSION ((UINT32)0xFFFFFFFF) ++ ++#define NVSP_PROTOCOL_VERSION_1 2 ++#define NVSP_MIN_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 ++#define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 ++ ++typedef enum _NVSP_MESSAGE_TYPE ++{ ++ NvspMessageTypeNone = 0, ++ ++ // ++ // Init Messages ++ // ++ NvspMessageTypeInit = 1, ++ NvspMessageTypeInitComplete = 2, ++ ++ NvspVersionMessageStart = 100, ++ ++ // ++ // Version 1 Messages ++ // ++ NvspMessage1TypeSendNdisVersion = NvspVersionMessageStart, ++ ++ NvspMessage1TypeSendReceiveBuffer, ++ NvspMessage1TypeSendReceiveBufferComplete, ++ NvspMessage1TypeRevokeReceiveBuffer, ++ ++ NvspMessage1TypeSendSendBuffer, ++ NvspMessage1TypeSendSendBufferComplete, ++ NvspMessage1TypeRevokeSendBuffer, ++ ++ NvspMessage1TypeSendRNDISPacket, ++ NvspMessage1TypeSendRNDISPacketComplete, ++ ++ // ++ // This should be set to the number of messages for the version ++ // with the maximum number of messages. ++ // ++ NvspNumMessagePerVersion = 9, ++ ++} NVSP_MESSAGE_TYPE, *PNVSP_MESSAGE_TYPE; ++ ++typedef enum _NVSP_STATUS ++{ ++ NvspStatusNone = 0, ++ NvspStatusSuccess, ++ NvspStatusFailure, ++ NvspStatusProtocolVersionRangeTooNew, ++ NvspStatusProtocolVersionRangeTooOld, ++ NvspStatusInvalidRndisPacket, ++ NvspStatusBusy, ++ NvspStatusMax, ++} NVSP_STATUS, *PNVSP_STATUS; ++ ++#pragma pack(push, 1) ++ ++typedef struct _NVSP_MESSAGE_HEADER ++{ ++ UINT32 MessageType; ++} NVSP_MESSAGE_HEADER, *PNVSP_MESSAGE_HEADER; ++ ++// ++// Init Messages ++// ++ ++// ++// This message is used by the VSC to initialize the channel ++// after the channels has been opened. This message should ++// never include anything other then versioning (i.e. this ++// message will be the same for ever). ++// ++typedef struct _NVSP_MESSAGE_INIT ++{ ++ UINT32 MinProtocolVersion; ++ UINT32 MaxProtocolVersion; ++} NVSP_MESSAGE_INIT, *PNVSP_MESSAGE_INIT; ++ ++// ++// This message is used by the VSP to complete the initialization ++// of the channel. This message should never include anything other ++// then versioning (i.e. this message will be the same for ever). ++// ++typedef struct _NVSP_MESSAGE_INIT_COMPLETE ++{ ++ UINT32 NegotiatedProtocolVersion; ++ UINT32 MaximumMdlChainLength; ++ UINT32 Status; ++} NVSP_MESSAGE_INIT_COMPLETE, *PNVSP_MESSAGE_INIT_COMPLETE; ++ ++typedef union _NVSP_MESSAGE_INIT_UBER ++{ ++ NVSP_MESSAGE_INIT Init; ++ NVSP_MESSAGE_INIT_COMPLETE InitComplete; ++} NVSP_MESSAGE_INIT_UBER; ++ ++// ++// Version 1 Messages ++// ++ ++// ++// This message is used by the VSC to send the NDIS version ++// to the VSP. The VSP can use this information when handling ++// OIDs sent by the VSC. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_NDIS_VERSION ++{ ++ UINT32 NdisMajorVersion; ++ UINT32 NdisMinorVersion; ++} NVSP_1_MESSAGE_SEND_NDIS_VERSION, *PNVSP_1_MESSAGE_SEND_NDIS_VERSION; ++ ++// ++// This message is used by the VSC to send a receive buffer ++// to the VSP. The VSP can then use the receive buffer to ++// send data to the VSC. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER ++{ ++ GPADL_HANDLE GpadlHandle; ++ UINT16 Id; ++} NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER, *PNVSP_1_MESSAGE_SEND_RECEIVE_BUFFER; ++ ++typedef struct _NVSP_1_RECEIVE_BUFFER_SECTION ++{ ++ UINT32 Offset; ++ UINT32 SubAllocationSize; ++ UINT32 NumSubAllocations; ++ UINT32 EndOffset; ++} NVSP_1_RECEIVE_BUFFER_SECTION, *PNVSP_1_RECEIVE_BUFFER_SECTION; ++ ++// ++// This message is used by the VSP to acknowledge a receive ++// buffer send by the VSC. This message must be sent by the ++// VSP before the VSP uses the receive buffer. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE ++{ ++ UINT32 Status; ++ UINT32 NumSections; ++ ++ // ++ // The receive buffer is split into two parts, a large ++ // suballocation section and a small suballocation ++ // section. These sections are then suballocated by a ++ // certain size. ++ // ++ // For example, the following break up of the receive ++ // buffer has 6 large suballocations and 10 small ++ // suballocations. ++ // ++ // | Large Section | | Small Section | ++ // ------------------------------------------------------------ ++ // | | | | | | | | | | | | | | | | | | ++ // | | ++ // LargeOffset SmallOffset ++ // ++ NVSP_1_RECEIVE_BUFFER_SECTION Sections[1]; ++ ++} NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE, *PNVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE; ++ ++// ++// This message is sent by the VSC to revoke the receive buffer. ++// After the VSP completes this transaction, the vsp should never ++// use the receive buffer again. ++// ++typedef struct _NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER ++{ ++ UINT16 Id; ++} NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER, *PNVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER; ++ ++// ++// This message is used by the VSC to send a send buffer ++// to the VSP. The VSC can then use the send buffer to ++// send data to the VSP. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER ++{ ++ GPADL_HANDLE GpadlHandle; ++ UINT16 Id; ++} NVSP_1_MESSAGE_SEND_SEND_BUFFER, *PNVSP_1_MESSAGE_SEND_SEND_BUFFER; ++ ++// ++// This message is used by the VSP to acknowledge a send ++// buffer sent by the VSC. This message must be sent by the ++// VSP before the VSP uses the sent buffer. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE ++{ ++ UINT32 Status; ++ ++ // ++ // The VSC gets to choose the size of the send buffer and ++ // the VSP gets to choose the sections size of the buffer. ++ // This was done to enable dynamic reconfigurations when ++ // the cost of GPA-direct buffers decreases. ++ // ++ UINT32 SectionSize; ++} NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE, *PNVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE; ++ ++// ++// This message is sent by the VSC to revoke the send buffer. ++// After the VSP completes this transaction, the vsp should never ++// use the send buffer again. ++// ++typedef struct _NVSP_1_MESSAGE_REVOKE_SEND_BUFFER ++{ ++ UINT16 Id; ++} NVSP_1_MESSAGE_REVOKE_SEND_BUFFER, *PNVSP_1_MESSAGE_REVOKE_SEND_BUFFER; ++ ++// ++// This message is used by both the VSP and the VSC to send ++// a RNDIS message to the opposite channel endpoint. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET ++{ ++ // ++ // This field is specified by RNIDS. They assume there's ++ // two different channels of communication. However, ++ // the Network VSP only has one. Therefore, the channel ++ // travels with the RNDIS packet. ++ // ++ UINT32 ChannelType; ++ ++ // ++ // This field is used to send part or all of the data ++ // through a send buffer. This values specifies an ++ // index into the send buffer. If the index is ++ // 0xFFFFFFFF, then the send buffer is not being used ++ // and all of the data was sent through other VMBus ++ // mechanisms. ++ // ++ UINT32 SendBufferSectionIndex; ++ UINT32 SendBufferSectionSize; ++} NVSP_1_MESSAGE_SEND_RNDIS_PACKET, *PNVSP_1_MESSAGE_SEND_RNDIS_PACKET; ++ ++// ++// This message is used by both the VSP and the VSC to complete ++// a RNDIS message to the opposite channel endpoint. At this ++// point, the initiator of this message cannot use any resources ++// associated with the original RNDIS packet. ++// ++typedef struct _NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE ++{ ++ UINT32 Status; ++} NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE, *PNVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE; ++ ++typedef union _NVSP_MESSAGE_1_UBER ++{ ++ NVSP_1_MESSAGE_SEND_NDIS_VERSION SendNdisVersion; ++ ++ NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER SendReceiveBuffer; ++ NVSP_1_MESSAGE_SEND_RECEIVE_BUFFER_COMPLETE SendReceiveBufferComplete; ++ NVSP_1_MESSAGE_REVOKE_RECEIVE_BUFFER RevokeReceiveBuffer; ++ ++ NVSP_1_MESSAGE_SEND_SEND_BUFFER SendSendBuffer; ++ NVSP_1_MESSAGE_SEND_SEND_BUFFER_COMPLETE SendSendBufferComplete; ++ NVSP_1_MESSAGE_REVOKE_SEND_BUFFER RevokeSendBuffer; ++ ++ NVSP_1_MESSAGE_SEND_RNDIS_PACKET SendRNDISPacket; ++ NVSP_1_MESSAGE_SEND_RNDIS_PACKET_COMPLETE SendRNDISPacketComplete; ++} NVSP_1_MESSAGE_UBER; ++ ++typedef union _NVSP_ALL_MESSAGES ++{ ++ NVSP_MESSAGE_INIT_UBER InitMessages; ++ NVSP_1_MESSAGE_UBER Version1Messages; ++ ++} NVSP_ALL_MESSAGES; ++ ++// ++// ALL Messages ++// ++typedef struct _NVSP_MESSAGE ++{ ++ NVSP_MESSAGE_HEADER Header; ++ NVSP_ALL_MESSAGES Messages; ++} NVSP_MESSAGE, *PNVSP_MESSAGE; ++ ++#pragma pack(pop) +--- /dev/null ++++ b/drivers/staging/hv/include/rndis.h +@@ -0,0 +1,836 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _RNDIS_H_ ++#define _RNDIS_H_ ++ ++// ++// Basic types ++// ++typedef UINT32 RNDIS_REQUEST_ID; ++typedef UINT32 RNDIS_HANDLE; ++typedef UINT32 RNDIS_STATUS; ++typedef UINT32 RNDIS_REQUEST_TYPE; ++typedef UINT32 RNDIS_OID; ++typedef UINT32 RNDIS_CLASS_ID; ++typedef UINT32 RNDIS_MEDIUM; ++typedef UINT32 *PRNDIS_REQUEST_ID; ++typedef UINT32 *PRNDIS_HANDLE; ++typedef UINT32 *PRNDIS_STATUS; ++typedef UINT32 *PRNDIS_REQUEST_TYPE; ++typedef UINT32 *PRNDIS_OID; ++typedef UINT32 *PRNDIS_CLASS_ID; ++typedef UINT32 *PRNDIS_MEDIUM; ++typedef UINT32 RNDIS_AF; ++ ++// ++// Status codes ++// ++ ++#ifndef STATUS_SUCCESS ++#define STATUS_SUCCESS (0x00000000L) ++#endif ++ ++#ifndef STATUS_UNSUCCESSFUL ++#define STATUS_UNSUCCESSFUL (0xC0000001L) ++#endif ++ ++#ifndef STATUS_PENDING ++#define STATUS_PENDING (0x00000103L) ++#endif ++ ++#ifndef STATUS_INSUFFICIENT_RESOURCES ++#define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL) ++#endif ++ ++#ifndef STATUS_BUFFER_OVERFLOW ++#define STATUS_BUFFER_OVERFLOW (0x80000005L) ++#endif ++ ++#ifndef STATUS_NOT_SUPPORTED ++#define STATUS_NOT_SUPPORTED (0xC00000BBL) ++#endif ++ ++#define RNDIS_STATUS_SUCCESS ((RNDIS_STATUS)STATUS_SUCCESS) ++#define RNDIS_STATUS_PENDING ((RNDIS_STATUS)STATUS_PENDING) ++#define RNDIS_STATUS_NOT_RECOGNIZED ((RNDIS_STATUS)0x00010001L) ++#define RNDIS_STATUS_NOT_COPIED ((RNDIS_STATUS)0x00010002L) ++#define RNDIS_STATUS_NOT_ACCEPTED ((RNDIS_STATUS)0x00010003L) ++#define RNDIS_STATUS_CALL_ACTIVE ((RNDIS_STATUS)0x00010007L) ++ ++#define RNDIS_STATUS_ONLINE ((RNDIS_STATUS)0x40010003L) ++#define RNDIS_STATUS_RESET_START ((RNDIS_STATUS)0x40010004L) ++#define RNDIS_STATUS_RESET_END ((RNDIS_STATUS)0x40010005L) ++#define RNDIS_STATUS_RING_STATUS ((RNDIS_STATUS)0x40010006L) ++#define RNDIS_STATUS_CLOSED ((RNDIS_STATUS)0x40010007L) ++#define RNDIS_STATUS_WAN_LINE_UP ((RNDIS_STATUS)0x40010008L) ++#define RNDIS_STATUS_WAN_LINE_DOWN ((RNDIS_STATUS)0x40010009L) ++#define RNDIS_STATUS_WAN_FRAGMENT ((RNDIS_STATUS)0x4001000AL) ++#define RNDIS_STATUS_MEDIA_CONNECT ((RNDIS_STATUS)0x4001000BL) ++#define RNDIS_STATUS_MEDIA_DISCONNECT ((RNDIS_STATUS)0x4001000CL) ++#define RNDIS_STATUS_HARDWARE_LINE_UP ((RNDIS_STATUS)0x4001000DL) ++#define RNDIS_STATUS_HARDWARE_LINE_DOWN ((RNDIS_STATUS)0x4001000EL) ++#define RNDIS_STATUS_INTERFACE_UP ((RNDIS_STATUS)0x4001000FL) ++#define RNDIS_STATUS_INTERFACE_DOWN ((RNDIS_STATUS)0x40010010L) ++#define RNDIS_STATUS_MEDIA_BUSY ((RNDIS_STATUS)0x40010011L) ++#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((RNDIS_STATUS)0x40010012L) ++#define RNDIS_STATUS_WW_INDICATION RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION ++#define RNDIS_STATUS_LINK_SPEED_CHANGE ((RNDIS_STATUS)0x40010013L) ++ ++#define RNDIS_STATUS_NOT_RESETTABLE ((RNDIS_STATUS)0x80010001L) ++#define RNDIS_STATUS_SOFT_ERRORS ((RNDIS_STATUS)0x80010003L) ++#define RNDIS_STATUS_HARD_ERRORS ((RNDIS_STATUS)0x80010004L) ++#define RNDIS_STATUS_BUFFER_OVERFLOW ((RNDIS_STATUS)STATUS_BUFFER_OVERFLOW) ++ ++#define RNDIS_STATUS_FAILURE ((RNDIS_STATUS)STATUS_UNSUCCESSFUL) ++#define RNDIS_STATUS_RESOURCES ((RNDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES) ++#define RNDIS_STATUS_CLOSING ((RNDIS_STATUS)0xC0010002L) ++#define RNDIS_STATUS_BAD_VERSION ((RNDIS_STATUS)0xC0010004L) ++#define RNDIS_STATUS_BAD_CHARACTERISTICS ((RNDIS_STATUS)0xC0010005L) ++#define RNDIS_STATUS_ADAPTER_NOT_FOUND ((RNDIS_STATUS)0xC0010006L) ++#define RNDIS_STATUS_OPEN_FAILED ((RNDIS_STATUS)0xC0010007L) ++#define RNDIS_STATUS_DEVICE_FAILED ((RNDIS_STATUS)0xC0010008L) ++#define RNDIS_STATUS_MULTICAST_FULL ((RNDIS_STATUS)0xC0010009L) ++#define RNDIS_STATUS_MULTICAST_EXISTS ((RNDIS_STATUS)0xC001000AL) ++#define RNDIS_STATUS_MULTICAST_NOT_FOUND ((RNDIS_STATUS)0xC001000BL) ++#define RNDIS_STATUS_REQUEST_ABORTED ((RNDIS_STATUS)0xC001000CL) ++#define RNDIS_STATUS_RESET_IN_PROGRESS ((RNDIS_STATUS)0xC001000DL) ++#define RNDIS_STATUS_CLOSING_INDICATING ((RNDIS_STATUS)0xC001000EL) ++#define RNDIS_STATUS_NOT_SUPPORTED ((RNDIS_STATUS)STATUS_NOT_SUPPORTED) ++#define RNDIS_STATUS_INVALID_PACKET ((RNDIS_STATUS)0xC001000FL) ++#define RNDIS_STATUS_OPEN_LIST_FULL ((RNDIS_STATUS)0xC0010010L) ++#define RNDIS_STATUS_ADAPTER_NOT_READY ((RNDIS_STATUS)0xC0010011L) ++#define RNDIS_STATUS_ADAPTER_NOT_OPEN ((RNDIS_STATUS)0xC0010012L) ++#define RNDIS_STATUS_NOT_INDICATING ((RNDIS_STATUS)0xC0010013L) ++#define RNDIS_STATUS_INVALID_LENGTH ((RNDIS_STATUS)0xC0010014L) ++#define RNDIS_STATUS_INVALID_DATA ((RNDIS_STATUS)0xC0010015L) ++#define RNDIS_STATUS_BUFFER_TOO_SHORT ((RNDIS_STATUS)0xC0010016L) ++#define RNDIS_STATUS_INVALID_OID ((RNDIS_STATUS)0xC0010017L) ++#define RNDIS_STATUS_ADAPTER_REMOVED ((RNDIS_STATUS)0xC0010018L) ++#define RNDIS_STATUS_UNSUPPORTED_MEDIA ((RNDIS_STATUS)0xC0010019L) ++#define RNDIS_STATUS_GROUP_ADDRESS_IN_USE ((RNDIS_STATUS)0xC001001AL) ++#define RNDIS_STATUS_FILE_NOT_FOUND ((RNDIS_STATUS)0xC001001BL) ++#define RNDIS_STATUS_ERROR_READING_FILE ((RNDIS_STATUS)0xC001001CL) ++#define RNDIS_STATUS_ALREADY_MAPPED ((RNDIS_STATUS)0xC001001DL) ++#define RNDIS_STATUS_RESOURCE_CONFLICT ((RNDIS_STATUS)0xC001001EL) ++#define RNDIS_STATUS_NO_CABLE ((RNDIS_STATUS)0xC001001FL) ++ ++#define RNDIS_STATUS_INVALID_SAP ((RNDIS_STATUS)0xC0010020L) ++#define RNDIS_STATUS_SAP_IN_USE ((RNDIS_STATUS)0xC0010021L) ++#define RNDIS_STATUS_INVALID_ADDRESS ((RNDIS_STATUS)0xC0010022L) ++#define RNDIS_STATUS_VC_NOT_ACTIVATED ((RNDIS_STATUS)0xC0010023L) ++#define RNDIS_STATUS_DEST_OUT_OF_ORDER ((RNDIS_STATUS)0xC0010024L) ++#define RNDIS_STATUS_VC_NOT_AVAILABLE ((RNDIS_STATUS)0xC0010025L) ++#define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE ((RNDIS_STATUS)0xC0010026L) ++#define RNDIS_STATUS_INCOMPATABLE_QOS ((RNDIS_STATUS)0xC0010027L) ++#define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((RNDIS_STATUS)0xC0010028L) ++#define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION ((RNDIS_STATUS)0xC0010029L) ++ ++#define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR ((RNDIS_STATUS)0xC0011000L) ++ ++ ++// ++// Object Identifiers used by NdisRequest Query/Set Information ++// ++ ++// ++// General Objects ++// ++ ++#define RNDIS_OID_GEN_SUPPORTED_LIST 0x00010101 ++#define RNDIS_OID_GEN_HARDWARE_STATUS 0x00010102 ++#define RNDIS_OID_GEN_MEDIA_SUPPORTED 0x00010103 ++#define RNDIS_OID_GEN_MEDIA_IN_USE 0x00010104 ++#define RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 ++#define RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 ++#define RNDIS_OID_GEN_LINK_SPEED 0x00010107 ++#define RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 ++#define RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 ++#define RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A ++#define RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B ++#define RNDIS_OID_GEN_VENDOR_ID 0x0001010C ++#define RNDIS_OID_GEN_VENDOR_DESCRIPTION 0x0001010D ++#define RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0x0001010E ++#define RNDIS_OID_GEN_CURRENT_LOOKAHEAD 0x0001010F ++#define RNDIS_OID_GEN_DRIVER_VERSION 0x00010110 ++#define RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 ++#define RNDIS_OID_GEN_PROTOCOL_OPTIONS 0x00010112 ++#define RNDIS_OID_GEN_MAC_OPTIONS 0x00010113 ++#define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 ++#define RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 ++#define RNDIS_OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 ++#define RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 ++#define RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 ++#define RNDIS_OID_GEN_MACHINE_NAME 0x0001021A ++#define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B ++ ++#define RNDIS_OID_GEN_XMIT_OK 0x00020101 ++#define RNDIS_OID_GEN_RCV_OK 0x00020102 ++#define RNDIS_OID_GEN_XMIT_ERROR 0x00020103 ++#define RNDIS_OID_GEN_RCV_ERROR 0x00020104 ++#define RNDIS_OID_GEN_RCV_NO_BUFFER 0x00020105 ++ ++#define RNDIS_OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 ++#define RNDIS_OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202 ++#define RNDIS_OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 ++#define RNDIS_OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204 ++#define RNDIS_OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 ++#define RNDIS_OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206 ++#define RNDIS_OID_GEN_DIRECTED_BYTES_RCV 0x00020207 ++#define RNDIS_OID_GEN_DIRECTED_FRAMES_RCV 0x00020208 ++#define RNDIS_OID_GEN_MULTICAST_BYTES_RCV 0x00020209 ++#define RNDIS_OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A ++#define RNDIS_OID_GEN_BROADCAST_BYTES_RCV 0x0002020B ++#define RNDIS_OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C ++ ++#define RNDIS_OID_GEN_RCV_CRC_ERROR 0x0002020D ++#define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E ++ ++#define RNDIS_OID_GEN_GET_TIME_CAPS 0x0002020F ++#define RNDIS_OID_GEN_GET_NETCARD_TIME 0x00020210 ++ ++// ++// These are connection-oriented general OIDs. ++// These replace the above OIDs for connection-oriented media. ++// ++#define RNDIS_OID_GEN_CO_SUPPORTED_LIST 0x00010101 ++#define RNDIS_OID_GEN_CO_HARDWARE_STATUS 0x00010102 ++#define RNDIS_OID_GEN_CO_MEDIA_SUPPORTED 0x00010103 ++#define RNDIS_OID_GEN_CO_MEDIA_IN_USE 0x00010104 ++#define RNDIS_OID_GEN_CO_LINK_SPEED 0x00010105 ++#define RNDIS_OID_GEN_CO_VENDOR_ID 0x00010106 ++#define RNDIS_OID_GEN_CO_VENDOR_DESCRIPTION 0x00010107 ++#define RNDIS_OID_GEN_CO_DRIVER_VERSION 0x00010108 ++#define RNDIS_OID_GEN_CO_PROTOCOL_OPTIONS 0x00010109 ++#define RNDIS_OID_GEN_CO_MAC_OPTIONS 0x0001010A ++#define RNDIS_OID_GEN_CO_MEDIA_CONNECT_STATUS 0x0001010B ++#define RNDIS_OID_GEN_CO_VENDOR_DRIVER_VERSION 0x0001010C ++#define RNDIS_OID_GEN_CO_MINIMUM_LINK_SPEED 0x0001010D ++ ++#define RNDIS_OID_GEN_CO_GET_TIME_CAPS 0x00010201 ++#define RNDIS_OID_GEN_CO_GET_NETCARD_TIME 0x00010202 ++ ++// ++// These are connection-oriented statistics OIDs. ++// ++#define RNDIS_OID_GEN_CO_XMIT_PDUS_OK 0x00020101 ++#define RNDIS_OID_GEN_CO_RCV_PDUS_OK 0x00020102 ++#define RNDIS_OID_GEN_CO_XMIT_PDUS_ERROR 0x00020103 ++#define RNDIS_OID_GEN_CO_RCV_PDUS_ERROR 0x00020104 ++#define RNDIS_OID_GEN_CO_RCV_PDUS_NO_BUFFER 0x00020105 ++ ++ ++#define RNDIS_OID_GEN_CO_RCV_CRC_ERROR 0x00020201 ++#define RNDIS_OID_GEN_CO_TRANSMIT_QUEUE_LENGTH 0x00020202 ++#define RNDIS_OID_GEN_CO_BYTES_XMIT 0x00020203 ++#define RNDIS_OID_GEN_CO_BYTES_RCV 0x00020204 ++#define RNDIS_OID_GEN_CO_BYTES_XMIT_OUTSTANDING 0x00020205 ++#define RNDIS_OID_GEN_CO_NETCARD_LOAD 0x00020206 ++ ++// ++// These are objects for Connection-oriented media call-managers. ++// ++#define RNDIS_OID_CO_ADD_PVC 0xFF000001 ++#define RNDIS_OID_CO_DELETE_PVC 0xFF000002 ++#define RNDIS_OID_CO_GET_CALL_INFORMATION 0xFF000003 ++#define RNDIS_OID_CO_ADD_ADDRESS 0xFF000004 ++#define RNDIS_OID_CO_DELETE_ADDRESS 0xFF000005 ++#define RNDIS_OID_CO_GET_ADDRESSES 0xFF000006 ++#define RNDIS_OID_CO_ADDRESS_CHANGE 0xFF000007 ++#define RNDIS_OID_CO_SIGNALING_ENABLED 0xFF000008 ++#define RNDIS_OID_CO_SIGNALING_DISABLED 0xFF000009 ++ ++ ++// ++// 802.3 Objects (Ethernet) ++// ++ ++#define RNDIS_OID_802_3_PERMANENT_ADDRESS 0x01010101 ++#define RNDIS_OID_802_3_CURRENT_ADDRESS 0x01010102 ++#define RNDIS_OID_802_3_MULTICAST_LIST 0x01010103 ++#define RNDIS_OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 ++#define RNDIS_OID_802_3_MAC_OPTIONS 0x01010105 ++ ++// ++// ++#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 ++ ++#define RNDIS_OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 ++#define RNDIS_OID_802_3_XMIT_ONE_COLLISION 0x01020102 ++#define RNDIS_OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 ++ ++#define RNDIS_OID_802_3_XMIT_DEFERRED 0x01020201 ++#define RNDIS_OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 ++#define RNDIS_OID_802_3_RCV_OVERRUN 0x01020203 ++#define RNDIS_OID_802_3_XMIT_UNDERRUN 0x01020204 ++#define RNDIS_OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 ++#define RNDIS_OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 ++#define RNDIS_OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 ++ ++ ++// ++// Remote NDIS message types ++// ++#define REMOTE_NDIS_PACKET_MSG 0x00000001 ++#define REMOTE_NDIS_INITIALIZE_MSG 0x00000002 ++#define REMOTE_NDIS_HALT_MSG 0x00000003 ++#define REMOTE_NDIS_QUERY_MSG 0x00000004 ++#define REMOTE_NDIS_SET_MSG 0x00000005 ++#define REMOTE_NDIS_RESET_MSG 0x00000006 ++#define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007 ++#define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008 ++ ++#define REMOTE_CONDIS_MP_CREATE_VC_MSG 0x00008001 ++#define REMOTE_CONDIS_MP_DELETE_VC_MSG 0x00008002 ++#define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG 0x00008005 ++#define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG 0x00008006 ++#define REMOTE_CONDIS_INDICATE_STATUS_MSG 0x00008007 ++ ++ ++// Remote NDIS message completion types ++#define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002 ++#define REMOTE_NDIS_QUERY_CMPLT 0x80000004 ++#define REMOTE_NDIS_SET_CMPLT 0x80000005 ++#define REMOTE_NDIS_RESET_CMPLT 0x80000006 ++#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008 ++ ++#define REMOTE_CONDIS_MP_CREATE_VC_CMPLT 0x80008001 ++#define REMOTE_CONDIS_MP_DELETE_VC_CMPLT 0x80008002 ++#define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT 0x80008005 ++#define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT 0x80008006 ++ ++// ++// Reserved message type for private communication between lower-layer ++// host driver and remote device, if necessary. ++// ++#define REMOTE_NDIS_BUS_MSG 0xff000001 ++ ++ ++ ++// ++// Defines for DeviceFlags in RNDIS_INITIALIZE_COMPLETE ++// ++#define RNDIS_DF_CONNECTIONLESS 0x00000001 ++#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 ++#define RNDIS_DF_RAW_DATA 0x00000004 ++ ++// ++// Remote NDIS medium types. ++// ++#define RNdisMedium802_3 0x00000000 ++#define RNdisMedium802_5 0x00000001 ++#define RNdisMediumFddi 0x00000002 ++#define RNdisMediumWan 0x00000003 ++#define RNdisMediumLocalTalk 0x00000004 ++#define RNdisMediumArcnetRaw 0x00000006 ++#define RNdisMediumArcnet878_2 0x00000007 ++#define RNdisMediumAtm 0x00000008 ++#define RNdisMediumWirelessWan 0x00000009 ++#define RNdisMediumIrda 0x0000000a ++#define RNdisMediumCoWan 0x0000000b ++#define RNdisMediumMax 0x0000000d // Not a real medium, defined as an upper-bound ++ ++// ++// Remote NDIS medium connection states. ++// ++#define RNdisMediaStateConnected 0x00000000 ++#define RNdisMediaStateDisconnected 0x00000001 ++ ++// ++// Remote NDIS version numbers ++// ++#define RNDIS_MAJOR_VERSION 0x00000001 ++#define RNDIS_MINOR_VERSION 0x00000000 ++ ++// ++// NdisInitialize message ++// ++typedef struct _RNDIS_INITIALIZE_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ UINT32 MajorVersion; ++ UINT32 MinorVersion; ++ UINT32 MaxTransferSize; ++} RNDIS_INITIALIZE_REQUEST, *PRNDIS_INITIALIZE_REQUEST; ++ ++ ++// ++// Response to NdisInitialize ++// ++typedef struct _RNDIS_INITIALIZE_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++ UINT32 MajorVersion; ++ UINT32 MinorVersion; ++ UINT32 DeviceFlags; ++ RNDIS_MEDIUM Medium; ++ UINT32 MaxPacketsPerMessage; ++ UINT32 MaxTransferSize; ++ UINT32 PacketAlignmentFactor; ++ UINT32 AFListOffset; ++ UINT32 AFListSize; ++} RNDIS_INITIALIZE_COMPLETE, *PRNDIS_INITIALIZE_COMPLETE; ++ ++ ++// ++// Call manager devices only: Information about an address family ++// supported by the device is appended to the response to NdisInitialize. ++// ++typedef struct _RNDIS_CO_ADDRESS_FAMILY ++{ ++ RNDIS_AF AddressFamily; ++ UINT32 MajorVersion; ++ UINT32 MinorVersion; ++} RNDIS_CO_ADDRESS_FAMILY, *PRNDIS_CO_ADDRESS_FAMILY; ++ ++ ++// ++// NdisHalt message ++// ++typedef struct _RNDIS_HALT_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++} RNDIS_HALT_REQUEST, *PRNDIS_HALT_REQUEST; ++ ++ ++// ++// NdisQueryRequest message ++// ++typedef struct _RNDIS_QUERY_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_OID Oid; ++ UINT32 InformationBufferLength; ++ UINT32 InformationBufferOffset; ++ RNDIS_HANDLE DeviceVcHandle; ++} RNDIS_QUERY_REQUEST, *PRNDIS_QUERY_REQUEST; ++ ++ ++// ++// Response to NdisQueryRequest ++// ++typedef struct _RNDIS_QUERY_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++ UINT32 InformationBufferLength; ++ UINT32 InformationBufferOffset; ++} RNDIS_QUERY_COMPLETE, *PRNDIS_QUERY_COMPLETE; ++ ++ ++// ++// NdisSetRequest message ++// ++typedef struct _RNDIS_SET_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_OID Oid; ++ UINT32 InformationBufferLength; ++ UINT32 InformationBufferOffset; ++ RNDIS_HANDLE DeviceVcHandle; ++} RNDIS_SET_REQUEST, *PRNDIS_SET_REQUEST; ++ ++ ++// ++// Response to NdisSetRequest ++// ++typedef struct _RNDIS_SET_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++} RNDIS_SET_COMPLETE, *PRNDIS_SET_COMPLETE; ++ ++ ++// ++// NdisReset message ++// ++typedef struct _RNDIS_RESET_REQUEST ++{ ++ UINT32 Reserved; ++} RNDIS_RESET_REQUEST, *PRNDIS_RESET_REQUEST; ++ ++// ++// Response to NdisReset ++// ++typedef struct _RNDIS_RESET_COMPLETE ++{ ++ RNDIS_STATUS Status; ++ UINT32 AddressingReset; ++} RNDIS_RESET_COMPLETE, *PRNDIS_RESET_COMPLETE; ++ ++ ++// ++// NdisMIndicateStatus message ++// ++typedef struct _RNDIS_INDICATE_STATUS ++{ ++ RNDIS_STATUS Status; ++ UINT32 StatusBufferLength; ++ UINT32 StatusBufferOffset; ++} RNDIS_INDICATE_STATUS, *PRNDIS_INDICATE_STATUS; ++ ++ ++// ++// Diagnostic information passed as the status buffer in ++// RNDIS_INDICATE_STATUS messages signifying error conditions. ++// ++typedef struct _RNDIS_DIAGNOSTIC_INFO ++{ ++ RNDIS_STATUS DiagStatus; ++ UINT32 ErrorOffset; ++} RNDIS_DIAGNOSTIC_INFO, *PRNDIS_DIAGNOSTIC_INFO; ++ ++ ++ ++// ++// NdisKeepAlive message ++// ++typedef struct _RNDIS_KEEPALIVE_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++} RNDIS_KEEPALIVE_REQUEST, *PRNDIS_KEEPALIVE_REQUEST; ++ ++ ++// ++// Response to NdisKeepAlive ++// ++typedef struct _RNDIS_KEEPALIVE_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++} RNDIS_KEEPALIVE_COMPLETE, *PRNDIS_KEEPALIVE_COMPLETE; ++ ++ ++// ++// Data message. All Offset fields contain byte offsets from the beginning ++// of the RNDIS_PACKET structure. All Length fields are in bytes. ++// VcHandle is set to 0 for connectionless data, otherwise it ++// contains the VC handle. ++// ++typedef struct _RNDIS_PACKET ++{ ++ UINT32 DataOffset; ++ UINT32 DataLength; ++ UINT32 OOBDataOffset; ++ UINT32 OOBDataLength; ++ UINT32 NumOOBDataElements; ++ UINT32 PerPacketInfoOffset; ++ UINT32 PerPacketInfoLength; ++ RNDIS_HANDLE VcHandle; ++ UINT32 Reserved; ++} RNDIS_PACKET, *PRNDIS_PACKET; ++ ++// ++// Optional Out of Band data associated with a Data message. ++// ++typedef struct _RNDIS_OOBD ++{ ++ UINT32 Size; ++ RNDIS_CLASS_ID Type; ++ UINT32 ClassInformationOffset; ++} RNDIS_OOBD, *PRNDIS_OOBD; ++ ++// ++// Packet extension field contents associated with a Data message. ++// ++typedef struct _RNDIS_PER_PACKET_INFO ++{ ++ UINT32 Size; ++ UINT32 Type; ++ UINT32 PerPacketInformationOffset; ++} RNDIS_PER_PACKET_INFO, *PRNDIS_PER_PACKET_INFO; ++ ++ ++// ++// Format of Information buffer passed in a SetRequest for the OID ++// OID_GEN_RNDIS_CONFIG_PARAMETER. ++// ++typedef struct _RNDIS_CONFIG_PARAMETER_INFO ++{ ++ UINT32 ParameterNameOffset; ++ UINT32 ParameterNameLength; ++ UINT32 ParameterType; ++ UINT32 ParameterValueOffset; ++ UINT32 ParameterValueLength; ++} RNDIS_CONFIG_PARAMETER_INFO, *PRNDIS_CONFIG_PARAMETER_INFO; ++ ++// ++// Values for ParameterType in RNDIS_CONFIG_PARAMETER_INFO ++// ++#define RNDIS_CONFIG_PARAM_TYPE_INTEGER 0 ++#define RNDIS_CONFIG_PARAM_TYPE_STRING 2 ++ ++ ++// ++// CONDIS Miniport messages for connection oriented devices ++// that do not implement a call manager. ++// ++ ++// ++// CoNdisMiniportCreateVc message ++// ++typedef struct _RCONDIS_MP_CREATE_VC ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_HANDLE NdisVcHandle; ++} RCONDIS_MP_CREATE_VC, *PRCONDIS_MP_CREATE_VC; ++ ++// ++// Response to CoNdisMiniportCreateVc ++// ++typedef struct _RCONDIS_MP_CREATE_VC_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_HANDLE DeviceVcHandle; ++ RNDIS_STATUS Status; ++} RCONDIS_MP_CREATE_VC_COMPLETE, *PRCONDIS_MP_CREATE_VC_COMPLETE; ++ ++ ++// ++// CoNdisMiniportDeleteVc message ++// ++typedef struct _RCONDIS_MP_DELETE_VC ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_HANDLE DeviceVcHandle; ++} RCONDIS_MP_DELETE_VC, *PRCONDIS_MP_DELETE_VC; ++ ++// ++// Response to CoNdisMiniportDeleteVc ++// ++typedef struct _RCONDIS_MP_DELETE_VC_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++} RCONDIS_MP_DELETE_VC_COMPLETE, *PRCONDIS_MP_DELETE_VC_COMPLETE; ++ ++ ++// ++// CoNdisMiniportQueryRequest message ++// ++typedef struct _RCONDIS_MP_QUERY_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_REQUEST_TYPE RequestType; ++ RNDIS_OID Oid; ++ RNDIS_HANDLE DeviceVcHandle; ++ UINT32 InformationBufferLength; ++ UINT32 InformationBufferOffset; ++} RCONDIS_MP_QUERY_REQUEST, *PRCONDIS_MP_QUERY_REQUEST; ++ ++ ++// ++// CoNdisMiniportSetRequest message ++// ++typedef struct _RCONDIS_MP_SET_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_REQUEST_TYPE RequestType; ++ RNDIS_OID Oid; ++ RNDIS_HANDLE DeviceVcHandle; ++ UINT32 InformationBufferLength; ++ UINT32 InformationBufferOffset; ++} RCONDIS_MP_SET_REQUEST, *PRCONDIS_MP_SET_REQUEST; ++ ++ ++// ++// CoNdisIndicateStatus message ++// ++typedef struct _RCONDIS_INDICATE_STATUS ++{ ++ RNDIS_HANDLE NdisVcHandle; ++ RNDIS_STATUS Status; ++ UINT32 StatusBufferLength; ++ UINT32 StatusBufferOffset; ++} RCONDIS_INDICATE_STATUS, *PRCONDIS_INDICATE_STATUS; ++ ++ ++// ++// CONDIS Call/VC parameters ++// ++ ++typedef struct _RCONDIS_SPECIFIC_PARAMETERS ++{ ++ UINT32 ParameterType; ++ UINT32 ParameterLength; ++ UINT32 ParameterOffset; ++} RCONDIS_SPECIFIC_PARAMETERS, *PRCONDIS_SPECIFIC_PARAMETERS; ++ ++typedef struct _RCONDIS_MEDIA_PARAMETERS ++{ ++ UINT32 Flags; ++ UINT32 Reserved1; ++ UINT32 Reserved2; ++ RCONDIS_SPECIFIC_PARAMETERS MediaSpecific; ++} RCONDIS_MEDIA_PARAMETERS, *PRCONDIS_MEDIA_PARAMETERS; ++ ++ ++typedef struct _RNDIS_FLOWSPEC ++{ ++ UINT32 TokenRate; ++ UINT32 TokenBucketSize; ++ UINT32 PeakBandwidth; ++ UINT32 Latency; ++ UINT32 DelayVariation; ++ UINT32 ServiceType; ++ UINT32 MaxSduSize; ++ UINT32 MinimumPolicedSize; ++} RNDIS_FLOWSPEC, *PRNDIS_FLOWSPEC; ++ ++typedef struct _RCONDIS_CALL_MANAGER_PARAMETERS ++{ ++ RNDIS_FLOWSPEC Transmit; ++ RNDIS_FLOWSPEC Receive; ++ RCONDIS_SPECIFIC_PARAMETERS CallMgrSpecific; ++} RCONDIS_CALL_MANAGER_PARAMETERS, *PRCONDIS_CALL_MANAGER_PARAMETERS; ++ ++// ++// CoNdisMiniportActivateVc message ++// ++typedef struct _RCONDIS_MP_ACTIVATE_VC_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ UINT32 Flags; ++ RNDIS_HANDLE DeviceVcHandle; ++ UINT32 MediaParamsOffset; ++ UINT32 MediaParamsLength; ++ UINT32 CallMgrParamsOffset; ++ UINT32 CallMgrParamsLength; ++} RCONDIS_MP_ACTIVATE_VC_REQUEST, *PRCONDIS_MP_ACTIVATE_VC_REQUEST; ++ ++// ++// Response to CoNdisMiniportActivateVc ++// ++typedef struct _RCONDIS_MP_ACTIVATE_VC_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++} RCONDIS_MP_ACTIVATE_VC_COMPLETE, *PRCONDIS_MP_ACTIVATE_VC_COMPLETE; ++ ++ ++// ++// CoNdisMiniportDeactivateVc message ++// ++typedef struct _RCONDIS_MP_DEACTIVATE_VC_REQUEST ++{ ++ RNDIS_REQUEST_ID RequestId; ++ UINT32 Flags; ++ RNDIS_HANDLE DeviceVcHandle; ++} RCONDIS_MP_DEACTIVATE_VC_REQUEST, *PRCONDIS_MP_DEACTIVATE_VC_REQUEST; ++ ++// ++// Response to CoNdisMiniportDeactivateVc ++// ++typedef struct _RCONDIS_MP_DEACTIVATE_VC_COMPLETE ++{ ++ RNDIS_REQUEST_ID RequestId; ++ RNDIS_STATUS Status; ++} RCONDIS_MP_DEACTIVATE_VC_COMPLETE, *PRCONDIS_MP_DEACTIVATE_VC_COMPLETE; ++ ++ ++// ++// union with all of the RNDIS messages ++// ++typedef union _RNDIS_MESSAGE_CONTAINER ++{ ++ RNDIS_PACKET Packet; ++ RNDIS_INITIALIZE_REQUEST InitializeRequest; ++ RNDIS_HALT_REQUEST HaltRequest; ++ RNDIS_QUERY_REQUEST QueryRequest; ++ RNDIS_SET_REQUEST SetRequest; ++ RNDIS_RESET_REQUEST ResetRequest; ++ RNDIS_KEEPALIVE_REQUEST KeepaliveRequest; ++ RNDIS_INDICATE_STATUS IndicateStatus; ++ RNDIS_INITIALIZE_COMPLETE InitializeComplete; ++ RNDIS_QUERY_COMPLETE QueryComplete; ++ RNDIS_SET_COMPLETE SetComplete; ++ RNDIS_RESET_COMPLETE ResetComplete; ++ RNDIS_KEEPALIVE_COMPLETE KeepaliveComplete; ++ RCONDIS_MP_CREATE_VC CoMiniportCreateVc; ++ RCONDIS_MP_DELETE_VC CoMiniportDeleteVc; ++ RCONDIS_INDICATE_STATUS CoIndicateStatus; ++ RCONDIS_MP_ACTIVATE_VC_REQUEST CoMiniportActivateVc; ++ RCONDIS_MP_DEACTIVATE_VC_REQUEST CoMiniportDeactivateVc; ++ RCONDIS_MP_CREATE_VC_COMPLETE CoMiniportCreateVcComplete; ++ RCONDIS_MP_DELETE_VC_COMPLETE CoMiniportDeleteVcComplete; ++ RCONDIS_MP_ACTIVATE_VC_COMPLETE CoMiniportActivateVcComplete; ++ RCONDIS_MP_DEACTIVATE_VC_COMPLETE CoMiniportDeactivateVcComplete; ++ ++ ++} RNDIS_MESSAGE_CONTAINER, *PRNDIS_MESSAGE_CONTAINER; ++ ++// ++// Remote NDIS message format ++// ++typedef __struct_bcount(MessageLength) struct _RNDIS_MESSAGE ++{ ++ UINT32 NdisMessageType; ++ ++ // ++ // Total length of this message, from the beginning ++ // of the RNDIS_MESSAGE struct, in bytes. ++ // ++ UINT32 MessageLength; ++ ++ // Actual message ++ RNDIS_MESSAGE_CONTAINER Message; ++ ++} RNDIS_MESSAGE, *PRNDIS_MESSAGE; ++ ++ ++ ++// ++// Handy macros ++ ++// get the size of an RNDIS message. Pass in the message type, ++// RNDIS_SET_REQUEST, RNDIS_PACKET for example ++#define RNDIS_MESSAGE_SIZE(Message) \ ++ (sizeof(Message) + (sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER))) ++ ++// get pointer to info buffer with message pointer ++#define MESSAGE_TO_INFO_BUFFER(Message) \ ++ (((PUCHAR)(Message)) + Message->InformationBufferOffset) ++ ++// get pointer to status buffer with message pointer ++#define MESSAGE_TO_STATUS_BUFFER(Message) \ ++ (((PUCHAR)(Message)) + Message->StatusBufferOffset) ++ ++// get pointer to OOBD buffer with message pointer ++#define MESSAGE_TO_OOBD_BUFFER(Message) \ ++ (((PUCHAR)(Message)) + Message->OOBDataOffset) ++ ++// get pointer to data buffer with message pointer ++#define MESSAGE_TO_DATA_BUFFER(Message) \ ++ (((PUCHAR)(Message)) + Message->PerPacketInfoOffset) ++ ++// get pointer to contained message from NDIS_MESSAGE pointer ++#define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(RndisMessage) \ ++ ((PVOID) &RndisMessage->Message) ++ ++// get pointer to contained message from NDIS_MESSAGE pointer ++#define RNDIS_MESSAGE_RAW_PTR_TO_MESSAGE_PTR(RndisMessage) \ ++ ((PVOID) RndisMessage) ++ ++#endif // _RNDIS_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/VmbusChannelInterface.h +@@ -0,0 +1,131 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++// allow nameless unions ++//#pragma warning(disable : 4201) ++ ++// ++// A revision number of vmbus that is used for ensuring both ends on a ++// partition are using compatible versions. ++// ++#define VMBUS_REVISION_NUMBER 13 ++ ++// ++// Make maximum size of pipe payload of 16K ++// ++#define MAX_PIPE_DATA_PAYLOAD (sizeof(BYTE) * 16384) ++ ++// ++// Define PipeMode values. ++// ++#define VMBUS_PIPE_TYPE_BYTE 0x00000000 ++#define VMBUS_PIPE_TYPE_MESSAGE 0x00000004 ++ ++// ++// The size of the user defined data buffer for non-pipe offers. ++// ++#define MAX_USER_DEFINED_BYTES 120 ++ ++// ++// The size of the user defined data buffer for pipe offers. ++// ++#define MAX_PIPE_USER_DEFINED_BYTES 116 ++ ++ ++// ++// At the center of the Channel Management library is ++// the Channel Offer. This struct contains the ++// fundamental information about an offer. ++// ++#pragma pack(push,1) ++ ++typedef struct ++{ ++ ++ GUID InterfaceType; ++ GUID InterfaceInstance; ++ UINT64 InterruptLatencyIn100nsUnits; ++ UINT32 InterfaceRevision; ++ UINT32 ServerContextAreaSize; // in bytes ++ UINT16 ChannelFlags; ++ UINT16 MmioMegabytes; // in bytes * 1024 * 1024 ++ ++ union ++ { ++ // ++ // Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. ++ // ++ struct ++ { ++ UCHAR UserDefined[MAX_USER_DEFINED_BYTES]; ++ } Standard; ++ ++ // ++ // Pipes: The following sructure is an integrated pipe protocol, which ++ // is implemented on top of standard user-defined data. Pipe clients ++ // have MAX_PIPE_USER_DEFINED_BYTES left for their own use. ++ // ++ struct ++ { ++ UINT32 PipeMode; ++ UCHAR UserDefined[MAX_PIPE_USER_DEFINED_BYTES]; ++ } Pipe; ++ } u; ++ UINT32 Padding; ++} VMBUS_CHANNEL_OFFER, *PVMBUS_CHANNEL_OFFER; ++#pragma pack(pop) ++ ++ ++// ++// Verify the MAX_PIPE_USER_DEFINED_BYTES value. ++// ++//C_ASSERT(MAX_PIPE_USER_DEFINED_BYTES == ++// MAX_USER_DEFINED_BYTES - ++// (FIELD_OFFSET(VMBUS_CHANNEL_OFFER, u.Pipe.UserDefined) - ++// FIELD_OFFSET(VMBUS_CHANNEL_OFFER, u.Standard.UserDefined))); ++// ++ ++typedef UINT32 GPADL_HANDLE; ++ ++// ++// Server Flags ++// ++ ++#define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1 ++#define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2 ++#define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4 ++#define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10 ++#define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100 ++#define VMBUS_CHANNEL_PARENT_OFFER 0x200 ++#define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400 ++ ++// ++// TEMPTEMP -- move this next define to devioctl.h some day ++// ++ ++#ifndef FILE_DEVICE_VMBUS ++#define FILE_DEVICE_VMBUS 0x0000003E ++#endif ++ +--- /dev/null ++++ b/drivers/staging/hv/include/VmbusPacketFormat.h +@@ -0,0 +1,322 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++//#ifndef PAGE_SIZE ++//#if defined(_IA64_) ++//#error This does not work for IA64 ++//#else ++//#define PAGE_SIZE 0x1000 ++//#endif ++//#endif ++ ++// allow nameless unions ++//#pragma warning(disable : 4201) ++ ++typedef struct ++{ ++ union ++ { ++ struct ++ { ++ volatile UINT32 In; // Offset in bytes from the ring base ++ volatile UINT32 Out; // Offset in bytes from the ring base ++ }; ++ volatile LONGLONG InOut; ++ }; ++ ++ // ++ // If the receiving endpoint sets this to some non-zero value, the sending ++ // endpoint should not send any interrupts. ++ // ++ ++ volatile UINT32 InterruptMask; ++ ++} VMRCB, *PVMRCB; ++ ++typedef struct ++{ ++ union ++ { ++ struct ++ { ++ VMRCB Control; ++ }; ++ ++ UINT8 Reserved[PAGE_SIZE]; ++ }; ++ ++ // ++ // Beginning of the ring data. Note: It must be guaranteed that ++ // this data does not share a page with the control structure. ++ // ++ UINT8 Data[1]; ++} VMRING, *PVMRING; ++ ++#pragma pack(push, 1) ++ ++typedef struct ++{ ++ UINT16 Type; ++ UINT16 DataOffset8; ++ UINT16 Length8; ++ UINT16 Flags; ++ UINT64 TransactionId; ++} VMPACKET_DESCRIPTOR, *PVMPACKET_DESCRIPTOR; ++ ++typedef UINT32 PREVIOUS_PACKET_OFFSET, *PPREVIOUS_PACKET_OFFSET; ++ ++typedef struct ++{ ++ PREVIOUS_PACKET_OFFSET PreviousPacketStartOffset; ++ VMPACKET_DESCRIPTOR Descriptor; ++} VMPACKET_HEADER, *PVMPACKET_HEADER; ++ ++typedef struct ++{ ++ UINT32 ByteCount; ++ UINT32 ByteOffset; ++} VMTRANSFER_PAGE_RANGE, *PVMTRANSFER_PAGE_RANGE; ++ ++#ifdef __cplusplus ++ ++typedef struct _VMTRANSFER_PAGE_PACKET_HEADER : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct VMTRANSFER_PAGE_PACKET_HEADER { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT16 TransferPageSetId; ++ BOOLEAN SenderOwnsSet; ++ UINT8 Reserved; ++ UINT32 RangeCount; ++ VMTRANSFER_PAGE_RANGE Ranges[1]; ++ ++} VMTRANSFER_PAGE_PACKET_HEADER, *PVMTRANSFER_PAGE_PACKET_HEADER; ++ ++ ++#ifdef __cplusplus ++ ++typedef struct _VMGPADL_PACKET_HEADER : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMGPADL_PACKET_HEADER { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ ++ UINT32 Gpadl; ++ UINT32 Reserved; ++ ++} VMGPADL_PACKET_HEADER, *PVMGPADL_PACKET_HEADER; ++ ++#ifdef __cplusplus ++ ++typedef struct _VMADD_REMOVE_TRANSFER_PAGE_SET : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMADD_REMOVE_TRANSFER_PAGE_SET { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT32 Gpadl; ++ UINT16 TransferPageSetId; ++ UINT16 Reserved; ++ ++} VMADD_REMOVE_TRANSFER_PAGE_SET, *PVMADD_REMOVE_TRANSFER_PAGE_SET; ++ ++#pragma pack(pop) ++ ++// ++// This structure defines a range in guest physical space that can be made ++// to look virtually contiguous. ++// ++ ++typedef struct _GPA_RANGE { ++ ++ UINT32 ByteCount; ++ UINT32 ByteOffset; ++ UINT64 PfnArray[0]; ++ ++} GPA_RANGE, *PGPA_RANGE; ++ ++ ++ ++#pragma pack(push, 1) ++ ++// ++// This is the format for an Establish Gpadl packet, which contains a handle ++// by which this GPADL will be known and a set of GPA ranges associated with ++// it. This can be converted to a MDL by the guest OS. If there are multiple ++// GPA ranges, then the resulting MDL will be "chained," representing multiple ++// VA ranges. ++// ++ ++#ifdef __cplusplus ++ ++typedef struct _VMESTABLISH_GPADL : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMESTABLISH_GPADL { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT32 Gpadl; ++ UINT32 RangeCount; ++ GPA_RANGE Range[1]; ++ ++} VMESTABLISH_GPADL, *PVMESTABLISH_GPADL; ++ ++ ++// ++// This is the format for a Teardown Gpadl packet, which indicates that the ++// GPADL handle in the Establish Gpadl packet will never be referenced again. ++// ++ ++#ifdef __cplusplus ++ ++typedef struct _VMTEARDOWN_GPADL : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMTEARDOWN_GPADL { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT32 Gpadl; ++ UINT32 Reserved; // for alignment to a 8-byte boundary ++} VMTEARDOWN_GPADL, *PVMTEARDOWN_GPADL; ++ ++ ++// ++// This is the format for a GPA-Direct packet, which contains a set of GPA ++// ranges, in addition to commands and/or data. ++// ++ ++#ifdef __cplusplus ++ ++typedef struct _VMDATA_GPA_DIRECT : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMDATA_GPA_DIRECT { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT32 Reserved; ++ UINT32 RangeCount; ++ GPA_RANGE Range[1]; ++ ++} VMDATA_GPA_DIRECT, *PVMDATA_GPA_DIRECT; ++ ++ ++ ++// ++// This is the format for a Additional Data Packet. ++// ++ ++#ifdef __cplusplus ++ ++typedef struct _VMADDITIONAL_DATA : VMPACKET_DESCRIPTOR { ++ ++#else ++ ++typedef struct _VMADDITIONAL_DATA { ++ ++ VMPACKET_DESCRIPTOR d; ++ ++#endif ++ ++ UINT64 TotalBytes; ++ UINT32 ByteOffset; ++ UINT32 ByteCount; ++ UCHAR Data[1]; ++ ++} VMADDITIONAL_DATA, *PVMADDITIONAL_DATA; ++ ++ ++#pragma pack(pop) ++ ++typedef union { ++ VMPACKET_DESCRIPTOR SimpleHeader; ++ VMTRANSFER_PAGE_PACKET_HEADER TransferPageHeader; ++ VMGPADL_PACKET_HEADER GpadlHeader; ++ VMADD_REMOVE_TRANSFER_PAGE_SET AddRemoveTransferPageHeader; ++ VMESTABLISH_GPADL EstablishGpadlHeader; ++ VMTEARDOWN_GPADL TeardownGpadlHeader; ++ VMDATA_GPA_DIRECT DataGpaDirectHeader; ++} VMPACKET_LARGEST_POSSIBLE_HEADER, *PVMPACKET_LARGEST_POSSIBLE_HEADER; ++ ++#define VMPACKET_DATA_START_ADDRESS(__packet) \ ++ (PVOID)(((PUCHAR)__packet) + ((PVMPACKET_DESCRIPTOR)__packet)->DataOffset8 * 8) ++ ++#define VMPACKET_DATA_LENGTH(__packet) \ ++ ((((PVMPACKET_DESCRIPTOR)__packet)->Length8 - ((PVMPACKET_DESCRIPTOR)__packet)->DataOffset8) * 8) ++ ++#define VMPACKET_TRANSFER_MODE(__packet) ((PVMPACKET_DESCRIPTOR)__packet)->Type ++ ++typedef enum { ++ VmbusServerEndpoint = 0, ++ VmbusClientEndpoint, ++ VmbusEndpointMaximum ++} ENDPOINT_TYPE, *PENDPOINT_TYPE; ++ ++typedef enum { ++ VmbusPacketTypeInvalid = 0x0, ++ VmbusPacketTypeSynch = 0x1, ++ VmbusPacketTypeAddTransferPageSet = 0x2, ++ VmbusPacketTypeRemoveTransferPageSet = 0x3, ++ VmbusPacketTypeEstablishGpadl = 0x4, ++ VmbusPacketTypeTearDownGpadl = 0x5, ++ VmbusPacketTypeDataInBand = 0x6, ++ VmbusPacketTypeDataUsingTransferPages = 0x7, ++ VmbusPacketTypeDataUsingGpadl = 0x8, ++ VmbusPacketTypeDataUsingGpaDirect = 0x9, ++ VmbusPacketTypeCancelRequest = 0xa, ++ VmbusPacketTypeCompletion = 0xb, ++ VmbusPacketTypeDataUsingAdditionalPackets = 0xc, ++ VmbusPacketTypeAdditionalData = 0xd ++} VMBUS_PACKET_TYPE, *PVMBUS_PACKET_TYPE; ++ ++#define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1 ++ ++ +--- /dev/null ++++ b/drivers/staging/hv/include/vstorage.h +@@ -0,0 +1,309 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++//#include ++//#include ++ ++#define C_ASSERT(x) ++// ++// public interface to the server ++// ++ ++// ++// Storvsp device interface guid ++// ++ ++ ++// ++// Protocol versions. ++// ++ ++// ++// vstorage.w revision number. This is used in the case of a version match, ++// to alert the user that structure sizes may be mismatched even though the ++// protocol versions match. ++// ++ ++#define REVISION_STRING(REVISION_) #REVISION_ ++#define FILL_VMSTOR_REVISION(RESULT_LVALUE_) \ ++{ \ ++ char *revisionString = REVISION_STRING($Revision: 6 $) + 11; \ ++ RESULT_LVALUE_ = 0; \ ++ while (*revisionString >= '0' && *revisionString <= '9') \ ++ { \ ++ RESULT_LVALUE_ *= 10; \ ++ RESULT_LVALUE_ += *revisionString - '0'; \ ++ revisionString++; \ ++ } \ ++} ++ ++// ++// Major/minor macros. Minor version is in LSB, meaning that earlier flat ++// version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). ++// ++ ++#define VMSTOR_PROTOCOL_MAJOR(VERSION_) (((VERSION_) >> 8) & 0xff) ++#define VMSTOR_PROTOCOL_MINOR(VERSION_) (((VERSION_) ) & 0xff) ++#define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \ ++ (((MINOR_) & 0xff) )) ++ ++// ++// Invalid version. ++// ++ ++#define VMSTOR_INVALID_PROTOCOL_VERSION -1 ++ ++// ++// Version history: ++// V1 Beta 0.1 ++// V1 RC < 2008/1/31 1.0 ++// V1 RC > 2008/1/31 2.0 ++// ++#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0) ++ ++ ++// ++// This will get replaced with the max transfer length that is possible on ++// the host adapter. ++// The max transfer length will be published when we offer a vmbus channel. ++// ++ ++#define MAX_TRANSFER_LENGTH 0x40000 ++#define DEFAULT_PACKET_SIZE (sizeof(VMDATA_GPA_DIRECT) + \ ++ sizeof(VSTOR_PACKET) + \ ++ (sizeof(UINT64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE))) ++ ++ ++ ++// ++// Packet structure describing virtual storage requests. ++// ++ ++typedef enum ++{ ++ VStorOperationCompleteIo = 1, ++ VStorOperationRemoveDevice = 2, ++ VStorOperationExecuteSRB = 3, ++ VStorOperationResetLun = 4, ++ VStorOperationResetAdapter = 5, ++ VStorOperationResetBus = 6, ++ VStorOperationBeginInitialization = 7, ++ VStorOperationEndInitialization = 8, ++ VStorOperationQueryProtocolVersion = 9, ++ VStorOperationQueryProperties = 10, ++ VStorOperationMaximum = 10 ++ ++} VSTOR_PACKET_OPERATION; ++ ++ ++// ++// Platform neutral description of a scsi request - ++// this remains the same across the write regardless of 32/64 bit ++// note: it's patterned off the SCSI_PASS_THROUGH structure ++// ++ ++ ++#pragma pack(push,1) ++ ++ ++#define CDB16GENERIC_LENGTH 0x10 ++ ++#ifndef SENSE_BUFFER_SIZE ++#define SENSE_BUFFER_SIZE 0x12 ++#endif ++C_ASSERT(SENSE_BUFFER_SIZE == 0x12); ++ ++#define MAX_DATA_BUFFER_LENGTH_WITH_PADDING 0x14 ++ ++ ++typedef struct ++{ ++ USHORT Length; ++ UCHAR SrbStatus; ++ UCHAR ScsiStatus; ++ ++ UCHAR PortNumber; ++ UCHAR PathId; ++ UCHAR TargetId; ++ UCHAR Lun; ++ ++ UCHAR CdbLength; ++ UCHAR SenseInfoLength; ++ UCHAR DataIn; ++ UCHAR Reserved; ++ ++ ULONG DataTransferLength; ++ ++ union ++ { ++ UCHAR Cdb[CDB16GENERIC_LENGTH]; ++ ++ UCHAR SenseData[SENSE_BUFFER_SIZE]; ++ ++ UCHAR ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING]; ++ }; ++ ++} VMSCSI_REQUEST, *PVMSCSI_REQUEST; ++ ++C_ASSERT((sizeof(VMSCSI_REQUEST) % 4) == 0); ++ ++ ++// ++// This structure is sent during the intialization phase to get the different ++// properties of the channel. ++// ++ ++typedef struct ++{ ++ USHORT ProtocolVersion; ++ UCHAR PathId; ++ UCHAR TargetId; ++ ++ // ++ // Note: port number is only really known on the client side ++ // ++ ULONG PortNumber; ++ ++ ULONG Flags; ++ ++ ULONG MaxTransferBytes; ++ ++ // ++ // This id is unique for each channel and will correspond with ++ // vendor specific data in the inquirydata ++ // ++ ++ ULONGLONG UniqueId; ++ ++} VMSTORAGE_CHANNEL_PROPERTIES, *PVMSTORAGE_CHANNEL_PROPERTIES; ++ ++C_ASSERT((sizeof(VMSTORAGE_CHANNEL_PROPERTIES) % 4) == 0); ++ ++ ++// ++// This structure is sent during the storage protocol negotiations. ++// ++ ++typedef struct ++{ ++ // ++ // Major (MSW) and minor (LSW) version numbers. ++ // ++ ++ USHORT MajorMinor; ++ ++ ++ // ++ // Revision number is auto-incremented whenever this file is changed ++ // (See FILL_VMSTOR_REVISION macro above). Mismatch does not definitely ++ // indicate incompatibility--but it does indicate mismatched builds. ++ // ++ ++ USHORT Revision; ++ ++} VMSTORAGE_PROTOCOL_VERSION, *PVMSTORAGE_PROTOCOL_VERSION; ++ ++C_ASSERT((sizeof(VMSTORAGE_PROTOCOL_VERSION) % 4) == 0); ++ ++ ++// ++// Channel Property Flags ++// ++ ++#define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1 ++#define STORAGE_CHANNEL_EMULATED_IDE_FLAG 0x2 ++ ++ ++typedef struct _VSTOR_PACKET ++{ ++ // ++ // Requested operation type ++ // ++ ++ VSTOR_PACKET_OPERATION Operation; ++ ++ // ++ // Flags - see below for values ++ // ++ ++ ULONG Flags; ++ ++ // ++ // Status of the request returned from the server side. ++ // ++ ++ ULONG Status; ++ ++ // ++ // Data payload area ++ // ++ ++ union ++ { ++ // ++ // Structure used to forward SCSI commands from the client to the server. ++ // ++ ++ VMSCSI_REQUEST VmSrb; ++ ++ // ++ // Structure used to query channel properties. ++ // ++ ++ VMSTORAGE_CHANNEL_PROPERTIES StorageChannelProperties; ++ ++ // ++ // Used during version negotiations. ++ // ++ ++ VMSTORAGE_PROTOCOL_VERSION Version; ++ }; ++ ++} VSTOR_PACKET, *PVSTOR_PACKET; ++ ++C_ASSERT((sizeof(VSTOR_PACKET) % 4) == 0); ++ ++// ++// Packet flags ++// ++ ++// ++// This flag indicates that the server should send back a completion for this ++// packet. ++// ++ ++#define REQUEST_COMPLETION_FLAG 0x1 ++ ++// ++// This is the set of flags that the vsc can set in any packets it sends ++// ++ ++#define VSC_LEGAL_FLAGS (REQUEST_COMPLETION_FLAG) ++ ++ ++#pragma pack(pop) ++ ++ diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-driver-header-files.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-driver-header-files.patch new file mode 100644 index 000000000..42c74e5d7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-driver-header-files.patch @@ -0,0 +1,1098 @@ +From bee20ea87b3e6f246b387f707983a0ef47c8a15b Mon Sep 17 00:00:00 2001 +From: Hank Janssen +Date: Mon, 13 Jul 2009 15:19:28 -0700 +Subject: Staging: hv: add the Hyper-V driver header files + +From: Hank Janssen + +These are the header files for the different Linux Hyper-V drivers to +use. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/hv/include/NetVscApi.h | 145 +++++++++++++++++ + drivers/staging/hv/include/StorVscApi.h | 137 ++++++++++++++++ + drivers/staging/hv/include/VmbusApi.h | 262 +++++++++++++++++++++++++++++++ + drivers/staging/hv/include/logging.h | 134 ++++++++++++++++ + drivers/staging/hv/include/osd.h | 263 ++++++++++++++++++++++++++++++++ + drivers/staging/hv/include/vmbus.h | 111 +++++++++++++ + 6 files changed, 1052 insertions(+) + create mode 100644 drivers/staging/hv/include/NetVscApi.h + create mode 100644 drivers/staging/hv/include/StorVscApi.h + create mode 100644 drivers/staging/hv/include/VmbusApi.h + create mode 100644 drivers/staging/hv/include/logging.h + create mode 100644 drivers/staging/hv/include/osd.h + create mode 100644 drivers/staging/hv/include/vmbus.h + +--- /dev/null ++++ b/drivers/staging/hv/include/logging.h +@@ -0,0 +1,134 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _LOGGING_H_ ++#define _LOGGING_H_ ++ ++//#include ++//#include ++ ++#include "osd.h" ++ ++#define VMBUS 0x0001 ++#define STORVSC 0x0002 ++#define NETVSC 0x0004 ++#define INPUTVSC 0x0008 ++#define BLKVSC 0x0010 ++#define VMBUS_DRV 0x0100 ++#define STORVSC_DRV 0x0200 ++#define NETVSC_DRV 0x0400 ++#define INPUTVSC_DRV 0x0800 ++#define BLKVSC_DRV 0x1000 ++ ++#define ALL_MODULES (VMBUS |\ ++ STORVSC |\ ++ NETVSC |\ ++ INPUTVSC |\ ++ BLKVSC |\ ++ VMBUS_DRV |\ ++ STORVSC_DRV |\ ++ NETVSC_DRV |\ ++ INPUTVSC_DRV|\ ++ BLKVSC_DRV) ++ ++// Logging Level ++#define CRITICAL_LVL 2 ++#define ERROR_LVL 3 ++#define WARNING_LVL 4 ++#define INFO_LVL 6 ++#define DEBUG_LVL 7 ++#define DEBUG_LVL_ENTEREXIT 8 ++#define DEBUG_RING_LVL 9 ++ ++extern unsigned int vmbus_loglevel; ++ ++#define ASSERT(expr) \ ++ if (!(expr)) { \ ++ LogMsg("<%d>Assertion failed! %s,%s,%s,line=%d\n", CRITICAL_LVL, #expr,__FILE__,__FUNCTION__,__LINE__); \ ++ __asm__ __volatile__("int3"); \ ++ } ++ ++#define DPRINT(mod, lvl, fmt, args...) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (lvl <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\ ++ } while (0) ++ ++#define DPRINT_DBG(mod, fmt, args...) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (DEBUG_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\ ++ } while (0) ++ ++#define DPRINT_INFO(mod, fmt, args...) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (INFO_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": " fmt "\n", INFO_LVL, ## args)):(0);\ ++ } while (0) ++ ++#define DPRINT_WARN(mod, fmt, args...) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (WARNING_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": WARNING! " fmt "\n", WARNING_LVL, ## args)):(0);\ ++ } while (0) ++ ++#define DPRINT_ERR(mod, fmt, args...) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (ERROR_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() ERROR!! " fmt "\n", ERROR_LVL, __FUNCTION__, ## args)):(0);\ ++ } while (0) ++ ++#ifdef DEBUG ++#define DPRINT_ENTER(mod) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() enter\n", DEBUG_LVL, __FUNCTION__)):(0);\ ++ } while (0) ++ ++#define DPRINT_EXIT(mod) do {\ ++ if (mod & (HIWORD(vmbus_loglevel))) \ ++ (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() exit\n", DEBUG_LVL, __FUNCTION__)):(0);\ ++ } while (0) ++#else ++#define DPRINT_ENTER(mod) ++#define DPRINT_EXIT(mod) ++#endif ++ ++static inline void PrintBytes(const unsigned char* bytes, int len) ++{ ++ int i=0; ++ ++ LogMsg("\n<< "); ++ for (i=0; i< len; i++) ++ { ++ LogMsg("0x%x ", bytes[i]); ++ } ++ LogMsg(">>\n"); ++} ++ ++// ++// Inline ++// ++//static inline void GuidToStr(const GUID g, char *str) ++//{ ++// sprintf(str, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++// g[3], g[2], g[1], g[0], g[5], g[4], g[7], g[6], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15]); ++// ++//} ++ ++#endif //_LOGGING_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/NetVscApi.h +@@ -0,0 +1,145 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _NETVSC_API_H_ ++#define _NETVSC_API_H_ ++ ++#include "VmbusApi.h" ++ ++// ++// Defines ++// ++#define NETVSC_DEVICE_RING_BUFFER_SIZE 64*PAGE_SIZE ++ ++#define HW_MACADDR_LEN 6 ++ ++// ++// Fwd declaration ++// ++typedef struct _NETVSC_PACKET *PNETVSC_PACKET; ++ ++ ++// ++// Data types ++// ++ ++typedef int (*PFN_ON_OPEN)(DEVICE_OBJECT *Device); ++typedef int (*PFN_ON_CLOSE)(DEVICE_OBJECT *Device); ++ ++typedef void (*PFN_QUERY_LINKSTATUS)(DEVICE_OBJECT *Device); ++typedef int (*PFN_ON_SEND)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet); ++typedef void (*PFN_ON_SENDRECVCOMPLETION)(PVOID Context); ++ ++typedef int (*PFN_ON_RECVCALLBACK)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet); ++typedef void (*PFN_ON_LINKSTATUS_CHANGED)(DEVICE_OBJECT *dev, UINT32 Status); ++ ++// Represent the xfer page packet which contains 1 or more netvsc packet ++typedef struct _XFERPAGE_PACKET { ++ DLIST_ENTRY ListEntry; ++ ++ // # of netvsc packets this xfer packet contains ++ UINT32 Count; ++} XFERPAGE_PACKET; ++ ++ ++// The number of pages which are enough to cover jumbo frame buffer. ++#define NETVSC_PACKET_MAXPAGE 4 ++ ++// Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame within the RNDIS ++typedef struct _NETVSC_PACKET { ++ // Bookkeeping stuff ++ DLIST_ENTRY ListEntry; ++ ++ DEVICE_OBJECT *Device; ++ BOOL IsDataPacket; ++ ++ // Valid only for receives when we break a xfer page packet into multiple netvsc packets ++ XFERPAGE_PACKET *XferPagePacket; ++ ++ union { ++ struct{ ++ UINT64 ReceiveCompletionTid; ++ PVOID ReceiveCompletionContext; ++ PFN_ON_SENDRECVCOMPLETION OnReceiveCompletion; ++ } Recv; ++ struct{ ++ UINT64 SendCompletionTid; ++ PVOID SendCompletionContext; ++ PFN_ON_SENDRECVCOMPLETION OnSendCompletion; ++ } Send; ++ } Completion; ++ ++ // This points to the memory after PageBuffers ++ PVOID Extension; ++ ++ UINT32 TotalDataBufferLength; ++ // Points to the send/receive buffer where the ethernet frame is ++ UINT32 PageBufferCount; ++ PAGE_BUFFER PageBuffers[NETVSC_PACKET_MAXPAGE]; ++ ++} NETVSC_PACKET; ++ ++ ++// Represents the net vsc driver ++typedef struct _NETVSC_DRIVER_OBJECT { ++ DRIVER_OBJECT Base; // Must be the first field ++ ++ UINT32 RingBufferSize; ++ UINT32 RequestExtSize; ++ ++ // Additional num of page buffers to allocate ++ UINT32 AdditionalRequestPageBufferCount; ++ ++ // This is set by the caller to allow us to callback when we receive a packet ++ // from the "wire" ++ PFN_ON_RECVCALLBACK OnReceiveCallback; ++ ++ PFN_ON_LINKSTATUS_CHANGED OnLinkStatusChanged; ++ ++ // Specific to this driver ++ PFN_ON_OPEN OnOpen; ++ PFN_ON_CLOSE OnClose; ++ PFN_ON_SEND OnSend; ++ //PFN_ON_RECVCOMPLETION OnReceiveCompletion; ++ ++ //PFN_QUERY_LINKSTATUS QueryLinkStatus; ++ ++ void* Context; ++} NETVSC_DRIVER_OBJECT; ++ ++ ++typedef struct _NETVSC_DEVICE_INFO { ++ UCHAR MacAddr[6]; ++ BOOL LinkState; // 0 - link up, 1 - link down ++} NETVSC_DEVICE_INFO; ++ ++// ++// Interface ++// ++int ++NetVscInitialize( ++ DRIVER_OBJECT* drv ++ ); ++ ++#endif // _NETVSC_API_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/osd.h +@@ -0,0 +1,263 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _OSD_H_ ++#define _OSD_H_ ++ ++// ++// Defines ++// ++ ++#ifndef PAGE_SIZE ++#define PAGE_SIZE 0x1000 ++#endif ++ ++#ifndef PAGE_SHIFT ++#define PAGE_SHIFT 12 ++#endif ++ ++#ifndef memcpy ++#define memcpy __builtin_memcpy ++#endif ++ ++#ifndef memset ++#define memset __builtin_memset ++#endif ++ ++#ifndef memcmp ++#define memcmp __builtin_memcmp ++#endif ++ ++#ifndef strcpy ++#define strcpy __builtin_strcpy ++#endif ++ ++// ++//#ifndef sprintf ++//#define sprintf __builtin_sprintf ++//#endif ++ ++#define STRUCT_PACKED __attribute__((__packed__)) ++#define STRUCT_ALIGNED(x) __attribute__((__aligned__(x))) ++ ++#define UNUSED_VAR(v) v __attribute__((__unused__)) ++ ++#define ALIGN_UP(value, align) ( ((value) & (align-1))? ( ((value) + (align-1)) & ~(align-1) ): (value) ) ++#define ALIGN_DOWN(value, align) ( (value) & ~(align-1) ) ++#define NUM_PAGES_SPANNED(addr, len) ( (ALIGN_UP(addr+len, PAGE_SIZE) - ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT ) ++ ++#define MIN(a, b) ((a) < (b)? (a): (b)) ++#define MAX(a, b) ((a) > (b)? (a): (b)) ++ ++#define LOWORD(dw) ((unsigned short) (dw)) ++#define HIWORD(dw) ((unsigned short) (((unsigned int) (dw) >> 16) & 0xFFFF)) ++ ++#define FIELD_OFFSET(t, f) ((unsigned int)(unsigned long)&(((t *)0)->f)) ++ ++#ifdef FALSE ++#undef FALSE ++#endif ++#define FALSE 0 ++ ++#ifdef TRUE ++#undef TRUE ++#endif ++#define TRUE 1 ++ ++#ifndef NULL ++#define NULL (void *)0 ++#endif ++ ++typedef struct _DLIST_ENTRY { ++ struct _DLIST_ENTRY *Flink; ++ struct _DLIST_ENTRY *Blink; ++} DLIST_ENTRY; ++ ++// ++// unsigned types ++// ++typedef unsigned char UINT8; ++typedef unsigned short UINT16; ++typedef unsigned int UINT32; ++#ifdef __x86_64__ ++typedef unsigned long UINT64; ++#else ++typedef unsigned long long UINT64; ++#endif ++ ++typedef unsigned long long ULONGLONG; ++typedef unsigned int ULONG; ++typedef unsigned short USHORT; ++typedef unsigned char UCHAR; ++ ++// ++// signed types ++// ++typedef char INT8; ++typedef short INT16; ++typedef int INT32; ++#ifdef __x86_64__ ++typedef long INT64; ++#else ++typedef long long INT64; ++#endif ++ ++typedef int LONG; ++typedef char CHAR; ++typedef long long LONGLONG; ++ ++// ++// Other types ++// ++typedef unsigned long SIZE_T; ++typedef void VOID; ++//typedef unsigned char GUID[16]; ++typedef void* PVOID; ++typedef unsigned char BOOL; ++typedef unsigned char BOOLEAN; ++typedef void* HANDLE; ++typedef UINT32 DWORD; ++typedef char* PCHAR; ++typedef unsigned char BYTE; ++ ++typedef unsigned long ULONG_PTR; ++ ++typedef struct { ++ unsigned char Data[16]; ++} GUID; ++ ++typedef void (*PFN_WORKITEM_CALLBACK)(void* context); ++typedef void (*PFN_TIMER_CALLBACK)(void* context); ++ ++ ++#ifdef __x86_64__ ++ ++#define RDMSR(reg, v) { \ ++ UINT32 h, l; \ ++ __asm__ __volatile__("rdmsr" \ ++ : "=a" (l), "=d" (h) \ ++ : "c" (reg)); \ ++ v = (((UINT64)h) << 32) | l; \ ++} ++ ++#define WRMSR(reg, v) { \ ++ UINT32 h, l; \ ++ l = (UINT32)(((UINT64)(v)) & 0xFFFFFFFF); \ ++ h = (UINT32)((((UINT64)(v)) >> 32) & 0xFFFFFFFF); \ ++ __asm__ __volatile__("wrmsr" \ ++ : /* no outputs */ \ ++ : "c" (reg), "a" (l), "d" (h)); \ ++} ++ ++#else ++ ++#define RDMSR(reg, v) \ ++ __asm__ __volatile__("rdmsr" \ ++ : "=A" (v) \ ++ : "c" (reg)) ++ ++#define WRMSR(reg, v) \ ++ __asm__ __volatile__("wrmsr" \ ++ : /* no outputs */ \ ++ : "c" (reg), "A" ((UINT64)v)) ++ ++#endif ++ ++ ++static inline void do_cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) ++{ ++ __asm__ __volatile__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (op), "c" (ecx)); ++} ++ ++// ++// Osd routines ++// ++extern void LogMsg(const char *fmt, ...); ++ ++extern void BitSet(unsigned int* addr, int value); ++extern void BitClear(unsigned int* addr, int value); ++extern int BitTest(unsigned int* addr, int value); ++extern int BitTestAndClear(unsigned int* addr, int value); ++extern int BitTestAndSet(unsigned int* addr, int value); ++ ++extern int InterlockedIncrement(int *val); ++extern int InterlockedDecrement(int *val); ++extern int InterlockedCompareExchange(int *val, int new, int curr); ++ ++extern void Sleep(unsigned long usecs); ++ ++extern void* VirtualAllocExec(unsigned int size); ++extern void VirtualFree(void* VirtAddr); ++ ++extern void* PageAlloc(unsigned int count); ++extern void PageFree(void* page, unsigned int count); ++ ++extern void* MemMapIO(unsigned long phys, unsigned long size); ++extern void MemUnmapIO(void* virt); ++ ++extern void* MemAlloc(unsigned int size); ++extern void* MemAllocZeroed(unsigned int size); ++extern void* MemAllocAtomic(unsigned int size); ++extern void MemFree(void* buf); ++extern void MemoryFence(VOID); ++ ++extern HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context); ++extern void TimerClose(HANDLE hTimer); ++extern int TimerStop(HANDLE hTimer); ++extern void TimerStart(HANDLE hTimer, UINT32 expirationInUs); ++extern SIZE_T GetTickCount(void); ++ ++extern HANDLE WaitEventCreate(void); ++extern void WaitEventClose(HANDLE hWait); ++extern void WaitEventSet(HANDLE hWait); ++extern int WaitEventWait(HANDLE hWait); ++ ++// If >0, hWait got signaled. If ==0, timeout. If < 0, error ++extern int WaitEventWaitEx(HANDLE hWait, UINT32 TimeoutInMs); ++ ++extern HANDLE SpinlockCreate(void); ++extern void SpinlockClose(HANDLE hSpin); ++extern void SpinlockAcquire(HANDLE hSpin); ++extern void SpinlockRelease(HANDLE hSpin); ++ ++ ++#define GetVirtualAddress Physical2LogicalAddr ++void* Physical2LogicalAddr(ULONG_PTR PhysAddr); ++ ++#define GetPhysicalAddress Logical2PhysicalAddr ++ULONG_PTR Logical2PhysicalAddr(PVOID LogicalAddr); ++ ++ULONG_PTR Virtual2Physical(PVOID VirtAddr); ++ ++void* PageMapVirtualAddress(unsigned long Pfn); ++void PageUnmapVirtualAddress(void* VirtAddr); ++ ++ ++extern HANDLE WorkQueueCreate(char* name); ++extern void WorkQueueClose(HANDLE hWorkQueue); ++extern int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, void* context); ++ ++extern void QueueWorkItem(PFN_WORKITEM_CALLBACK workItem, void* context); ++ ++#endif // _OSD_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/StorVscApi.h +@@ -0,0 +1,137 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _STORVSC_API_H_ ++#define _STORVSC_API_H_ ++ ++#include "VmbusApi.h" ++ ++// ++// Defines ++// ++ ++#define STORVSC_RING_BUFFER_SIZE 10*PAGE_SIZE ++#define BLKVSC_RING_BUFFER_SIZE 20*PAGE_SIZE ++ ++#define STORVSC_MAX_IO_REQUESTS 64 ++ ++// In Hyper-V, each port/path/target maps to 1 scsi host adapter. ++// In reality, the path/target is not used (ie always set to 0) so ++// our scsi host adapter essentially has 1 bus with 1 target that contains ++// up to 256 luns. ++ ++#define STORVSC_MAX_LUNS_PER_TARGET 64 ++#define STORVSC_MAX_TARGETS 1 ++#define STORVSC_MAX_CHANNELS 1 ++ ++ ++// Fwd decl ++// ++//struct VMBUS_CHANNEL; ++typedef struct _STORVSC_REQUEST* PSTORVSC_REQUEST; ++ ++// ++// Data types ++// ++typedef int (*PFN_ON_IO_REQUEST)(PDEVICE_OBJECT Device, PSTORVSC_REQUEST Request); ++typedef void (*PFN_ON_IO_REQUEST_COMPLTN)(PSTORVSC_REQUEST Request); ++ ++typedef int (*PFN_ON_HOST_RESET)(PDEVICE_OBJECT Device); ++typedef void (*PFN_ON_HOST_RESCAN)(PDEVICE_OBJECT Device); ++ ++ ++// Matches Windows-end ++typedef enum _STORVSC_REQUEST_TYPE{ ++ WRITE_TYPE, ++ READ_TYPE, ++ UNKNOWN_TYPE, ++} STORVSC_REQUEST_TYPE; ++ ++ ++typedef struct _STORVSC_REQUEST { ++ STORVSC_REQUEST_TYPE Type; ++ UINT32 Host; ++ UINT32 Bus; ++ UINT32 TargetId; ++ UINT32 LunId; ++ UINT8* Cdb; ++ UINT32 CdbLen; ++ UINT32 Status; ++ UINT32 BytesXfer; ++ ++ UCHAR* SenseBuffer; ++ UINT32 SenseBufferSize; ++ ++ PVOID Context; ++ ++ PFN_ON_IO_REQUEST_COMPLTN OnIOCompletion; ++ ++ // This points to the memory after DataBuffer ++ PVOID Extension; ++ ++ MULTIPAGE_BUFFER DataBuffer; ++} STORVSC_REQUEST; ++ ++ ++// Represents the block vsc driver ++typedef struct _STORVSC_DRIVER_OBJECT { ++ DRIVER_OBJECT Base; // Must be the first field ++ ++ // Set by caller (in bytes) ++ UINT32 RingBufferSize; ++ ++ // Allocate this much private extension for each I/O request ++ UINT32 RequestExtSize; ++ ++ // Maximum # of requests in flight per channel/device ++ UINT32 MaxOutstandingRequestsPerChannel; ++ ++ // Set by the caller to allow us to re-enumerate the bus on the host ++ PFN_ON_HOST_RESCAN OnHostRescan; ++ ++ // Specific to this driver ++ PFN_ON_IO_REQUEST OnIORequest; ++ PFN_ON_HOST_RESET OnHostReset; ++ ++} STORVSC_DRIVER_OBJECT; ++ ++typedef struct _STORVSC_DEVICE_INFO { ++ ULONG PortNumber; ++ UCHAR PathId; ++ UCHAR TargetId; ++} STORVSC_DEVICE_INFO; ++ ++// ++// Interface ++// ++int ++StorVscInitialize( ++ DRIVER_OBJECT *Driver ++ ); ++ ++int ++BlkVscInitialize( ++ DRIVER_OBJECT *Driver ++ ); ++#endif // _STORVSC_API_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/VmbusApi.h +@@ -0,0 +1,262 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _VMBUS_API_H_ ++#define _VMBUS_API_H_ ++ ++#include "osd.h" ++ ++// ++// Defines ++// ++ ++#define MAX_PAGE_BUFFER_COUNT 16 ++#define MAX_MULTIPAGE_BUFFER_COUNT 32 // 128K ++ ++ ++// ++// Fwd declarations ++// ++typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; ++typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; ++ ++// ++// Data types ++// ++ ++#pragma pack(push,1) ++ ++// Single-page buffer ++typedef struct _PAGE_BUFFER { ++ UINT32 Length; ++ UINT32 Offset; ++ UINT64 Pfn; ++} PAGE_BUFFER; ++ ++// Multiple-page buffer ++typedef struct _MULTIPAGE_BUFFER { ++ // Length and Offset determines the # of pfns in the array ++ UINT32 Length; ++ UINT32 Offset; ++ UINT64 PfnArray[MAX_MULTIPAGE_BUFFER_COUNT]; ++}MULTIPAGE_BUFFER; ++ ++//0x18 includes the proprietary packet header ++#define MAX_PAGE_BUFFER_PACKET (0x18 + (sizeof(PAGE_BUFFER) * MAX_PAGE_BUFFER_COUNT)) ++#define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + sizeof(MULTIPAGE_BUFFER)) ++ ++ ++#pragma pack(pop) ++ ++// All drivers ++typedef int (*PFN_ON_DEVICEADD)(PDEVICE_OBJECT Device, void* AdditionalInfo); ++typedef int (*PFN_ON_DEVICEREMOVE)(PDEVICE_OBJECT Device); ++typedef char** (*PFN_ON_GETDEVICEIDS)(void); ++typedef void (*PFN_ON_CLEANUP)(PDRIVER_OBJECT Driver); ++ ++// Vmbus extensions ++//typedef int (*PFN_ON_MATCH)(PDEVICE_OBJECT dev, PDRIVER_OBJECT drv); ++//typedef int (*PFN_ON_PROBE)(PDEVICE_OBJECT dev); ++typedef int (*PFN_ON_ISR)(PDRIVER_OBJECT drv); ++typedef void (*PFN_ON_DPC)(PDRIVER_OBJECT drv); ++typedef void (*PFN_GET_CHANNEL_OFFERS)(void); ++ ++typedef PDEVICE_OBJECT (*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context); ++typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(PDEVICE_OBJECT Device); ++typedef int (*PFN_ON_CHILDDEVICE_ADD)(PDEVICE_OBJECT RootDevice, PDEVICE_OBJECT ChildDevice); ++typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(PDEVICE_OBJECT Device); ++ ++// Vmbus channel interface ++typedef void (*VMBUS_CHANNEL_CALLBACK)(PVOID context); ++ ++typedef int (*VMBUS_CHANNEL_OPEN)( ++ PDEVICE_OBJECT Device, ++ UINT32 SendBufferSize, ++ UINT32 RecvRingBufferSize, ++ PVOID UserData, ++ UINT32 UserDataLen, ++ VMBUS_CHANNEL_CALLBACK ChannelCallback, ++ PVOID Context ++ ); ++ ++typedef void (*VMBUS_CHANNEL_CLOSE)( ++ PDEVICE_OBJECT Device ++ ); ++ ++typedef int (*VMBUS_CHANNEL_SEND_PACKET)( ++ PDEVICE_OBJECT Device, ++ const PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId, ++ UINT32 Type, ++ UINT32 Flags ++); ++ ++typedef int (*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER)( ++ PDEVICE_OBJECT Device, ++ PAGE_BUFFER PageBuffers[], ++ UINT32 PageCount, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++ ); ++ ++typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)( ++ PDEVICE_OBJECT Device, ++ MULTIPAGE_BUFFER *MultiPageBuffer, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++); ++ ++typedef int (*VMBUS_CHANNEL_RECV_PACKET)( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ); ++ ++typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ); ++ ++typedef int (*VMBUS_CHANNEL_ESTABLISH_GPADL)( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, // from kmalloc() ++ UINT32 BufferLen, // page-size multiple ++ UINT32* GpadlHandle ++ ); ++ ++typedef int (*VMBUS_CHANNEL_TEARDOWN_GPADL)( ++ PDEVICE_OBJECT Device, ++ UINT32 GpadlHandle ++ ); ++ ++ ++typedef struct _PORT_INFO { ++ UINT32 InterruptMask; ++ UINT32 ReadIndex; ++ UINT32 WriteIndex; ++ UINT32 BytesAvailToRead; ++ UINT32 BytesAvailToWrite; ++} PORT_INFO; ++ ++ ++typedef struct _DEVICE_INFO { ++ UINT32 ChannelId; ++ UINT32 ChannelState; ++ GUID ChannelType; ++ GUID ChannelInstance; ++ ++ UINT32 MonitorId; ++ UINT32 ServerMonitorPending; ++ UINT32 ServerMonitorLatency; ++ UINT32 ServerMonitorConnectionId; ++ UINT32 ClientMonitorPending; ++ UINT32 ClientMonitorLatency; ++ UINT32 ClientMonitorConnectionId; ++ ++ PORT_INFO Inbound; ++ PORT_INFO Outbound; ++} DEVICE_INFO; ++ ++typedef void (*VMBUS_GET_CHANNEL_INFO)(PDEVICE_OBJECT Device, DEVICE_INFO* DeviceInfo); ++ ++typedef struct _VMBUS_CHANNEL_INTERFACE { ++ VMBUS_CHANNEL_OPEN Open; ++ VMBUS_CHANNEL_CLOSE Close; ++ VMBUS_CHANNEL_SEND_PACKET SendPacket; ++ VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER SendPacketPageBuffer; ++ VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER SendPacketMultiPageBuffer; ++ VMBUS_CHANNEL_RECV_PACKET RecvPacket; ++ VMBUS_CHANNEL_RECV_PACKET_PAW RecvPacketRaw; ++ VMBUS_CHANNEL_ESTABLISH_GPADL EstablishGpadl; ++ VMBUS_CHANNEL_TEARDOWN_GPADL TeardownGpadl; ++ VMBUS_GET_CHANNEL_INFO GetInfo; ++} VMBUS_CHANNEL_INTERFACE; ++ ++typedef void (*VMBUS_GET_CHANNEL_INTERFACE)(VMBUS_CHANNEL_INTERFACE *Interface); ++ ++// Base driver object ++typedef struct _DRIVER_OBJECT { ++ const char* name; ++ GUID deviceType; // the device type supported by this driver ++ ++ PFN_ON_DEVICEADD OnDeviceAdd; ++ PFN_ON_DEVICEREMOVE OnDeviceRemove; ++ PFN_ON_GETDEVICEIDS OnGetDeviceIds; // device ids supported by this driver ++ PFN_ON_CLEANUP OnCleanup; ++ ++ VMBUS_CHANNEL_INTERFACE VmbusChannelInterface; ++} DRIVER_OBJECT; ++ ++ ++// Base device object ++typedef struct _DEVICE_OBJECT { ++ DRIVER_OBJECT* Driver; // the driver for this device ++ char name[64]; ++ GUID deviceType; // the device type id of this device ++ GUID deviceInstance; // the device instance id of this device ++ void* context; ++ void* Extension; // Device extension; ++} DEVICE_OBJECT; ++ ++ ++// Vmbus driver object ++typedef struct _VMBUS_DRIVER_OBJECT { ++ DRIVER_OBJECT Base; // !! Must be the 1st field !! ++ ++ // Set by the caller ++ PFN_ON_CHILDDEVICE_CREATE OnChildDeviceCreate; ++ PFN_ON_CHILDDEVICE_DESTROY OnChildDeviceDestroy; ++ PFN_ON_CHILDDEVICE_ADD OnChildDeviceAdd; ++ PFN_ON_CHILDDEVICE_REMOVE OnChildDeviceRemove; ++ ++ // Set by the callee ++ //PFN_ON_MATCH OnMatch; ++ //PFN_ON_PROBE OnProbe; ++ PFN_ON_ISR OnIsr; ++ PFN_ON_DPC OnMsgDpc; ++ PFN_ON_DPC OnEventDpc; ++ PFN_GET_CHANNEL_OFFERS GetChannelOffers; ++ ++ VMBUS_GET_CHANNEL_INTERFACE GetChannelInterface; ++ VMBUS_GET_CHANNEL_INFO GetChannelInfo; ++} VMBUS_DRIVER_OBJECT; ++ ++ ++// ++// Interface ++// ++int ++VmbusInitialize( ++ DRIVER_OBJECT* drv ++ ); ++ ++#endif // _VMBUS_API_H_ +--- /dev/null ++++ b/drivers/staging/hv/include/vmbus.h +@@ -0,0 +1,111 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _VMBUS_H_ ++#define _VMBUS_H_ ++ ++#include ++ ++#include "VmbusApi.h" ++ ++// ++// Data types ++// ++ ++typedef int (*PFN_DRIVERINITIALIZE)(DRIVER_OBJECT *drv); ++typedef int (*PFN_DRIVEREXIT)(DRIVER_OBJECT *drv); ++ ++struct driver_context { ++ GUID class_id; ++ ++ struct device_driver driver; ++ ++ // Use these methods instead of the struct device_driver so 2.6 kernel stops complaining ++ int (*probe)(struct device *); ++ int (*remove)(struct device *); ++ void (*shutdown)(struct device *); ++}; ++ ++struct device_context { ++ struct work_struct probe_failed_work_item; ++ GUID class_id; ++ GUID device_id; ++ int probe_error; ++ struct device device; ++ DEVICE_OBJECT device_obj; ++}; ++ ++ ++// ++// Global ++// ++ ++// ++// Inlines ++// ++static inline struct device_context *to_device_context(DEVICE_OBJECT *device_obj) ++{ ++ return container_of(device_obj, struct device_context, device_obj); ++} ++ ++static inline struct device_context *device_to_device_context(struct device *device) ++{ ++ return container_of(device, struct device_context, device); ++} ++ ++static inline struct driver_context *driver_to_driver_context(struct device_driver *driver) ++{ ++ return container_of(driver, struct driver_context, driver); ++} ++ ++#if defined(KERNEL_2_6_5) ++static inline void* kzalloc(int size, int flags) ++{ ++ void *p; ++ p = kmalloc(size, flags); ++ if (p) memset(p, 0, size); ++ ++ return p; ++} ++#endif // KERNEL_2_6_5 ++ ++// ++// Vmbus interface ++// ++void ++vmbus_child_driver_register( ++ struct driver_context* driver_ctx ++ ); ++ ++void ++vmbus_child_driver_unregister( ++ struct driver_context *driver_ctx ++ ); ++ ++void ++vmbus_get_interface( ++ VMBUS_CHANNEL_INTERFACE *interface ++ ); ++ ++#endif // _VMBUS_H_ diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver-to-the-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver-to-the-build.patch new file mode 100644 index 000000000..89cd91766 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver-to-the-build.patch @@ -0,0 +1,42 @@ +From foo@baz Tue Jul 14 10:25:53 PDT 2009 +Date: Tue, 14 Jul 2009 10:25:53 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: add the Hyper-V virtual block driver to the build + +From: Greg Kroah-Hartman + +Add the Hyper-V virtual block driver to the kernel build system. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/staging/hv/Kconfig | 7 +++++++ + drivers/staging/hv/Makefile | 2 ++ + 2 files changed, 9 insertions(+) + +--- a/drivers/staging/hv/Kconfig ++++ b/drivers/staging/hv/Kconfig +@@ -12,3 +12,10 @@ config HYPERV_STORAGE + default n + help + Select this option to enable the Hyper-V virtual storage driver. ++ ++config HYPERV_BLOCK ++ tristate "Microsoft Hyper-V virtual block driver" ++ depends on HYPERV && BLOCK ++ default n ++ help ++ Select this option to enable the Hyper-V virtual block driver. +--- a/drivers/staging/hv/Makefile ++++ b/drivers/staging/hv/Makefile +@@ -1,5 +1,7 @@ + obj-$(CONFIG_HYPERV) += hv_vmbus.o + obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o ++obj-$(CONFIG_HYPERV_BLOCK) += hv_blkvsc.o + + hv_vmbus-objs := vmbus_drv.o osd.o Sources.o + hv_storvsc-objs := storvsc_drv.o osd.o StorVsc.o ++hv_blkvsc-objs := blkvsc_drv.o osd.o BlkVsc.o diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver.patch new file mode 100644 index 000000000..93e1aa358 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver.patch @@ -0,0 +1,1678 @@ +From 582e26118ab754a3bca9b98351cb874f22b76ffd Mon Sep 17 00:00:00 2001 +From: Hank Janssen +Date: Mon, 13 Jul 2009 15:33:02 -0700 +Subject: Staging: hv: add the Hyper-V virtual block driver + +From: Hank Janssen + +This is the virtual block driver when running Linux on top of Hyper-V. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/hv/BlkVsc.c | 107 ++ + drivers/staging/hv/blkvsc_drv.c | 1547 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1654 insertions(+) + create mode 100644 drivers/staging/hv/blkvsc.c + +--- /dev/null ++++ b/drivers/staging/hv/BlkVsc.c +@@ -0,0 +1,107 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "../storvsc/StorVsc.c" ++ ++static const char* gBlkDriverName="blkvsc"; ++ ++//{32412632-86cb-44a2-9b5c-50d1417354f5} ++static const GUID gBlkVscDeviceType={ ++ .Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5} ++}; ++ ++// Static routines ++static int ++BlkVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ); ++ ++ ++int ++BlkVscInitialize( ++ DRIVER_OBJECT *Driver ++ ) ++{ ++ STORVSC_DRIVER_OBJECT* storDriver = (STORVSC_DRIVER_OBJECT*)Driver; ++ int ret=0; ++ ++ DPRINT_ENTER(BLKVSC); ++ ++ // Make sure we are at least 2 pages since 1 page is used for control ++ ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); ++ ++ Driver->name = gBlkDriverName; ++ memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(GUID)); ++ ++ storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION); ++ // Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) ++ // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + UINT64) ++ storDriver->MaxOutstandingRequestsPerChannel = ++ ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(UINT64),sizeof(UINT64))); ++ ++ DPRINT_INFO(BLKVSC, "max io outstd %u", storDriver->MaxOutstandingRequestsPerChannel); ++ ++ // Setup the dispatch table ++ storDriver->Base.OnDeviceAdd = BlkVscOnDeviceAdd; ++ storDriver->Base.OnDeviceRemove = StorVscOnDeviceRemove; ++ storDriver->Base.OnCleanup = StorVscOnCleanup; ++ ++ storDriver->OnIORequest = StorVscOnIORequest; ++ ++ DPRINT_EXIT(BLKVSC); ++ ++ return ret; ++} ++ ++int ++BlkVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ) ++{ ++ int ret=0; ++ STORVSC_DEVICE_INFO *deviceInfo = (STORVSC_DEVICE_INFO*)AdditionalInfo; ++ ++ DPRINT_ENTER(BLKVSC); ++ ++ ret = StorVscOnDeviceAdd(Device, AdditionalInfo); ++ ++ if (ret != 0) ++ { ++ DPRINT_EXIT(BLKVSC); ++ ++ return ret; ++ } ++ ++ // We need to use the device instance guid to set the path and target id. For IDE devices, the ++ // device instance id is formatted as - - 8899 - 000000000000. ++ deviceInfo->PathId = Device->deviceInstance.Data[3] << 24 | Device->deviceInstance.Data[2] << 16 | ++ Device->deviceInstance.Data[1] << 8 |Device->deviceInstance.Data[0]; ++ ++ deviceInfo->TargetId = Device->deviceInstance.Data[5] << 8 | Device->deviceInstance.Data[4]; ++ ++ DPRINT_EXIT(BLKVSC); ++ ++ return ret; ++} +--- /dev/null ++++ b/drivers/staging/hv/blkvsc_drv.c +@@ -0,0 +1,1547 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "logging.h" ++#include "vmbus.h" ++ ++#include "StorVscApi.h" ++ ++// ++// #defines ++// ++#define BLKVSC_MINORS 64 ++ ++// ++// Data types ++// ++enum blkvsc_device_type { ++ UNKNOWN_DEV_TYPE, ++ HARDDISK_TYPE, ++ DVD_TYPE, ++}; ++ ++// This request ties the struct request and struct blkvsc_request/STORVSC_REQUEST together ++// A struct request may be represented by 1 or more struct blkvsc_request ++struct blkvsc_request_group { ++ int outstanding; ++ int status; ++ ++ struct list_head blkvsc_req_list; // list of blkvsc_requests ++}; ++ ++ ++struct blkvsc_request { ++ struct list_head req_entry; // blkvsc_request_group.blkvsc_req_list ++ ++ struct list_head pend_entry; // block_device_context.pending_list ++ ++ struct request *req; // This may be null if we generate a request internally ++ struct block_device_context *dev; ++ struct blkvsc_request_group *group; // The group this request is part of. Maybe null ++ ++ wait_queue_head_t wevent; ++ int cond; ++ ++ int write; ++ sector_t sector_start; ++ unsigned long sector_count; ++ ++ unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; ++ unsigned char cmd_len; ++ unsigned char cmnd[MAX_COMMAND_SIZE]; ++ ++ STORVSC_REQUEST request; ++ // !!!DO NOT ADD ANYTHING BELOW HERE!!! Otherwise, memory can overlap, because - ++ // The extension buffer falls right here and is pointed to by request.Extension; ++}; ++ ++// Per device structure ++struct block_device_context { ++ struct device_context *device_ctx; // point back to our device context ++ struct kmem_cache *request_pool; ++ spinlock_t lock; ++ struct gendisk *gd; ++ enum blkvsc_device_type device_type; ++ struct list_head pending_list; ++ ++ unsigned char device_id[64]; ++ unsigned int device_id_len; ++ int num_outstanding_reqs; ++ int shutting_down; ++ int media_not_present; ++ unsigned int sector_size; ++ sector_t capacity; ++ unsigned int port; ++ unsigned char path; ++ unsigned char target; ++ int users; ++}; ++ ++// Per driver ++struct blkvsc_driver_context { ++ // !! These must be the first 2 fields !! ++ struct driver_context drv_ctx; ++ STORVSC_DRIVER_OBJECT drv_obj; ++}; ++ ++// Static decl ++static int blkvsc_probe(struct device *dev); ++static int blkvsc_remove(struct device *device); ++static void blkvsc_shutdown(struct device *device); ++ ++static int blkvsc_open(struct inode *inode, struct file *filep); ++static int blkvsc_release(struct inode *inode, struct file *filep); ++static int blkvsc_media_changed(struct gendisk *gd); ++static int blkvsc_revalidate_disk(struct gendisk *gd); ++static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg); ++static int blkvsc_ioctl(struct inode *inode, struct file *filep, unsigned cmd, unsigned long arg); ++ ++static void blkvsc_request(struct request_queue *queue); ++static void blkvsc_request_completion(STORVSC_REQUEST* request); ++static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req); ++static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(STORVSC_REQUEST*) ); ++static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req); ++static void blkvsc_cmd_completion(STORVSC_REQUEST* request); ++static int blkvsc_do_inquiry(struct block_device_context *blkdev); ++static int blkvsc_do_read_capacity(struct block_device_context *blkdev); ++static int blkvsc_do_read_capacity16(struct block_device_context *blkdev); ++static int blkvsc_do_flush(struct block_device_context *blkdev); ++static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev); ++static int blkvsc_do_pending_reqs(struct block_device_context *blkdev); ++ ++ ++static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; ++ ++// The one and only one ++static struct blkvsc_driver_context g_blkvsc_drv; ++ ++ ++static struct block_device_operations block_ops = ++{ ++ .owner = THIS_MODULE, ++ .open = blkvsc_open, ++ .release = blkvsc_release, ++ .media_changed = blkvsc_media_changed, ++ .revalidate_disk = blkvsc_revalidate_disk, ++ .getgeo = blkvsc_getgeo, ++ .ioctl = blkvsc_ioctl, ++}; ++ ++/*++ ++ ++Name: blkvsc_drv_init() ++ ++Desc: BlkVsc driver initialization. ++ ++--*/ ++int blkvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init) ++{ ++ int ret=0; ++ STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_blkvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_blkvsc_drv.drv_ctx; ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ vmbus_get_interface(&storvsc_drv_obj->Base.VmbusChannelInterface); ++ ++ storvsc_drv_obj->RingBufferSize = blkvsc_ringbuffer_size; ++ ++ // Callback to client driver to complete the initialization ++ pfn_drv_init(&storvsc_drv_obj->Base); ++ ++ drv_ctx->driver.name = storvsc_drv_obj->Base.name; ++ memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID)); ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++ drv_ctx->driver.probe = blkvsc_probe; ++ drv_ctx->driver.remove = blkvsc_remove; ++#else ++ drv_ctx->probe = blkvsc_probe; ++ drv_ctx->remove = blkvsc_remove; ++ drv_ctx->shutdown = blkvsc_shutdown; ++#endif ++ ++ // The driver belongs to vmbus ++ vmbus_child_driver_register(drv_ctx); ++ ++ DPRINT_EXIT(BLKVSC_DRV); ++ ++ return ret; ++} ++ ++ ++static int blkvsc_drv_exit_cb(struct device *dev, void *data) ++{ ++ struct device **curr = (struct device **)data; ++ *curr = dev; ++ return 1; // stop iterating ++} ++ ++/*++ ++ ++Name: blkvsc_drv_exit() ++ ++Desc: ++ ++--*/ ++void blkvsc_drv_exit(void) ++{ ++ STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_blkvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_blkvsc_drv.drv_ctx; ++ ++ struct device *current_dev=NULL; ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#define driver_for_each_device(drv, start, data, fn) \ ++ struct list_head *ptr, *n; \ ++ list_for_each_safe(ptr, n, &((drv)->devices)) {\ ++ struct device *curr_dev;\ ++ curr_dev = list_entry(ptr, struct device, driver_list);\ ++ fn(curr_dev, data);\ ++ } ++#endif // KERNEL_2_6_9 ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ while (1) ++ { ++ current_dev = NULL; ++ ++ // Get the device ++ driver_for_each_device(&drv_ctx->driver, NULL, (void*)¤t_dev, blkvsc_drv_exit_cb); ++ ++ if (current_dev == NULL) ++ break; ++ ++ // Initiate removal from the top-down ++ device_unregister(current_dev); ++ } ++ ++ if (storvsc_drv_obj->Base.OnCleanup) ++ storvsc_drv_obj->Base.OnCleanup(&storvsc_drv_obj->Base); ++ ++ vmbus_child_driver_unregister(drv_ctx); ++ ++ DPRINT_EXIT(BLKVSC_DRV); ++ ++ return; ++} ++ ++/*++ ++ ++Name: blkvsc_probe() ++ ++Desc: Add a new device for this driver ++ ++--*/ ++static int blkvsc_probe(struct device *device) ++{ ++ int ret=0; ++ ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct blkvsc_driver_context *blkvsc_drv_ctx = (struct blkvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ DEVICE_OBJECT* device_obj = &device_ctx->device_obj; ++ ++ struct block_device_context *blkdev=NULL; ++ STORVSC_DEVICE_INFO device_info; ++ int major=0; ++ int devnum=0; ++ ++ static int ide0_registered=0; ++ static int ide1_registered=0; ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_probe - enter"); ++ ++ if (!storvsc_drv_obj->Base.OnDeviceAdd) ++ { ++ DPRINT_ERR(BLKVSC_DRV, "OnDeviceAdd() not set"); ++ ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL); ++ if (!blkdev) ++ { ++ ret = -ENOMEM; ++ goto Cleanup; ++ } ++ ++ INIT_LIST_HEAD(&blkdev->pending_list); ++ ++ // Initialize what we can here ++ spin_lock_init(&blkdev->lock); ++ ++ ASSERT(sizeof(struct blkvsc_request_group) <= sizeof(struct blkvsc_request)); ++ ++#ifdef KERNEL_2_6_27 ++ blkdev->request_pool = kmem_cache_create(device_ctx->device.bus_id, ++ sizeof(struct blkvsc_request) + storvsc_drv_obj->RequestExtSize, 0, ++ SLAB_HWCACHE_ALIGN, NULL); ++#else ++ blkdev->request_pool = kmem_cache_create(device_ctx->device.bus_id, ++ sizeof(struct blkvsc_request) + storvsc_drv_obj->RequestExtSize, 0, ++ SLAB_HWCACHE_ALIGN, NULL, NULL); ++#endif ++ if (!blkdev->request_pool) ++ { ++ ret = -ENOMEM; ++ goto Cleanup; ++ } ++ ++ ++ // Call to the vsc driver to add the device ++ ret = storvsc_drv_obj->Base.OnDeviceAdd(device_obj, &device_info); ++ if (ret != 0) ++ { ++ DPRINT_ERR(BLKVSC_DRV, "unable to add blkvsc device"); ++ goto Cleanup; ++ } ++ ++ blkdev->device_ctx = device_ctx; ++ blkdev->target = device_info.TargetId; // this identified the device 0 or 1 ++ blkdev->path = device_info.PathId; // this identified the ide ctrl 0 or 1 ++ ++ device->driver_data = blkdev; ++ ++ // Calculate the major and device num ++ if (blkdev->path == 0) ++ { ++ major = IDE0_MAJOR; ++ devnum = blkdev->path + blkdev->target; // 0 or 1 ++ ++ if (!ide0_registered) ++ { ++ ret = register_blkdev(major, "ide"); ++ if (ret != 0) ++ { ++ DPRINT_ERR(BLKVSC_DRV, "register_blkdev() failed! ret %d", ret); ++ goto Remove; ++ } ++ ++ ide0_registered = 1; ++ } ++ } ++ else if (blkdev->path == 1) ++ { ++ major = IDE1_MAJOR; ++ devnum = blkdev->path + blkdev->target + 1; // 2 or 3 ++ ++ if (!ide1_registered) ++ { ++ ret = register_blkdev(major, "ide"); ++ if (ret != 0) ++ { ++ DPRINT_ERR(BLKVSC_DRV, "register_blkdev() failed! ret %d", ret); ++ goto Remove; ++ } ++ ++ ide1_registered = 1; ++ } ++ ++ } ++ else ++ { ++ DPRINT_ERR(BLKVSC_DRV, "invalid pathid"); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ DPRINT_INFO(BLKVSC_DRV, "blkvsc registered for major %d!!", major); ++ ++ blkdev->gd = alloc_disk(BLKVSC_MINORS); ++ if (!blkdev->gd) ++ { ++ DPRINT_ERR(BLKVSC_DRV, "register_blkdev() failed! ret %d", ret); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ blkdev->gd->queue = blk_init_queue(blkvsc_request, &blkdev->lock); ++ ++ blk_queue_max_segment_size(blkdev->gd->queue, PAGE_SIZE); ++ blk_queue_max_phys_segments(blkdev->gd->queue, MAX_MULTIPAGE_BUFFER_COUNT); ++ blk_queue_max_hw_segments(blkdev->gd->queue, MAX_MULTIPAGE_BUFFER_COUNT); ++ blk_queue_segment_boundary(blkdev->gd->queue, PAGE_SIZE-1); ++ blk_queue_bounce_limit(blkdev->gd->queue, BLK_BOUNCE_ANY); ++ blk_queue_dma_alignment(blkdev->gd->queue, 511); ++ ++ blkdev->gd->major = major; ++ if (devnum == 1 || devnum == 3) ++ blkdev->gd->first_minor = BLKVSC_MINORS; ++ else ++ blkdev->gd->first_minor = 0; ++ blkdev->gd->fops = &block_ops; ++ blkdev->gd->private_data = blkdev; ++ sprintf(blkdev->gd->disk_name, "hd%c", 'a'+ devnum); ++ ++ blkvsc_do_inquiry(blkdev); ++ if (blkdev->device_type == DVD_TYPE) ++ { ++ set_disk_ro(blkdev->gd, 1); ++ blkdev->gd->flags |= GENHD_FL_REMOVABLE; ++ blkvsc_do_read_capacity(blkdev); ++ } ++ else ++ { ++ blkvsc_do_read_capacity16(blkdev); ++ } ++ ++ set_capacity(blkdev->gd, blkdev->capacity * (blkdev->sector_size/512)); ++ blk_queue_hardsect_size(blkdev->gd->queue, blkdev->sector_size); ++ // go! ++ add_disk(blkdev->gd); ++ ++ DPRINT_INFO(BLKVSC_DRV, "%s added!! capacity %llu sector_size %d", blkdev->gd->disk_name, blkdev->capacity, blkdev->sector_size); ++ ++ return ret; ++ ++Remove: ++ storvsc_drv_obj->Base.OnDeviceRemove(device_obj); ++ ++Cleanup: ++ if (blkdev) ++ { ++ if (blkdev->request_pool) ++ { ++ kmem_cache_destroy(blkdev->request_pool); ++ blkdev->request_pool = NULL; ++ } ++ kfree(blkdev); ++ blkdev = NULL; ++ } ++ ++ DPRINT_EXIT(BLKVSC_DRV); ++ ++ return ret; ++} ++ ++static void blkvsc_shutdown(struct device *device) ++{ ++ struct block_device_context *blkdev = (struct block_device_context*)device->driver_data; ++ unsigned long flags; ++ ++ if (!blkdev) ++ return; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_shutdown - users %d disk %s\n", blkdev->users, blkdev->gd->disk_name); ++ ++ spin_lock_irqsave(&blkdev->lock, flags); ++ ++ blkdev->shutting_down = 1; ++ ++ blk_stop_queue(blkdev->gd->queue); ++ ++ spin_unlock_irqrestore(&blkdev->lock, flags); ++ ++ while (blkdev->num_outstanding_reqs) ++ { ++ DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", blkdev->num_outstanding_reqs); ++ ++ udelay(100); ++ } ++ ++ blkvsc_do_flush(blkdev); ++ ++ spin_lock_irqsave(&blkdev->lock, flags); ++ ++ blkvsc_cancel_pending_reqs(blkdev); ++ ++ spin_unlock_irqrestore(&blkdev->lock, flags); ++} ++ ++static int blkvsc_do_flush(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *blkvsc_req=NULL; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_flush()\n"); ++ ++ if (blkdev->device_type != HARDDISK_TYPE) ++ return 0; ++ ++ blkvsc_req = kmem_cache_alloc(blkdev->request_pool, GFP_KERNEL); ++ if (!blkvsc_req) ++ { ++ return -ENOMEM; ++ } ++ ++ memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); ++ init_waitqueue_head(&blkvsc_req->wevent); ++ blkvsc_req->dev = blkdev; ++ blkvsc_req->req = NULL; ++ blkvsc_req->write = 0; ++ ++ blkvsc_req->request.DataBuffer.PfnArray[0] = 0; ++ blkvsc_req->request.DataBuffer.Offset = 0; ++ blkvsc_req->request.DataBuffer.Length = 0; ++ ++ blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE; ++ blkvsc_req->cmd_len = 10; ++ ++ // Set this here since the completion routine may be invoked and completed before we return ++ blkvsc_req->cond =0; ++ blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); ++ ++ wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond); ++ ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ ++ return 0; ++} ++ ++// Do a scsi INQUIRY cmd here to get the device type (ie disk or dvd) ++static int blkvsc_do_inquiry(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *blkvsc_req=NULL; ++ struct page *page_buf; ++ unsigned char *buf; ++ unsigned char device_type; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_inquiry()\n"); ++ ++ blkvsc_req = kmem_cache_alloc(blkdev->request_pool, GFP_KERNEL); ++ if (!blkvsc_req) ++ { ++ return -ENOMEM; ++ } ++ ++ memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); ++ page_buf = alloc_page(GFP_KERNEL); ++ if (!page_buf) ++ { ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ return -ENOMEM; ++ } ++ ++ init_waitqueue_head(&blkvsc_req->wevent); ++ blkvsc_req->dev = blkdev; ++ blkvsc_req->req = NULL; ++ blkvsc_req->write = 0; ++ ++ blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf); ++ blkvsc_req->request.DataBuffer.Offset = 0; ++ blkvsc_req->request.DataBuffer.Length = 64; ++ ++ blkvsc_req->cmnd[0] = INQUIRY; ++ blkvsc_req->cmnd[1] = 0x1; // Get product data ++ blkvsc_req->cmnd[2] = 0x83; // mode page 83 ++ blkvsc_req->cmnd[4] = 64; ++ blkvsc_req->cmd_len = 6; ++ ++ // Set this here since the completion routine may be invoked and completed before we return ++ blkvsc_req->cond =0; ++ ++ blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); ++ ++ DPRINT_DBG(BLKVSC_DRV, "waiting %p to complete - cond %d\n", blkvsc_req, blkvsc_req->cond); ++ ++ wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond); ++ ++ buf = kmap(page_buf); ++ ++ //PrintBytes(buf, 64); ++ // be to le ++ device_type = buf[0] & 0x1F; ++ ++ if (device_type == 0x0) ++ { ++ blkdev->device_type = HARDDISK_TYPE; ++ } ++ else if (device_type == 0x5) ++ { ++ blkdev->device_type = DVD_TYPE; ++ } ++ else ++ { ++ // TODO: this is currently unsupported device type ++ blkdev->device_type = UNKNOWN_DEV_TYPE; ++ } ++ ++ DPRINT_DBG(BLKVSC_DRV, "device type %d \n", device_type); ++ ++ blkdev->device_id_len = buf[7]; ++ if (blkdev->device_id_len > 64) ++ blkdev->device_id_len = 64; ++ ++ memcpy(blkdev->device_id, &buf[8], blkdev->device_id_len); ++ //PrintBytes(blkdev->device_id, blkdev->device_id_len); ++ ++ kunmap(page_buf); ++ ++ __free_page(page_buf); ++ ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ ++ return 0; ++} ++ ++// Do a scsi READ_CAPACITY cmd here to get the size of the disk ++static int blkvsc_do_read_capacity(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *blkvsc_req=NULL; ++ struct page *page_buf; ++ unsigned char *buf; ++ struct scsi_sense_hdr sense_hdr; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_read_capacity()\n"); ++ ++ blkdev->sector_size = 0; ++ blkdev->capacity = 0; ++ blkdev->media_not_present = 0; // assume a disk is present ++ ++ blkvsc_req = kmem_cache_alloc(blkdev->request_pool, GFP_KERNEL); ++ if (!blkvsc_req) ++ { ++ return -ENOMEM; ++ } ++ ++ memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); ++ page_buf = alloc_page(GFP_KERNEL); ++ if (!page_buf) ++ { ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ return -ENOMEM; ++ } ++ ++ init_waitqueue_head(&blkvsc_req->wevent); ++ blkvsc_req->dev = blkdev; ++ blkvsc_req->req = NULL; ++ blkvsc_req->write = 0; ++ ++ blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf); ++ blkvsc_req->request.DataBuffer.Offset = 0; ++ blkvsc_req->request.DataBuffer.Length = 8; ++ ++ blkvsc_req->cmnd[0] = READ_CAPACITY; ++ blkvsc_req->cmd_len = 16; ++ ++ // Set this here since the completion routine may be invoked and completed before we return ++ blkvsc_req->cond =0; ++ ++ blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); ++ ++ DPRINT_DBG(BLKVSC_DRV, "waiting %p to complete - cond %d\n", blkvsc_req, blkvsc_req->cond); ++ ++ wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond); ++ ++ // check error ++ if (blkvsc_req->request.Status) ++ { ++ scsi_normalize_sense(blkvsc_req->sense_buffer, SCSI_SENSE_BUFFERSIZE, &sense_hdr); ++ ++ if (sense_hdr.asc == 0x3A) // Medium not present ++ { ++ blkdev->media_not_present = 1; ++ } ++ ++ return 0; ++ } ++ buf = kmap(page_buf); ++ ++ // be to le ++ blkdev->capacity = ((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]) + 1; ++ blkdev->sector_size = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; ++ ++ kunmap(page_buf); ++ ++ __free_page(page_buf); ++ ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ ++ return 0; ++} ++ ++ ++static int blkvsc_do_read_capacity16(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *blkvsc_req=NULL; ++ struct page *page_buf; ++ unsigned char *buf; ++ struct scsi_sense_hdr sense_hdr; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_read_capacity16()\n"); ++ ++ blkdev->sector_size = 0; ++ blkdev->capacity = 0; ++ blkdev->media_not_present = 0; // assume a disk is present ++ ++ blkvsc_req = kmem_cache_alloc(blkdev->request_pool, GFP_KERNEL); ++ if (!blkvsc_req) ++ { ++ return -ENOMEM; ++ } ++ ++ memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); ++ page_buf = alloc_page(GFP_KERNEL); ++ if (!page_buf) ++ { ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ return -ENOMEM; ++ } ++ ++ init_waitqueue_head(&blkvsc_req->wevent); ++ blkvsc_req->dev = blkdev; ++ blkvsc_req->req = NULL; ++ blkvsc_req->write = 0; ++ ++ blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf); ++ blkvsc_req->request.DataBuffer.Offset = 0; ++ blkvsc_req->request.DataBuffer.Length = 12; ++ ++ blkvsc_req->cmnd[0] = 0x9E; //READ_CAPACITY16; ++ blkvsc_req->cmd_len = 16; ++ ++ // Set this here since the completion routine may be invoked and completed before we return ++ blkvsc_req->cond =0; ++ ++ blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); ++ ++ DPRINT_DBG(BLKVSC_DRV, "waiting %p to complete - cond %d\n", blkvsc_req, blkvsc_req->cond); ++ ++ wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond); ++ ++ // check error ++ if (blkvsc_req->request.Status) ++ { ++ scsi_normalize_sense(blkvsc_req->sense_buffer, SCSI_SENSE_BUFFERSIZE, &sense_hdr); ++ ++ if (sense_hdr.asc == 0x3A) // Medium not present ++ { ++ blkdev->media_not_present = 1; ++ } ++ ++ return 0; ++ } ++ buf = kmap(page_buf); ++ ++ // be to le ++ blkdev->capacity = be64_to_cpu(*(unsigned long long*) &buf[0]) + 1; ++ blkdev->sector_size = be32_to_cpu(*(unsigned int*)&buf[8]); ++ ++ //blkdev->capacity = ((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]) + 1; ++ //blkdev->sector_size = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; ++ ++ kunmap(page_buf); ++ ++ __free_page(page_buf); ++ ++ kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); ++ ++ return 0; ++} ++ ++/*++ ++ ++Name: blkvsc_remove() ++ ++Desc: Callback when our device is removed ++ ++--*/ ++static int blkvsc_remove(struct device *device) ++{ ++ int ret=0; ++ ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct blkvsc_driver_context *blkvsc_drv_ctx = (struct blkvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ DEVICE_OBJECT* device_obj = &device_ctx->device_obj; ++ struct block_device_context *blkdev = (struct block_device_context*)device->driver_data; ++ unsigned long flags; ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_remove()\n"); ++ ++ if (!storvsc_drv_obj->Base.OnDeviceRemove) ++ { ++ DPRINT_EXIT(BLKVSC_DRV); ++ return -1; ++ } ++ ++ // Call to the vsc driver to let it know that the device is being removed ++ ret = storvsc_drv_obj->Base.OnDeviceRemove(device_obj); ++ if (ret != 0) ++ { ++ // TODO: ++ DPRINT_ERR(BLKVSC_DRV, "unable to remove blkvsc device (ret %d)", ret); ++ } ++ ++ // Get to a known state ++ spin_lock_irqsave(&blkdev->lock, flags); ++ ++ blkdev->shutting_down = 1; ++ ++ blk_stop_queue(blkdev->gd->queue); ++ ++ spin_unlock_irqrestore(&blkdev->lock, flags); ++ ++ while (blkdev->num_outstanding_reqs) ++ { ++ DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", blkdev->num_outstanding_reqs); ++ ++ udelay(100); ++ } ++ ++ blkvsc_do_flush(blkdev); ++ ++ spin_lock_irqsave(&blkdev->lock, flags); ++ ++ blkvsc_cancel_pending_reqs(blkdev); ++ ++ spin_unlock_irqrestore(&blkdev->lock, flags); ++ ++ blk_cleanup_queue(blkdev->gd->queue); ++ ++ del_gendisk(blkdev->gd); ++ ++ kmem_cache_destroy(blkdev->request_pool); ++ ++ kfree(blkdev); ++ ++ DPRINT_EXIT(BLKVSC_DRV); ++ ++ return ret; ++} ++ ++static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) ++{ ++ ASSERT(blkvsc_req->req); ++ ASSERT(blkvsc_req->sector_count <= (MAX_MULTIPAGE_BUFFER_COUNT*8)); ++ ++ blkvsc_req->cmd_len = 16; ++ ++ if (blkvsc_req->sector_start > 0xffffffff) ++ { ++ if (rq_data_dir(blkvsc_req->req)) ++ { ++ blkvsc_req->write = 1; ++ blkvsc_req->cmnd[0] = WRITE_16; ++ } ++ else ++ { ++ blkvsc_req->write = 0; ++ blkvsc_req->cmnd[0] = READ_16; ++ } ++ ++ blkvsc_req->cmnd[1] |= blk_fua_rq(blkvsc_req->req) ? 0x8 : 0; ++ ++ *(unsigned long long*)&blkvsc_req->cmnd[2] = cpu_to_be64(blkvsc_req->sector_start); ++ *(unsigned int*)&blkvsc_req->cmnd[10] = cpu_to_be32(blkvsc_req->sector_count); ++ } ++ else if ((blkvsc_req->sector_count > 0xff) || (blkvsc_req->sector_start > 0x1fffff)) ++ { ++ if (rq_data_dir(blkvsc_req->req)) ++ { ++ blkvsc_req->write = 1; ++ blkvsc_req->cmnd[0] = WRITE_10; ++ } ++ else ++ { ++ blkvsc_req->write = 0; ++ blkvsc_req->cmnd[0] = READ_10; ++ } ++ ++ blkvsc_req->cmnd[1] |= blk_fua_rq(blkvsc_req->req) ? 0x8 : 0; ++ ++ *(unsigned int *)&blkvsc_req->cmnd[2] = cpu_to_be32(blkvsc_req->sector_start); ++ *(unsigned short*)&blkvsc_req->cmnd[7] = cpu_to_be16(blkvsc_req->sector_count); ++ } ++ else ++ { ++ if (rq_data_dir(blkvsc_req->req)) ++ { ++ blkvsc_req->write = 1; ++ blkvsc_req->cmnd[0] = WRITE_6; ++ } ++ else ++ { ++ blkvsc_req->write = 0; ++ blkvsc_req->cmnd[0] = READ_6; ++ } ++ ++ *(unsigned int *)&blkvsc_req->cmnd[1] = cpu_to_be32(blkvsc_req->sector_start) >> 8; ++ blkvsc_req->cmnd[1] &= 0x1f; ++ blkvsc_req->cmnd[4] = (unsigned char) blkvsc_req->sector_count; ++ } ++} ++ ++static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(STORVSC_REQUEST*) ) ++{ ++ struct block_device_context *blkdev = blkvsc_req->dev; ++ struct device_context *device_ctx=blkdev->device_ctx; ++ struct driver_context *driver_ctx = driver_to_driver_context(device_ctx->device.driver); ++ struct blkvsc_driver_context *blkvsc_drv_ctx = (struct blkvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj; ++ int ret =0; ++ ++ STORVSC_REQUEST *storvsc_req; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - req %p type %s start_sector %llu count %d offset %d len %d\n", ++ blkvsc_req, ++ (blkvsc_req->write)?"WRITE":"READ", ++ blkvsc_req->sector_start, ++ blkvsc_req->sector_count, ++ blkvsc_req->request.DataBuffer.Offset, ++ blkvsc_req->request.DataBuffer.Length); ++ ++ /*for (i=0; i < (blkvsc_req->request.DataBuffer.Length >> 12); i++) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - req %p pfn[%d] %llx\n", ++ blkvsc_req, ++ i, ++ blkvsc_req->request.DataBuffer.PfnArray[i]); ++ }*/ ++ ++ storvsc_req = &blkvsc_req->request; ++ storvsc_req->Extension = (void*)((unsigned long)blkvsc_req + sizeof(struct blkvsc_request)); ++ ++ storvsc_req->Type = blkvsc_req->write? WRITE_TYPE : READ_TYPE; ++ ++ storvsc_req->OnIOCompletion = request_completion; ++ storvsc_req->Context = blkvsc_req; ++ ++ storvsc_req->Host = blkdev->port; ++ storvsc_req->Bus = blkdev->path; ++ storvsc_req->TargetId = blkdev->target; ++ storvsc_req->LunId = 0; // this is not really used at all ++ ++ storvsc_req->CdbLen = blkvsc_req->cmd_len; ++ storvsc_req->Cdb = blkvsc_req->cmnd; ++ ++ storvsc_req->SenseBuffer = blkvsc_req->sense_buffer; ++ storvsc_req->SenseBufferSize = SCSI_SENSE_BUFFERSIZE; ++ ++ ret = storvsc_drv_obj->OnIORequest(&blkdev->device_ctx->device_obj, &blkvsc_req->request); ++ if (ret == 0) ++ { ++ blkdev->num_outstanding_reqs++; ++ } ++ ++ return ret; ++} ++ ++// ++// We break the request into 1 or more blkvsc_requests and submit them. ++// If we cant submit them all, we put them on the pending_list. The ++// blkvsc_request() will work on the pending_list. ++// ++static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req) ++{ ++ struct bio *bio=NULL; ++ struct bio_vec *bvec=NULL; ++ struct bio_vec *prev_bvec=NULL; ++ ++ struct blkvsc_request *blkvsc_req=NULL; ++ struct blkvsc_request *tmp; ++ int databuf_idx=0; ++ int seg_idx=0; ++ ++ sector_t start_sector; ++ unsigned long num_sectors = 0; ++ int ret=0; ++ int pending=0; ++ struct blkvsc_request_group *group=NULL; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkdev %p req %p sect %llu \n", blkdev, req, req->sector); ++ ++ // Create a group to tie req to list of blkvsc_reqs ++ group = (struct blkvsc_request_group*)kmem_cache_alloc(blkdev->request_pool, GFP_ATOMIC); ++ if (!group) ++ { ++ return -ENOMEM; ++ } ++ ++ INIT_LIST_HEAD(&group->blkvsc_req_list); ++ group->outstanding = group->status = 0; ++ ++ start_sector = req->sector; ++ ++ // foreach bio in the request ++ if (req->bio) ++ for (bio = req->bio; bio; bio = bio->bi_next) ++ { ++ // Map this bio into an existing or new storvsc request ++ bio_for_each_segment (bvec, bio, seg_idx) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "bio_for_each_segment() - req %p bio %p bvec %p seg_idx %d databuf_idx %d\n", ++ req, bio, bvec, seg_idx, databuf_idx); ++ ++ // Get a new storvsc request ++ if ( (!blkvsc_req) || // 1st-time ++ (databuf_idx >= MAX_MULTIPAGE_BUFFER_COUNT) || ++ (bvec->bv_offset != 0) || // hole at the begin of page ++ (prev_bvec && (prev_bvec->bv_len != PAGE_SIZE)) ) // hold at the end of page ++ { ++ // submit the prev one ++ if (blkvsc_req) ++ { ++ blkvsc_req->sector_start = start_sector; ++ sector_div(blkvsc_req->sector_start, (blkdev->sector_size >> 9)); ++ ++ blkvsc_req->sector_count = num_sectors / (blkdev->sector_size >> 9); ++ ++ blkvsc_init_rw(blkvsc_req); ++ } ++ ++ // Create new blkvsc_req to represent the current bvec ++ blkvsc_req = kmem_cache_alloc(blkdev->request_pool, GFP_ATOMIC); ++ if (!blkvsc_req) ++ { ++ // free up everything ++ list_for_each_entry_safe(blkvsc_req, tmp, &group->blkvsc_req_list, req_entry) ++ { ++ list_del(&blkvsc_req->req_entry); ++ kmem_cache_free(blkdev->request_pool, blkvsc_req); ++ } ++ ++ kmem_cache_free(blkdev->request_pool, group); ++ return -ENOMEM; ++ } ++ ++ memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); ++ ++ blkvsc_req->dev = blkdev; ++ blkvsc_req->req = req; ++ blkvsc_req->request.DataBuffer.Offset = bvec->bv_offset; ++ blkvsc_req->request.DataBuffer.Length = 0; ++ ++ // Add to the group ++ blkvsc_req->group = group; ++ blkvsc_req->group->outstanding++; ++ list_add_tail(&blkvsc_req->req_entry, &blkvsc_req->group->blkvsc_req_list); ++ ++ start_sector += num_sectors; ++ num_sectors = 0; ++ databuf_idx = 0; ++ } ++ ++ // Add the curr bvec/segment to the curr blkvsc_req ++ blkvsc_req->request.DataBuffer.PfnArray[databuf_idx] = page_to_pfn(bvec->bv_page); ++ blkvsc_req->request.DataBuffer.Length += bvec->bv_len; ++ ++ prev_bvec = bvec; ++ ++ databuf_idx++; ++ num_sectors += bvec->bv_len >> 9; ++ ++ } // bio_for_each_segment ++ ++ } // rq_for_each_bio ++ ++ // Handle the last one ++ if (blkvsc_req) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "blkdev %p req %p group %p count %d\n", blkdev, req, blkvsc_req->group, blkvsc_req->group->outstanding); ++ ++ blkvsc_req->sector_start = start_sector; ++ sector_div(blkvsc_req->sector_start, (blkdev->sector_size >> 9)); ++ ++ blkvsc_req->sector_count = num_sectors / (blkdev->sector_size >> 9); ++ ++ blkvsc_init_rw(blkvsc_req); ++ } ++ ++ list_for_each_entry(blkvsc_req, &group->blkvsc_req_list, req_entry) ++ { ++ if (pending) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "adding blkvsc_req to pending_list - blkvsc_req %p start_sect %llu sect_count %d (%llu %d)\n", ++ blkvsc_req, blkvsc_req->sector_start, blkvsc_req->sector_count, start_sector, num_sectors); ++ ++ list_add_tail(&blkvsc_req->pend_entry, &blkdev->pending_list); ++ } ++ else ++ { ++ ret = blkvsc_submit_request(blkvsc_req, blkvsc_request_completion); ++ if (ret == -1) ++ { ++ pending = 1; ++ list_add_tail(&blkvsc_req->pend_entry, &blkdev->pending_list); ++ } ++ ++ DPRINT_DBG(BLKVSC_DRV, "submitted blkvsc_req %p start_sect %llu sect_count %d (%llu %d) ret %d\n", ++ blkvsc_req, blkvsc_req->sector_start, blkvsc_req->sector_count, start_sector, num_sectors, ret); ++ } ++ } ++ ++ return pending; ++} ++ ++static void blkvsc_cmd_completion(STORVSC_REQUEST* request) ++{ ++ struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context; ++ struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev; ++ ++ struct scsi_sense_hdr sense_hdr; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_cmd_completion() - req %p\n", blkvsc_req); ++ ++ blkdev->num_outstanding_reqs--; ++ ++ if (blkvsc_req->request.Status) ++ { ++ if (scsi_normalize_sense(blkvsc_req->sense_buffer, SCSI_SENSE_BUFFERSIZE, &sense_hdr)) ++ { ++ scsi_print_sense_hdr("blkvsc", &sense_hdr); ++ } ++ } ++ ++ blkvsc_req->cond =1; ++ wake_up_interruptible(&blkvsc_req->wevent); ++} ++ ++static void blkvsc_request_completion(STORVSC_REQUEST* request) ++{ ++ struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context; ++ struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev; ++ unsigned long flags; ++ struct blkvsc_request *comp_req, *tmp; ++ ++ ASSERT(blkvsc_req->group); ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkdev %p blkvsc_req %p group %p type %s sect_start %llu sect_count %d len %d group outstd %d total outstd %d\n", ++ blkdev, ++ blkvsc_req, ++ blkvsc_req->group, ++ (blkvsc_req->write)?"WRITE":"READ", ++ blkvsc_req->sector_start, ++ blkvsc_req->sector_count, ++ blkvsc_req->request.DataBuffer.Length, ++ blkvsc_req->group->outstanding, ++ blkdev->num_outstanding_reqs); ++ ++ spin_lock_irqsave(&blkdev->lock, flags); ++ ++ blkdev->num_outstanding_reqs--; ++ blkvsc_req->group->outstanding--; ++ ++ // Only start processing when all the blkvsc_reqs are completed. This guarantees no out-of-order ++ // blkvsc_req completion when calling end_that_request_first() ++ if (blkvsc_req->group->outstanding == 0) ++ { ++ list_for_each_entry_safe(comp_req, tmp, &blkvsc_req->group->blkvsc_req_list, req_entry) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "completing blkvsc_req %p sect_start %llu sect_count %d \n", ++ comp_req, ++ comp_req->sector_start, ++ comp_req->sector_count); ++ ++ list_del(&comp_req->req_entry); ++ ++#ifdef KERNEL_2_6_27 ++ if (!__blk_end_request( ++ comp_req->req, ++ (!comp_req->request.Status ? 0: -EIO), ++ comp_req->sector_count * blkdev->sector_size)) ++ { ++ //All the sectors have been xferred ie the request is done ++ DPRINT_DBG(BLKVSC_DRV, "req %p COMPLETED\n", comp_req->req); ++ kmem_cache_free(blkdev->request_pool, comp_req->group); ++ } ++#else ++ if (!end_that_request_first(comp_req->req, !comp_req->request.Status, (comp_req->sector_count * (blkdev->sector_size >> 9)))) ++ { ++ //All the sectors have been xferred ie the request is done ++ DPRINT_DBG(BLKVSC_DRV, "req %p COMPLETED\n", comp_req->req); ++ ++ end_that_request_last(comp_req->req, !comp_req->request.Status); ++ ++ kmem_cache_free(blkdev->request_pool, comp_req->group); ++ } ++#endif ++ ++ kmem_cache_free(blkdev->request_pool, comp_req); ++ } ++ ++ if (!blkdev->shutting_down) ++ { ++ blkvsc_do_pending_reqs(blkdev); ++ blk_start_queue(blkdev->gd->queue); ++ blkvsc_request(blkdev->gd->queue); ++ } ++ } ++ ++ spin_unlock_irqrestore(&blkdev->lock, flags); ++} ++ ++static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *pend_req, *tmp; ++ struct blkvsc_request *comp_req, *tmp2; ++ ++ int ret=0; ++ ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_cancel_pending_reqs()"); ++ ++ // Flush the pending list first ++ list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list, pend_entry) ++ { ++ // The pend_req could be part of a partially completed request. If so, complete those req first ++ // until we hit the pend_req ++ list_for_each_entry_safe(comp_req, tmp2, &pend_req->group->blkvsc_req_list, req_entry) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "completing blkvsc_req %p sect_start %llu sect_count %d \n", ++ comp_req, ++ comp_req->sector_start, ++ comp_req->sector_count); ++ ++ if (comp_req == pend_req) ++ break; ++ ++ list_del(&comp_req->req_entry); ++ ++ if (comp_req->req) ++ { ++#ifdef KERNEL_2_6_27 ++ ret = __blk_end_request( ++ comp_req->req, ++ (!comp_req->request.Status ? 0 : -EIO), ++ comp_req->sector_count * blkdev->sector_size); ++#else ++ ret = end_that_request_first(comp_req->req, !comp_req->request.Status, (comp_req->sector_count * (blkdev->sector_size >> 9))); ++#endif ++ ASSERT(ret != 0); ++ } ++ ++ kmem_cache_free(blkdev->request_pool, comp_req); ++ } ++ ++ DPRINT_DBG(BLKVSC_DRV, "cancelling pending request - %p\n", pend_req); ++ ++ list_del(&pend_req->pend_entry); ++ ++ list_del(&pend_req->req_entry); ++ ++ if (comp_req->req) ++ { ++#ifdef KERNEL_2_6_27 ++ if (!__blk_end_request( ++ pend_req->req, ++ -EIO, ++ pend_req->sector_count * blkdev->sector_size)) ++ { ++ //All the sectors have been xferred ie the request is done ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_cancel_pending_reqs() - req %p COMPLETED\n", pend_req->req); ++ kmem_cache_free(blkdev->request_pool, pend_req->group); ++ } ++#else ++ if (!end_that_request_first(pend_req->req, 0, (pend_req->sector_count * (blkdev->sector_size >> 9)))) ++ { ++ //All the sectors have been xferred ie the request is done ++ DPRINT_DBG(BLKVSC_DRV, "blkvsc_cancel_pending_reqs() - req %p COMPLETED\n", pend_req->req); ++ ++ end_that_request_last(pend_req->req, 0); ++ ++ kmem_cache_free(blkdev->request_pool, pend_req->group); ++ } ++#endif ++ } ++ ++ kmem_cache_free(blkdev->request_pool, pend_req); ++ } ++ ++ return ret; ++} ++ ++static int blkvsc_do_pending_reqs(struct block_device_context *blkdev) ++{ ++ struct blkvsc_request *pend_req, *tmp; ++ int ret=0; ++ ++ // Flush the pending list first ++ list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list, pend_entry) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "working off pending_list - %p\n", pend_req); ++ ++ ret = blkvsc_submit_request(pend_req, blkvsc_request_completion); ++ if (ret != 0) ++ { ++ break; ++ } ++ else ++ { ++ list_del(&pend_req->pend_entry); ++ } ++ } ++ ++ return ret; ++} ++ ++static void blkvsc_request(struct request_queue *queue) ++{ ++ struct block_device_context *blkdev = NULL; ++ struct request *req; ++ int ret=0; ++ ++ DPRINT_DBG(BLKVSC_DRV, "- enter \n"); ++ while ((req = elv_next_request(queue)) != NULL) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req); ++ ++ blkdev = req->rq_disk->private_data; ++ if (blkdev->shutting_down || !blk_fs_request(req) || blkdev->media_not_present) { ++ end_request(req, 0); ++ continue; ++ } ++ ++ ret = blkvsc_do_pending_reqs(blkdev); ++ ++ if (ret != 0) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "- stop queue - pending_list not empty\n"); ++ blk_stop_queue(queue); ++ break; ++ } ++ ++ blkdev_dequeue_request(req); ++ ++ ret = blkvsc_do_request(blkdev, req); ++ if (ret > 0) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n"); ++ blk_stop_queue(queue); ++ break; ++ } ++ else if (ret < 0) ++ { ++ DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n"); ++ blk_requeue_request(queue, req); ++ blk_stop_queue(queue); ++ break; ++ } ++ } ++} ++ ++static int blkvsc_open(struct inode *inode, struct file *filep) ++{ ++ struct block_device_context *blkdev = inode->i_bdev->bd_disk->private_data; ++ ++ DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users, blkdev->gd->disk_name); ++ ++ spin_lock(&blkdev->lock); ++ ++ if (!blkdev->users && blkdev->device_type == DVD_TYPE) ++ { ++ spin_unlock(&blkdev->lock); ++ check_disk_change(inode->i_bdev); ++ spin_lock(&blkdev->lock); ++ } ++ ++ blkdev->users++; ++ ++ spin_unlock(&blkdev->lock); ++ return 0; ++} ++ ++static int blkvsc_release(struct inode *inode, struct file *filep) ++{ ++ struct block_device_context *blkdev = inode->i_bdev->bd_disk->private_data; ++ ++ DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users, blkdev->gd->disk_name); ++ ++ spin_lock(&blkdev->lock); ++ if (blkdev->users == 1) ++ { ++ spin_unlock(&blkdev->lock); ++ blkvsc_do_flush(blkdev); ++ spin_lock(&blkdev->lock); ++ } ++ ++ blkdev->users--; ++ ++ spin_unlock(&blkdev->lock); ++ return 0; ++} ++ ++static int blkvsc_media_changed(struct gendisk *gd) ++{ ++ DPRINT_DBG(BLKVSC_DRV, "- enter\n"); ++ ++ return 1; ++} ++ ++static int blkvsc_revalidate_disk(struct gendisk *gd) ++{ ++ struct block_device_context *blkdev = gd->private_data; ++ ++ DPRINT_DBG(BLKVSC_DRV, "- enter\n"); ++ ++ if (blkdev->device_type == DVD_TYPE) ++ { ++ blkvsc_do_read_capacity(blkdev); ++ set_capacity(blkdev->gd, blkdev->capacity * (blkdev->sector_size/512)); ++ blk_queue_hardsect_size(gd->queue, blkdev->sector_size); ++ } ++ return 0; ++} ++ ++int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg) ++{ ++ sector_t total_sectors = get_capacity(bd->bd_disk); ++ sector_t cylinder_times_heads=0; ++ sector_t temp=0; ++ ++ int sectors_per_track=0; ++ int heads=0; ++ int cylinders=0; ++ int rem=0; ++ ++ if (total_sectors > (65535 * 16 * 255)) { ++ total_sectors = (65535 * 16 * 255); ++ } ++ ++ if (total_sectors >= (65535 * 16 * 63)) { ++ sectors_per_track = 255; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ else ++ { ++ sectors_per_track = 17; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ ++ temp = cylinder_times_heads + 1023; ++ rem = sector_div(temp, 1024); // sector_div stores the quotient in temp ++ ++ heads = temp; ++ ++ if (heads < 4) { ++ heads = 4; ++ } ++ ++ if (cylinder_times_heads >= (heads * 1024) || (heads > 16)) { ++ sectors_per_track = 31; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ ++ if (cylinder_times_heads >= (heads * 1024)) { ++ sectors_per_track = 63; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ } ++ ++ temp = cylinder_times_heads; ++ rem = sector_div(temp, heads); // sector_div stores the quotient in temp ++ cylinders = temp; ++ ++ hg->heads = heads; ++ hg->sectors = sectors_per_track; ++ hg->cylinders = cylinders; ++ ++ DPRINT_INFO(BLKVSC_DRV, "CHS (%d, %d, %d)", cylinders, heads, sectors_per_track); ++ ++ return 0; ++} ++ ++static int blkvsc_ioctl(struct inode *inode, struct file *filep, unsigned cmd, unsigned long arg) ++{ ++ struct block_device *bd = inode->i_bdev; ++ struct block_device_context *blkdev = bd->bd_disk->private_data; ++ int ret=0; ++ ++ switch (cmd) ++ { ++ // TODO: I think there is certain format for HDIO_GET_IDENTITY rather than just ++ // a GUID. Commented it out for now. ++ /*case HDIO_GET_IDENTITY: ++ DPRINT_INFO(BLKVSC_DRV, "HDIO_GET_IDENTITY\n"); ++ ++ if (copy_to_user((void __user *)arg, blkdev->device_id, blkdev->device_id_len)) ++ { ++ ret = -EFAULT; ++ } ++ ++ break;*/ ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ ++ return ret; ++} ++ ++ ++MODULE_LICENSE("GPL"); ++ ++static int __init blkvsc_init(void) ++{ ++ int ret; ++ ++ ASSERT(sizeof(sector_t) == 8); // Make sure CONFIG_LBD is set ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ DPRINT_INFO(BLKVSC_DRV, "Blkvsc initializing...."); ++ ++ ret = blkvsc_drv_init(BlkVscInitialize); ++ ++ DPRINT_EXIT(BLKVSC_DRV); ++ ++ return ret; ++} ++ ++static void __exit blkvsc_exit(void) ++{ ++ DPRINT_ENTER(BLKVSC_DRV); ++ ++ blkvsc_drv_exit(); ++ ++ DPRINT_ENTER(BLKVSC_DRV); ++} ++ ++module_param(blkvsc_ringbuffer_size, int, S_IRUGO); ++ ++module_init(blkvsc_init); ++module_exit(blkvsc_exit); ++ ++// eof diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus-to-the-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus-to-the-build.patch new file mode 100644 index 000000000..8ccfffbba --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus-to-the-build.patch @@ -0,0 +1,54 @@ +From foo@baz Mon Jul 13 17:07:49 PDT 2009 +Date: Mon, 13 Jul 2009 17:07:49 -0700 +From: Greg Kroah-Hartman +Date: Mon, 13 Jul 2009 16:04:02 -0700 +Subject: Staging: hv: add the Hyper-V virtual bus to the build + +From: Greg Kroah-Hartman + +Add the Hyper-V virtual bus to the kernel build system. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/Kconfig | 2 ++ + drivers/staging/Makefile | 1 + + drivers/staging/hv/Kconfig | 8 ++++++++ + drivers/staging/hv/Makefile | 3 +++ + 4 files changed, 14 insertions(+) + +--- a/drivers/staging/Kconfig ++++ b/drivers/staging/Kconfig +@@ -57,4 +57,6 @@ source "drivers/staging/benet/Kconfig" + + source "drivers/staging/rtl8187se/Kconfig" + ++source "drivers/staging/hv/Kconfig" ++ + endif # STAGING +--- a/drivers/staging/Makefile ++++ b/drivers/staging/Makefile +@@ -20,3 +20,4 @@ obj-$(CONFIG_RT2870) += rt2870/ + obj-$(CONFIG_RT3070) += rt3070/ + obj-$(CONFIG_BENET) += benet/ + obj-$(CONFIG_RTL8187SE) += rtl8187se/ ++obj-$(CONFIG_HYPERV) += hv/ +--- /dev/null ++++ b/drivers/staging/hv/Kconfig +@@ -0,0 +1,8 @@ ++config HYPERV ++ tristate "Microsoft Hyper-V client drivers" ++ depends on X86 && !XEN ++ default n ++ help ++ Select this option to run Linux as a Hyper-V client operating ++ system. ++ +--- /dev/null ++++ b/drivers/staging/hv/Makefile +@@ -0,0 +1,3 @@ ++obj-$(CONFIG_HYPERV) += hv_vmbus.o ++ ++hv_vmbus-objs := vmbus_drv.o osd.o Sources.o diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus.patch new file mode 100644 index 000000000..e4d4fa435 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-bus.patch @@ -0,0 +1,7192 @@ +From foo@baz Mon Jul 13 16:02:34 PDT 2009 +Date: Mon, 13 Jul 2009 16:02:34 -0700 +From: Hank Janssen +Subject: Staging: hv: add the Hyper-V virtual bus + +From: Hank Janssen + +This is the virtual bus that all of the Linux Hyper-V drivers use. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/Channel.c | 1199 +++++++++++++++++++++++++++++++++ + drivers/staging/hv/Channel.h | 157 ++++ + drivers/staging/hv/ChannelInterface.c | 222 ++++++ + drivers/staging/hv/ChannelInterface.h | 41 + + drivers/staging/hv/ChannelMgmt.c | 826 ++++++++++++++++++++++ + drivers/staging/hv/ChannelMgmt.h | 156 ++++ + drivers/staging/hv/Connection.c | 432 +++++++++++ + drivers/staging/hv/Hv.c | 672 ++++++++++++++++++ + drivers/staging/hv/Hv.h | 184 +++++ + drivers/staging/hv/RingBuffer.c | 630 +++++++++++++++++ + drivers/staging/hv/RingBuffer.h | 123 +++ + drivers/staging/hv/Sources.c | 31 + drivers/staging/hv/VersionInfo.h | 29 + drivers/staging/hv/Vmbus.c | 508 ++++++++++++++ + drivers/staging/hv/VmbusPrivate.h | 170 ++++ + drivers/staging/hv/osd.c | 500 +++++++++++++ + drivers/staging/hv/vmbus_drv.c | 1228 ++++++++++++++++++++++++++++++++++ + 17 files changed, 7108 insertions(+) + +--- /dev/null ++++ b/drivers/staging/hv/Channel.c +@@ -0,0 +1,1199 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "osd.h" ++#include "logging.h" ++ ++#include "VmbusPrivate.h" ++ ++// ++// Internal routines ++// ++static int ++VmbusChannelCreateGpadlHeader( ++ PVOID Kbuffer, // must be phys and virt contiguous ++ UINT32 Size, // page-size multiple ++ VMBUS_CHANNEL_MSGINFO **msgInfo, ++ UINT32 *MessageCount ++ ); ++ ++static void ++DumpVmbusChannel( ++ VMBUS_CHANNEL *Channel ++ ); ++ ++ ++static void ++VmbusChannelSetEvent( ++ VMBUS_CHANNEL *Channel ++ ); ++ ++ ++#if 0 ++static void ++DumpMonitorPage( ++ HV_MONITOR_PAGE *MonitorPage ++ ) ++{ ++ int i=0; ++ int j=0; ++ ++ DPRINT_DBG(VMBUS, "monitorPage - %p, trigger state - %d", MonitorPage, MonitorPage->TriggerState); ++ ++ for (i=0; i<4; i++) ++ { ++ DPRINT_DBG(VMBUS, "trigger group (%d) - %llx", i, MonitorPage->TriggerGroup[i].AsUINT64); ++ } ++ ++ for (i=0; i<4; i++) ++ { ++ for (j=0; j<32; j++) ++ { ++ DPRINT_DBG(VMBUS, "latency (%d)(%d) - %llx", i, j, MonitorPage->Latency[i][j]); ++ } ++ } ++ for (i=0; i<4; i++) ++ { ++ for (j=0; j<32; j++) ++ { ++ DPRINT_DBG(VMBUS, "param-conn id (%d)(%d) - %d", i, j, MonitorPage->Parameter[i][j].ConnectionId.AsUINT32); ++ DPRINT_DBG(VMBUS, "param-flag (%d)(%d) - %d", i, j, MonitorPage->Parameter[i][j].FlagNumber); ++ ++ } ++ } ++} ++#endif ++ ++/*++ ++ ++Name: ++ VmbusChannelSetEvent() ++ ++Description: ++ Trigger an event notification on the specified channel. ++ ++--*/ ++static void ++VmbusChannelSetEvent( ++ VMBUS_CHANNEL *Channel ++ ) ++{ ++ HV_MONITOR_PAGE *monitorPage; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ if (Channel->OfferMsg.MonitorAllocated) ++ { ++ // Each UINT32 represents 32 channels ++ BitSet((UINT32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31); ++ ++ monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages; ++ monitorPage++; // Get the child to parent monitor page ++ ++ BitSet((UINT32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit); ++ } ++ else ++ { ++ VmbusSetEvent(Channel->OfferMsg.ChildRelId); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++#if 0 ++static void ++VmbusChannelClearEvent( ++ VMBUS_CHANNEL *Channel ++ ) ++{ ++ HV_MONITOR_PAGE *monitorPage; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ if (Channel->OfferMsg.MonitorAllocated) ++ { ++ // Each UINT32 represents 32 channels ++ BitClear((UINT32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31); ++ ++ monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages; ++ monitorPage++; // Get the child to parent monitor page ++ ++ BitClear((UINT32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++#endif ++/*++; ++ ++Name: ++ VmbusChannelGetDebugInfo() ++ ++Description: ++ Retrieve various channel debug info ++ ++--*/ ++void ++VmbusChannelGetDebugInfo( ++ VMBUS_CHANNEL *Channel, ++ VMBUS_CHANNEL_DEBUG_INFO *DebugInfo ++ ) ++{ ++ HV_MONITOR_PAGE *monitorPage; ++ UINT8 monitorGroup = (UINT8)Channel->OfferMsg.MonitorId / 32; ++ UINT8 monitorOffset = (UINT8)Channel->OfferMsg.MonitorId % 32; ++ //UINT32 monitorBit = 1 << monitorOffset; ++ ++ DebugInfo->RelId = Channel->OfferMsg.ChildRelId; ++ DebugInfo->State = Channel->State; ++ memcpy(&DebugInfo->InterfaceType, &Channel->OfferMsg.Offer.InterfaceType, sizeof(GUID)); ++ memcpy(&DebugInfo->InterfaceInstance, &Channel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID)); ++ ++ monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages; ++ ++ DebugInfo->MonitorId = Channel->OfferMsg.MonitorId; ++ ++ DebugInfo->ServerMonitorPending = monitorPage->TriggerGroup[monitorGroup].Pending; ++ DebugInfo->ServerMonitorLatency = monitorPage->Latency[monitorGroup][ monitorOffset]; ++ DebugInfo->ServerMonitorConnectionId = monitorPage->Parameter[monitorGroup][ monitorOffset].ConnectionId.u.Id; ++ ++ monitorPage++; ++ ++ DebugInfo->ClientMonitorPending = monitorPage->TriggerGroup[monitorGroup].Pending; ++ DebugInfo->ClientMonitorLatency = monitorPage->Latency[monitorGroup][ monitorOffset]; ++ DebugInfo->ClientMonitorConnectionId = monitorPage->Parameter[monitorGroup][ monitorOffset].ConnectionId.u.Id; ++ ++ RingBufferGetDebugInfo(&Channel->Inbound, &DebugInfo->Inbound); ++ RingBufferGetDebugInfo(&Channel->Outbound, &DebugInfo->Outbound); ++} ++ ++ ++/*++; ++ ++Name: ++ VmbusChannelOpen() ++ ++Description: ++ Open the specified channel. ++ ++--*/ ++int ++VmbusChannelOpen( ++ VMBUS_CHANNEL *NewChannel, ++ UINT32 SendRingBufferSize, ++ UINT32 RecvRingBufferSize, ++ PVOID UserData, ++ UINT32 UserDataLen, ++ PFN_CHANNEL_CALLBACK pfnOnChannelCallback, ++ PVOID Context ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; ++ VMBUS_CHANNEL_MSGINFO* openInfo; ++ void *in, *out; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Aligned to page size ++ ASSERT(!(SendRingBufferSize & (PAGE_SIZE -1))); ++ ASSERT(!(RecvRingBufferSize & (PAGE_SIZE -1))); ++ ++ NewChannel->OnChannelCallback = pfnOnChannelCallback; ++ NewChannel->ChannelCallbackContext = Context; ++ ++ // Allocate the ring buffer ++ out = PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT); ++ //out = MemAllocZeroed(sendRingBufferSize + recvRingBufferSize); ++ ASSERT(out); ++ ASSERT(((ULONG_PTR)out & (PAGE_SIZE-1)) == 0); ++ ++ in = (void*)((ULONG_PTR)out + SendRingBufferSize); ++ ++ NewChannel->RingBufferPages = out; ++ NewChannel->RingBufferPageCount = (SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT; ++ ++ RingBufferInit(&NewChannel->Outbound, out, SendRingBufferSize); ++ ++ RingBufferInit(&NewChannel->Inbound, in, RecvRingBufferSize); ++ ++ // Establish the gpadl for the ring buffer ++ DPRINT_DBG(VMBUS, "Establishing ring buffer's gpadl for channel %p...", NewChannel); ++ ++ NewChannel->RingBufferGpadlHandle = 0; ++ ++ ret = VmbusChannelEstablishGpadl(NewChannel, ++ NewChannel->Outbound.RingBuffer, ++ SendRingBufferSize + RecvRingBufferSize, ++ &NewChannel->RingBufferGpadlHandle); ++ ++ DPRINT_DBG(VMBUS, "channel %p ", ++ NewChannel, ++ NewChannel->OfferMsg.ChildRelId, ++ NewChannel->RingBufferGpadlHandle, ++ NewChannel->Outbound.RingBuffer, ++ NewChannel->Outbound.RingSize, ++ NewChannel->Inbound.RingBuffer, ++ NewChannel->Inbound.RingSize, ++ SendRingBufferSize); ++ ++ // Create and init the channel open message ++ openInfo = ++ (VMBUS_CHANNEL_MSGINFO*)MemAlloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_OPEN_CHANNEL)); ++ ASSERT(openInfo != NULL); ++ ++ openInfo->WaitEvent = WaitEventCreate(); ++ ++ openMsg = (VMBUS_CHANNEL_OPEN_CHANNEL*)openInfo->Msg; ++ openMsg->Header.MessageType = ChannelMessageOpenChannel; ++ openMsg->OpenId = NewChannel->OfferMsg.ChildRelId; // FIXME ++ openMsg->ChildRelId = NewChannel->OfferMsg.ChildRelId; ++ openMsg->RingBufferGpadlHandle = NewChannel->RingBufferGpadlHandle; ++ ASSERT(openMsg->RingBufferGpadlHandle); ++ openMsg->DownstreamRingBufferPageOffset = SendRingBufferSize >> PAGE_SHIFT; ++ openMsg->ServerContextAreaGpadlHandle = 0; // TODO ++ ++ ASSERT(UserDataLen <= MAX_USER_DEFINED_BYTES); ++ if (UserDataLen) ++ { ++ memcpy(openMsg->UserData, UserData, UserDataLen); ++ } ++ ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &openInfo->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_DBG(VMBUS, "Sending channel open msg..."); ++ ++ ret = VmbusPostMessage(openMsg, sizeof(VMBUS_CHANNEL_OPEN_CHANNEL)); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS, "unable to open channel - %d", ret); ++ goto Cleanup; ++ } ++ ++ // FIXME: Need to time-out here ++ WaitEventWait(openInfo->WaitEvent); ++ ++ if (openInfo->Response.OpenResult.Status == 0) ++ { ++ DPRINT_INFO(VMBUS, "channel <%p> open success!!", NewChannel); ++ } ++ else ++ { ++ DPRINT_INFO(VMBUS, "channel <%p> open failed - %d!!", NewChannel, openInfo->Response.OpenResult.Status); ++ } ++ ++Cleanup: ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ REMOVE_ENTRY_LIST(&openInfo->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ WaitEventClose(openInfo->WaitEvent); ++ MemFree(openInfo); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return 0; ++} ++ ++/*++; ++ ++Name: ++ DumpGpadlBody() ++ ++Description: ++ Dump the gpadl body message to the console for debugging purposes. ++ ++--*/ ++static void DumpGpadlBody( ++ VMBUS_CHANNEL_GPADL_BODY *Gpadl, ++ UINT32 Len) ++{ ++ int i=0; ++ int pfnCount=0; ++ ++ pfnCount = (Len - sizeof(VMBUS_CHANNEL_GPADL_BODY))/ sizeof(UINT64); ++ DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", Len, pfnCount); ++ ++ for (i=0; i< pfnCount; i++) ++ { ++ DPRINT_DBG(VMBUS, "gpadl body - %d) pfn %llu", i, Gpadl->Pfn[i]); ++ } ++} ++ ++ ++/*++; ++ ++Name: ++ DumpGpadlHeader() ++ ++Description: ++ Dump the gpadl header message to the console for debugging purposes. ++ ++--*/ ++static void DumpGpadlHeader( ++ VMBUS_CHANNEL_GPADL_HEADER *Gpadl ++ ) ++{ ++ int i=0,j=0; ++ int pageCount=0; ++ ++ ++ DPRINT_DBG(VMBUS, "gpadl header - relid %d, range count %d, range buflen %d", ++ Gpadl->ChildRelId, ++ Gpadl->RangeCount, ++ Gpadl->RangeBufLen); ++ for (i=0; i< Gpadl->RangeCount; i++) ++ { ++ pageCount = Gpadl->Range[i].ByteCount >> PAGE_SHIFT; ++ pageCount = (pageCount > 26)? 26 : pageCount; ++ ++ DPRINT_DBG(VMBUS, "gpadl range %d - len %d offset %d page count %d", ++ i, Gpadl->Range[i].ByteCount, Gpadl->Range[i].ByteOffset, pageCount); ++ ++ for (j=0; j< pageCount; j++) ++ { ++ DPRINT_DBG(VMBUS, "%d) pfn %llu", j, Gpadl->Range[i].PfnArray[j]); ++ } ++ } ++} ++ ++/*++; ++ ++Name: ++ VmbusChannelCreateGpadlHeader() ++ ++Description: ++ Creates a gpadl for the specified buffer ++ ++--*/ ++static int ++VmbusChannelCreateGpadlHeader( ++ PVOID Kbuffer, // from kmalloc() ++ UINT32 Size, // page-size multiple ++ VMBUS_CHANNEL_MSGINFO **MsgInfo, ++ UINT32 *MessageCount) ++{ ++ int i; ++ int pageCount; ++ unsigned long long pfn; ++ VMBUS_CHANNEL_GPADL_HEADER* gpaHeader; ++ VMBUS_CHANNEL_GPADL_BODY* gpadlBody; ++ VMBUS_CHANNEL_MSGINFO* msgHeader; ++ VMBUS_CHANNEL_MSGINFO* msgBody; ++ UINT32 msgSize; ++ ++ int pfnSum, pfnCount, pfnLeft, pfnCurr, pfnSize; ++ ++ //ASSERT( (kbuffer & (PAGE_SIZE-1)) == 0); ++ ASSERT( (Size & (PAGE_SIZE-1)) == 0); ++ ++ pageCount = Size >> PAGE_SHIFT; ++ pfn = GetPhysicalAddress(Kbuffer) >> PAGE_SHIFT; ++ ++ // do we need a gpadl body msg ++ pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_HEADER) - sizeof(GPA_RANGE); ++ pfnCount = pfnSize / sizeof(UINT64); ++ ++ if (pageCount > pfnCount) // we need a gpadl body ++ { ++ // fill in the header ++ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(UINT64); ++ msgHeader = MemAllocZeroed(msgSize); ++ ++ INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList); ++ msgHeader->MessageSize=msgSize; ++ ++ gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg; ++ gpaHeader->RangeCount = 1; ++ gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(UINT64); ++ gpaHeader->Range[0].ByteOffset = 0; ++ gpaHeader->Range[0].ByteCount = Size; ++ for (i=0; iRange[0].PfnArray[i] = pfn+i; ++ } ++ *MsgInfo = msgHeader; ++ *MessageCount = 1; ++ ++ pfnSum = pfnCount; ++ pfnLeft = pageCount - pfnCount; ++ ++ // how many pfns can we fit ++ pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_BODY); ++ pfnCount = pfnSize / sizeof(UINT64); ++ ++ // fill in the body ++ while (pfnLeft) ++ { ++ if (pfnLeft > pfnCount) ++ { ++ pfnCurr = pfnCount; ++ } ++ else ++ { ++ pfnCurr = pfnLeft; ++ } ++ ++ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(UINT64); ++ msgBody = MemAllocZeroed(msgSize); ++ ASSERT(msgBody); ++ msgBody->MessageSize = msgSize; ++ (*MessageCount)++; ++ gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)msgBody->Msg; ++ ++ // FIXME: Gpadl is UINT32 and we are using a pointer which could be 64-bit ++ //gpadlBody->Gpadl = kbuffer; ++ for (i=0; iPfn[i] = pfn + pfnSum + i; ++ } ++ ++ // add to msg header ++ INSERT_TAIL_LIST(&msgHeader->SubMsgList, &msgBody->MsgListEntry); ++ pfnSum += pfnCurr; ++ pfnLeft -= pfnCurr; ++ } ++ } ++ else ++ { ++ // everything fits in a header ++ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(UINT64); ++ msgHeader = MemAllocZeroed(msgSize); ++ msgHeader->MessageSize=msgSize; ++ ++ gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg; ++ gpaHeader->RangeCount = 1; ++ gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(UINT64); ++ gpaHeader->Range[0].ByteOffset = 0; ++ gpaHeader->Range[0].ByteCount = Size; ++ for (i=0; iRange[0].PfnArray[i] = pfn+i; ++ } ++ ++ *MsgInfo = msgHeader; ++ *MessageCount = 1; ++ } ++ ++ return 0; ++} ++ ++ ++/*++; ++ ++Name: ++ VmbusChannelEstablishGpadl() ++ ++Description: ++ Estabish a GPADL for the specified buffer ++ ++--*/ ++int ++VmbusChannelEstablishGpadl( ++ VMBUS_CHANNEL *Channel, ++ PVOID Kbuffer, // from kmalloc() ++ UINT32 Size, // page-size multiple ++ UINT32 *GpadlHandle ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_GPADL_HEADER* gpadlMsg; ++ VMBUS_CHANNEL_GPADL_BODY* gpadlBody; ++ //VMBUS_CHANNEL_GPADL_CREATED* gpadlCreated; ++ ++ VMBUS_CHANNEL_MSGINFO *msgInfo; ++ VMBUS_CHANNEL_MSGINFO *subMsgInfo; ++ ++ UINT32 msgCount; ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ UINT32 nextGpadlHandle; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ nextGpadlHandle = gVmbusConnection.NextGpadlHandle; ++ InterlockedIncrement((int*)&gVmbusConnection.NextGpadlHandle); ++ ++ VmbusChannelCreateGpadlHeader(Kbuffer, Size, &msgInfo, &msgCount); ++ ASSERT(msgInfo != NULL); ++ ASSERT(msgCount >0); ++ ++ msgInfo->WaitEvent = WaitEventCreate(); ++ gpadlMsg = (VMBUS_CHANNEL_GPADL_HEADER*)msgInfo->Msg; ++ gpadlMsg->Header.MessageType = ChannelMessageGpadlHeader; ++ gpadlMsg->ChildRelId = Channel->OfferMsg.ChildRelId; ++ gpadlMsg->Gpadl = nextGpadlHandle; ++ ++ DumpGpadlHeader(gpadlMsg); ++ ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &msgInfo->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d", Kbuffer, Size, msgCount); ++ ++ DPRINT_DBG(VMBUS, "Sending GPADL Header - len %d", msgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ++ ++ ret = VmbusPostMessage(gpadlMsg, msgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS, "Unable to open channel - %d", ret); ++ goto Cleanup; ++ } ++ ++ if (msgCount>1) ++ { ++ ITERATE_LIST_ENTRIES(anchor, curr, &msgInfo->SubMsgList) ++ { ++ subMsgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; ++ gpadlBody = (VMBUS_CHANNEL_GPADL_BODY*)subMsgInfo->Msg; ++ ++ gpadlBody->Header.MessageType = ChannelMessageGpadlBody; ++ gpadlBody->Gpadl = nextGpadlHandle; ++ ++ DPRINT_DBG(VMBUS, "Sending GPADL Body - len %d", subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ++ ++ DumpGpadlBody(gpadlBody, subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ++ ret = VmbusPostMessage(gpadlBody, subMsgInfo->MessageSize - sizeof(VMBUS_CHANNEL_MSGINFO)); ++ ASSERT(ret == 0); ++ } ++ } ++ WaitEventWait(msgInfo->WaitEvent); ++ ++ // At this point, we received the gpadl created msg ++ DPRINT_DBG(VMBUS, "Received GPADL created (relid %d, status %d handle %x)", ++ Channel->OfferMsg.ChildRelId, ++ msgInfo->Response.GpadlCreated.CreationStatus, ++ gpadlMsg->Gpadl); ++ ++ *GpadlHandle = gpadlMsg->Gpadl; ++ ++Cleanup: ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ WaitEventClose(msgInfo->WaitEvent); ++ MemFree(msgInfo); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++ ++/*++; ++ ++Name: ++ VmbusChannelTeardownGpadl() ++ ++Description: ++ Teardown the specified GPADL handle ++ ++--*/ ++int ++VmbusChannelTeardownGpadl( ++ VMBUS_CHANNEL *Channel, ++ UINT32 GpadlHandle ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_GPADL_TEARDOWN *msg; ++ VMBUS_CHANNEL_MSGINFO* info; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ ASSERT(GpadlHandle != 0); ++ ++ info = ++ (VMBUS_CHANNEL_MSGINFO*)MemAlloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN)); ++ ASSERT(info != NULL); ++ ++ info->WaitEvent = WaitEventCreate(); ++ ++ msg = (VMBUS_CHANNEL_GPADL_TEARDOWN*)info->Msg; ++ ++ msg->Header.MessageType = ChannelMessageGpadlTeardown; ++ msg->ChildRelId = Channel->OfferMsg.ChildRelId; ++ msg->Gpadl = GpadlHandle; ++ ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &info->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN)); ++ if (ret != 0) ++ { ++ // TODO: ++ } ++ ++ WaitEventWait(info->WaitEvent); ++ ++ // Received a torndown response ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ REMOVE_ENTRY_LIST(&info->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ WaitEventClose(info->WaitEvent); ++ MemFree(info); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelClose() ++ ++Description: ++ Close the specified channel ++ ++--*/ ++VOID ++VmbusChannelClose( ++ VMBUS_CHANNEL *Channel ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_CLOSE_CHANNEL* msg; ++ VMBUS_CHANNEL_MSGINFO* info; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Stop callback and cancel the timer asap ++ Channel->OnChannelCallback = NULL; ++ TimerStop(Channel->PollTimer); ++ ++ // Send a closing message ++ info = ++ (VMBUS_CHANNEL_MSGINFO*)MemAlloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL)); ++ ASSERT(info != NULL); ++ ++ //info->waitEvent = WaitEventCreate(); ++ ++ msg = (VMBUS_CHANNEL_CLOSE_CHANNEL*)info->Msg; ++ msg->Header.MessageType = ChannelMessageCloseChannel; ++ msg->ChildRelId = Channel->OfferMsg.ChildRelId; ++ ++ ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL)); ++ if (ret != 0) ++ { ++ // TODO: ++ } ++ ++ // Tear down the gpadl for the channel's ring buffer ++ if (Channel->RingBufferGpadlHandle) ++ { ++ VmbusChannelTeardownGpadl(Channel, Channel->RingBufferGpadlHandle); ++ } ++ ++ // TODO: Send a msg to release the childRelId ++ ++ // Cleanup the ring buffers for this channel ++ RingBufferCleanup(&Channel->Outbound); ++ RingBufferCleanup(&Channel->Inbound); ++ ++ PageFree(Channel->RingBufferPages, Channel->RingBufferPageCount); ++ ++ MemFree(info); ++ ++ // If we are closing the channel during an error path in opening the channel, don't free the channel ++ // since the caller will free the channel ++ if (Channel->State == CHANNEL_OPEN_STATE) ++ { ++ SpinlockAcquire(gVmbusConnection.ChannelLock); ++ REMOVE_ENTRY_LIST(&Channel->ListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelLock); ++ ++ FreeVmbusChannel(Channel); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelSendPacket() ++ ++Description: ++ Send the specified buffer on the given channel ++ ++--*/ ++int ++VmbusChannelSendPacket( ++ VMBUS_CHANNEL *Channel, ++ const PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId, ++ VMBUS_PACKET_TYPE Type, ++ UINT32 Flags ++) ++{ ++ int ret=0; ++ VMPACKET_DESCRIPTOR desc; ++ UINT32 packetLen = sizeof(VMPACKET_DESCRIPTOR) + BufferLen; ++ UINT32 packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64)); ++ SG_BUFFER_LIST bufferList[3]; ++ UINT64 alignedData=0; ++ ++ DPRINT_ENTER(VMBUS); ++ DPRINT_DBG(VMBUS, "channel %p buffer %p len %d", Channel, Buffer, BufferLen); ++ ++ DumpVmbusChannel(Channel); ++ ++ ASSERT((packetLenAligned - packetLen) < sizeof(UINT64)); ++ ++ // Setup the descriptor ++ desc.Type = Type;//VmbusPacketTypeDataInBand; ++ desc.Flags = Flags;//VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; ++ desc.DataOffset8 = sizeof(VMPACKET_DESCRIPTOR) >> 3; // in 8-bytes granularity ++ desc.Length8 = (UINT16)(packetLenAligned >> 3); ++ desc.TransactionId = RequestId; ++ ++ bufferList[0].Data = &desc; ++ bufferList[0].Length = sizeof(VMPACKET_DESCRIPTOR); ++ ++ bufferList[1].Data = Buffer; ++ bufferList[1].Length = BufferLen; ++ ++ bufferList[2].Data = &alignedData; ++ bufferList[2].Length = packetLenAligned - packetLen; ++ ++ ret = RingBufferWrite( ++ &Channel->Outbound, ++ bufferList, ++ 3); ++ ++ // TODO: We should determine if this is optional ++ if (ret == 0 && !GetRingBufferInterruptMask(&Channel->Outbound)) ++ { ++ VmbusChannelSetEvent(Channel); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelSendPacketPageBuffer() ++ ++Description: ++ Send a range of single-page buffer packets using a GPADL Direct packet type. ++ ++--*/ ++int ++VmbusChannelSendPacketPageBuffer( ++ VMBUS_CHANNEL *Channel, ++ PAGE_BUFFER PageBuffers[], ++ UINT32 PageCount, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++) ++{ ++ int ret=0; ++ int i=0; ++ VMBUS_CHANNEL_PACKET_PAGE_BUFFER desc; ++ UINT32 descSize; ++ UINT32 packetLen; ++ UINT32 packetLenAligned; ++ SG_BUFFER_LIST bufferList[3]; ++ UINT64 alignedData=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ ASSERT(PageCount <= MAX_PAGE_BUFFER_COUNT); ++ ++ DumpVmbusChannel(Channel); ++ ++ // Adjust the size down since VMBUS_CHANNEL_PACKET_PAGE_BUFFER is the largest size we support ++ descSize = sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER) - ((MAX_PAGE_BUFFER_COUNT - PageCount)*sizeof(PAGE_BUFFER)); ++ packetLen = descSize + BufferLen; ++ packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64)); ++ ++ ASSERT((packetLenAligned - packetLen) < sizeof(UINT64)); ++ ++ // Setup the descriptor ++ desc.Type = VmbusPacketTypeDataUsingGpaDirect; ++ desc.Flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; ++ desc.DataOffset8 = descSize >> 3; // in 8-bytes grandularity ++ desc.Length8 = (UINT16)(packetLenAligned >> 3); ++ desc.TransactionId = RequestId; ++ desc.RangeCount = PageCount; ++ ++ for (i=0; iOutbound, ++ bufferList, ++ 3); ++ ++ // TODO: We should determine if this is optional ++ if (ret == 0 && !GetRingBufferInterruptMask(&Channel->Outbound)) ++ { ++ VmbusChannelSetEvent(Channel); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelSendPacketMultiPageBuffer() ++ ++Description: ++ Send a multi-page buffer packet using a GPADL Direct packet type. ++ ++--*/ ++int ++VmbusChannelSendPacketMultiPageBuffer( ++ VMBUS_CHANNEL *Channel, ++ MULTIPAGE_BUFFER *MultiPageBuffer, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER desc; ++ UINT32 descSize; ++ UINT32 packetLen; ++ UINT32 packetLenAligned; ++ SG_BUFFER_LIST bufferList[3]; ++ UINT64 alignedData=0; ++ UINT32 PfnCount = NUM_PAGES_SPANNED(MultiPageBuffer->Offset, MultiPageBuffer->Length); ++ ++ DPRINT_ENTER(VMBUS); ++ ++ DumpVmbusChannel(Channel); ++ ++ DPRINT_DBG(VMBUS, "data buffer - offset %u len %u pfn count %u", MultiPageBuffer->Offset, MultiPageBuffer->Length, PfnCount); ++ ++ ASSERT(PfnCount > 0); ++ ASSERT(PfnCount <= MAX_MULTIPAGE_BUFFER_COUNT); ++ ++ // Adjust the size down since VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER is the largest size we support ++ descSize = sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER) - ((MAX_MULTIPAGE_BUFFER_COUNT - PfnCount)*sizeof(UINT64)); ++ packetLen = descSize + BufferLen; ++ packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64)); ++ ++ ASSERT((packetLenAligned - packetLen) < sizeof(UINT64)); ++ ++ // Setup the descriptor ++ desc.Type = VmbusPacketTypeDataUsingGpaDirect; ++ desc.Flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; ++ desc.DataOffset8 = descSize >> 3; // in 8-bytes grandularity ++ desc.Length8 = (UINT16)(packetLenAligned >> 3); ++ desc.TransactionId = RequestId; ++ desc.RangeCount = 1; ++ ++ desc.Range.Length = MultiPageBuffer->Length; ++ desc.Range.Offset = MultiPageBuffer->Offset; ++ ++ memcpy(desc.Range.PfnArray, MultiPageBuffer->PfnArray, PfnCount*sizeof(UINT64)); ++ ++ bufferList[0].Data = &desc; ++ bufferList[0].Length = descSize; ++ ++ bufferList[1].Data = Buffer; ++ bufferList[1].Length = BufferLen; ++ ++ bufferList[2].Data = &alignedData; ++ bufferList[2].Length = packetLenAligned - packetLen; ++ ++ ret = RingBufferWrite( ++ &Channel->Outbound, ++ bufferList, ++ 3); ++ ++ // TODO: We should determine if this is optional ++ if (ret == 0 && !GetRingBufferInterruptMask(&Channel->Outbound)) ++ { ++ VmbusChannelSetEvent(Channel); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelRecvPacket() ++ ++Description: ++ Retrieve the user packet on the specified channel ++ ++--*/ ++// TODO: Do we ever receive a gpa direct packet other than the ones we send ? ++int ++VmbusChannelRecvPacket( ++ VMBUS_CHANNEL *Channel, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ) ++{ ++ VMPACKET_DESCRIPTOR desc; ++ UINT32 packetLen; ++ UINT32 userLen; ++ int ret; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ *BufferActualLen = 0; ++ *RequestId = 0; ++ ++ SpinlockAcquire(Channel->InboundLock); ++ ++ ret = RingBufferPeek(&Channel->Inbound, &desc, sizeof(VMPACKET_DESCRIPTOR)); ++ if (ret != 0) ++ { ++ SpinlockRelease(Channel->InboundLock); ++ ++ //DPRINT_DBG(VMBUS, "nothing to read!!"); ++ DPRINT_EXIT(VMBUS); ++ return 0; ++ } ++ ++ //VmbusChannelClearEvent(Channel); ++ ++ packetLen = desc.Length8 << 3; ++ userLen = packetLen - (desc.DataOffset8 << 3); ++ //ASSERT(userLen > 0); ++ ++ DPRINT_DBG(VMBUS, "packet received on channel %p relid %d ", ++ Channel, ++ Channel->OfferMsg.ChildRelId, ++ desc.Type, ++ desc.Flags, ++ desc.TransactionId, packetLen, userLen); ++ ++ *BufferActualLen = userLen; ++ ++ if (userLen > BufferLen) ++ { ++ SpinlockRelease(Channel->InboundLock); ++ ++ DPRINT_ERR(VMBUS, "buffer too small - got %d needs %d", BufferLen, userLen); ++ DPRINT_EXIT(VMBUS); ++ ++ return -1; ++ } ++ ++ *RequestId = desc.TransactionId; ++ ++ // Copy over the packet to the user buffer ++ ret = RingBufferRead(&Channel->Inbound, Buffer, userLen, (desc.DataOffset8 << 3)); ++ ++ SpinlockRelease(Channel->InboundLock); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return 0; ++} ++ ++/*++ ++ ++Name: ++ VmbusChannelRecvPacketRaw() ++ ++Description: ++ Retrieve the raw packet on the specified channel ++ ++--*/ ++int ++VmbusChannelRecvPacketRaw( ++ VMBUS_CHANNEL *Channel, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ) ++{ ++ VMPACKET_DESCRIPTOR desc; ++ UINT32 packetLen; ++ UINT32 userLen; ++ int ret; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ *BufferActualLen = 0; ++ *RequestId = 0; ++ ++ SpinlockAcquire(Channel->InboundLock); ++ ++ ret = RingBufferPeek(&Channel->Inbound, &desc, sizeof(VMPACKET_DESCRIPTOR)); ++ if (ret != 0) ++ { ++ SpinlockRelease(Channel->InboundLock); ++ ++ //DPRINT_DBG(VMBUS, "nothing to read!!"); ++ DPRINT_EXIT(VMBUS); ++ return 0; ++ } ++ ++ //VmbusChannelClearEvent(Channel); ++ ++ packetLen = desc.Length8 << 3; ++ userLen = packetLen - (desc.DataOffset8 << 3); ++ ++ DPRINT_DBG(VMBUS, "packet received on channel %p relid %d ", ++ Channel, ++ Channel->OfferMsg.ChildRelId, ++ desc.Type, ++ desc.Flags, ++ desc.TransactionId, packetLen, userLen); ++ ++ *BufferActualLen = packetLen; ++ ++ if (packetLen > BufferLen) ++ { ++ SpinlockRelease(Channel->InboundLock); ++ ++ DPRINT_ERR(VMBUS, "buffer too small - needed %d bytes but got space for only %d bytes", packetLen, BufferLen); ++ DPRINT_EXIT(VMBUS); ++ return -2; ++ } ++ ++ *RequestId = desc.TransactionId; ++ ++ // Copy over the entire packet to the user buffer ++ ret = RingBufferRead(&Channel->Inbound, Buffer, packetLen, 0); ++ ++ SpinlockRelease(Channel->InboundLock); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return 0; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnChannelEvent() ++ ++Description: ++ Channel event callback ++ ++--*/ ++void ++VmbusChannelOnChannelEvent( ++ VMBUS_CHANNEL *Channel ++ ) ++{ ++ DumpVmbusChannel(Channel); ++ ASSERT(Channel->OnChannelCallback); ++#ifdef ENABLE_POLLING ++ TimerStop(Channel->PollTimer); ++ Channel->OnChannelCallback(Channel->ChannelCallbackContext); ++ TimerStart(Channel->PollTimer, 100 /* 100us */); ++#else ++ Channel->OnChannelCallback(Channel->ChannelCallbackContext); ++#endif ++} ++ ++/*++ ++ ++Name: ++ VmbusChannelOnTimer() ++ ++Description: ++ Timer event callback ++ ++--*/ ++void ++VmbusChannelOnTimer( ++ void *Context ++ ) ++{ ++ VMBUS_CHANNEL *channel = (VMBUS_CHANNEL*)Context; ++ ++ if (channel->OnChannelCallback) ++ { ++ channel->OnChannelCallback(channel->ChannelCallbackContext); ++#ifdef ENABLE_POLLING ++ TimerStart(channel->PollTimer, 100 /* 100us */); ++#endif ++ } ++} ++ ++ ++/*++ ++ ++Name: ++ DumpVmbusChannel() ++ ++Description: ++ Dump vmbus channel info to the console ++ ++--*/ ++static void ++DumpVmbusChannel( ++ VMBUS_CHANNEL *Channel ++ ) ++{ ++ DPRINT_DBG(VMBUS, "Channel (%d)", Channel->OfferMsg.ChildRelId); ++ DumpRingInfo(&Channel->Outbound, "Outbound "); ++ DumpRingInfo(&Channel->Inbound, "Inbound "); ++} ++ ++ ++// eof +--- /dev/null ++++ b/drivers/staging/hv/Channel.h +@@ -0,0 +1,157 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _CHANNEL_H_ ++#define _CHANNEL_H_ ++ ++#include "osd.h" ++#include "ChannelMgmt.h" ++ ++#pragma pack(push,1) ++ ++ ++// The format must be the same as VMDATA_GPA_DIRECT ++typedef struct _VMBUS_CHANNEL_PACKET_PAGE_BUFFER { ++ UINT16 Type; ++ UINT16 DataOffset8; ++ UINT16 Length8; ++ UINT16 Flags; ++ UINT64 TransactionId; ++ UINT32 Reserved; ++ UINT32 RangeCount; ++ PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT]; ++} VMBUS_CHANNEL_PACKET_PAGE_BUFFER; ++ ++ ++// The format must be the same as VMDATA_GPA_DIRECT ++typedef struct _VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER { ++ UINT16 Type; ++ UINT16 DataOffset8; ++ UINT16 Length8; ++ UINT16 Flags; ++ UINT64 TransactionId; ++ UINT32 Reserved; ++ UINT32 RangeCount; // Always 1 in this case ++ MULTIPAGE_BUFFER Range; ++} VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER; ++ ++#pragma pack(pop) ++ ++// ++// Routines ++// ++ ++INTERNAL int ++VmbusChannelOpen( ++ VMBUS_CHANNEL *Channel, ++ UINT32 SendRingBufferSize, ++ UINT32 RecvRingBufferSize, ++ PVOID UserData, ++ UINT32 UserDataLen, ++ PFN_CHANNEL_CALLBACK pfnOnChannelCallback, ++ PVOID Context ++ ); ++ ++INTERNAL void ++VmbusChannelClose( ++ VMBUS_CHANNEL *Channel ++ ); ++ ++INTERNAL int ++VmbusChannelSendPacket( ++ VMBUS_CHANNEL *Channel, ++ const PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId, ++ VMBUS_PACKET_TYPE Type, ++ UINT32 Flags ++); ++ ++INTERNAL int ++VmbusChannelSendPacketPageBuffer( ++ VMBUS_CHANNEL *Channel, ++ PAGE_BUFFER PageBuffers[], ++ UINT32 PageCount, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++ ); ++ ++INTERNAL int ++VmbusChannelSendPacketMultiPageBuffer( ++ VMBUS_CHANNEL *Channel, ++ MULTIPAGE_BUFFER *MultiPageBuffer, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++); ++ ++INTERNAL int ++VmbusChannelEstablishGpadl( ++ VMBUS_CHANNEL *Channel, ++ PVOID Kbuffer, // from kmalloc() ++ UINT32 Size, // page-size multiple ++ UINT32 *GpadlHandle ++ ); ++ ++INTERNAL int ++VmbusChannelTeardownGpadl( ++ VMBUS_CHANNEL *Channel, ++ UINT32 GpadlHandle ++ ); ++ ++INTERNAL int ++VmbusChannelRecvPacket( ++ VMBUS_CHANNEL *Channel, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ); ++ ++INTERNAL int ++VmbusChannelRecvPacketRaw( ++ VMBUS_CHANNEL *Channel, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ); ++ ++INTERNAL void ++VmbusChannelOnChannelEvent( ++ VMBUS_CHANNEL *Channel ++ ); ++ ++INTERNAL void ++VmbusChannelGetDebugInfo( ++ VMBUS_CHANNEL *Channel, ++ VMBUS_CHANNEL_DEBUG_INFO *DebugInfo ++ ); ++ ++INTERNAL void ++VmbusChannelOnTimer( ++ void *Context ++ ); ++#endif //_CHANNEL_H_ +--- /dev/null ++++ b/drivers/staging/hv/ChannelInterface.c +@@ -0,0 +1,222 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++#include "VmbusPrivate.h" ++ ++INTERNAL int ++IVmbusChannelOpen( ++ PDEVICE_OBJECT Device, ++ UINT32 SendBufferSize, ++ UINT32 RecvRingBufferSize, ++ PVOID UserData, ++ UINT32 UserDataLen, ++ VMBUS_CHANNEL_CALLBACK ChannelCallback, ++ PVOID Context ++ ) ++{ ++ return VmbusChannelOpen( (VMBUS_CHANNEL*)Device->context, ++ SendBufferSize, ++ RecvRingBufferSize, ++ UserData, ++ UserDataLen, ++ ChannelCallback, ++ Context); ++} ++ ++ ++INTERNAL void ++IVmbusChannelClose( ++ PDEVICE_OBJECT Device ++ ) ++{ ++ VmbusChannelClose((VMBUS_CHANNEL*)Device->context); ++} ++ ++ ++INTERNAL int ++IVmbusChannelSendPacket( ++ PDEVICE_OBJECT Device, ++ const PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId, ++ UINT32 Type, ++ UINT32 Flags ++ ) ++{ ++ return VmbusChannelSendPacket((VMBUS_CHANNEL*)Device->context, ++ Buffer, ++ BufferLen, ++ RequestId, ++ Type, ++ Flags); ++} ++ ++INTERNAL int ++IVmbusChannelSendPacketPageBuffer( ++ PDEVICE_OBJECT Device, ++ PAGE_BUFFER PageBuffers[], ++ UINT32 PageCount, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++ ) ++{ ++ return VmbusChannelSendPacketPageBuffer((VMBUS_CHANNEL*)Device->context, ++ PageBuffers, ++ PageCount, ++ Buffer, ++ BufferLen, ++ RequestId); ++} ++ ++INTERNAL int ++IVmbusChannelSendPacketMultiPageBuffer( ++ PDEVICE_OBJECT Device, ++ MULTIPAGE_BUFFER *MultiPageBuffer, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT64 RequestId ++ ) ++{ ++ return VmbusChannelSendPacketMultiPageBuffer((VMBUS_CHANNEL*)Device->context, ++ MultiPageBuffer, ++ Buffer, ++ BufferLen, ++ RequestId); ++} ++ ++INTERNAL int ++IVmbusChannelRecvPacket ( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ) ++{ ++ return VmbusChannelRecvPacket((VMBUS_CHANNEL*)Device->context, ++ Buffer, ++ BufferLen, ++ BufferActualLen, ++ RequestId); ++} ++ ++INTERNAL int ++IVmbusChannelRecvPacketRaw( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* BufferActualLen, ++ UINT64* RequestId ++ ) ++{ ++ return VmbusChannelRecvPacketRaw((VMBUS_CHANNEL*)Device->context, ++ Buffer, ++ BufferLen, ++ BufferActualLen, ++ RequestId); ++} ++ ++INTERNAL int ++IVmbusChannelEstablishGpadl( ++ PDEVICE_OBJECT Device, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32* GpadlHandle ++ ) ++{ ++ return VmbusChannelEstablishGpadl((VMBUS_CHANNEL*)Device->context, ++ Buffer, ++ BufferLen, ++ GpadlHandle); ++} ++ ++INTERNAL int ++IVmbusChannelTeardownGpadl( ++ PDEVICE_OBJECT Device, ++ UINT32 GpadlHandle ++ ) ++{ ++ return VmbusChannelTeardownGpadl((VMBUS_CHANNEL*)Device->context, ++ GpadlHandle); ++ ++} ++ ++INTERNAL void ++GetChannelInterface( ++ VMBUS_CHANNEL_INTERFACE *ChannelInterface ++ ) ++{ ++ ChannelInterface->Open = IVmbusChannelOpen; ++ ChannelInterface->Close = IVmbusChannelClose; ++ ChannelInterface->SendPacket = IVmbusChannelSendPacket; ++ ChannelInterface->SendPacketPageBuffer = IVmbusChannelSendPacketPageBuffer; ++ ChannelInterface->SendPacketMultiPageBuffer = IVmbusChannelSendPacketMultiPageBuffer; ++ ChannelInterface->RecvPacket = IVmbusChannelRecvPacket; ++ ChannelInterface->RecvPacketRaw = IVmbusChannelRecvPacketRaw; ++ ChannelInterface->EstablishGpadl = IVmbusChannelEstablishGpadl; ++ ChannelInterface->TeardownGpadl = IVmbusChannelTeardownGpadl; ++ ChannelInterface->GetInfo = GetChannelInfo; ++} ++ ++ ++INTERNAL void ++GetChannelInfo( ++ PDEVICE_OBJECT Device, ++ DEVICE_INFO *DeviceInfo ++ ) ++{ ++ VMBUS_CHANNEL_DEBUG_INFO debugInfo; ++ ++ if (Device->context) ++ { ++ VmbusChannelGetDebugInfo((VMBUS_CHANNEL*)Device->context, &debugInfo); ++ ++ DeviceInfo->ChannelId = debugInfo.RelId; ++ DeviceInfo->ChannelState = debugInfo.State; ++ memcpy(&DeviceInfo->ChannelType, &debugInfo.InterfaceType, sizeof(GUID)); ++ memcpy(&DeviceInfo->ChannelInstance, &debugInfo.InterfaceInstance, sizeof(GUID)); ++ ++ DeviceInfo->MonitorId = debugInfo.MonitorId; ++ ++ DeviceInfo->ServerMonitorPending = debugInfo.ServerMonitorPending; ++ DeviceInfo->ServerMonitorLatency = debugInfo.ServerMonitorLatency; ++ DeviceInfo->ServerMonitorConnectionId = debugInfo.ServerMonitorConnectionId; ++ ++ DeviceInfo->ClientMonitorPending = debugInfo.ClientMonitorPending; ++ DeviceInfo->ClientMonitorLatency = debugInfo.ClientMonitorLatency; ++ DeviceInfo->ClientMonitorConnectionId = debugInfo.ClientMonitorConnectionId; ++ ++ DeviceInfo->Inbound.InterruptMask = debugInfo.Inbound.CurrentInterruptMask; ++ DeviceInfo->Inbound.ReadIndex = debugInfo.Inbound.CurrentReadIndex; ++ DeviceInfo->Inbound.WriteIndex = debugInfo.Inbound.CurrentWriteIndex; ++ DeviceInfo->Inbound.BytesAvailToRead = debugInfo.Inbound.BytesAvailToRead; ++ DeviceInfo->Inbound.BytesAvailToWrite = debugInfo.Inbound.BytesAvailToWrite; ++ ++ DeviceInfo->Outbound.InterruptMask = debugInfo.Outbound.CurrentInterruptMask; ++ DeviceInfo->Outbound.ReadIndex = debugInfo.Outbound.CurrentReadIndex; ++ DeviceInfo->Outbound.WriteIndex = debugInfo.Outbound.CurrentWriteIndex; ++ DeviceInfo->Outbound.BytesAvailToRead = debugInfo.Outbound.BytesAvailToRead; ++ DeviceInfo->Outbound.BytesAvailToWrite = debugInfo.Outbound.BytesAvailToWrite; ++ } ++} +--- /dev/null ++++ b/drivers/staging/hv/ChannelInterface.h +@@ -0,0 +1,41 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _CHANNEL_INTERFACE_H_ ++#define _CHANNEL_INTERFACE_H_ ++ ++#include "VmbusApi.h" ++ ++INTERNAL void ++GetChannelInterface( ++ VMBUS_CHANNEL_INTERFACE *ChannelInterface ++ ); ++ ++INTERNAL void ++GetChannelInfo( ++ PDEVICE_OBJECT Device, ++ DEVICE_INFO *DeviceInfo ++ ); ++ ++#endif // _CHANNEL_INTERFACE_H_ +--- /dev/null ++++ b/drivers/staging/hv/ChannelMgmt.c +@@ -0,0 +1,826 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "osd.h" ++#include "logging.h" ++ ++#include "VmbusPrivate.h" ++ ++// ++// Defines ++// ++ ++// ++// Data types ++// ++ ++typedef void (*PFN_CHANNEL_MESSAGE_HANDLER)(VMBUS_CHANNEL_MESSAGE_HEADER* msg); ++ ++typedef struct _VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY { ++ VMBUS_CHANNEL_MESSAGE_TYPE messageType; ++ PFN_CHANNEL_MESSAGE_HANDLER messageHandler; ++} VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY; ++ ++// ++// Internal routines ++// ++ ++static void ++VmbusChannelOnOffer( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++static void ++VmbusChannelOnOpenResult( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelOnOfferRescind( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelOnGpadlCreated( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelOnGpadlTorndown( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelOnOffersDelivered( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelOnVersionResponse( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ); ++ ++static void ++VmbusChannelProcessOffer( ++ PVOID context ++ ); ++ ++static void ++VmbusChannelProcessRescindOffer( ++ PVOID context ++ ); ++ ++ ++// ++// Globals ++// ++ ++#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 4 ++ ++const GUID gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED]= { ++ //{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} ++ {.Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}},// Storage - SCSI ++ //{F8615163-DF3E-46c5-913F-F2D2F965ED0E} ++ {.Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}}, // Network ++ //{CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} ++ {.Data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c, 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}}, // Input ++ //{32412632-86cb-44a2-9b5c-50d1417354f5} ++ {.Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}}, // IDE ++ ++}; ++ ++// Channel message dispatch table ++VMBUS_CHANNEL_MESSAGE_TABLE_ENTRY gChannelMessageTable[ChannelMessageCount]= { ++ {ChannelMessageInvalid, NULL}, ++ {ChannelMessageOfferChannel, VmbusChannelOnOffer}, ++ {ChannelMessageRescindChannelOffer, VmbusChannelOnOfferRescind}, ++ {ChannelMessageRequestOffers, NULL}, ++ {ChannelMessageAllOffersDelivered, VmbusChannelOnOffersDelivered}, ++ {ChannelMessageOpenChannel, NULL}, ++ {ChannelMessageOpenChannelResult, VmbusChannelOnOpenResult}, ++ {ChannelMessageCloseChannel, NULL}, ++ {ChannelMessageGpadlHeader, NULL}, ++ {ChannelMessageGpadlBody, NULL}, ++ {ChannelMessageGpadlCreated, VmbusChannelOnGpadlCreated}, ++ {ChannelMessageGpadlTeardown, NULL}, ++ {ChannelMessageGpadlTorndown, VmbusChannelOnGpadlTorndown}, ++ {ChannelMessageRelIdReleased, NULL}, ++ {ChannelMessageInitiateContact, NULL}, ++ {ChannelMessageVersionResponse, VmbusChannelOnVersionResponse}, ++ {ChannelMessageUnload, NULL}, ++}; ++ ++/*++ ++ ++Name: ++ AllocVmbusChannel() ++ ++Description: ++ Allocate and initialize a vmbus channel object ++ ++--*/ ++VMBUS_CHANNEL* AllocVmbusChannel(void) ++{ ++ VMBUS_CHANNEL* channel; ++ ++ channel = (VMBUS_CHANNEL*) MemAllocAtomic(sizeof(VMBUS_CHANNEL)); ++ if (!channel) ++ { ++ return NULL; ++ } ++ ++ memset(channel, 0,sizeof(VMBUS_CHANNEL)); ++ channel->InboundLock = SpinlockCreate(); ++ if (!channel->InboundLock) ++ { ++ MemFree(channel); ++ return NULL; ++ } ++ ++ channel->PollTimer = TimerCreate(VmbusChannelOnTimer, channel); ++ if (!channel->PollTimer) ++ { ++ SpinlockClose(channel->InboundLock); ++ MemFree(channel); ++ return NULL; ++ } ++ ++ //channel->dataWorkQueue = WorkQueueCreate("data"); ++ channel->ControlWQ = WorkQueueCreate("control"); ++ if (!channel->ControlWQ) ++ { ++ TimerClose(channel->PollTimer); ++ SpinlockClose(channel->InboundLock); ++ MemFree(channel); ++ return NULL; ++ } ++ ++ return channel; ++} ++ ++/*++ ++ ++Name: ++ ReleaseVmbusChannel() ++ ++Description: ++ Release the vmbus channel object itself ++ ++--*/ ++static inline void ReleaseVmbusChannel(void* Context) ++{ ++ VMBUS_CHANNEL* channel = (VMBUS_CHANNEL*)Context; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ DPRINT_DBG(VMBUS, "releasing channel (%p)", channel); ++ WorkQueueClose(channel->ControlWQ); ++ DPRINT_DBG(VMBUS, "channel released (%p)", channel); ++ ++ MemFree(channel); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++/*++ ++ ++Name: ++ FreeVmbusChannel() ++ ++Description: ++ Release the resources used by the vmbus channel object ++ ++--*/ ++void FreeVmbusChannel(VMBUS_CHANNEL* Channel) ++{ ++ SpinlockClose(Channel->InboundLock); ++ TimerClose(Channel->PollTimer); ++ ++ // We have to release the channel's workqueue/thread in the vmbus's workqueue/thread context ++ // ie we can't destroy ourselves. ++ WorkQueueQueueWorkItem(gVmbusConnection.WorkQueue, ReleaseVmbusChannel, (void*)Channel); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelProcessOffer() ++ ++Description: ++ Process the offer by creating a channel/device associated with this offer ++ ++--*/ ++static void ++VmbusChannelProcessOffer( ++ PVOID context ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL* newChannel=(VMBUS_CHANNEL*)context; ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ BOOL fNew=TRUE; ++ VMBUS_CHANNEL* channel; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Make sure this is a new offer ++ SpinlockAcquire(gVmbusConnection.ChannelLock); ++ ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList) ++ { ++ channel = CONTAINING_RECORD(curr, VMBUS_CHANNEL, ListEntry); ++ ++ if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(GUID)) && ++ !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID))) ++ { ++ fNew = FALSE; ++ break; ++ } ++ } ++ ++ if (fNew) ++ { ++ INSERT_TAIL_LIST(&gVmbusConnection.ChannelList, &newChannel->ListEntry); ++ } ++ SpinlockRelease(gVmbusConnection.ChannelLock); ++ ++ if (!fNew) ++ { ++ DPRINT_DBG(VMBUS, "Ignoring duplicate offer for relid (%d)", newChannel->OfferMsg.ChildRelId); ++ FreeVmbusChannel(newChannel); ++ DPRINT_EXIT(VMBUS); ++ return; ++ } ++ ++ // Start the process of binding this offer to the driver ++ // We need to set the DeviceObject field before calling VmbusChildDeviceAdd() ++ newChannel->DeviceObject = VmbusChildDeviceCreate( ++ newChannel->OfferMsg.Offer.InterfaceType, ++ newChannel->OfferMsg.Offer.InterfaceInstance, ++ newChannel); ++ ++ DPRINT_DBG(VMBUS, "child device object allocated - %p", newChannel->DeviceObject); ++ ++ // Add the new device to the bus. This will kick off device-driver binding ++ // which eventually invokes the device driver's AddDevice() method. ++ ret = VmbusChildDeviceAdd(newChannel->DeviceObject); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS, "unable to add child device object (relid %d)", ++ newChannel->OfferMsg.ChildRelId); ++ ++ SpinlockAcquire(gVmbusConnection.ChannelLock); ++ REMOVE_ENTRY_LIST(&newChannel->ListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelLock); ++ ++ FreeVmbusChannel(newChannel); ++ } ++ else ++ { ++ // This state is used to indicate a successful open so that when we do close the channel normally, ++ // we can cleanup properly ++ newChannel->State = CHANNEL_OPEN_STATE; ++ } ++ DPRINT_EXIT(VMBUS); ++} ++ ++/*++ ++ ++Name: ++ VmbusChannelProcessRescindOffer() ++ ++Description: ++ Rescind the offer by initiating a device removal ++ ++--*/ ++static void ++VmbusChannelProcessRescindOffer( ++ PVOID context ++ ) ++{ ++ VMBUS_CHANNEL* channel=(VMBUS_CHANNEL*)context; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ VmbusChildDeviceRemove(channel->DeviceObject); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnOffer() ++ ++Description: ++ Handler for channel offers from vmbus in parent partition. We ignore all offers except ++ network and storage offers. For each network and storage offers, we create a channel object ++ and queue a work item to the channel object to process the offer synchronously ++ ++--*/ ++static void ++VmbusChannelOnOffer( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr; ++ VMBUS_CHANNEL* newChannel; ++ ++ GUID *guidType; ++ GUID *guidInstance; ++ int i; ++ int fSupported=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ for (i=0; iOffer.InterfaceType, &gSupportedDeviceClasses[i], sizeof(GUID)) == 0) ++ { ++ fSupported = 1; ++ break; ++ } ++ } ++ ++ if (!fSupported) ++ { ++ DPRINT_DBG(VMBUS, "Ignoring channel offer notification for child relid %d", offer->ChildRelId); ++ DPRINT_EXIT(VMBUS); ++ ++ return; ++ } ++ ++ guidType = &offer->Offer.InterfaceType; ++ guidInstance = &offer->Offer.InterfaceInstance; ++ ++ DPRINT_INFO(VMBUS, "Channel offer notification - child relid %d monitor id %d allocated %d, " ++ "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x} " ++ "instance {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ offer->ChildRelId, ++ offer->MonitorId, ++ offer->MonitorAllocated, ++ guidType->Data[3], guidType->Data[2], guidType->Data[1], guidType->Data[0], guidType->Data[5], guidType->Data[4], guidType->Data[7], guidType->Data[6], guidType->Data[8], guidType->Data[9], guidType->Data[10], guidType->Data[11], guidType->Data[12], guidType->Data[13], guidType->Data[14], guidType->Data[15], ++ guidInstance->Data[3], guidInstance->Data[2], guidInstance->Data[1], guidInstance->Data[0], guidInstance->Data[5], guidInstance->Data[4], guidInstance->Data[7], guidInstance->Data[6], guidInstance->Data[8], guidInstance->Data[9], guidInstance->Data[10], guidInstance->Data[11], guidInstance->Data[12], guidInstance->Data[13], guidInstance->Data[14], guidInstance->Data[15]); ++ ++ // Allocate the channel object and save this offer. ++ newChannel = AllocVmbusChannel(); ++ if (!newChannel) ++ { ++ DPRINT_ERR(VMBUS, "unable to allocate channel object"); ++ return; ++ } ++ ++ DPRINT_DBG(VMBUS, "channel object allocated - %p", newChannel); ++ ++ memcpy(&newChannel->OfferMsg, offer, sizeof(VMBUS_CHANNEL_OFFER_CHANNEL)); ++ newChannel->MonitorGroup = (UINT8)offer->MonitorId / 32; ++ newChannel->MonitorBit = (UINT8)offer->MonitorId % 32; ++ ++ // TODO: Make sure the offer comes from our parent partition ++ WorkQueueQueueWorkItem(newChannel->ControlWQ, VmbusChannelProcessOffer, newChannel); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnOfferRescind() ++ ++Description: ++ Rescind offer handler. We queue a work item to process this offer ++ synchronously ++ ++--*/ ++static void ++VmbusChannelOnOfferRescind( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ VMBUS_CHANNEL_RESCIND_OFFER* rescind = (VMBUS_CHANNEL_RESCIND_OFFER*)hdr; ++ VMBUS_CHANNEL* channel; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ channel = GetChannelFromRelId(rescind->ChildRelId); ++ if (channel == NULL) ++ { ++ DPRINT_DBG(VMBUS, "channel not found for relId %d", rescind->ChildRelId); ++ return; ++ } ++ ++ WorkQueueQueueWorkItem(channel->ControlWQ, VmbusChannelProcessRescindOffer, channel); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnOffersDelivered() ++ ++Description: ++ This is invoked when all offers have been delivered. ++ Nothing to do here. ++ ++--*/ ++static void ++VmbusChannelOnOffersDelivered( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ DPRINT_ENTER(VMBUS); ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnOpenResult() ++ ++Description: ++ Open result handler. This is invoked when we received a response ++ to our channel open request. Find the matching request, copy the ++ response and signal the requesting thread. ++ ++--*/ ++static void ++VmbusChannelOnOpenResult( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ VMBUS_CHANNEL_OPEN_RESULT* result = (VMBUS_CHANNEL_OPEN_RESULT*)hdr; ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ VMBUS_CHANNEL_MSGINFO* msgInfo; ++ VMBUS_CHANNEL_MESSAGE_HEADER* requestHeader; ++ VMBUS_CHANNEL_OPEN_CHANNEL* openMsg; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ DPRINT_DBG(VMBUS, "vmbus open result - %d", result->Status); ++ ++ // Find the open msg, copy the result and signal/unblock the wait event ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ++ { ++ msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; ++ requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; ++ ++ if (requestHeader->MessageType == ChannelMessageOpenChannel) ++ { ++ openMsg = (VMBUS_CHANNEL_OPEN_CHANNEL*)msgInfo->Msg; ++ if (openMsg->ChildRelId == result->ChildRelId && ++ openMsg->OpenId == result->OpenId) ++ { ++ memcpy(&msgInfo->Response.OpenResult, result, sizeof(VMBUS_CHANNEL_OPEN_RESULT)); ++ WaitEventSet(msgInfo->WaitEvent); ++ break; ++ } ++ } ++ } ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnGpadlCreated() ++ ++Description: ++ GPADL created handler. This is invoked when we received a response ++ to our gpadl create request. Find the matching request, copy the ++ response and signal the requesting thread. ++ ++--*/ ++static void ++VmbusChannelOnGpadlCreated( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ VMBUS_CHANNEL_GPADL_CREATED *gpadlCreated = (VMBUS_CHANNEL_GPADL_CREATED*)hdr; ++ LIST_ENTRY *anchor; ++ LIST_ENTRY *curr; ++ VMBUS_CHANNEL_MSGINFO *msgInfo; ++ VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; ++ VMBUS_CHANNEL_GPADL_HEADER *gpadlHeader; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ DPRINT_DBG(VMBUS, "vmbus gpadl created result - %d", gpadlCreated->CreationStatus); ++ ++ // Find the establish msg, copy the result and signal/unblock the wait event ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ++ { ++ msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; ++ requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; ++ ++ if (requestHeader->MessageType == ChannelMessageGpadlHeader) ++ { ++ gpadlHeader = (VMBUS_CHANNEL_GPADL_HEADER*)requestHeader; ++ ++ if ((gpadlCreated->ChildRelId == gpadlHeader->ChildRelId) && ++ (gpadlCreated->Gpadl == gpadlHeader->Gpadl)) ++ { ++ memcpy(&msgInfo->Response.GpadlCreated, gpadlCreated, sizeof(VMBUS_CHANNEL_GPADL_CREATED)); ++ WaitEventSet(msgInfo->WaitEvent); ++ break; ++ } ++ } ++ } ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnGpadlTorndown() ++ ++Description: ++ GPADL torndown handler. This is invoked when we received a response ++ to our gpadl teardown request. Find the matching request, copy the ++ response and signal the requesting thread. ++ ++--*/ ++static void ++VmbusChannelOnGpadlTorndown( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ VMBUS_CHANNEL_GPADL_TORNDOWN* gpadlTorndown = (VMBUS_CHANNEL_GPADL_TORNDOWN*)hdr; ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ VMBUS_CHANNEL_MSGINFO* msgInfo; ++ VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; ++ VMBUS_CHANNEL_GPADL_TEARDOWN *gpadlTeardown; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Find the open msg, copy the result and signal/unblock the wait event ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ++ { ++ msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; ++ requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; ++ ++ if (requestHeader->MessageType == ChannelMessageGpadlTeardown) ++ { ++ gpadlTeardown = (VMBUS_CHANNEL_GPADL_TEARDOWN*)requestHeader; ++ ++ if (gpadlTorndown->Gpadl == gpadlTeardown->Gpadl) ++ { ++ memcpy(&msgInfo->Response.GpadlTorndown, gpadlTorndown, sizeof(VMBUS_CHANNEL_GPADL_TORNDOWN)); ++ WaitEventSet(msgInfo->WaitEvent); ++ break; ++ } ++ } ++ } ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelOnVersionResponse() ++ ++Description: ++ Version response handler. This is invoked when we received a response ++ to our initiate contact request. Find the matching request, copy the ++ response and signal the requesting thread. ++ ++--*/ ++static void ++VmbusChannelOnVersionResponse( ++ PVMBUS_CHANNEL_MESSAGE_HEADER hdr ++ ) ++{ ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ VMBUS_CHANNEL_MSGINFO *msgInfo; ++ VMBUS_CHANNEL_MESSAGE_HEADER *requestHeader; ++ VMBUS_CHANNEL_INITIATE_CONTACT *initiate; ++ VMBUS_CHANNEL_VERSION_RESPONSE *versionResponse = (VMBUS_CHANNEL_VERSION_RESPONSE*)hdr; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelMsgList) ++ { ++ msgInfo = (VMBUS_CHANNEL_MSGINFO*) curr; ++ requestHeader = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; ++ ++ if (requestHeader->MessageType == ChannelMessageInitiateContact) ++ { ++ initiate = (VMBUS_CHANNEL_INITIATE_CONTACT*)requestHeader; ++ memcpy(&msgInfo->Response.VersionResponse, versionResponse, sizeof(VMBUS_CHANNEL_VERSION_RESPONSE)); ++ WaitEventSet(msgInfo->WaitEvent); ++ } ++ } ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnChannelMessage() ++ ++Description: ++ Handler for channel protocol messages. ++ This is invoked in the vmbus worker thread context. ++ ++--*/ ++VOID ++VmbusOnChannelMessage( ++ void *Context ++ ) ++{ ++ HV_MESSAGE *msg=(HV_MESSAGE*)Context; ++ VMBUS_CHANNEL_MESSAGE_HEADER* hdr; ++ int size; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ hdr = (VMBUS_CHANNEL_MESSAGE_HEADER*)msg->u.Payload; ++ size=msg->Header.PayloadSize; ++ ++ DPRINT_DBG(VMBUS, "message type %d size %d", hdr->MessageType, size); ++ ++ if (hdr->MessageType >= ChannelMessageCount) ++ { ++ DPRINT_ERR(VMBUS, "Received invalid channel message type %d size %d", hdr->MessageType, size); ++ PrintBytes((unsigned char *)msg->u.Payload, size); ++ MemFree(msg); ++ return; ++ } ++ ++ if (gChannelMessageTable[hdr->MessageType].messageHandler) ++ { ++ gChannelMessageTable[hdr->MessageType].messageHandler(hdr); ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS, "Unhandled channel message type %d", hdr->MessageType); ++ } ++ ++ // Free the msg that was allocated in VmbusOnMsgDPC() ++ MemFree(msg); ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChannelRequestOffers() ++ ++Description: ++ Send a request to get all our pending offers. ++ ++--*/ ++int ++VmbusChannelRequestOffers( ++ VOID ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_MESSAGE_HEADER* msg; ++ VMBUS_CHANNEL_MSGINFO* msgInfo; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ msgInfo = ++ (VMBUS_CHANNEL_MSGINFO*)MemAlloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_MESSAGE_HEADER)); ++ ASSERT(msgInfo != NULL); ++ ++ msgInfo->WaitEvent = WaitEventCreate(); ++ msg = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg; ++ ++ msg->MessageType = ChannelMessageRequestOffers; ++ ++ /*SpinlockAcquire(gVmbusConnection.channelMsgLock); ++ INSERT_TAIL_LIST(&gVmbusConnection.channelMsgList, &msgInfo->msgListEntry); ++ SpinlockRelease(gVmbusConnection.channelMsgLock);*/ ++ ++ ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_MESSAGE_HEADER)); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret); ++ ++ /*SpinlockAcquire(gVmbusConnection.channelMsgLock); ++ REMOVE_ENTRY_LIST(&msgInfo->msgListEntry); ++ SpinlockRelease(gVmbusConnection.channelMsgLock);*/ ++ ++ goto Cleanup; ++ } ++ //WaitEventWait(msgInfo->waitEvent); ++ ++ /*SpinlockAcquire(gVmbusConnection.channelMsgLock); ++ REMOVE_ENTRY_LIST(&msgInfo->msgListEntry); ++ SpinlockRelease(gVmbusConnection.channelMsgLock);*/ ++ ++ ++Cleanup: ++ if (msgInfo) ++ { ++ WaitEventClose(msgInfo->WaitEvent); ++ MemFree(msgInfo); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: ++ VmbusChannelReleaseUnattachedChannels() ++ ++Description: ++ Release channels that are unattached/unconnected ie (no drivers associated) ++ ++--*/ ++void ++VmbusChannelReleaseUnattachedChannels( ++ VOID ++ ) ++{ ++ LIST_ENTRY *entry; ++ VMBUS_CHANNEL *channel; ++ VMBUS_CHANNEL *start=NULL; ++ ++ SpinlockAcquire(gVmbusConnection.ChannelLock); ++ ++ while (!IsListEmpty(&gVmbusConnection.ChannelList)) ++ { ++ entry = TOP_LIST_ENTRY(&gVmbusConnection.ChannelList); ++ channel = CONTAINING_RECORD(entry, VMBUS_CHANNEL, ListEntry); ++ ++ if (channel == start) ++ break; ++ ++ if (!channel->DeviceObject->Driver) ++ { ++ REMOVE_ENTRY_LIST(&channel->ListEntry); ++ DPRINT_INFO(VMBUS, "Releasing unattached device object %p", channel->DeviceObject); ++ ++ VmbusChildDeviceRemove(channel->DeviceObject); ++ FreeVmbusChannel(channel); ++ } ++ else ++ { ++ if (!start) ++ { ++ start = channel; ++ } ++ } ++ } ++ ++ SpinlockRelease(gVmbusConnection.ChannelLock); ++} ++ ++// eof ++ +--- /dev/null ++++ b/drivers/staging/hv/ChannelMgmt.h +@@ -0,0 +1,156 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _CHANNEL_MGMT_H_ ++#define _CHANNEL_MGMT_H_ ++ ++#include "osd.h" ++#include "List.h" ++#include "RingBuffer.h" ++ ++#include "VmbusChannelInterface.h" ++#include "ChannelMessages.h" ++ ++ ++ ++typedef void (*PFN_CHANNEL_CALLBACK)(PVOID context); ++ ++typedef enum { ++ CHANNEL_OFFER_STATE, ++ CHANNEL_OPENING_STATE, ++ CHANNEL_OPEN_STATE, ++} VMBUS_CHANNEL_STATE; ++ ++typedef struct _VMBUS_CHANNEL { ++ LIST_ENTRY ListEntry; ++ ++ DEVICE_OBJECT* DeviceObject; ++ ++ HANDLE PollTimer; // SA-111 workaround ++ ++ VMBUS_CHANNEL_STATE State; ++ ++ VMBUS_CHANNEL_OFFER_CHANNEL OfferMsg; ++ // These are based on the OfferMsg.MonitorId. Save it here for easy access. ++ UINT8 MonitorGroup; ++ UINT8 MonitorBit; ++ ++ UINT32 RingBufferGpadlHandle; ++ ++ // Allocated memory for ring buffer ++ VOID* RingBufferPages; ++ UINT32 RingBufferPageCount; ++ RING_BUFFER_INFO Outbound; // send to parent ++ RING_BUFFER_INFO Inbound; // receive from parent ++ HANDLE InboundLock; ++ HANDLE ControlWQ; ++ ++ // Channel callback are invoked in this workqueue context ++ //HANDLE dataWorkQueue; ++ ++ PFN_CHANNEL_CALLBACK OnChannelCallback; ++ PVOID ChannelCallbackContext; ++ ++} VMBUS_CHANNEL; ++ ++ ++typedef struct _VMBUS_CHANNEL_DEBUG_INFO { ++ UINT32 RelId; ++ VMBUS_CHANNEL_STATE State; ++ GUID InterfaceType; ++ GUID InterfaceInstance; ++ UINT32 MonitorId; ++ UINT32 ServerMonitorPending; ++ UINT32 ServerMonitorLatency; ++ UINT32 ServerMonitorConnectionId; ++ UINT32 ClientMonitorPending; ++ UINT32 ClientMonitorLatency; ++ UINT32 ClientMonitorConnectionId; ++ ++ RING_BUFFER_DEBUG_INFO Inbound; ++ RING_BUFFER_DEBUG_INFO Outbound; ++} VMBUS_CHANNEL_DEBUG_INFO; ++ ++ ++typedef union { ++ VMBUS_CHANNEL_VERSION_SUPPORTED VersionSupported; ++ VMBUS_CHANNEL_OPEN_RESULT OpenResult; ++ VMBUS_CHANNEL_GPADL_TORNDOWN GpadlTorndown; ++ VMBUS_CHANNEL_GPADL_CREATED GpadlCreated; ++ VMBUS_CHANNEL_VERSION_RESPONSE VersionResponse; ++} VMBUS_CHANNEL_MESSAGE_RESPONSE; ++ ++ ++// Represents each channel msg on the vmbus connection ++// This is a variable-size data structure depending on ++// the msg type itself ++typedef struct _VMBUS_CHANNEL_MSGINFO { ++ // Bookkeeping stuff ++ LIST_ENTRY MsgListEntry; ++ ++ // So far, this is only used to handle gpadl body message ++ LIST_ENTRY SubMsgList; ++ ++ // Synchronize the request/response if needed ++ HANDLE WaitEvent; ++ ++ VMBUS_CHANNEL_MESSAGE_RESPONSE Response; ++ ++ UINT32 MessageSize; ++ // The channel message that goes out on the "wire". ++ // It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header ++ unsigned char Msg[0]; ++} VMBUS_CHANNEL_MSGINFO; ++ ++ ++// ++// Routines ++// ++ ++INTERNAL VMBUS_CHANNEL* ++AllocVmbusChannel( ++ void ++ ); ++ ++INTERNAL void ++FreeVmbusChannel( ++ VMBUS_CHANNEL *Channel ++ ); ++ ++INTERNAL void ++VmbusOnChannelMessage( ++ void *Context ++ ); ++ ++INTERNAL int ++VmbusChannelRequestOffers( ++ void ++ ); ++ ++INTERNAL void ++VmbusChannelReleaseUnattachedChannels( ++ void ++ ); ++ ++#endif //_CHANNEL_MGMT_H_ +--- /dev/null ++++ b/drivers/staging/hv/Connection.c +@@ -0,0 +1,432 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++ ++#include "VmbusPrivate.h" ++ ++// ++// Globals ++// ++ ++ ++VMBUS_CONNECTION gVmbusConnection = { ++ .ConnectState = Disconnected, ++ .NextGpadlHandle = 0xE1E10, ++}; ++ ++ ++/*++ ++ ++Name: ++ VmbusConnect() ++ ++Description: ++ Sends a connect request on the partition service connection ++ ++--*/ ++int ++VmbusConnect( ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_MSGINFO *msgInfo=NULL; ++ VMBUS_CHANNEL_INITIATE_CONTACT *msg; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Make sure we are not connecting or connected ++ if (gVmbusConnection.ConnectState != Disconnected) ++ return -1; ++ ++ // Initialize the vmbus connection ++ gVmbusConnection.ConnectState = Connecting; ++ gVmbusConnection.WorkQueue = WorkQueueCreate("vmbusQ"); ++ ++ INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelMsgList); ++ gVmbusConnection.ChannelMsgLock = SpinlockCreate(); ++ ++ INITIALIZE_LIST_HEAD(&gVmbusConnection.ChannelList); ++ gVmbusConnection.ChannelLock = SpinlockCreate(); ++ ++ // Setup the vmbus event connection for channel interrupt abstraction stuff ++ gVmbusConnection.InterruptPage = PageAlloc(1); ++ if (gVmbusConnection.InterruptPage == NULL) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ gVmbusConnection.RecvInterruptPage = gVmbusConnection.InterruptPage; ++ gVmbusConnection.SendInterruptPage = (void*)((ULONG_PTR)gVmbusConnection.InterruptPage + (PAGE_SIZE >> 1)); ++ ++ // Setup the monitor notification facility. The 1st page for parent->child and the 2nd page for child->parent ++ gVmbusConnection.MonitorPages = PageAlloc(2); ++ if (gVmbusConnection.MonitorPages == NULL) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ msgInfo = (VMBUS_CHANNEL_MSGINFO*)MemAllocZeroed(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT)); ++ if (msgInfo == NULL) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ msgInfo->WaitEvent = WaitEventCreate(); ++ msg = (VMBUS_CHANNEL_INITIATE_CONTACT*)msgInfo->Msg; ++ ++ msg->Header.MessageType = ChannelMessageInitiateContact; ++ msg->VMBusVersionRequested = VMBUS_REVISION_NUMBER; ++ msg->InterruptPage = GetPhysicalAddress(gVmbusConnection.InterruptPage); ++ msg->MonitorPage1 = GetPhysicalAddress(gVmbusConnection.MonitorPages); ++ msg->MonitorPage2 = GetPhysicalAddress((PVOID)((ULONG_PTR)gVmbusConnection.MonitorPages + PAGE_SIZE)); ++ ++ // Add to list before we send the request since we may receive the response ++ // before returning from this routine ++ SpinlockAcquire(gVmbusConnection.ChannelMsgLock); ++ INSERT_TAIL_LIST(&gVmbusConnection.ChannelMsgList, &msgInfo->MsgListEntry); ++ SpinlockRelease(gVmbusConnection.ChannelMsgLock); ++ ++ DPRINT_DBG(VMBUS, "Vmbus connection - interrupt pfn %llx, monitor1 pfn %llx,, monitor2 pfn %llx", ++ msg->InterruptPage, msg->MonitorPage1, msg->MonitorPage2); ++ ++ DPRINT_DBG(VMBUS, "Sending channel initiate msg..."); ++ ++ ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_INITIATE_CONTACT)); ++ if (ret != 0) ++ { ++ REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry); ++ goto Cleanup; ++ } ++ ++ // Wait for the connection response ++ WaitEventWait(msgInfo->WaitEvent); ++ ++ REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry); ++ ++ // Check if successful ++ if (msgInfo->Response.VersionResponse.VersionSupported) ++ { ++ DPRINT_INFO(VMBUS, "Vmbus connected!!"); ++ gVmbusConnection.ConnectState = Connected; ++ ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS, "Vmbus connection failed!!...current version (%d) not supported", VMBUS_REVISION_NUMBER); ++ ret = -1; ++ ++ goto Cleanup; ++ } ++ ++ ++ WaitEventClose(msgInfo->WaitEvent); ++ MemFree(msgInfo); ++ DPRINT_EXIT(VMBUS); ++ ++ return 0; ++ ++Cleanup: ++ ++ gVmbusConnection.ConnectState = Disconnected; ++ ++ WorkQueueClose(gVmbusConnection.WorkQueue); ++ SpinlockClose(gVmbusConnection.ChannelLock); ++ SpinlockClose(gVmbusConnection.ChannelMsgLock); ++ ++ if (gVmbusConnection.InterruptPage) ++ { ++ PageFree(gVmbusConnection.InterruptPage, 1); ++ gVmbusConnection.InterruptPage = NULL; ++ } ++ ++ if (gVmbusConnection.MonitorPages) ++ { ++ PageFree(gVmbusConnection.MonitorPages, 2); ++ gVmbusConnection.MonitorPages = NULL; ++ } ++ ++ if (msgInfo) ++ { ++ if (msgInfo->WaitEvent) ++ WaitEventClose(msgInfo->WaitEvent); ++ ++ MemFree(msgInfo); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusDisconnect() ++ ++Description: ++ Sends a disconnect request on the partition service connection ++ ++--*/ ++int ++VmbusDisconnect( ++ VOID ++ ) ++{ ++ int ret=0; ++ VMBUS_CHANNEL_UNLOAD *msg; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Make sure we are connected ++ if (gVmbusConnection.ConnectState != Connected) ++ return -1; ++ ++ msg = MemAllocZeroed(sizeof(VMBUS_CHANNEL_UNLOAD)); ++ ++ msg->MessageType = ChannelMessageUnload; ++ ++ ret = VmbusPostMessage(msg, sizeof(VMBUS_CHANNEL_UNLOAD)); ++ ++ if (ret != 0) ++ { ++ goto Cleanup; ++ } ++ ++ PageFree(gVmbusConnection.InterruptPage, 1); ++ ++ // TODO: iterate thru the msg list and free up ++ ++ SpinlockClose(gVmbusConnection.ChannelMsgLock); ++ ++ WorkQueueClose(gVmbusConnection.WorkQueue); ++ ++ gVmbusConnection.ConnectState = Disconnected; ++ ++ DPRINT_INFO(VMBUS, "Vmbus disconnected!!"); ++ ++Cleanup: ++ if (msg) ++ { ++ MemFree(msg); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ GetChannelFromRelId() ++ ++Description: ++ Get the channel object given its child relative id (ie channel id) ++ ++--*/ ++VMBUS_CHANNEL* ++GetChannelFromRelId( ++ UINT32 relId ++ ) ++{ ++ VMBUS_CHANNEL* channel; ++ VMBUS_CHANNEL* foundChannel=NULL; ++ LIST_ENTRY* anchor; ++ LIST_ENTRY* curr; ++ ++ SpinlockAcquire(gVmbusConnection.ChannelLock); ++ ITERATE_LIST_ENTRIES(anchor, curr, &gVmbusConnection.ChannelList) ++ { ++ channel = CONTAINING_RECORD(curr, VMBUS_CHANNEL, ListEntry); ++ ++ if (channel->OfferMsg.ChildRelId == relId) ++ { ++ foundChannel = channel; ++ break; ++ } ++ } ++ SpinlockRelease(gVmbusConnection.ChannelLock); ++ ++ return foundChannel; ++} ++ ++ ++ ++/*++ ++ ++Name: ++ VmbusProcessChannelEvent() ++ ++Description: ++ Process a channel event notification ++ ++--*/ ++static void ++VmbusProcessChannelEvent( ++ PVOID context ++ ) ++{ ++ VMBUS_CHANNEL* channel; ++ UINT32 relId = (UINT32)(ULONG_PTR)context; ++ ++ ASSERT(relId > 0); ++ ++ // Find the channel based on this relid and invokes ++ // the channel callback to process the event ++ channel = GetChannelFromRelId(relId); ++ ++ if (channel) ++ { ++ VmbusChannelOnChannelEvent(channel); ++ //WorkQueueQueueWorkItem(channel->dataWorkQueue, VmbusChannelOnChannelEvent, (void*)channel); ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS, "channel not found for relid - %d.", relId); ++ } ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnEvents() ++ ++Description: ++ Handler for events ++ ++--*/ ++VOID ++VmbusOnEvents( ++ VOID ++ ) ++{ ++ int dword; ++ //int maxdword = PAGE_SIZE >> 3; // receive size is 1/2 page and divide that by 4 bytes ++ int maxdword = MAX_NUM_CHANNELS_SUPPORTED >> 5; ++ int bit; ++ int relid; ++ UINT32* recvInterruptPage = gVmbusConnection.RecvInterruptPage; ++ //VMBUS_CHANNEL_MESSAGE* receiveMsg; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Check events ++ if (recvInterruptPage) ++ { ++ for (dword = 0; dword < maxdword; dword++) ++ { ++ if (recvInterruptPage[dword]) ++ { ++ for (bit = 0; bit < 32; bit++) ++ { ++ if (BitTestAndClear(&recvInterruptPage[dword], bit)) ++ { ++ relid = (dword << 5) + bit; ++ ++ DPRINT_DBG(VMBUS, "event detected for relid - %d", relid); ++ ++ if (relid == 0) // special case - vmbus channel protocol msg ++ { ++ DPRINT_DBG(VMBUS, "invalid relid - %d", relid); ++ ++ continue; } ++ else ++ { ++ //QueueWorkItem(VmbusProcessEvent, (void*)relid); ++ //ret = WorkQueueQueueWorkItem(gVmbusConnection.workQueue, VmbusProcessChannelEvent, (void*)relid); ++ VmbusProcessChannelEvent((void*)(ULONG_PTR)relid); ++ } ++ } ++ } ++ } ++ } ++ } ++ DPRINT_EXIT(VMBUS); ++ ++ return; ++} ++ ++/*++ ++ ++Name: ++ VmbusPostMessage() ++ ++Description: ++ Send a msg on the vmbus's message connection ++ ++--*/ ++int ++VmbusPostMessage( ++ PVOID buffer, ++ SIZE_T bufferLen ++ ) ++{ ++ int ret=0; ++ HV_CONNECTION_ID connId; ++ ++ ++ connId.AsUINT32 =0; ++ connId.u.Id = VMBUS_MESSAGE_CONNECTION_ID; ++ ret = HvPostMessage( ++ connId, ++ 1, ++ buffer, ++ bufferLen); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: ++ VmbusSetEvent() ++ ++Description: ++ Send an event notification to the parent ++ ++--*/ ++int ++VmbusSetEvent(UINT32 childRelId) ++{ ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Each UINT32 represents 32 channels ++ BitSet((UINT32*)gVmbusConnection.SendInterruptPage + (childRelId >> 5), childRelId & 31); ++ ret = HvSignalEvent(); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++// EOF +--- /dev/null ++++ b/drivers/staging/hv/Hv.c +@@ -0,0 +1,672 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++#include "VmbusPrivate.h" ++ ++// ++// Globals ++// ++ ++// The one and only ++HV_CONTEXT gHvContext={ ++ .SynICInitialized = FALSE, ++ .HypercallPage = NULL, ++ .SignalEventParam = NULL, ++ .SignalEventBuffer = NULL, ++}; ++ ++ ++/*++ ++ ++Name: ++ HvQueryHypervisorPresence() ++ ++Description: ++ Query the cpuid for presense of windows hypervisor ++ ++--*/ ++static int ++HvQueryHypervisorPresence ( ++ void ++ ) ++{ ++ unsigned int eax; ++ unsigned int ebx; ++ unsigned int ecx; ++ unsigned int edx; ++ unsigned int op; ++ ++ eax = 0; ++ ebx = 0; ++ ecx = 0; ++ edx = 0; ++ op = HvCpuIdFunctionVersionAndFeatures; ++ do_cpuid(op, &eax, &ebx, &ecx, &edx); ++ ++ return (ecx & HV_PRESENT_BIT); ++} ++ ++ ++/*++ ++ ++Name: ++ HvQueryHypervisorInfo() ++ ++Description: ++ Get version info of the windows hypervisor ++ ++--*/ ++static int ++HvQueryHypervisorInfo ( ++ void ++ ) ++{ ++ unsigned int eax; ++ unsigned int ebx; ++ unsigned int ecx; ++ unsigned int edx; ++ unsigned int maxLeaf; ++ unsigned int op; ++ ++ // ++ // Its assumed that this is called after confirming that Viridian is present. ++ // Query id and revision. ++ // ++ ++ eax = 0; ++ ebx = 0; ++ ecx = 0; ++ edx = 0; ++ op = HvCpuIdFunctionHvVendorAndMaxFunction; ++ do_cpuid(op, &eax, &ebx, &ecx, &edx); ++ ++ DPRINT_INFO(VMBUS, "Vendor ID: %c%c%c%c%c%c%c%c%c%c%c%c", ++ (ebx & 0xFF), ++ ((ebx >> 8) & 0xFF), ++ ((ebx >> 16) & 0xFF), ++ ((ebx >> 24) & 0xFF), ++ (ecx & 0xFF), ++ ((ecx >> 8) & 0xFF), ++ ((ecx >> 16) & 0xFF), ++ ((ecx >> 24) & 0xFF), ++ (edx & 0xFF), ++ ((edx >> 8) & 0xFF), ++ ((edx >> 16) & 0xFF), ++ ((edx >> 24) & 0xFF)); ++ ++ maxLeaf = eax; ++ eax = 0; ++ ebx = 0; ++ ecx = 0; ++ edx = 0; ++ op = HvCpuIdFunctionHvInterface; ++ do_cpuid(op, &eax, &ebx, &ecx, &edx); ++ ++ DPRINT_INFO(VMBUS, "Interface ID: %c%c%c%c", ++ (eax & 0xFF), ++ ((eax >> 8) & 0xFF), ++ ((eax >> 16) & 0xFF), ++ ((eax >> 24) & 0xFF)); ++ ++ if (maxLeaf >= HvCpuIdFunctionMsHvVersion) { ++ eax = 0; ++ ebx = 0; ++ ecx = 0; ++ edx = 0; ++ op = HvCpuIdFunctionMsHvVersion; ++ do_cpuid(op, &eax, &ebx, &ecx, &edx); ++ DPRINT_INFO(VMBUS, "OS Build:%d-%d.%d-%d-%d.%d", ++ eax, ++ ebx >> 16, ++ ebx & 0xFFFF, ++ ecx, ++ edx >> 24, ++ edx & 0xFFFFFF); ++ } ++ return maxLeaf; ++} ++ ++ ++/*++ ++ ++Name: ++ HvDoHypercall() ++ ++Description: ++ Invoke the specified hypercall ++ ++--*/ ++static UINT64 ++HvDoHypercall ( ++ UINT64 Control, ++ void* Input, ++ void* Output ++ ) ++{ ++#ifdef x86_64 ++ UINT64 hvStatus=0; ++ UINT64 inputAddress = (Input)? GetPhysicalAddress(Input) : 0; ++ UINT64 outputAddress = (Output)? GetPhysicalAddress(Output) : 0; ++ volatile void* hypercallPage = gHvContext.HypercallPage; ++ ++ DPRINT_DBG(VMBUS, "Hypercall ", ++ Control, ++ inputAddress, ++ Input, ++ outputAddress, ++ Output, ++ hypercallPage); ++ ++ __asm__ __volatile__ ("mov %0, %%r8" : : "r" (outputAddress): "r8"); ++ __asm__ __volatile__ ("call *%3" : "=a"(hvStatus): "c" (Control), "d" (inputAddress), "m" (hypercallPage)); ++ ++ DPRINT_DBG(VMBUS, "Hypercall ", hvStatus); ++ ++ return hvStatus; ++ ++#else ++ ++ UINT32 controlHi = Control >> 32; ++ UINT32 controlLo = Control & 0xFFFFFFFF; ++ UINT32 hvStatusHi = 1; ++ UINT32 hvStatusLo = 1; ++ UINT64 inputAddress = (Input) ? GetPhysicalAddress(Input) : 0; ++ UINT32 inputAddressHi = inputAddress >> 32; ++ UINT32 inputAddressLo = inputAddress & 0xFFFFFFFF; ++ UINT64 outputAddress = (Output) ?GetPhysicalAddress(Output) : 0; ++ UINT32 outputAddressHi = outputAddress >> 32; ++ UINT32 outputAddressLo = outputAddress & 0xFFFFFFFF; ++ volatile void* hypercallPage = gHvContext.HypercallPage; ++ ++ DPRINT_DBG(VMBUS, "Hypercall ", ++ Control, ++ Input, ++ Output); ++ ++ __asm__ __volatile__ ("call *%8" : "=d"(hvStatusHi), "=a"(hvStatusLo) : "d" (controlHi), "a" (controlLo), "b" (inputAddressHi), "c" (inputAddressLo), "D"(outputAddressHi), "S"(outputAddressLo), "m" (hypercallPage)); ++ ++ ++ DPRINT_DBG(VMBUS, "Hypercall ", hvStatusLo | ((UINT64)hvStatusHi << 32)); ++ ++ return (hvStatusLo | ((UINT64)hvStatusHi << 32)); ++#endif // x86_64 ++} ++ ++/*++ ++ ++Name: ++ HvInit() ++ ++Description: ++ Main initialization routine. This routine must be called ++ before any other routines in here are called ++ ++--*/ ++static int ++HvInit ( ++ void ++ ) ++{ ++ int ret=0; ++ int maxLeaf; ++ HV_X64_MSR_HYPERCALL_CONTENTS hypercallMsr; ++ void* virtAddr=0; ++ ULONG_PTR physAddr=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ memset(gHvContext.synICEventPage, 0, sizeof(HANDLE)*MAX_NUM_CPUS); ++ memset(gHvContext.synICMessagePage, 0, sizeof(HANDLE)*MAX_NUM_CPUS); ++ ++ if (!HvQueryHypervisorPresence()) ++ { ++ DPRINT_ERR(VMBUS, "No Windows hypervisor detected!!"); ++ goto Cleanup; ++ } ++ ++ DPRINT_INFO(VMBUS, "Windows hypervisor detected! Retrieving more info..."); ++ ++ maxLeaf = HvQueryHypervisorInfo(); ++ //HvQueryHypervisorFeatures(maxLeaf); ++ ++ // Determine if we are running on xenlinux (ie x2v shim) or native linux ++ gHvContext.GuestId = ReadMsr(HV_X64_MSR_GUEST_OS_ID); ++ ++ if (gHvContext.GuestId == 0) ++ { ++ // Write our OS info ++ WriteMsr(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); ++ ++ gHvContext.GuestId = HV_LINUX_GUEST_ID; ++ } ++ ++ // See if the hypercall page is already set ++ hypercallMsr.AsUINT64 = ReadMsr(HV_X64_MSR_HYPERCALL); ++ ++ if (gHvContext.GuestId == HV_LINUX_GUEST_ID) ++ { ++ // Allocate the hypercall page memory ++ //virtAddr = PageAlloc(1); ++ virtAddr = VirtualAllocExec(PAGE_SIZE); ++ ++ if (!virtAddr) ++ { ++ DPRINT_ERR(VMBUS, "unable to allocate hypercall page!!"); ++ goto Cleanup; ++ } ++ ++ hypercallMsr.Enable = 1; ++ //hypercallMsr.GuestPhysicalAddress = Logical2PhysicalAddr(virtAddr) >> PAGE_SHIFT; ++ hypercallMsr.GuestPhysicalAddress = Virtual2Physical(virtAddr) >> PAGE_SHIFT; ++ WriteMsr(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ ++ // Confirm that hypercall page did get setup. ++ hypercallMsr.AsUINT64 = 0; ++ hypercallMsr.AsUINT64 = ReadMsr(HV_X64_MSR_HYPERCALL); ++ ++ if (!hypercallMsr.Enable) ++ { ++ DPRINT_ERR(VMBUS, "unable to set hypercall page!!"); ++ goto Cleanup; ++ } ++ ++ gHvContext.HypercallPage = virtAddr; ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS, "Unknown guest id (0x%llx)!!", gHvContext.GuestId); ++ goto Cleanup; ++ } ++ ++ DPRINT_INFO(VMBUS, "Hypercall page VA=0x%08x, PA=0x%08x", ++ (unsigned long)gHvContext.HypercallPage, ++ (unsigned long)hypercallMsr.GuestPhysicalAddress << PAGE_SHIFT); ++ ++ // Setup the global signal event param for the signal event hypercall ++ gHvContext.SignalEventBuffer = MemAlloc(sizeof(HV_INPUT_SIGNAL_EVENT_BUFFER)); ++ if (!gHvContext.SignalEventBuffer) ++ { ++ goto Cleanup; ++ } ++ ++ gHvContext.SignalEventParam = (PHV_INPUT_SIGNAL_EVENT)(ALIGN_UP((ULONG_PTR)gHvContext.SignalEventBuffer, HV_HYPERCALL_PARAM_ALIGN)); ++ gHvContext.SignalEventParam->ConnectionId.AsUINT32 = 0; ++ gHvContext.SignalEventParam->ConnectionId.u.Id = VMBUS_EVENT_CONNECTION_ID; ++ gHvContext.SignalEventParam->FlagNumber = 0; ++ gHvContext.SignalEventParam->RsvdZ = 0; ++ ++ //DPRINT_DBG(VMBUS, "My id %llu", HvGetCurrentPartitionId()); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++ ++Cleanup: ++ if (virtAddr) ++ { ++ if (hypercallMsr.Enable) ++ { ++ hypercallMsr.AsUINT64 = 0; ++ WriteMsr(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ } ++ ++ VirtualFree(virtAddr); ++ } ++ ret = -1; ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ HvCleanup() ++ ++Description: ++ Cleanup routine. This routine is called normally during driver unloading or exiting. ++ ++--*/ ++void ++HvCleanup ( ++ void ++ ) ++{ ++ HV_X64_MSR_HYPERCALL_CONTENTS hypercallMsr; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ if (gHvContext.SignalEventBuffer) ++ { ++ MemFree(gHvContext.SignalEventBuffer); ++ gHvContext.SignalEventBuffer = NULL; ++ gHvContext.SignalEventParam = NULL; ++ } ++ ++ if (gHvContext.GuestId == HV_LINUX_GUEST_ID) ++ { ++ if (gHvContext.HypercallPage) ++ { ++ hypercallMsr.AsUINT64 = 0; ++ WriteMsr(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ VirtualFree(gHvContext.HypercallPage); ++ gHvContext.HypercallPage = NULL; ++ } ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++} ++ ++ ++/*++ ++ ++Name: ++ HvPostMessage() ++ ++Description: ++ Post a message using the hypervisor message IPC. This ++ involves a hypercall. ++ ++--*/ ++HV_STATUS ++HvPostMessage( ++ HV_CONNECTION_ID connectionId, ++ HV_MESSAGE_TYPE messageType, ++ PVOID payload, ++ SIZE_T payloadSize ++ ) ++{ ++ struct alignedInput { ++ UINT64 alignment8; ++ HV_INPUT_POST_MESSAGE msg; ++ }; ++ ++ PHV_INPUT_POST_MESSAGE alignedMsg; ++ HV_STATUS status; ++ ULONG_PTR addr; ++ ++ if (payloadSize > HV_MESSAGE_PAYLOAD_BYTE_COUNT) ++ { ++ return -1; ++ } ++ ++ addr = (ULONG_PTR)MemAllocAtomic(sizeof(struct alignedInput)); ++ ++ if (!addr) ++ { ++ return -1; ++ } ++ ++ alignedMsg = (PHV_INPUT_POST_MESSAGE)(ALIGN_UP(addr, HV_HYPERCALL_PARAM_ALIGN)); ++ ++ alignedMsg->ConnectionId = connectionId; ++ alignedMsg->MessageType = messageType; ++ alignedMsg->PayloadSize = payloadSize; ++ memcpy((void*)alignedMsg->Payload, payload, payloadSize); ++ ++ status = HvDoHypercall(HvCallPostMessage, alignedMsg, 0) & 0xFFFF; ++ ++ MemFree((void*)addr); ++ ++ return status; ++} ++ ++ ++/*++ ++ ++Name: ++ HvSignalEvent() ++ ++Description: ++ Signal an event on the specified connection using the hypervisor event IPC. This ++ involves a hypercall. ++ ++--*/ ++HV_STATUS ++HvSignalEvent( ++ ) ++{ ++ HV_STATUS status; ++ ++ status = HvDoHypercall(HvCallSignalEvent, gHvContext.SignalEventParam, 0) & 0xFFFF; ++ ++ return status; ++} ++ ++ ++/*++ ++ ++Name: ++ HvSynicInit() ++ ++Description: ++ Initialize the Synthethic Interrupt Controller. If it is already initialized by ++ another entity (ie x2v shim), we need to retrieve the initialized message and event pages. ++ Otherwise, we create and initialize the message and event pages. ++ ++--*/ ++int ++HvSynicInit ( ++ UINT32 irqVector ++ ) ++{ ++ UINT64 version; ++ HV_SYNIC_SIMP simp; ++ HV_SYNIC_SIEFP siefp; ++ HV_SYNIC_SINT sharedSint; ++ HV_SYNIC_SCONTROL sctrl; ++ UINT64 guestID; ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ if (!gHvContext.HypercallPage) ++ { ++ DPRINT_EXIT(VMBUS); ++ return ret; ++ } ++ ++ // Check the version ++ version = ReadMsr(HV_X64_MSR_SVERSION); ++ ++ DPRINT_INFO(VMBUS, "SynIC version: %llx", version); ++ ++ // TODO: Handle SMP ++ if (gHvContext.GuestId == HV_XENLINUX_GUEST_ID) ++ { ++ DPRINT_INFO(VMBUS, "Skipping SIMP and SIEFP setup since it is already set."); ++ ++ simp.AsUINT64 = ReadMsr(HV_X64_MSR_SIMP); ++ siefp.AsUINT64 = ReadMsr(HV_X64_MSR_SIEFP); ++ ++ DPRINT_DBG(VMBUS, "Simp: %llx, Sifep: %llx", simp.AsUINT64, siefp.AsUINT64); ++ ++ // Determine if we are running on xenlinux (ie x2v shim) or native linux ++ guestID = ReadMsr(HV_X64_MSR_GUEST_OS_ID); ++ ++ if (guestID == HV_LINUX_GUEST_ID) ++ { ++ gHvContext.synICMessagePage[0] = GetVirtualAddress(simp.BaseSimpGpa << PAGE_SHIFT); ++ gHvContext.synICEventPage[0] = GetVirtualAddress(siefp.BaseSiefpGpa << PAGE_SHIFT); ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS, "unknown guest id!!"); ++ goto Cleanup; ++ } ++ DPRINT_DBG(VMBUS, "MAPPED: Simp: %p, Sifep: %p", gHvContext.synICMessagePage[0], gHvContext.synICEventPage[0]); ++ } ++ else ++ { ++ gHvContext.synICMessagePage[0] = PageAlloc(1); ++ if (gHvContext.synICMessagePage[0] == NULL) ++ { ++ DPRINT_ERR(VMBUS, "unable to allocate SYNIC message page!!"); ++ goto Cleanup; ++ } ++ ++ gHvContext.synICEventPage[0] = PageAlloc(1); ++ if (gHvContext.synICEventPage[0] == NULL) ++ { ++ DPRINT_ERR(VMBUS, "unable to allocate SYNIC event page!!"); ++ goto Cleanup; ++ } ++ ++ // ++ // Setup the Synic's message page ++ // ++ simp.AsUINT64 = ReadMsr(HV_X64_MSR_SIMP); ++ simp.SimpEnabled = 1; ++ simp.BaseSimpGpa = GetPhysicalAddress(gHvContext.synICMessagePage[0]) >> PAGE_SHIFT; ++ ++ DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.AsUINT64); ++ ++ WriteMsr(HV_X64_MSR_SIMP, simp.AsUINT64); ++ ++ // ++ // Setup the Synic's event page ++ // ++ siefp.AsUINT64 = ReadMsr(HV_X64_MSR_SIEFP); ++ siefp.SiefpEnabled = 1; ++ siefp.BaseSiefpGpa = GetPhysicalAddress(gHvContext.synICEventPage[0]) >> PAGE_SHIFT; ++ ++ DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.AsUINT64); ++ ++ WriteMsr(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ } ++ // ++ // Setup the interception SINT. ++ // ++ //WriteMsr((HV_X64_MSR_SINT0 + HV_SYNIC_INTERCEPTION_SINT_INDEX), ++ // interceptionSint.AsUINT64); ++ ++ // ++ // Setup the shared SINT. ++ // ++ sharedSint.AsUINT64 = ReadMsr(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT); ++ ++ sharedSint.AsUINT64 = 0; ++ sharedSint.Vector = irqVector; //HV_SHARED_SINT_IDT_VECTOR + 0x20; ++ sharedSint.Masked = FALSE; ++ sharedSint.AutoEoi = TRUE; ++ ++ DPRINT_DBG(VMBUS, "HV_X64_MSR_SINT1 msr set to: %llx", sharedSint.AsUINT64); ++ ++ WriteMsr(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64); ++ ++ // Enable the global synic bit ++ sctrl.AsUINT64 = ReadMsr(HV_X64_MSR_SCONTROL); ++ sctrl.Enable = 1; ++ ++ WriteMsr(HV_X64_MSR_SCONTROL, sctrl.AsUINT64); ++ ++ gHvContext.SynICInitialized = TRUE; ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++ ++Cleanup: ++ ret = -1; ++ ++ if (gHvContext.GuestId == HV_LINUX_GUEST_ID) ++ { ++ if (gHvContext.synICEventPage[0]) ++ { ++ PageFree(gHvContext.synICEventPage[0],1); ++ } ++ ++ if (gHvContext.synICMessagePage[0]) ++ { ++ PageFree(gHvContext.synICMessagePage[0], 1); ++ } ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++ ++} ++ ++/*++ ++ ++Name: ++ HvSynicCleanup() ++ ++Description: ++ Cleanup routine for HvSynicInit(). ++ ++--*/ ++VOID ++HvSynicCleanup( ++ VOID ++ ) ++{ ++ HV_SYNIC_SINT sharedSint; ++ HV_SYNIC_SIMP simp; ++ HV_SYNIC_SIEFP siefp; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ if (!gHvContext.SynICInitialized) ++ { ++ DPRINT_EXIT(VMBUS); ++ return; ++ } ++ ++ sharedSint.AsUINT64 = ReadMsr(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT); ++ ++ sharedSint.Masked = 1; ++ ++ // Disable the interrupt ++ WriteMsr(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64); ++ ++ // Disable and free the resources only if we are running as native linux ++ // since in xenlinux, we are sharing the resources with the x2v shim ++ if (gHvContext.GuestId == HV_LINUX_GUEST_ID) ++ { ++ simp.AsUINT64 = ReadMsr(HV_X64_MSR_SIMP); ++ simp.SimpEnabled = 0; ++ simp.BaseSimpGpa = 0; ++ ++ WriteMsr(HV_X64_MSR_SIMP, simp.AsUINT64); ++ ++ siefp.AsUINT64 = ReadMsr(HV_X64_MSR_SIEFP); ++ siefp.SiefpEnabled = 0; ++ siefp.BaseSiefpGpa = 0; ++ ++ WriteMsr(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ ++ PageFree(gHvContext.synICMessagePage[0], 1); ++ PageFree(gHvContext.synICEventPage[0], 1); ++ } ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++// eof +--- /dev/null ++++ b/drivers/staging/hv/Hv.h +@@ -0,0 +1,184 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef __HV_H__ ++#define __HV_H__ ++ ++#include "osd.h" ++ ++#include "HvTypes.h" ++#include "HvStatus.h" ++//#include "HvVmApi.h" ++//#include "HvKeApi.h" ++//#include "HvMmApi.h" ++//#include "HvCpuApi.h" ++#include "HvHalApi.h" ++#include "HvVpApi.h" ++//#include "HvTrApi.h" ++#include "HvSynicApi.h" ++//#include "HvAmApi.h" ++//#include "HvHkApi.h" ++//#include "HvValApi.h" ++#include "HvHcApi.h" ++#include "HvPtApi.h" ++ ++enum ++{ ++ VMBUS_MESSAGE_CONNECTION_ID = 1, ++ VMBUS_MESSAGE_PORT_ID = 1, ++ VMBUS_EVENT_CONNECTION_ID = 2, ++ VMBUS_EVENT_PORT_ID = 2, ++ VMBUS_MONITOR_CONNECTION_ID = 3, ++ VMBUS_MONITOR_PORT_ID = 3, ++ VMBUS_MESSAGE_SINT = 2 ++}; ++// ++// #defines ++// ++#define HV_PRESENT_BIT 0x80000000 ++ ++#define HV_XENLINUX_GUEST_ID_LO 0x00000000 ++#define HV_XENLINUX_GUEST_ID_HI 0x0B00B135 ++#define HV_XENLINUX_GUEST_ID (((UINT64)HV_XENLINUX_GUEST_ID_HI << 32) | HV_XENLINUX_GUEST_ID_LO) ++ ++#define HV_LINUX_GUEST_ID_LO 0x00000000 ++#define HV_LINUX_GUEST_ID_HI 0xB16B00B5 ++#define HV_LINUX_GUEST_ID (((UINT64)HV_LINUX_GUEST_ID_HI << 32) | HV_LINUX_GUEST_ID_LO) ++ ++#define HV_CPU_POWER_MANAGEMENT (1 << 0) ++#define HV_RECOMMENDATIONS_MAX 4 ++ ++#define HV_X64_MAX 5 ++#define HV_CAPS_MAX 8 ++ ++ ++#define HV_HYPERCALL_PARAM_ALIGN sizeof(UINT64) ++ ++// ++// Service definitions ++// ++#define HV_SERVICE_PARENT_PORT (0) ++#define HV_SERVICE_PARENT_CONNECTION (0) ++ ++#define HV_SERVICE_CONNECT_RESPONSE_SUCCESS (0) ++#define HV_SERVICE_CONNECT_RESPONSE_INVALID_PARAMETER (1) ++#define HV_SERVICE_CONNECT_RESPONSE_UNKNOWN_SERVICE (2) ++#define HV_SERVICE_CONNECT_RESPONSE_CONNECTION_REJECTED (3) ++ ++#define HV_SERVICE_CONNECT_REQUEST_MESSAGE_ID (1) ++#define HV_SERVICE_CONNECT_RESPONSE_MESSAGE_ID (2) ++#define HV_SERVICE_DISCONNECT_REQUEST_MESSAGE_ID (3) ++#define HV_SERVICE_DISCONNECT_RESPONSE_MESSAGE_ID (4) ++#define HV_SERVICE_MAX_MESSAGE_ID (4) ++ ++#define HV_SERVICE_PROTOCOL_VERSION (0x0010) ++#define HV_CONNECT_PAYLOAD_BYTE_COUNT 64 ++ ++//#define VMBUS_REVISION_NUMBER 6 ++//#define VMBUS_PORT_ID 11 // Our local vmbus's port and connection id. Anything >0 is fine ++ ++// 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 ++static const GUID VMBUS_SERVICE_ID = {.Data = {0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c, 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4} }; ++ ++#define MAX_NUM_CPUS 1 ++ ++ ++typedef struct { ++ UINT64 Align8; ++ HV_INPUT_SIGNAL_EVENT Event; ++} HV_INPUT_SIGNAL_EVENT_BUFFER; ++ ++typedef struct { ++ UINT64 GuestId; // XenLinux or native Linux. If XenLinux, the hypercall and synic pages has already been initialized ++ void* HypercallPage; ++ ++ BOOL SynICInitialized; ++ // This is used as an input param to HvCallSignalEvent hypercall. The input param is immutable ++ // in our usage and must be dynamic mem (vs stack or global). ++ HV_INPUT_SIGNAL_EVENT_BUFFER *SignalEventBuffer; ++ HV_INPUT_SIGNAL_EVENT *SignalEventParam; // 8-bytes aligned of the buffer above ++ ++ HANDLE synICMessagePage[MAX_NUM_CPUS]; ++ HANDLE synICEventPage[MAX_NUM_CPUS]; ++} HV_CONTEXT; ++ ++extern HV_CONTEXT gHvContext; ++ ++ ++// ++// Inline routines ++// ++static inline unsigned long long ReadMsr(int msr) ++{ ++ unsigned long long val; ++ ++ RDMSR(msr, val); ++ ++ return val; ++} ++ ++static inline void WriteMsr(int msr, UINT64 val) ++{ ++ WRMSR(msr, val); ++ ++ return; ++} ++ ++// ++// Hv Interface ++// ++INTERNAL int ++HvInit( ++ VOID ++ ); ++ ++INTERNAL VOID ++HvCleanup( ++ VOID ++ ); ++ ++INTERNAL HV_STATUS ++HvPostMessage( ++ HV_CONNECTION_ID connectionId, ++ HV_MESSAGE_TYPE messageType, ++ PVOID payload, ++ SIZE_T payloadSize ++ ); ++ ++INTERNAL HV_STATUS ++HvSignalEvent( ++ VOID ++ ); ++ ++INTERNAL int ++HvSynicInit( ++ UINT32 irqVector ++ ); ++ ++INTERNAL VOID ++HvSynicCleanup( ++ VOID ++ ); ++ ++#endif // __HV_H__ +--- /dev/null ++++ b/drivers/staging/hv/osd.c +@@ -0,0 +1,500 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "osd.h" ++ ++// ++// Data types ++// ++typedef struct _TIMER { ++ struct timer_list timer; ++ PFN_TIMER_CALLBACK callback; ++ void* context; ++}TIMER; ++ ++ ++typedef struct _WAITEVENT { ++ int condition; ++ wait_queue_head_t event; ++} WAITEVENT; ++ ++typedef struct _SPINLOCK { ++ spinlock_t lock; ++ unsigned long flags; ++} SPINLOCK; ++ ++typedef struct _WORKQUEUE { ++ struct workqueue_struct *queue; ++} WORKQUEUE; ++ ++typedef struct _WORKITEM { ++ struct work_struct work; ++ PFN_WORKITEM_CALLBACK callback; ++ void* context; ++} WORKITEM; ++ ++ ++// ++// Global ++// ++ ++void LogMsg(const char *fmt, ...) ++{ ++#ifdef KERNEL_2_6_5 ++ char buf[1024]; ++#endif ++ va_list args; ++ ++ va_start(args, fmt); ++#ifdef KERNEL_2_6_5 ++ vsnprintf(buf, 1024, fmt, args); ++ va_end(args); ++ printk(buf); ++#else ++ vprintk(fmt, args); ++ va_end(args); ++#endif ++} ++ ++void BitSet(unsigned int* addr, int bit) ++{ ++ set_bit(bit, (unsigned long*)addr); ++} ++ ++int BitTest(unsigned int* addr, int bit) ++{ ++ return test_bit(bit, (unsigned long*)addr); ++} ++ ++void BitClear(unsigned int* addr, int bit) ++{ ++ clear_bit(bit, (unsigned long*)addr); ++} ++ ++int BitTestAndClear(unsigned int* addr, int bit) ++{ ++ return test_and_clear_bit(bit, (unsigned long*)addr); ++} ++ ++int BitTestAndSet(unsigned int* addr, int bit) ++{ ++ return test_and_set_bit(bit, (unsigned long*)addr); ++} ++ ++ ++int InterlockedIncrement(int *val) ++{ ++#ifdef KERNEL_2_6_5 ++ int i; ++ local_irq_disable(); ++ i = atomic_read((atomic_t*)val); ++ atomic_set((atomic_t*)val, i+1); ++ local_irq_enable(); ++ return i+1; ++#else ++ return atomic_inc_return((atomic_t*)val); ++#endif ++} ++ ++int InterlockedDecrement(int *val) ++{ ++#ifdef KERNEL_2_6_5 ++ int i; ++ local_irq_disable(); ++ i = atomic_read((atomic_t*)val); ++ atomic_set((atomic_t*)val, i-1); ++ local_irq_enable(); ++ return i-1; ++#else ++ return atomic_dec_return((atomic_t*)val); ++#endif ++} ++ ++#ifndef atomic_cmpxchg ++#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) ++#endif ++int InterlockedCompareExchange(int *val, int new, int curr) ++{ ++ //return ((int)cmpxchg(((atomic_t*)val), curr, new)); ++ return atomic_cmpxchg((atomic_t*)val, curr, new); ++ ++} ++ ++void Sleep(unsigned long usecs) ++{ ++ udelay(usecs); ++} ++ ++void* VirtualAllocExec(unsigned int size) ++{ ++#ifdef __x86_64__ ++ return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL_EXEC); ++#else ++ return __vmalloc(size, GFP_KERNEL, __pgprot(__PAGE_KERNEL & (~_PAGE_NX))); ++#endif ++} ++ ++void VirtualFree(void* VirtAddr) ++{ ++ return vfree(VirtAddr); ++} ++ ++void* PageAlloc(unsigned int count) ++{ ++ void *p; ++ p = (void *)__get_free_pages(GFP_KERNEL, get_order(count * PAGE_SIZE)); ++ if (p) memset(p, 0, count * PAGE_SIZE); ++ return p; ++ ++ //struct page* page = alloc_page(GFP_KERNEL|__GFP_ZERO); ++ //void *p; ++ ++ ////BUGBUG: We need to use kmap in case we are in HIMEM region ++ //p = page_address(page); ++ //if (p) memset(p, 0, PAGE_SIZE); ++ //return p; ++} ++ ++void PageFree(void* page, unsigned int count) ++{ ++ free_pages((unsigned long)page, get_order(count * PAGE_SIZE)); ++ /*struct page* p = virt_to_page(page); ++ __free_page(p);*/ ++} ++ ++ ++void* PageMapVirtualAddress(unsigned long Pfn) ++{ ++ return kmap_atomic(pfn_to_page(Pfn), KM_IRQ0); ++} ++ ++void PageUnmapVirtualAddress(void* VirtAddr) ++{ ++ kunmap_atomic(VirtAddr, KM_IRQ0); ++} ++ ++void* MemAlloc(unsigned int size) ++{ ++ return kmalloc(size, GFP_KERNEL); ++} ++ ++void* MemAllocZeroed(unsigned int size) ++{ ++ void *p = kmalloc(size, GFP_KERNEL); ++ if (p) memset(p, 0, size); ++ return p; ++} ++ ++void* MemAllocAtomic(unsigned int size) ++{ ++ return kmalloc(size, GFP_ATOMIC); ++} ++ ++void MemFree(void* buf) ++{ ++ kfree(buf); ++} ++ ++void *MemMapIO(unsigned long phys, unsigned long size) ++{ ++#if X2V_LINUX ++#ifdef __x86_64__ ++ return (void*)(phys + 0xFFFF83000C000000); ++#else // i386 ++ return (void*)(phys + 0xfb000000); ++#endif ++#else ++ return (void*)GetVirtualAddress(phys); //return ioremap_nocache(phys, size); ++#endif ++} ++ ++void MemUnmapIO(void *virt) ++{ ++ //iounmap(virt); ++} ++ ++void MemoryFence() ++{ ++ mb(); ++} ++ ++void TimerCallback(unsigned long data) ++{ ++ TIMER* t = (TIMER*)data; ++ ++ t->callback(t->context); ++} ++ ++HANDLE TimerCreate(PFN_TIMER_CALLBACK pfnTimerCB, void* context) ++{ ++ TIMER* t = kmalloc(sizeof(TIMER), GFP_KERNEL); ++ if (!t) ++ { ++ return NULL; ++ } ++ ++ t->callback = pfnTimerCB; ++ t->context = context; ++ ++ init_timer(&t->timer); ++ t->timer.data = (unsigned long)t; ++ t->timer.function = TimerCallback; ++ ++ return t; ++} ++ ++void TimerStart(HANDLE hTimer, UINT32 expirationInUs) ++{ ++ TIMER* t = (TIMER* )hTimer; ++ ++ t->timer.expires = jiffies + usecs_to_jiffies(expirationInUs); ++ add_timer(&t->timer); ++} ++ ++int TimerStop(HANDLE hTimer) ++{ ++ TIMER* t = (TIMER* )hTimer; ++ ++ return del_timer(&t->timer); ++} ++ ++void TimerClose(HANDLE hTimer) ++{ ++ TIMER* t = (TIMER* )hTimer; ++ ++ del_timer(&t->timer); ++ kfree(t); ++} ++ ++SIZE_T GetTickCount(void) ++{ ++ return jiffies; ++} ++ ++signed long long GetTimestamp(void) ++{ ++ struct timeval t; ++ ++ do_gettimeofday(&t); ++ ++ return timeval_to_ns(&t); ++} ++ ++HANDLE WaitEventCreate(void) ++{ ++ WAITEVENT* wait = kmalloc(sizeof(WAITEVENT), GFP_KERNEL); ++ if (!wait) ++ { ++ return NULL; ++ } ++ ++ wait->condition = 0; ++ init_waitqueue_head(&wait->event); ++ return wait; ++} ++ ++void WaitEventClose(HANDLE hWait) ++{ ++ WAITEVENT* waitEvent = (WAITEVENT* )hWait; ++ kfree(waitEvent); ++} ++ ++void WaitEventSet(HANDLE hWait) ++{ ++ WAITEVENT* waitEvent = (WAITEVENT* )hWait; ++ waitEvent->condition = 1; ++ wake_up_interruptible(&waitEvent->event); ++} ++ ++int WaitEventWait(HANDLE hWait) ++{ ++ int ret=0; ++ WAITEVENT* waitEvent = (WAITEVENT* )hWait; ++ ++ ret= wait_event_interruptible(waitEvent->event, ++ waitEvent->condition); ++ waitEvent->condition = 0; ++ return ret; ++} ++ ++int WaitEventWaitEx(HANDLE hWait, UINT32 TimeoutInMs) ++{ ++ int ret=0; ++ WAITEVENT* waitEvent = (WAITEVENT* )hWait; ++ ++ ret= wait_event_interruptible_timeout(waitEvent->event, ++ waitEvent->condition, ++ msecs_to_jiffies(TimeoutInMs)); ++ waitEvent->condition = 0; ++ return ret; ++} ++ ++HANDLE SpinlockCreate(VOID) ++{ ++ SPINLOCK* spin = kmalloc(sizeof(SPINLOCK), GFP_KERNEL); ++ if (!spin) ++ { ++ return NULL; ++ } ++ spin_lock_init(&spin->lock); ++ ++ return spin; ++} ++ ++VOID SpinlockAcquire(HANDLE hSpin) ++{ ++ SPINLOCK* spin = (SPINLOCK* )hSpin; ++ ++ spin_lock_irqsave(&spin->lock, spin->flags); ++} ++ ++VOID SpinlockRelease(HANDLE hSpin) ++{ ++ SPINLOCK* spin = (SPINLOCK* )hSpin; ++ ++ spin_unlock_irqrestore(&spin->lock, spin->flags); ++} ++ ++VOID SpinlockClose(HANDLE hSpin) ++{ ++ SPINLOCK* spin = (SPINLOCK* )hSpin; ++ kfree(spin); ++} ++ ++void* Physical2LogicalAddr(ULONG_PTR PhysAddr) ++{ ++ void* logicalAddr = phys_to_virt(PhysAddr); ++ BUG_ON(!virt_addr_valid(logicalAddr)); ++ return logicalAddr; ++} ++ ++ULONG_PTR Logical2PhysicalAddr(PVOID LogicalAddr) ++{ ++ BUG_ON(!virt_addr_valid(LogicalAddr)); ++ return virt_to_phys(LogicalAddr); ++} ++ ++ ++ULONG_PTR Virtual2Physical(PVOID VirtAddr) ++{ ++ ULONG_PTR pfn = vmalloc_to_pfn(VirtAddr); ++ ++ return pfn << PAGE_SHIFT; ++} ++ ++#ifdef KERNEL_2_6_27 ++void WorkItemCallback(struct work_struct *work) ++#else ++void WorkItemCallback(void* work) ++#endif ++{ ++ WORKITEM* w = (WORKITEM*)work; ++ ++ w->callback(w->context); ++ ++ kfree(w); ++} ++ ++HANDLE WorkQueueCreate(char* name) ++{ ++ WORKQUEUE *wq = kmalloc(sizeof(WORKQUEUE), GFP_KERNEL); ++ if (!wq) ++ { ++ return NULL; ++ } ++ wq->queue = create_workqueue(name); ++ ++ return wq; ++} ++ ++void WorkQueueClose(HANDLE hWorkQueue) ++{ ++ WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue; ++ ++ destroy_workqueue(wq->queue); ++ ++ return; ++} ++ ++int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, void* context) ++{ ++ WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue; ++ ++ WORKITEM* w = kmalloc(sizeof(WORKITEM), GFP_ATOMIC); ++ if (!w) ++ { ++ return -1; ++ } ++ ++ w->callback = workItem, ++ w->context = context; ++#ifdef KERNEL_2_6_27 ++ INIT_WORK(&w->work, WorkItemCallback); ++#else ++ INIT_WORK(&w->work, WorkItemCallback, w); ++#endif ++ return queue_work(wq->queue, &w->work); ++} ++ ++void QueueWorkItem(PFN_WORKITEM_CALLBACK workItem, void* context) ++{ ++ WORKITEM* w = kmalloc(sizeof(WORKITEM), GFP_ATOMIC); ++ if (!w) ++ { ++ return; ++ } ++ ++ w->callback = workItem, ++ w->context = context; ++#ifdef KERNEL_2_6_27 ++ INIT_WORK(&w->work, WorkItemCallback); ++#else ++ INIT_WORK(&w->work, WorkItemCallback, w); ++#endif ++ schedule_work(&w->work); ++} +--- /dev/null ++++ b/drivers/staging/hv/RingBuffer.c +@@ -0,0 +1,630 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++#include "RingBuffer.h" ++ ++// ++// #defines ++// ++ ++// Amount of space to write to ++#define BYTES_AVAIL_TO_WRITE(r, w, z) ((w) >= (r))?((z) - ((w) - (r))):((r) - (w)) ++ ++ ++/*++ ++ ++Name: ++ GetRingBufferAvailBytes() ++ ++Description: ++ Get number of bytes available to read and to write to ++ for the specified ring buffer ++ ++--*/ ++static inline void ++GetRingBufferAvailBytes(RING_BUFFER_INFO *rbi, UINT32 *read, UINT32 *write) ++{ ++ UINT32 read_loc,write_loc; ++ ++ // Capture the read/write indices before they changed ++ read_loc = rbi->RingBuffer->ReadIndex; ++ write_loc = rbi->RingBuffer->WriteIndex; ++ ++ *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->RingDataSize); ++ *read = rbi->RingDataSize - *write; ++} ++ ++/*++ ++ ++Name: ++ GetNextWriteLocation() ++ ++Description: ++ Get the next write location for the specified ring buffer ++ ++--*/ ++static inline UINT32 ++GetNextWriteLocation(RING_BUFFER_INFO* RingInfo) ++{ ++ UINT32 next = RingInfo->RingBuffer->WriteIndex; ++ ++ ASSERT(next < RingInfo->RingDataSize); ++ ++ return next; ++} ++ ++/*++ ++ ++Name: ++ SetNextWriteLocation() ++ ++Description: ++ Set the next write location for the specified ring buffer ++ ++--*/ ++static inline void ++SetNextWriteLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextWriteLocation) ++{ ++ RingInfo->RingBuffer->WriteIndex = NextWriteLocation; ++} ++ ++/*++ ++ ++Name: ++ GetNextReadLocation() ++ ++Description: ++ Get the next read location for the specified ring buffer ++ ++--*/ ++static inline UINT32 ++GetNextReadLocation(RING_BUFFER_INFO* RingInfo) ++{ ++ UINT32 next = RingInfo->RingBuffer->ReadIndex; ++ ++ ASSERT(next < RingInfo->RingDataSize); ++ ++ return next; ++} ++ ++/*++ ++ ++Name: ++ GetNextReadLocationWithOffset() ++ ++Description: ++ Get the next read location + offset for the specified ring buffer. ++ This allows the caller to skip ++ ++--*/ ++static inline UINT32 ++GetNextReadLocationWithOffset(RING_BUFFER_INFO* RingInfo, UINT32 Offset) ++{ ++ UINT32 next = RingInfo->RingBuffer->ReadIndex; ++ ++ ASSERT(next < RingInfo->RingDataSize); ++ next += Offset; ++ next %= RingInfo->RingDataSize; ++ ++ return next; ++} ++ ++/*++ ++ ++Name: ++ SetNextReadLocation() ++ ++Description: ++ Set the next read location for the specified ring buffer ++ ++--*/ ++static inline void ++SetNextReadLocation(RING_BUFFER_INFO* RingInfo, UINT32 NextReadLocation) ++{ ++ RingInfo->RingBuffer->ReadIndex = NextReadLocation; ++} ++ ++ ++/*++ ++ ++Name: ++ GetRingBuffer() ++ ++Description: ++ Get the start of the ring buffer ++ ++--*/ ++static inline PVOID ++GetRingBuffer(RING_BUFFER_INFO* RingInfo) ++{ ++ return (PVOID)RingInfo->RingBuffer->Buffer; ++} ++ ++ ++/*++ ++ ++Name: ++ GetRingBufferSize() ++ ++Description: ++ Get the size of the ring buffer ++ ++--*/ ++static inline UINT32 ++GetRingBufferSize(RING_BUFFER_INFO* RingInfo) ++{ ++ return RingInfo->RingDataSize; ++} ++ ++/*++ ++ ++Name: ++ GetRingBufferIndices() ++ ++Description: ++ Get the read and write indices as UINT64 of the specified ring buffer ++ ++--*/ ++static inline UINT64 ++GetRingBufferIndices(RING_BUFFER_INFO* RingInfo) ++{ ++ return ((UINT64)RingInfo->RingBuffer->WriteIndex << 32) || RingInfo->RingBuffer->ReadIndex; ++} ++ ++ ++/*++ ++ ++Name: ++ DumpRingInfo() ++ ++Description: ++ Dump out to console the ring buffer info ++ ++--*/ ++void ++DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix) ++{ ++ UINT32 bytesAvailToWrite; ++ UINT32 bytesAvailToRead; ++ ++ GetRingBufferAvailBytes(RingInfo, &bytesAvailToRead, &bytesAvailToWrite); ++ ++ DPRINT(VMBUS, DEBUG_RING_LVL, "%s <>", ++ Prefix, ++ RingInfo, ++ RingInfo->RingBuffer->Buffer, ++ bytesAvailToWrite, ++ bytesAvailToRead, ++ RingInfo->RingBuffer->ReadIndex, ++ RingInfo->RingBuffer->WriteIndex); ++} ++ ++// ++// Internal routines ++// ++static UINT32 ++CopyToRingBuffer( ++ RING_BUFFER_INFO *RingInfo, ++ UINT32 StartWriteOffset, ++ PVOID Src, ++ UINT32 SrcLen); ++ ++static UINT32 ++CopyFromRingBuffer( ++ RING_BUFFER_INFO *RingInfo, ++ PVOID Dest, ++ UINT32 DestLen, ++ UINT32 StartReadOffset); ++ ++ ++ ++/*++ ++ ++Name: ++ RingBufferGetDebugInfo() ++ ++Description: ++ Get various debug metrics for the specified ring buffer ++ ++--*/ ++void ++RingBufferGetDebugInfo( ++ RING_BUFFER_INFO *RingInfo, ++ RING_BUFFER_DEBUG_INFO *DebugInfo ++ ) ++{ ++ UINT32 bytesAvailToWrite; ++ UINT32 bytesAvailToRead; ++ ++ if (RingInfo->RingBuffer) ++ { ++ GetRingBufferAvailBytes(RingInfo, &bytesAvailToRead, &bytesAvailToWrite); ++ ++ DebugInfo->BytesAvailToRead = bytesAvailToRead; ++ DebugInfo->BytesAvailToWrite = bytesAvailToWrite; ++ DebugInfo->CurrentReadIndex = RingInfo->RingBuffer->ReadIndex; ++ DebugInfo->CurrentWriteIndex = RingInfo->RingBuffer->WriteIndex; ++ ++ DebugInfo->CurrentInterruptMask = RingInfo->RingBuffer->InterruptMask; ++ } ++} ++ ++ ++/*++ ++ ++Name: ++ GetRingBufferInterruptMask() ++ ++Description: ++ Get the interrupt mask for the specified ring buffer ++ ++--*/ ++UINT32 ++GetRingBufferInterruptMask( ++ RING_BUFFER_INFO *rbi ++ ) ++{ ++ return rbi->RingBuffer->InterruptMask; ++} ++ ++/*++ ++ ++Name: ++ RingBufferInit() ++ ++Description: ++ Initialize the ring buffer ++ ++--*/ ++int ++RingBufferInit( ++ RING_BUFFER_INFO *RingInfo, ++ VOID *Buffer, ++ UINT32 BufferLen ++ ) ++{ ++ ASSERT(sizeof(RING_BUFFER) == PAGE_SIZE); ++ ++ memset(RingInfo, 0, sizeof(RING_BUFFER_INFO)); ++ ++ RingInfo->RingBuffer = (RING_BUFFER*)Buffer; ++ RingInfo->RingBuffer->ReadIndex = RingInfo->RingBuffer->WriteIndex = 0; ++ ++ RingInfo->RingSize = BufferLen; ++ RingInfo->RingDataSize = BufferLen - sizeof(RING_BUFFER); ++ ++ RingInfo->RingLock = SpinlockCreate(); ++ ++ return 0; ++} ++ ++/*++ ++ ++Name: ++ RingBufferCleanup() ++ ++Description: ++ Cleanup the ring buffer ++ ++--*/ ++void ++RingBufferCleanup( ++ RING_BUFFER_INFO* RingInfo ++ ) ++{ ++ SpinlockClose(RingInfo->RingLock); ++} ++ ++/*++ ++ ++Name: ++ RingBufferWrite() ++ ++Description: ++ Write to the ring buffer ++ ++--*/ ++int ++RingBufferWrite( ++ RING_BUFFER_INFO* OutRingInfo, ++ SG_BUFFER_LIST SgBuffers[], ++ UINT32 SgBufferCount ++ ) ++{ ++ int i=0; ++ UINT32 byteAvailToWrite; ++ UINT32 byteAvailToRead; ++ UINT32 totalBytesToWrite=0; ++ ++ volatile UINT32 nextWriteLocation; ++ UINT64 prevIndices=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ for (i=0; i < SgBufferCount; i++) ++ { ++ totalBytesToWrite += SgBuffers[i].Length; ++ } ++ ++ totalBytesToWrite += sizeof(UINT64); ++ ++ SpinlockAcquire(OutRingInfo->RingLock); ++ ++ GetRingBufferAvailBytes(OutRingInfo, &byteAvailToRead, &byteAvailToWrite); ++ ++ DPRINT_DBG(VMBUS, "Writing %u bytes...", totalBytesToWrite); ++ ++ //DumpRingInfo(OutRingInfo, "BEFORE "); ++ ++ // If there is only room for the packet, assume it is full. Otherwise, the next time around, we think the ring buffer ++ // is empty since the read index == write index ++ if (byteAvailToWrite <= totalBytesToWrite) ++ { ++ DPRINT_DBG(VMBUS, "No more space left on outbound ring buffer (needed %u, avail %u)", totalBytesToWrite, byteAvailToWrite); ++ ++ SpinlockRelease(OutRingInfo->RingLock); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return -1; ++ } ++ ++ // Write to the ring buffer ++ nextWriteLocation = GetNextWriteLocation(OutRingInfo); ++ ++ for (i=0; i < SgBufferCount; i++) ++ { ++ nextWriteLocation = CopyToRingBuffer(OutRingInfo, ++ nextWriteLocation, ++ SgBuffers[i].Data, ++ SgBuffers[i].Length); ++ } ++ ++ // Set previous packet start ++ prevIndices = GetRingBufferIndices(OutRingInfo); ++ ++ nextWriteLocation = CopyToRingBuffer(OutRingInfo, ++ nextWriteLocation, ++ &prevIndices, ++ sizeof(UINT64)); ++ ++ // Make sure we flush all writes before updating the writeIndex ++ MemoryFence(); ++ ++ // Now, update the write location ++ SetNextWriteLocation(OutRingInfo, nextWriteLocation); ++ ++ //DumpRingInfo(OutRingInfo, "AFTER "); ++ ++ SpinlockRelease(OutRingInfo->RingLock); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return 0; ++} ++ ++ ++/*++ ++ ++Name: ++ RingBufferPeek() ++ ++Description: ++ Read without advancing the read index ++ ++--*/ ++int ++RingBufferPeek( ++ RING_BUFFER_INFO* InRingInfo, ++ void* Buffer, ++ UINT32 BufferLen ++ ) ++{ ++ UINT32 bytesAvailToWrite; ++ UINT32 bytesAvailToRead; ++ UINT32 nextReadLocation=0; ++ ++ SpinlockAcquire(InRingInfo->RingLock); ++ ++ GetRingBufferAvailBytes(InRingInfo, &bytesAvailToRead, &bytesAvailToWrite); ++ ++ // Make sure there is something to read ++ if (bytesAvailToRead < BufferLen ) ++ { ++ //DPRINT_DBG(VMBUS, "got callback but not enough to read !!", bytesAvailToRead, BufferLen); ++ ++ SpinlockRelease(InRingInfo->RingLock); ++ ++ return -1; ++ } ++ ++ // Convert to byte offset ++ nextReadLocation = GetNextReadLocation(InRingInfo); ++ ++ nextReadLocation = CopyFromRingBuffer(InRingInfo, ++ Buffer, ++ BufferLen, ++ nextReadLocation); ++ ++ SpinlockRelease(InRingInfo->RingLock); ++ ++ return 0; ++} ++ ++ ++/*++ ++ ++Name: ++ RingBufferRead() ++ ++Description: ++ Read and advance the read index ++ ++--*/ ++int ++RingBufferRead( ++ RING_BUFFER_INFO* InRingInfo, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32 Offset ++ ) ++{ ++ UINT32 bytesAvailToWrite; ++ UINT32 bytesAvailToRead; ++ UINT32 nextReadLocation=0; ++ UINT64 prevIndices=0; ++ ++ ASSERT(BufferLen > 0); ++ ++ SpinlockAcquire(InRingInfo->RingLock); ++ ++ GetRingBufferAvailBytes(InRingInfo, &bytesAvailToRead, &bytesAvailToWrite); ++ ++ DPRINT_DBG(VMBUS, "Reading %u bytes...", BufferLen); ++ ++ //DumpRingInfo(InRingInfo, "BEFORE "); ++ ++ // Make sure there is something to read ++ if (bytesAvailToRead < BufferLen ) ++ { ++ DPRINT_DBG(VMBUS, "got callback but not enough to read !!", bytesAvailToRead, BufferLen); ++ ++ SpinlockRelease(InRingInfo->RingLock); ++ ++ return -1; ++ } ++ ++ nextReadLocation = GetNextReadLocationWithOffset(InRingInfo, Offset); ++ ++ nextReadLocation = CopyFromRingBuffer(InRingInfo, ++ Buffer, ++ BufferLen, ++ nextReadLocation); ++ ++ nextReadLocation = CopyFromRingBuffer(InRingInfo, ++ &prevIndices, ++ sizeof(UINT64), ++ nextReadLocation); ++ ++ // Make sure all reads are done before we update the read index since ++ // the writer may start writing to the read area once the read index is updated ++ MemoryFence(); ++ ++ // Update the read index ++ SetNextReadLocation(InRingInfo, nextReadLocation); ++ ++ //DumpRingInfo(InRingInfo, "AFTER "); ++ ++ SpinlockRelease(InRingInfo->RingLock); ++ ++ return 0; ++} ++ ++ ++/*++ ++ ++Name: ++ CopyToRingBuffer() ++ ++Description: ++ Helper routine to copy from source to ring buffer. ++ Assume there is enough room. Handles wrap-around in dest case only!! ++ ++--*/ ++UINT32 ++CopyToRingBuffer( ++ RING_BUFFER_INFO *RingInfo, ++ UINT32 StartWriteOffset, ++ PVOID Src, ++ UINT32 SrcLen) ++{ ++ PVOID ringBuffer=GetRingBuffer(RingInfo); ++ UINT32 ringBufferSize=GetRingBufferSize(RingInfo); ++ UINT32 fragLen; ++ ++ if (SrcLen > ringBufferSize - StartWriteOffset) // wrap-around detected! ++ { ++ DPRINT_DBG(VMBUS, "wrap-around detected!"); ++ ++ fragLen = ringBufferSize - StartWriteOffset; ++ memcpy(ringBuffer + StartWriteOffset, Src, fragLen); ++ memcpy(ringBuffer, Src + fragLen, SrcLen - fragLen); ++ } ++ else ++ { ++ memcpy(ringBuffer + StartWriteOffset, Src, SrcLen); ++ } ++ ++ StartWriteOffset += SrcLen; ++ StartWriteOffset %= ringBufferSize; ++ ++ return StartWriteOffset; ++} ++ ++ ++/*++ ++ ++Name: ++ CopyFromRingBuffer() ++ ++Description: ++ Helper routine to copy to source from ring buffer. ++ Assume there is enough room. Handles wrap-around in src case only!! ++ ++--*/ ++UINT32 ++CopyFromRingBuffer( ++ RING_BUFFER_INFO *RingInfo, ++ PVOID Dest, ++ UINT32 DestLen, ++ UINT32 StartReadOffset) ++{ ++ PVOID ringBuffer=GetRingBuffer(RingInfo); ++ UINT32 ringBufferSize=GetRingBufferSize(RingInfo); ++ ++ UINT32 fragLen; ++ ++ if (DestLen > ringBufferSize - StartReadOffset) // wrap-around detected at the src ++ { ++ DPRINT_DBG(VMBUS, "src wrap-around detected!"); ++ ++ fragLen = ringBufferSize - StartReadOffset; ++ ++ memcpy(Dest, ringBuffer + StartReadOffset, fragLen); ++ memcpy(Dest + fragLen, ringBuffer, DestLen - fragLen); ++ } ++ else ++ { ++ memcpy(Dest, ringBuffer + StartReadOffset, DestLen); ++ } ++ ++ StartReadOffset += DestLen; ++ StartReadOffset %= ringBufferSize; ++ ++ return StartReadOffset; ++} ++ ++ ++// eof +--- /dev/null ++++ b/drivers/staging/hv/RingBuffer.h +@@ -0,0 +1,123 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _RING_BUFFER_H_ ++#define _RING_BUFFER_H_ ++ ++#include "osd.h" ++ ++typedef struct _SG_BUFFER_LIST { ++ PVOID Data; ++ UINT32 Length; ++} SG_BUFFER_LIST; ++ ++typedef struct _RING_BUFFER { ++ volatile UINT32 WriteIndex; // Offset in bytes from the start of ring data below ++ volatile UINT32 ReadIndex; // Offset in bytes from the start of ring data below ++ ++ volatile UINT32 InterruptMask; ++ UINT8 Reserved[4084]; // Pad it to PAGE_SIZE so that data starts on page boundary ++ // NOTE: The InterruptMask field is used only for channels but since our vmbus connection ++ // also uses this data structure and its data starts here, we commented out this field. ++ // volatile UINT32 InterruptMask; ++ // Ring data starts here + RingDataStartOffset !!! DO NOT place any fields below this !!! ++ UINT8 Buffer[0]; ++} STRUCT_PACKED RING_BUFFER; ++ ++typedef struct _RING_BUFFER_INFO { ++ RING_BUFFER* RingBuffer; ++ UINT32 RingSize; // Include the shared header ++ HANDLE RingLock; ++ ++ UINT32 RingDataSize; // < ringSize ++ UINT32 RingDataStartOffset; ++ ++} RING_BUFFER_INFO; ++ ++ ++typedef struct _RING_BUFFER_DEBUG_INFO { ++ UINT32 CurrentInterruptMask; ++ UINT32 CurrentReadIndex; ++ UINT32 CurrentWriteIndex; ++ UINT32 BytesAvailToRead; ++ UINT32 BytesAvailToWrite; ++}RING_BUFFER_DEBUG_INFO; ++ ++ ++// ++// Interface ++// ++ ++INTERNAL int ++RingBufferInit( ++ RING_BUFFER_INFO *RingInfo, ++ PVOID Buffer, ++ UINT32 BufferLen ++ ); ++ ++INTERNAL void ++RingBufferCleanup( ++ RING_BUFFER_INFO *RingInfo ++ ); ++ ++INTERNAL int ++RingBufferWrite( ++ RING_BUFFER_INFO *RingInfo, ++ SG_BUFFER_LIST SgBuffers[], ++ UINT32 SgBufferCount ++ ); ++ ++INTERNAL int ++RingBufferPeek( ++ RING_BUFFER_INFO *RingInfo, ++ PVOID Buffer, ++ UINT32 BufferLen ++ ); ++ ++INTERNAL int ++RingBufferRead( ++ RING_BUFFER_INFO *RingInfo, ++ PVOID Buffer, ++ UINT32 BufferLen, ++ UINT32 Offset ++ ); ++ ++INTERNAL UINT32 ++GetRingBufferInterruptMask( ++ RING_BUFFER_INFO *RingInfo ++ ); ++ ++INTERNAL void ++DumpRingInfo( ++ RING_BUFFER_INFO* RingInfo, ++ char *Prefix ++ ); ++ ++INTERNAL void ++RingBufferGetDebugInfo( ++ RING_BUFFER_INFO *RingInfo, ++ RING_BUFFER_DEBUG_INFO *DebugInfo ++ ); ++ ++#endif // _RING_BUFFER_H_ +--- /dev/null ++++ b/drivers/staging/hv/Sources.c +@@ -0,0 +1,31 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "Vmbus.c" ++#include "Hv.c" ++#include "Connection.c" ++#include "Channel.c" ++#include "ChannelMgmt.c" ++#include "ChannelInterface.c" ++#include "RingBuffer.c" +--- /dev/null ++++ b/drivers/staging/hv/VersionInfo.h +@@ -0,0 +1,29 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#pragma once ++ ++const char VersionDate[]=__DATE__; ++const char VersionTime[]=__TIME__; ++const char VersionDesc[]= "Version 2.0"; +--- /dev/null ++++ b/drivers/staging/hv/Vmbus.c +@@ -0,0 +1,508 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++#include "VersionInfo.h" ++#include "VmbusPrivate.h" ++ ++// ++// Globals ++// ++static const char* gDriverName="vmbus"; ++ ++// Windows vmbus does not defined this. We defined this to be consistent with other devices ++//{c5295816-f63a-4d5f-8d1a-4daf999ca185} ++static const GUID gVmbusDeviceType={ ++ .Data = {0x16, 0x58, 0x29, 0xc5, 0x3a, 0xf6, 0x5f, 0x4d, 0x8d, 0x1a, 0x4d, 0xaf, 0x99, 0x9c, 0xa1, 0x85} ++}; ++ ++//{ac3760fc-9adf-40aa-9427-a70ed6de95c5} ++static const GUID gVmbusDeviceId={ ++ .Data = {0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40, 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5} ++}; ++ ++static DRIVER_OBJECT* gDriver; // vmbus driver object ++static DEVICE_OBJECT* gDevice; // vmbus root device ++ ++ ++// ++// Internal routines ++// ++ ++static void ++VmbusGetChannelInterface( ++ VMBUS_CHANNEL_INTERFACE *Interface ++ ); ++ ++static void ++VmbusGetChannelInfo( ++ DEVICE_OBJECT *DeviceObject, ++ DEVICE_INFO *DeviceInfo ++ ); ++ ++static void ++VmbusGetChannelOffers( ++ void ++ ); ++ ++static int ++VmbusOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ); ++ ++static int ++VmbusOnDeviceRemove( ++ DEVICE_OBJECT* dev ++ ); ++ ++static void ++VmbusOnCleanup( ++ DRIVER_OBJECT* drv ++ ); ++ ++static int ++VmbusOnISR( ++ DRIVER_OBJECT* drv ++ ); ++ ++static void ++VmbusOnMsgDPC( ++ DRIVER_OBJECT* drv ++ ); ++ ++static void ++VmbusOnEventDPC( ++ DRIVER_OBJECT* drv ++ ); ++ ++/*++; ++ ++Name: ++ VmbusInitialize() ++ ++Description: ++ Main entry point ++ ++--*/ ++int ++VmbusInitialize( ++ DRIVER_OBJECT* drv ++ ) ++{ ++ VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ DPRINT_INFO(VMBUS, "+++++++ Build Date=%s %s +++++++", VersionDate, VersionTime); ++ DPRINT_INFO(VMBUS, "+++++++ Build Description=%s +++++++", VersionDesc); ++ ++ DPRINT_INFO(VMBUS, "+++++++ Vmbus supported version = %d +++++++", VMBUS_REVISION_NUMBER); ++ DPRINT_INFO(VMBUS, "+++++++ Vmbus using SINT %d +++++++", VMBUS_MESSAGE_SINT); ++ ++ DPRINT_DBG(VMBUS, "sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER)=%d, sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)=%d", ++ sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER), sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)); ++ ++ drv->name = gDriverName; ++ memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(GUID)); ++ ++ // Setup dispatch table ++ driver->Base.OnDeviceAdd = VmbusOnDeviceAdd; ++ driver->Base.OnDeviceRemove = VmbusOnDeviceRemove; ++ driver->Base.OnCleanup = VmbusOnCleanup; ++ driver->OnIsr = VmbusOnISR; ++ driver->OnMsgDpc = VmbusOnMsgDPC; ++ driver->OnEventDpc = VmbusOnEventDPC; ++ driver->GetChannelOffers = VmbusGetChannelOffers; ++ driver->GetChannelInterface = VmbusGetChannelInterface; ++ driver->GetChannelInfo = VmbusGetChannelInfo; ++ ++ // Hypervisor initialization...setup hypercall page..etc ++ ret = HvInit(); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x", ret); ++ } ++ ++ gDriver = drv; ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++; ++ ++Name: ++ VmbusGetChannelOffers() ++ ++Description: ++ Retrieve the channel offers from the parent partition ++ ++--*/ ++ ++static void ++VmbusGetChannelOffers(void) ++{ ++ DPRINT_ENTER(VMBUS); ++ VmbusChannelRequestOffers(); ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++; ++ ++Name: ++ VmbusGetChannelInterface() ++ ++Description: ++ Get the channel interface ++ ++--*/ ++static void ++VmbusGetChannelInterface( ++ VMBUS_CHANNEL_INTERFACE *Interface ++ ) ++{ ++ GetChannelInterface(Interface); ++} ++ ++ ++/*++; ++ ++Name: ++ VmbusGetChannelInterface() ++ ++Description: ++ Get the device info for the specified device object ++ ++--*/ ++static void ++VmbusGetChannelInfo( ++ DEVICE_OBJECT *DeviceObject, ++ DEVICE_INFO *DeviceInfo ++ ) ++{ ++ GetChannelInfo(DeviceObject, DeviceInfo); ++} ++ ++ ++ ++/*++ ++ ++Name: ++ VmbusCreateChildDevice() ++ ++Description: ++ Creates the child device on the bus that represents the channel offer ++ ++--*/ ++ ++DEVICE_OBJECT* ++VmbusChildDeviceCreate( ++ GUID DeviceType, ++ GUID DeviceInstance, ++ void *Context) ++{ ++ VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; ++ ++ return vmbusDriver->OnChildDeviceCreate( ++ DeviceType, ++ DeviceInstance, ++ Context); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChildDeviceAdd() ++ ++Description: ++ Registers the child device with the vmbus ++ ++--*/ ++int ++VmbusChildDeviceAdd( ++ DEVICE_OBJECT* ChildDevice) ++{ ++ VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; ++ ++ return vmbusDriver->OnChildDeviceAdd(gDevice, ChildDevice); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusChildDeviceRemove() ++ ++Description: ++ Unregisters the child device from the vmbus ++ ++--*/ ++void ++VmbusChildDeviceRemove( ++ DEVICE_OBJECT* ChildDevice) ++{ ++ VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; ++ ++ vmbusDriver->OnChildDeviceRemove(ChildDevice); ++} ++ ++/*++ ++ ++Name: ++ VmbusChildDeviceDestroy() ++ ++Description: ++ Release the child device from the vmbus ++ ++--*/ ++//void ++//VmbusChildDeviceDestroy( ++// DEVICE_OBJECT* ChildDevice ++// ) ++//{ ++// VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; ++// ++// vmbusDriver->OnChildDeviceDestroy(ChildDevice); ++//} ++ ++/*++ ++ ++Name: ++ VmbusOnDeviceAdd() ++ ++Description: ++ Callback when the root bus device is added ++ ++--*/ ++static int ++VmbusOnDeviceAdd( ++ DEVICE_OBJECT *dev, ++ void *AdditionalInfo ++ ) ++{ ++ UINT32 *irqvector = (UINT32*) AdditionalInfo; ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ gDevice = dev; ++ ++ memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(GUID)); ++ memcpy(&gDevice->deviceInstance, &gVmbusDeviceId, sizeof(GUID)); ++ ++ //strcpy(dev->name, "vmbus"); ++ // SynIC setup... ++ ret = HvSynicInit(*irqvector); ++ ++ // Connect to VMBus in the root partition ++ ret = VmbusConnect(); ++ ++ //VmbusSendEvent(device->localPortId+1); ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnDeviceRemove() ++ ++Description: ++ Callback when the root bus device is removed ++ ++--*/ ++int VmbusOnDeviceRemove( ++ DEVICE_OBJECT* dev ++ ) ++{ ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ VmbusChannelReleaseUnattachedChannels(); ++ ++ VmbusDisconnect(); ++ ++ HvSynicCleanup(); ++ ++ DPRINT_EXIT(VMBUS); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnCleanup() ++ ++Description: ++ Perform any cleanup when the driver is removed ++ ++--*/ ++void ++VmbusOnCleanup( ++ DRIVER_OBJECT* drv ++ ) ++{ ++ //VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ HvCleanup(); ++ ++ DPRINT_EXIT(VMBUS); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnMsgDPC() ++ ++Description: ++ DPC routine to handle messages from the hypervisior ++ ++--*/ ++void ++VmbusOnMsgDPC( ++ DRIVER_OBJECT* drv ++ ) ++{ ++ void *page_addr = gHvContext.synICMessagePage[0]; ++ ++ HV_MESSAGE* msg = (HV_MESSAGE*)page_addr + VMBUS_MESSAGE_SINT; ++ HV_MESSAGE *copied; ++ while (1) ++ { ++ if (msg->Header.MessageType == HvMessageTypeNone) // no msg ++ { ++ break; ++ } ++ else ++ { ++ copied = MemAllocAtomic(sizeof(HV_MESSAGE)); ++ if (copied == NULL) ++ { ++ continue; ++ } ++ ++ memcpy(copied, msg, sizeof(HV_MESSAGE)); ++ WorkQueueQueueWorkItem(gVmbusConnection.WorkQueue, VmbusOnChannelMessage, (void*)copied); ++ } ++ ++ msg->Header.MessageType = HvMessageTypeNone; ++ ++ // Make sure the write to MessageType (ie set to HvMessageTypeNone) happens ++ // before we read the MessagePending and EOMing. Otherwise, the EOMing will not deliver ++ // any more messages since there is no empty slot ++ MemoryFence(); ++ ++ if (msg->Header.MessageFlags.MessagePending) ++ { ++ // This will cause message queue rescan to possibly deliver another msg from the hypervisor ++ WriteMsr(HV_X64_MSR_EOM, 0); ++ } ++ } ++} ++ ++/*++ ++ ++Name: ++ VmbusOnEventDPC() ++ ++Description: ++ DPC routine to handle events from the hypervisior ++ ++--*/ ++void ++VmbusOnEventDPC( ++ DRIVER_OBJECT* drv ++ ) ++{ ++ // TODO: Process any events ++ VmbusOnEvents(); ++} ++ ++ ++/*++ ++ ++Name: ++ VmbusOnISR() ++ ++Description: ++ ISR routine ++ ++--*/ ++int ++VmbusOnISR( ++ DRIVER_OBJECT* drv ++ ) ++{ ++ //VMBUS_DRIVER_OBJECT* driver = (VMBUS_DRIVER_OBJECT*)drv; ++ ++ int ret=0; ++ //struct page* page; ++ void *page_addr; ++ HV_MESSAGE* msg; ++ HV_SYNIC_EVENT_FLAGS* event; ++ ++ //page = SynICMessagePage[0]; ++ //page_addr = page_address(page); ++ page_addr = gHvContext.synICMessagePage[0]; ++ msg = (HV_MESSAGE*)page_addr + VMBUS_MESSAGE_SINT; ++ ++ DPRINT_ENTER(VMBUS); ++ ++ // Check if there are actual msgs to be process ++ if (msg->Header.MessageType != HvMessageTypeNone) ++ { ++ DPRINT_DBG(VMBUS, "received msg type %d size %d", msg->Header.MessageType, msg->Header.PayloadSize); ++ ret |= 0x1; ++ } ++ ++ // TODO: Check if there are events to be process ++ page_addr = gHvContext.synICEventPage[0]; ++ event = (HV_SYNIC_EVENT_FLAGS*)page_addr + VMBUS_MESSAGE_SINT; ++ ++ // Since we are a child, we only need to check bit 0 ++ if (BitTestAndClear(&event->Flags32[0], 0)) ++ { ++ DPRINT_DBG(VMBUS, "received event %d", event->Flags32[0]); ++ ret |= 0x2; ++ } ++ ++ DPRINT_EXIT(VMBUS); ++ return ret; ++} ++ ++// eof +--- /dev/null ++++ b/drivers/staging/hv/vmbus_drv.c +@@ -0,0 +1,1228 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "logging.h" ++#include "vmbus.h" ++ ++// ++// Defines ++// ++ ++// FIXME! We need to do this dynamically for PIC and APIC system ++#define VMBUS_IRQ 0x5 ++#ifdef KERNEL_2_6_27 ++#define VMBUS_IRQ_VECTOR IRQ5_VECTOR ++#endif ++// ++// Data types ++// ++ ++// Main vmbus driver data structure ++struct vmbus_driver_context { ++ // !! These must be the first 2 fields !! ++ // The driver field is not used in here. Instead, the bus field is ++ // used to represent the driver ++ struct driver_context drv_ctx; ++ VMBUS_DRIVER_OBJECT drv_obj; ++ ++ struct bus_type bus; ++ struct tasklet_struct msg_dpc; ++ struct tasklet_struct event_dpc; ++ ++ // The bus root device ++ struct device_context device_ctx; ++}; ++ ++// ++// Static decl ++// ++static int vmbus_match(struct device *device, struct device_driver *driver); ++static int vmbus_probe(struct device *device); ++static int vmbus_remove(struct device *device); ++static void vmbus_shutdown(struct device *device); ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#elif defined(KERNEL_2_6_27) ++static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env); ++#else ++static int vmbus_uevent(struct device *device, char **envp, int num_envp, char *buffer, int buffer_size); ++#endif ++static void vmbus_msg_dpc(unsigned long data); ++static void vmbus_event_dpc(unsigned long data); ++ ++#ifdef KERNEL_2_6_27 ++static irqreturn_t vmbus_isr(int irq, void* dev_id); ++#else ++static int vmbus_isr(int irq, void* dev_id, struct pt_regs *regs); ++#endif ++ ++static void vmbus_device_release(struct device *device); ++static void vmbus_bus_release(struct device *device); ++ ++static DEVICE_OBJECT* vmbus_child_device_create(GUID type, GUID instance, void* context); ++static void vmbus_child_device_destroy(DEVICE_OBJECT* device_obj); ++static int vmbus_child_device_register(DEVICE_OBJECT* root_device_obj, DEVICE_OBJECT* child_device_obj); ++static void vmbus_child_device_unregister(DEVICE_OBJECT* child_device_obj); ++static void vmbus_child_device_get_info(DEVICE_OBJECT *device_obj, DEVICE_INFO *device_info); ++ ++//static ssize_t vmbus_show_class_id(struct device *dev, struct device_attribute *attr, char *buf); ++//static ssize_t vmbus_show_device_id(struct device *dev, struct device_attribute *attr, char *buf); ++ ++static ssize_t vmbus_show_device_attr(struct device *dev, struct device_attribute *dev_attr, char *buf); ++ ++// ++// Global ++// ++ ++// Global logging setting ++ ++//unsigned int vmbus_loglevel= (((VMBUS | VMBUS_DRV)<<16) | DEBUG_LVL_ENTEREXIT); ++//unsigned int vmbus_loglevel= (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); ++unsigned int vmbus_loglevel= (ALL_MODULES << 16 | INFO_LVL); ++EXPORT_SYMBOL(vmbus_loglevel); ++ ++static int vmbus_irq = VMBUS_IRQ; ++ ++// Setup /proc/sys/bus/vmbus/vmbus_loglevel ++// Allow usage of sysctl cmd to set the logging level ++static struct ctl_table_header *vmbus_ctl_table_hdr; ++ ++static ctl_table vmbus_dev_ctl_table[] = { ++ { .ctl_name = 8461, ++ .procname = "vmbus_loglevel", ++ .data = &vmbus_loglevel, ++ .maxlen = sizeof(vmbus_loglevel), ++ .mode = 0644, ++ .proc_handler = &proc_dointvec }, ++ { } ++}; ++ ++static ctl_table vmbus_ctl_table[] = { ++ { .ctl_name = CTL_DEV, ++ .procname = "vmbus", ++ .mode = 0555, ++ .child = vmbus_dev_ctl_table }, ++ { } ++}; ++ ++static ctl_table vmus_root_ctl_table[] = { ++ { .ctl_name = CTL_BUS, ++ .procname = "bus", ++ .mode = 0555, ++ .child = vmbus_ctl_table }, ++ { } ++}; ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#else ++// ++// Set up per device attributes in /sys/bus/vmbus/devices/ ++// ++static struct device_attribute vmbus_device_attrs[] = { ++ __ATTR(id, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(state, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(monitor_id, S_IRUGO, vmbus_show_device_attr, NULL), ++ ++ __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(server_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), ++ ++ __ATTR(client_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(client_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(client_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), ++ ++ __ATTR(out_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(out_read_index, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(out_write_index, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(out_read_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(out_write_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), ++ ++ __ATTR(in_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(in_read_index, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(in_write_index, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(in_read_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR(in_write_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), ++ __ATTR_NULL ++}; ++#endif ++ ++// The one and only one ++static struct vmbus_driver_context g_vmbus_drv={ ++ .bus.name = "vmbus", ++ .bus.match = vmbus_match, ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#else ++ .bus.shutdown = vmbus_shutdown, ++ .bus.remove = vmbus_remove, ++ .bus.probe = vmbus_probe, ++ .bus.uevent = vmbus_uevent, ++ .bus.dev_attrs = vmbus_device_attrs, ++#endif ++}; ++ ++// ++// Routines ++// ++ ++ ++/*++ ++ ++Name: vmbus_show_device_attr() ++ ++Desc: Show the device attribute in sysfs. This is invoked when user does a "cat /sys/bus/vmbus/devices//" ++ ++--*/ ++static ssize_t vmbus_show_device_attr(struct device *dev, struct device_attribute *dev_attr, char *buf) ++{ ++ struct device_context *device_ctx = device_to_device_context(dev); ++ DEVICE_INFO device_info; ++ ++ memset(&device_info, 0, sizeof(DEVICE_INFO)); ++ ++ vmbus_child_device_get_info(&device_ctx->device_obj, &device_info); ++ ++ if (!strcmp(dev_attr->attr.name, "class_id")) ++ { ++ return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", ++ device_info.ChannelType.Data[3], device_info.ChannelType.Data[2], device_info.ChannelType.Data[1], device_info.ChannelType.Data[0], ++ device_info.ChannelType.Data[5], device_info.ChannelType.Data[4], ++ device_info.ChannelType.Data[7], device_info.ChannelType.Data[6], ++ device_info.ChannelType.Data[8], device_info.ChannelType.Data[9], device_info.ChannelType.Data[10], device_info.ChannelType.Data[11], device_info.ChannelType.Data[12], device_info.ChannelType.Data[13], device_info.ChannelType.Data[14], device_info.ChannelType.Data[15]); ++ ++ } ++ else if (!strcmp(dev_attr->attr.name, "device_id")) ++ { ++ return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", ++ device_info.ChannelInstance.Data[3], device_info.ChannelInstance.Data[2], device_info.ChannelInstance.Data[1], device_info.ChannelInstance.Data[0], ++ device_info.ChannelInstance.Data[5], device_info.ChannelInstance.Data[4], ++ device_info.ChannelInstance.Data[7], device_info.ChannelInstance.Data[6], ++ device_info.ChannelInstance.Data[8], device_info.ChannelInstance.Data[9], device_info.ChannelInstance.Data[10], device_info.ChannelInstance.Data[11], device_info.ChannelInstance.Data[12], device_info.ChannelInstance.Data[13], device_info.ChannelInstance.Data[14], device_info.ChannelInstance.Data[15]); ++ } ++ else if (!strcmp(dev_attr->attr.name, "state")) ++ { ++ return sprintf(buf, "%d\n", device_info.ChannelState); ++ } ++ else if (!strcmp(dev_attr->attr.name, "id")) ++ { ++ return sprintf(buf, "%d\n", device_info.ChannelId); ++ } ++ else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) ++ { ++ return sprintf(buf, "%d\n", device_info.Outbound.InterruptMask); ++ } ++ else if (!strcmp(dev_attr->attr.name, "out_read_index")) ++ { ++ return sprintf(buf, "%d\n", device_info.Outbound.ReadIndex); ++ } ++ else if (!strcmp(dev_attr->attr.name, "out_write_index")) ++ { ++ return sprintf(buf, "%d\n", device_info.Outbound.WriteIndex); ++ } ++ else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) ++ { ++ return sprintf(buf, "%d\n", device_info.Outbound.BytesAvailToRead); ++ } ++ else if (!strcmp(dev_attr->attr.name, "out_write_bytes_avail")) ++ { ++ return sprintf(buf, "%d\n", device_info.Outbound.BytesAvailToWrite); ++ } ++ else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) ++ { ++ return sprintf(buf, "%d\n", device_info.Inbound.InterruptMask); ++ } ++ else if (!strcmp(dev_attr->attr.name, "in_read_index")) ++ { ++ return sprintf(buf, "%d\n", device_info.Inbound.ReadIndex); ++ } ++ else if (!strcmp(dev_attr->attr.name, "in_write_index")) ++ { ++ return sprintf(buf, "%d\n", device_info.Inbound.WriteIndex); ++ } ++ else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) ++ { ++ return sprintf(buf, "%d\n", device_info.Inbound.BytesAvailToRead); ++ } ++ else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) ++ { ++ return sprintf(buf, "%d\n", device_info.Inbound.BytesAvailToWrite); ++ } ++ else if (!strcmp(dev_attr->attr.name, "monitor_id")) ++ { ++ return sprintf(buf, "%d\n", device_info.MonitorId); ++ } ++ else if (!strcmp(dev_attr->attr.name, "server_monitor_pending")) ++ { ++ return sprintf(buf, "%d\n", device_info.ServerMonitorPending); ++ } ++ else if (!strcmp(dev_attr->attr.name, "server_monitor_latency")) ++ { ++ return sprintf(buf, "%d\n", device_info.ServerMonitorLatency); ++ } ++ else if (!strcmp(dev_attr->attr.name, "server_monitor_conn_id")) ++ { ++ return sprintf(buf, "%d\n", device_info.ServerMonitorConnectionId); ++ } ++ else if (!strcmp(dev_attr->attr.name, "client_monitor_pending")) ++ { ++ return sprintf(buf, "%d\n", device_info.ClientMonitorPending); ++ } ++ else if (!strcmp(dev_attr->attr.name, "client_monitor_latency")) ++ { ++ return sprintf(buf, "%d\n", device_info.ClientMonitorLatency); ++ } ++ else if (!strcmp(dev_attr->attr.name, "client_monitor_conn_id")) ++ { ++ return sprintf(buf, "%d\n", device_info.ClientMonitorConnectionId); ++ } ++ else ++ { ++ return 0; ++ } ++} ++ ++/*++ ++ ++Name: vmbus_show_class_id() ++ ++Desc: Show the device class id in sysfs ++ ++--*/ ++//static ssize_t vmbus_show_class_id(struct device *dev, struct device_attribute *attr, char *buf) ++//{ ++// struct device_context *device_ctx = device_to_device_context(dev); ++// return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", ++// device_ctx->class_id[3], device_ctx->class_id[2], device_ctx->class_id[1], device_ctx->class_id[0], ++// device_ctx->class_id[5], device_ctx->class_id[4], ++// device_ctx->class_id[7], device_ctx->class_id[6], ++// device_ctx->class_id[8], device_ctx->class_id[9], device_ctx->class_id[10], device_ctx->class_id[11], device_ctx->class_id[12], device_ctx->class_id[13], device_ctx->class_id[14], device_ctx->class_id[15]); ++//} ++ ++/*++ ++ ++Name: vmbus_show_device_id() ++ ++Desc: Show the device instance id in sysfs ++ ++--*/ ++//static ssize_t vmbus_show_device_id(struct device *dev, struct device_attribute *attr, char *buf) ++//{ ++// struct device_context *device_ctx = device_to_device_context(dev); ++// return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", ++// device_ctx->device_id[3], device_ctx->device_id[2], device_ctx->device_id[1], device_ctx->device_id[0], ++// device_ctx->device_id[5], device_ctx->device_id[4], ++// device_ctx->device_id[7], device_ctx->device_id[6], ++// device_ctx->device_id[8], device_ctx->device_id[9], device_ctx->device_id[10], device_ctx->device_id[11], device_ctx->device_id[12], device_ctx->device_id[13], device_ctx->device_id[14], device_ctx->device_id[15]); ++//} ++ ++/*++ ++ ++Name: vmbus_bus_init() ++ ++Desc: Main vmbus driver initialization routine. Here, we ++ - initialize the vmbus driver context ++ - setup various driver entry points ++ - invoke the vmbus hv main init routine ++ - get the irq resource ++ - invoke the vmbus to add the vmbus root device ++ - setup the vmbus root device ++ - retrieve the channel offers ++--*/ ++int vmbus_bus_init(PFN_DRIVERINITIALIZE pfn_drv_init) ++{ ++ int ret=0; ++ unsigned int vector=0; ++ ++ struct vmbus_driver_context *vmbus_drv_ctx=&g_vmbus_drv; ++ VMBUS_DRIVER_OBJECT *vmbus_drv_obj=&g_vmbus_drv.drv_obj; ++ ++ struct device_context *dev_ctx=&g_vmbus_drv.device_ctx; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Set this up to allow lower layer to callback to add/remove child devices on the bus ++ vmbus_drv_obj->OnChildDeviceCreate = vmbus_child_device_create; ++ vmbus_drv_obj->OnChildDeviceDestroy = vmbus_child_device_destroy; ++ vmbus_drv_obj->OnChildDeviceAdd = vmbus_child_device_register; ++ vmbus_drv_obj->OnChildDeviceRemove = vmbus_child_device_unregister; ++ ++ // Call to bus driver to initialize ++ ret = pfn_drv_init(&vmbus_drv_obj->Base); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS_DRV, "Unable to initialize vmbus (%d)", ret); ++ goto cleanup; ++ } ++ ++ // Sanity checks ++ if (!vmbus_drv_obj->Base.OnDeviceAdd) ++ { ++ DPRINT_ERR(VMBUS_DRV, "OnDeviceAdd() routine not set"); ++ ret = -1; ++ goto cleanup; ++ } ++ ++ vmbus_drv_ctx->bus.name = vmbus_drv_obj->Base.name; ++ ++ // Initialize the bus context ++ tasklet_init(&vmbus_drv_ctx->msg_dpc, vmbus_msg_dpc, (unsigned long)vmbus_drv_obj); ++ tasklet_init(&vmbus_drv_ctx->event_dpc, vmbus_event_dpc, (unsigned long)vmbus_drv_obj); ++ ++ // Now, register the bus driver with LDM ++ bus_register(&vmbus_drv_ctx->bus); ++ ++ // Get the interrupt resource ++#ifdef KERNEL_2_6_27 ++ ret = request_irq(vmbus_irq, ++ vmbus_isr, ++ IRQF_SAMPLE_RANDOM, ++ vmbus_drv_obj->Base.name, ++ NULL); ++#else ++ ret = request_irq(vmbus_irq, ++ vmbus_isr, ++ SA_SAMPLE_RANDOM, ++ vmbus_drv_obj->Base.name, ++ NULL); ++#endif ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d", vmbus_irq); ++ ++ bus_unregister(&vmbus_drv_ctx->bus); ++ ++ ret = -1; ++ goto cleanup; ++ } ++#ifdef KERNEL_2_6_27 ++ vector = VMBUS_IRQ_VECTOR; ++#else ++#if X2V_LINUX ++ vector = vmbus_irq + FIRST_DEVICE_VECTOR - 2; ++#else ++ vector = vmbus_irq + FIRST_EXTERNAL_VECTOR; ++#endif ++#endif ++ ++ DPRINT_INFO(VMBUS_DRV, "irq 0x%x vector 0x%x", vmbus_irq, vector); ++ ++ // Call to bus driver to add the root device ++ memset(dev_ctx, 0, sizeof(struct device_context)); ++ ++ ret = vmbus_drv_obj->Base.OnDeviceAdd(&dev_ctx->device_obj, &vector); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to add vmbus root device"); ++ ++ free_irq(vmbus_irq, NULL); ++ ++ bus_unregister(&vmbus_drv_ctx->bus); ++ ++ ret = -1; ++ goto cleanup; ++ } ++ //strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); ++ sprintf(dev_ctx->device.bus_id, "vmbus_0_0"); ++ memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(GUID)); ++ memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(GUID)); ++ ++ // No need to bind a driver to the root device. ++ dev_ctx->device.parent = NULL; ++ dev_ctx->device.bus = &vmbus_drv_ctx->bus; //NULL; // vmbus_remove() does not get invoked ++ ++ // Setup the device dispatch table ++ dev_ctx->device.release = vmbus_bus_release; ++ ++ // Setup the bus as root device ++ device_register(&dev_ctx->device); ++ ++ vmbus_drv_obj->GetChannelOffers(); ++ ++cleanup: ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: vmbus_bus_exit() ++ ++Desc: Terminate the vmbus driver. This routine is opposite of vmbus_bus_init() ++ ++--*/ ++void vmbus_bus_exit(void) ++{ ++ VMBUS_DRIVER_OBJECT *vmbus_drv_obj=&g_vmbus_drv.drv_obj; ++ struct vmbus_driver_context *vmbus_drv_ctx=&g_vmbus_drv; ++ ++ struct device_context *dev_ctx=&g_vmbus_drv.device_ctx; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Remove the root device ++ if (vmbus_drv_obj->Base.OnDeviceRemove) ++ vmbus_drv_obj->Base.OnDeviceRemove(&dev_ctx->device_obj); ++ ++ if (vmbus_drv_obj->Base.OnCleanup) ++ vmbus_drv_obj->Base.OnCleanup(&vmbus_drv_obj->Base); ++ ++ // Unregister the root bus device ++ device_unregister(&dev_ctx->device); ++ ++ bus_unregister(&vmbus_drv_ctx->bus); ++ ++ free_irq(vmbus_irq, NULL); ++ ++ tasklet_kill(&vmbus_drv_ctx->msg_dpc); ++ tasklet_kill(&vmbus_drv_ctx->event_dpc); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return; ++} ++ ++/*++ ++ ++Name: vmbus_child_driver_register() ++ ++Desc: Register a vmbus's child driver ++ ++--*/ ++void vmbus_child_driver_register(struct driver_context* driver_ctx) ++{ ++ VMBUS_DRIVER_OBJECT *vmbus_drv_obj=&g_vmbus_drv.drv_obj; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, "child driver (%p) registering - name %s", driver_ctx, driver_ctx->driver.name); ++ ++ // The child driver on this vmbus ++ driver_ctx->driver.bus = &g_vmbus_drv.bus; ++ ++ driver_register(&driver_ctx->driver); ++ ++ vmbus_drv_obj->GetChannelOffers(); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++EXPORT_SYMBOL(vmbus_child_driver_register); ++ ++/*++ ++ ++Name: vmbus_child_driver_unregister() ++ ++Desc: Unregister a vmbus's child driver ++ ++--*/ ++void vmbus_child_driver_unregister(struct driver_context* driver_ctx) ++{ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, "child driver (%p) unregistering - name %s", driver_ctx, driver_ctx->driver.name); ++ ++ driver_unregister(&driver_ctx->driver); ++ ++ driver_ctx->driver.bus = NULL; ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++EXPORT_SYMBOL(vmbus_child_driver_unregister); ++ ++/*++ ++ ++Name: vmbus_get_interface() ++ ++Desc: Get the vmbus channel interface. This is invoked by child/client driver that sits ++ above vmbus ++--*/ ++void vmbus_get_interface(VMBUS_CHANNEL_INTERFACE *interface) ++{ ++ VMBUS_DRIVER_OBJECT *vmbus_drv_obj=&g_vmbus_drv.drv_obj; ++ ++ vmbus_drv_obj->GetChannelInterface(interface); ++} ++ ++EXPORT_SYMBOL(vmbus_get_interface); ++ ++ ++/*++ ++ ++Name: vmbus_child_device_get_info() ++ ++Desc: Get the vmbus child device info. This is invoked to display various device attributes in sysfs. ++--*/ ++static void vmbus_child_device_get_info(DEVICE_OBJECT *device_obj, DEVICE_INFO *device_info) ++{ ++ VMBUS_DRIVER_OBJECT *vmbus_drv_obj=&g_vmbus_drv.drv_obj; ++ ++ vmbus_drv_obj->GetChannelInfo(device_obj, device_info); ++} ++ ++ ++/*++ ++ ++Name: vmbus_child_device_create() ++ ++Desc: Creates and registers a new child device on the vmbus. ++ ++--*/ ++static DEVICE_OBJECT* vmbus_child_device_create(GUID type, GUID instance, void* context) ++{ ++ struct device_context *child_device_ctx; ++ DEVICE_OBJECT* child_device_obj; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Allocate the new child device ++ child_device_ctx = kzalloc(sizeof(struct device_context), GFP_KERNEL); ++ if (!child_device_ctx) ++ { ++ DPRINT_ERR(VMBUS_DRV, "unable to allocate device_context for child device"); ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return NULL; ++ } ++ ++ DPRINT_DBG(VMBUS_DRV, "child device (%p) allocated - " ++ "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}," ++ "id {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ &child_device_ctx->device, ++ type.Data[3], type.Data[2], type.Data[1], type.Data[0], type.Data[5], type.Data[4], type.Data[7], type.Data[6], type.Data[8], type.Data[9], type.Data[10], type.Data[11], type.Data[12], type.Data[13], type.Data[14], type.Data[15], ++ instance.Data[3], instance.Data[2], instance.Data[1], instance.Data[0], instance.Data[5], instance.Data[4], instance.Data[7], instance.Data[6], instance.Data[8], instance.Data[9], instance.Data[10], instance.Data[11], instance.Data[12], instance.Data[13], instance.Data[14], instance.Data[15]); ++ ++ child_device_obj = &child_device_ctx->device_obj; ++ child_device_obj->context = context; ++ memcpy(&child_device_obj->deviceType, &type, sizeof(GUID)); ++ memcpy(&child_device_obj->deviceInstance, &instance, sizeof(GUID)); ++ ++ memcpy(&child_device_ctx->class_id, &type, sizeof(GUID)); ++ memcpy(&child_device_ctx->device_id, &instance, sizeof(GUID)); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return child_device_obj; ++} ++ ++/*++ ++ ++Name: vmbus_child_device_register() ++ ++Desc: Register the child device on the specified bus ++ ++--*/ ++static int vmbus_child_device_register(DEVICE_OBJECT* root_device_obj, DEVICE_OBJECT* child_device_obj) ++{ ++ int ret=0; ++ struct device_context *root_device_ctx = to_device_context(root_device_obj); ++ struct device_context *child_device_ctx = to_device_context(child_device_obj); ++ static int device_num=0; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_DBG(VMBUS_DRV, "child device (%p) registering", child_device_ctx); ++ // ++ // Make sure we are not registered already ++ // ++ if (child_device_ctx->device.bus_id[0] != '\0') ++ { ++ DPRINT_ERR(VMBUS_DRV, "child device (%p) already registered - busid %s", child_device_ctx, child_device_ctx->device.bus_id); ++ ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Set the device bus id. Otherwise, device_register()will fail. ++ sprintf(child_device_ctx->device.bus_id, "vmbus_0_%d", InterlockedIncrement(&device_num)); ++ ++ // The new device belongs to this bus ++ child_device_ctx->device.bus = &g_vmbus_drv.bus; //device->dev.bus; ++ child_device_ctx->device.parent = &root_device_ctx->device; ++ child_device_ctx->device.release = vmbus_device_release; ++ ++ // Register with the LDM. This will kick off the driver/device binding...which will ++ // eventually call vmbus_match() and vmbus_probe() ++ ret = device_register(&child_device_ctx->device); ++ ++ // vmbus_probe() error does not get propergate to device_register(). ++ ret = child_device_ctx->probe_error; ++ ++ if (ret) ++ DPRINT_ERR(VMBUS_DRV, "unable to register child device (%p) (%d)", &child_device_ctx->device); ++ else ++ DPRINT_INFO(VMBUS_DRV, "child device (%p) registered", &child_device_ctx->device); ++ ++Cleanup: ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: vmbus_child_device_unregister() ++ ++Desc: Remove the specified child device from the vmbus. ++ ++--*/ ++static void vmbus_child_device_unregister(DEVICE_OBJECT* device_obj) ++{ ++ struct device_context *device_ctx = to_device_context(device_obj); ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, "unregistering child device (%p)", &device_ctx->device); ++ ++ // Kick off the process of unregistering the device. ++ // This will call vmbus_remove() and eventually vmbus_device_release() ++ device_unregister(&device_ctx->device); ++ ++ DPRINT_INFO(VMBUS_DRV, "child device (%p) unregistered", &device_ctx->device); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++ ++/*++ ++ ++Name: vmbus_child_device_destroy() ++ ++Desc: Destroy the specified child device on the vmbus. ++ ++--*/ ++static void vmbus_child_device_destroy(DEVICE_OBJECT* device_obj) ++{ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++/*++ ++ ++Name: vmbus_uevent() ++ ++Desc: This routine is invoked when a device is added or removed on the vmbus to generate a uevent to udev in the ++ userspace. The udev will then look at its rule and the uevent generated here to load the appropriate driver ++ ++--*/ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#elif defined(KERNEL_2_6_27) ++static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env) ++{ ++ struct device_context *device_ctx = device_to_device_context(device); ++ int i=0; ++ int len=0; ++ int ret; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], ++ device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], ++ device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], ++ device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], ++ device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); ++ ++ env->envp_idx = i; ++ env->buflen = len; ++ ret = add_uevent_var(env, ++ "VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], ++ device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], ++ device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], ++ device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], ++ device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); ++ ++ if (ret) ++ { ++ return ret; ++ } ++ ++ ret = add_uevent_var(env, ++ "VMBUS_DEVICE_DEVICE_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->device_id.Data[3], device_ctx->device_id.Data[2], device_ctx->device_id.Data[1], device_ctx->device_id.Data[0], ++ device_ctx->device_id.Data[5], device_ctx->device_id.Data[4], ++ device_ctx->device_id.Data[7], device_ctx->device_id.Data[6], ++ device_ctx->device_id.Data[8], device_ctx->device_id.Data[9], device_ctx->device_id.Data[10], device_ctx->device_id.Data[11], ++ device_ctx->device_id.Data[12], device_ctx->device_id.Data[13], device_ctx->device_id.Data[14], device_ctx->device_id.Data[15]); ++ ++ if (ret) ++ { ++ return ret; ++ } ++ ++ env->envp[env->envp_idx] = NULL; ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return 0; ++} ++ ++#else ++static int vmbus_uevent(struct device *device, char **envp, int num_envp, char *buffer, int buffer_size) ++{ ++ struct device_context *device_ctx = device_to_device_context(device); ++ int i=0; ++ int len=0; ++ int ret; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], ++ device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], ++ device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], ++ device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], ++ device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); ++ ++ ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, ++ "VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], ++ device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], ++ device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], ++ device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], ++ device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); ++ ++ if (ret) ++ { ++ return ret; ++ } ++ ++ ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, ++ "VMBUS_DEVICE_DEVICE_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", ++ device_ctx->device_id.Data[3], device_ctx->device_id.Data[2], device_ctx->device_id.Data[1], device_ctx->device_id.Data[0], ++ device_ctx->device_id.Data[5], device_ctx->device_id.Data[4], ++ device_ctx->device_id.Data[7], device_ctx->device_id.Data[6], ++ device_ctx->device_id.Data[8], device_ctx->device_id.Data[9], device_ctx->device_id.Data[10], device_ctx->device_id.Data[11], ++ device_ctx->device_id.Data[12], device_ctx->device_id.Data[13], device_ctx->device_id.Data[14], device_ctx->device_id.Data[15]); ++ ++ if (ret) ++ { ++ return ret; ++ } ++ ++ envp[i] = NULL; ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return 0; ++} ++#endif ++ ++/*++ ++ ++Name: vmbus_match() ++ ++Desc: Attempt to match the specified device to the specified driver ++ ++--*/ ++static int vmbus_match(struct device *device, struct device_driver *driver) ++{ ++ int match=0; ++ struct driver_context *driver_ctx = driver_to_driver_context(driver); ++ struct device_context *device_ctx = device_to_device_context(device); ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // We found our driver ? ++ if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(GUID)) == 0) ++ { ++ // !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast it here to access the ++ // DRIVER_OBJECT field ++ struct vmbus_driver_context *vmbus_drv_ctx = (struct vmbus_driver_context*)driver_ctx; ++ device_ctx->device_obj.Driver = &vmbus_drv_ctx->drv_obj.Base; ++ DPRINT_INFO(VMBUS_DRV, "device object (%p) set to driver object (%p)", &device_ctx->device_obj, device_ctx->device_obj.Driver); ++ ++ match = 1; ++ } ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return match; ++} ++ ++ ++/*++ ++ ++Name: vmbus_probe_failed_cb() ++ ++Desc: Callback when a driver probe failed in vmbus_probe(). We need a callback because ++ we cannot invoked device_unregister() inside vmbus_probe() since vmbus_probe() may be ++ invoked inside device_register() i.e. we cannot call device_unregister() inside ++ device_register() ++--*/ ++#ifdef KERNEL_2_6_27 ++static void vmbus_probe_failed_cb(struct work_struct *context) ++#else ++static void vmbus_probe_failed_cb(void* context) ++#endif ++{ ++ struct device_context *device_ctx = (struct device_context*)context; ++ ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Kick off the process of unregistering the device. ++ // This will call vmbus_remove() and eventually vmbus_device_release() ++ device_unregister(&device_ctx->device); ++ ++ //put_device(&device_ctx->device); ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++ ++/*++ ++ ++Name: vmbus_probe() ++ ++Desc: Add the new vmbus's child device ++ ++--*/ ++static int vmbus_probe(struct device *child_device) ++{ ++ int ret=0; ++ struct driver_context *driver_ctx = driver_to_driver_context(child_device->driver); ++ struct device_context *device_ctx = device_to_device_context(child_device); ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Let the specific open-source driver handles the probe if it can ++ if (driver_ctx->probe) ++ { ++ ret = device_ctx->probe_error = driver_ctx->probe(child_device); ++ if (ret != 0) ++ { ++ DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s (%p) on driver %s (%d)...", child_device->bus_id, child_device, child_device->driver->name, ret); ++ ++#ifdef KERNEL_2_6_27 ++ INIT_WORK(&device_ctx->probe_failed_work_item, vmbus_probe_failed_cb); ++#else ++ INIT_WORK(&device_ctx->probe_failed_work_item, vmbus_probe_failed_cb, device_ctx); ++#endif ++ schedule_work(&device_ctx->probe_failed_work_item); ++ } ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s", child_device->driver->name); ++ ret = -1; ++ } ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: vmbus_remove() ++ ++Desc: Remove a vmbus device ++ ++--*/ ++static int vmbus_remove(struct device *child_device) ++{ ++ int ret=0; ++ struct driver_context *driver_ctx; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Special case root bus device ++ if (child_device->parent == NULL) ++ { ++ // No-op since it is statically defined and handle in vmbus_bus_exit() ++ DPRINT_EXIT(VMBUS_DRV); ++ return 0; ++ } ++ ++ if (child_device->driver) ++ { ++ driver_ctx = driver_to_driver_context(child_device->driver); ++ ++ // Let the specific open-source driver handles the removal if it can ++ if (driver_ctx->remove) ++ { ++ ret = driver_ctx->remove(child_device); ++ } ++ else ++ { ++ DPRINT_ERR(VMBUS_DRV, "remove() method not set for driver - %s", child_device->driver->name); ++ ret = -1; ++ } ++ } ++ else ++ { ++ ++ } ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return 0; ++} ++ ++/*++ ++ ++Name: vmbus_shutdown() ++ ++Desc: Shutdown a vmbus device ++ ++--*/ ++static void vmbus_shutdown(struct device *child_device) ++{ ++ struct driver_context *driver_ctx; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ // Special case root bus device ++ if (child_device->parent == NULL) ++ { ++ // No-op since it is statically defined and handle in vmbus_bus_exit() ++ DPRINT_EXIT(VMBUS_DRV); ++ return; ++ } ++ ++ // The device may not be attached yet ++ if (!child_device->driver) ++ { ++ DPRINT_EXIT(VMBUS_DRV); ++ return; ++ } ++ ++ driver_ctx = driver_to_driver_context(child_device->driver); ++ ++ // Let the specific open-source driver handles the removal if it can ++ if (driver_ctx->shutdown) ++ { ++ driver_ctx->shutdown(child_device); ++ } ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return; ++} ++ ++/*++ ++ ++Name: vmbus_bus_release() ++ ++Desc: Final callback release of the vmbus root device ++ ++--*/ ++static void vmbus_bus_release(struct device *device) ++{ ++ DPRINT_ENTER(VMBUS_DRV); ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++/*++ ++ ++Name: vmbus_device_release() ++ ++Desc: Final callback release of the vmbus child device ++ ++--*/ ++static void vmbus_device_release(struct device *device) ++{ ++ struct device_context *device_ctx = device_to_device_context(device); ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ //vmbus_child_device_destroy(&device_ctx->device_obj); ++ kfree(device_ctx); ++ ++ // !!DO NOT REFERENCE device_ctx anymore at this point!! ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return; ++} ++ ++/*++ ++ ++Name: vmbus_msg_dpc() ++ ++Desc: Tasklet routine to handle hypervisor messages ++ ++--*/ ++static void vmbus_msg_dpc(unsigned long data) ++{ ++ VMBUS_DRIVER_OBJECT* vmbus_drv_obj = (VMBUS_DRIVER_OBJECT*)data; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ ASSERT(vmbus_drv_obj->OnMsgDpc != NULL); ++ ++ // Call to bus driver to handle interrupt ++ vmbus_drv_obj->OnMsgDpc(&vmbus_drv_obj->Base); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++/*++ ++ ++Name: vmbus_msg_dpc() ++ ++Desc: Tasklet routine to handle hypervisor events ++ ++--*/ ++static void vmbus_event_dpc(unsigned long data) ++{ ++ VMBUS_DRIVER_OBJECT* vmbus_drv_obj = (VMBUS_DRIVER_OBJECT*)data; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ ASSERT(vmbus_drv_obj->OnEventDpc != NULL); ++ ++ // Call to bus driver to handle interrupt ++ vmbus_drv_obj->OnEventDpc(&vmbus_drv_obj->Base); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++} ++ ++/*++ ++ ++Name: vmbus_msg_dpc() ++ ++Desc: ISR routine ++ ++--*/ ++#ifdef KERNEL_2_6_27 ++static irqreturn_t vmbus_isr(int irq, void* dev_id) ++#else ++static int vmbus_isr(int irq, void* dev_id, struct pt_regs *regs) ++#endif ++{ ++ int ret=0; ++ VMBUS_DRIVER_OBJECT* vmbus_driver_obj = &g_vmbus_drv.drv_obj; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ ASSERT(vmbus_driver_obj->OnIsr != NULL); ++ ++ // Call to bus driver to handle interrupt ++ ret = vmbus_driver_obj->OnIsr(&vmbus_driver_obj->Base); ++ ++ // Schedules a dpc if necessary ++ if (ret > 0) ++ { ++ if (test_bit(0, (unsigned long*)&ret)) ++ { ++ tasklet_schedule(&g_vmbus_drv.msg_dpc); ++ } ++ ++ if (test_bit(1, (unsigned long*)&ret)) ++ { ++ tasklet_schedule(&g_vmbus_drv.event_dpc); ++ } ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ return IRQ_HANDLED; ++ } ++ else ++ { ++ DPRINT_EXIT(VMBUS_DRV); ++ return IRQ_NONE; ++ } ++} ++ ++MODULE_LICENSE("GPL"); ++ ++ ++/*++ ++ ++Name: vmbus_init() ++ ++Desc: Main vmbus driver entry routine ++ ++--*/ ++static int __init vmbus_init(void) ++{ ++ int ret=0; ++ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ DPRINT_INFO(VMBUS_DRV, ++ "Vmbus initializing.... current log level 0x%x (%x,%x)", ++ vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel)); ++#ifdef KERNEL_2_6_27 ++//Todo: it is used for loglevel, to be ported to new kernel. ++#else ++ vmbus_ctl_table_hdr = register_sysctl_table(vmus_root_ctl_table, 0); ++ if (!vmbus_ctl_table_hdr) ++ { ++ DPRINT_EXIT(VMBUS_DRV); ++ return -ENOMEM; ++ } ++#endif ++ ++ ret = vmbus_bus_init(VmbusInitialize); ++ ++ DPRINT_EXIT(VMBUS_DRV); ++ return ret; ++} ++ ++ ++ ++/*++ ++ ++Name: vmbus_init() ++ ++Desc: Main vmbus driver exit routine ++ ++--*/ ++static void __exit vmbus_exit(void) ++{ ++ DPRINT_ENTER(VMBUS_DRV); ++ ++ vmbus_bus_exit(); ++#ifdef KERNEL_2_6_27 ++//Todo: it is used for loglevel, to be ported to new kernel. ++#else ++ unregister_sysctl_table(vmbus_ctl_table_hdr); ++#endif ++ DPRINT_EXIT(VMBUS_DRV); ++ ++ return; ++} ++ ++#if defined(KERNEL_2_6_5) ++#else ++module_param(vmbus_irq, int, S_IRUGO); ++module_param(vmbus_loglevel, int, S_IRUGO); ++#endif ++ ++module_init(vmbus_init); ++module_exit(vmbus_exit); ++// eof +--- /dev/null ++++ b/drivers/staging/hv/VmbusPrivate.h +@@ -0,0 +1,170 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _VMBUS_PRIVATE_H_ ++#define _VMBUS_PRIVATE_H_ ++ ++#ifndef INTERNAL ++#define INTERNAL static ++#endif ++ ++#include "Hv.h" ++#include "VmbusApi.h" ++#include "Channel.h" ++#include "ChannelMgmt.h" ++#include "ChannelInterface.h" ++//#include "ChannelMessages.h" ++#include "RingBuffer.h" ++//#include "Packet.h" ++#include "List.h" ++ ++// ++// Defines ++// ++ ++// Maximum channels is determined by the size of the interrupt page which is PAGE_SIZE. 1/2 of PAGE_SIZE is for ++// send endpoint interrupt and the other is receive endpoint interrupt ++#define MAX_NUM_CHANNELS (PAGE_SIZE >> 1) << 3 // 16348 channels ++ ++// The value here must be in multiple of 32 ++// TODO: Need to make this configurable ++#define MAX_NUM_CHANNELS_SUPPORTED 256 ++ ++// ++// Data types ++// ++ ++typedef enum { ++ Disconnected, ++ Connecting, ++ Connected, ++ Disconnecting ++} VMBUS_CONNECT_STATE; ++ ++#define MAX_SIZE_CHANNEL_MESSAGE HV_MESSAGE_PAYLOAD_BYTE_COUNT ++ ++typedef struct _VMBUS_CONNECTION { ++ ++ VMBUS_CONNECT_STATE ConnectState; ++ ++ UINT32 NextGpadlHandle; ++ ++ // Represents channel interrupts. Each bit position ++ // represents a channel. ++ // When a channel sends an interrupt via VMBUS, it ++ // finds its bit in the sendInterruptPage, set it and ++ // calls Hv to generate a port event. The other end ++ // receives the port event and parse the recvInterruptPage ++ // to see which bit is set ++ VOID* InterruptPage; ++ VOID* SendInterruptPage; ++ VOID* RecvInterruptPage; ++ ++ // 2 pages - 1st page for parent->child notification and 2nd is child->parent notification ++ VOID* MonitorPages; ++ LIST_ENTRY ChannelMsgList; ++ HANDLE ChannelMsgLock; ++ ++ // List of channels ++ LIST_ENTRY ChannelList; ++ HANDLE ChannelLock; ++ ++ HANDLE WorkQueue; ++} VMBUS_CONNECTION; ++ ++ ++typedef struct _VMBUS_MSGINFO { ++ // Bookkeeping stuff ++ LIST_ENTRY MsgListEntry; ++ ++ // Synchronize the request/response if needed ++ HANDLE WaitEvent; ++ ++ // The message itself ++ unsigned char Msg[0]; ++} VMBUS_MSGINFO; ++ ++ ++// ++// Externs ++// ++extern VMBUS_CONNECTION gVmbusConnection; ++ ++// ++// General vmbus interface ++// ++INTERNAL DEVICE_OBJECT* ++VmbusChildDeviceCreate( ++ GUID deviceType, ++ GUID deviceInstance, ++ void *context); ++ ++INTERNAL int ++VmbusChildDeviceAdd( ++ DEVICE_OBJECT* Device); ++ ++INTERNAL void ++VmbusChildDeviceRemove( ++ DEVICE_OBJECT* Device); ++ ++//INTERNAL void ++//VmbusChildDeviceDestroy( ++// DEVICE_OBJECT*); ++ ++INTERNAL VMBUS_CHANNEL* ++GetChannelFromRelId( ++ UINT32 relId ++ ); ++ ++// ++// Connection interface ++// ++INTERNAL int ++VmbusConnect( ++ VOID ++ ); ++ ++INTERNAL int ++VmbusDisconnect( ++ VOID ++ ); ++ ++INTERNAL int ++VmbusPostMessage( ++ PVOID buffer, ++ SIZE_T bufSize ++ ); ++ ++INTERNAL int ++VmbusSetEvent( ++ UINT32 childRelId ++ ); ++ ++INTERNAL VOID ++VmbusOnEvents( ++ VOID ++ ); ++ ++ ++#endif // _VMBUS_PRIVATE_H_ diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver-to-the-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver-to-the-build.patch new file mode 100644 index 000000000..2048a6324 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver-to-the-build.patch @@ -0,0 +1,43 @@ +From foo@baz Tue Jul 14 11:01:18 PDT 2009 +Date: Tue, 14 Jul 2009 11:01:18 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: add the Hyper-V virtual network driver to the build + +From: Greg Kroah-Hartman + +Add the Hyper-V virtual network driver to the kernel build system. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/Kconfig | 7 +++++++ + drivers/staging/hv/Makefile | 2 ++ + 2 files changed, 9 insertions(+) + +--- a/drivers/staging/hv/Kconfig ++++ b/drivers/staging/hv/Kconfig +@@ -19,3 +19,10 @@ config HYPERV_BLOCK + default n + help + Select this option to enable the Hyper-V virtual block driver. ++ ++config HYPERV_NET ++ tristate "Microsoft Hyper-V virtual network driver" ++ depends on HYPERV && NET ++ default n ++ help ++ Select this option to enable the Hyper-V virtual network driver. +--- a/drivers/staging/hv/Makefile ++++ b/drivers/staging/hv/Makefile +@@ -1,7 +1,9 @@ + obj-$(CONFIG_HYPERV) += hv_vmbus.o + obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o + obj-$(CONFIG_HYPERV_BLOCK) += hv_blkvsc.o ++obj-$(CONFIG_HYPERV_NET) += hv_netvsc.o + + hv_vmbus-objs := vmbus_drv.o osd.o Sources.o + hv_storvsc-objs := storvsc_drv.o osd.o StorVsc.o + hv_blkvsc-objs := blkvsc_drv.o osd.o BlkVsc.o ++hv_netvsc-objs := netvsc_drv.o osd.o NetVsc.o RndisFilter.o diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver.patch new file mode 100644 index 000000000..7c49cd1aa --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver.patch @@ -0,0 +1,3569 @@ +From fec8755b6193c93a935423fdd6026b354aa2e15e Mon Sep 17 00:00:00 2001 +From: Hank Janssen +Date: Mon, 13 Jul 2009 15:34:54 -0700 +Subject: Staging: hv: add the Hyper-V virtual network driver + +From: Hank Janssen + +This is the virtual network driver when running Linux on top of Hyper-V. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/hv/NetVsc.c | 1499 +++++++++++++++++++++++++++++++++++++++ + drivers/staging/hv/NetVsc.h | 91 ++ + drivers/staging/hv/RndisFilter.c | 1162 ++++++++++++++++++++++++++++++ + drivers/staging/hv/RndisFilter.h | 61 + + drivers/staging/hv/netvsc_drv.c | 720 ++++++++++++++++++ + 5 files changed, 3533 insertions(+) + create mode 100644 drivers/staging/hv/netvsc.c + +--- /dev/null ++++ b/drivers/staging/hv/NetVsc.c +@@ -0,0 +1,1499 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++#include "NetVsc.h" ++#include "RndisFilter.h" ++ ++ ++// ++// Globals ++// ++static const char* gDriverName="netvsc"; ++ ++// {F8615163-DF3E-46c5-913F-F2D2F965ED0E} ++static const GUID gNetVscDeviceType={ ++ .Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} ++}; ++ ++ ++// ++// Internal routines ++// ++static int ++NetVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ); ++ ++static int ++NetVscOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ); ++ ++static void ++NetVscOnCleanup( ++ DRIVER_OBJECT *Driver ++ ); ++ ++static void ++NetVscOnChannelCallback( ++ PVOID context ++ ); ++ ++static int ++NetVscInitializeSendBufferWithNetVsp( ++ DEVICE_OBJECT *Device ++ ); ++ ++static int ++NetVscInitializeReceiveBufferWithNetVsp( ++ DEVICE_OBJECT *Device ++ ); ++ ++static int ++NetVscDestroySendBuffer( ++ NETVSC_DEVICE *NetDevice ++ ); ++ ++static int ++NetVscDestroyReceiveBuffer( ++ NETVSC_DEVICE *NetDevice ++ ); ++ ++static int ++NetVscConnectToVsp( ++ DEVICE_OBJECT *Device ++ ); ++ ++static void ++NetVscOnSendCompletion( ++ DEVICE_OBJECT *Device, ++ VMPACKET_DESCRIPTOR *Packet ++ ); ++ ++static int ++NetVscOnSend( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ); ++ ++static void ++NetVscOnReceive( ++ DEVICE_OBJECT *Device, ++ VMPACKET_DESCRIPTOR *Packet ++ ); ++ ++static void ++NetVscOnReceiveCompletion( ++ PVOID Context ++ ); ++ ++static void ++NetVscSendReceiveCompletion( ++ DEVICE_OBJECT *Device, ++ UINT64 TransactionId ++ ); ++ ++static inline NETVSC_DEVICE* AllocNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = MemAllocZeroed(sizeof(NETVSC_DEVICE)); ++ if (!netDevice) ++ return NULL; ++ ++ // Set to 2 to allow both inbound and outbound traffic ++ InterlockedCompareExchange(&netDevice->RefCount, 2, 0); ++ ++ netDevice->Device = Device; ++ Device->Extension = netDevice; ++ ++ return netDevice; ++} ++ ++static inline void FreeNetDevice(NETVSC_DEVICE *Device) ++{ ++ ASSERT(Device->RefCount == 0); ++ Device->Device->Extension = NULL; ++ MemFree(Device); ++} ++ ++ ++// Get the net device object iff exists and its refcount > 1 ++static inline NETVSC_DEVICE* GetOutboundNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ if (netDevice && netDevice->RefCount > 1) ++ { ++ InterlockedIncrement(&netDevice->RefCount); ++ } ++ else ++ { ++ netDevice = NULL; ++ } ++ ++ return netDevice; ++} ++ ++// Get the net device object iff exists and its refcount > 0 ++static inline NETVSC_DEVICE* GetInboundNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ if (netDevice && netDevice->RefCount) ++ { ++ InterlockedIncrement(&netDevice->RefCount); ++ } ++ else ++ { ++ netDevice = NULL; ++ } ++ ++ return netDevice; ++} ++ ++static inline void PutNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ ASSERT(netDevice); ++ ++ InterlockedDecrement(&netDevice->RefCount); ++} ++ ++static inline NETVSC_DEVICE* ReleaseOutboundNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ if (netDevice == NULL) ++ return NULL; ++ ++ // Busy wait until the ref drop to 2, then set it to 1 ++ while (InterlockedCompareExchange(&netDevice->RefCount, 1, 2) != 2) ++ { ++ Sleep(100); ++ } ++ ++ return netDevice; ++} ++ ++static inline NETVSC_DEVICE* ReleaseInboundNetDevice(DEVICE_OBJECT *Device) ++{ ++ NETVSC_DEVICE *netDevice; ++ ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ if (netDevice == NULL) ++ return NULL; ++ ++ // Busy wait until the ref drop to 1, then set it to 0 ++ while (InterlockedCompareExchange(&netDevice->RefCount, 0, 1) != 1) ++ { ++ Sleep(100); ++ } ++ ++ Device->Extension = NULL; ++ return netDevice; ++} ++ ++/*++; ++ ++ ++Name: ++ NetVscInitialize() ++ ++Description: ++ Main entry point ++ ++--*/ ++int ++NetVscInitialize( ++ DRIVER_OBJECT *drv ++ ) ++{ ++ NETVSC_DRIVER_OBJECT* driver = (NETVSC_DRIVER_OBJECT*)drv; ++ int ret=0; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ DPRINT_DBG(NETVSC, "sizeof(NETVSC_PACKET)=%d, sizeof(NVSP_MESSAGE)=%d, sizeof(VMTRANSFER_PAGE_PACKET_HEADER)=%d", ++ sizeof(NETVSC_PACKET), sizeof(NVSP_MESSAGE), sizeof(VMTRANSFER_PAGE_PACKET_HEADER)); ++ ++ // Make sure we are at least 2 pages since 1 page is used for control ++ ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1)); ++ ++ drv->name = gDriverName; ++ memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(GUID)); ++ ++ // Make sure it is set by the caller ++ ASSERT(driver->OnReceiveCallback); ++ ASSERT(driver->OnLinkStatusChanged); ++ ++ // Setup the dispatch table ++ driver->Base.OnDeviceAdd = NetVscOnDeviceAdd; ++ driver->Base.OnDeviceRemove = NetVscOnDeviceRemove; ++ driver->Base.OnCleanup = NetVscOnCleanup; ++ ++ driver->OnSend = NetVscOnSend; ++ ++ RndisFilterInit(driver); ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++static int ++NetVscInitializeReceiveBufferWithNetVsp( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret=0; ++ NETVSC_DEVICE *netDevice; ++ NVSP_MESSAGE *initPacket; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetOutboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ASSERT(netDevice->ReceiveBufferSize > 0); ++ ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE-1)) == 0); // page-size grandularity ++ ++ netDevice->ReceiveBuffer = PageAlloc(netDevice->ReceiveBufferSize >> PAGE_SHIFT); ++ if (!netDevice->ReceiveBuffer) ++ { ++ DPRINT_ERR(NETVSC, "unable to allocate receive buffer of size %d", netDevice->ReceiveBufferSize); ++ ret = -1; ++ goto Cleanup; ++ } ++ ASSERT(((ULONG_PTR)netDevice->ReceiveBuffer & (PAGE_SIZE-1)) == 0); // page-aligned buffer ++ ++ DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL..."); ++ ++ // Establish the gpadl handle for this buffer on this channel. ++ // Note: This call uses the vmbus connection rather than the channel to establish ++ // the gpadl handle. ++ ret = Device->Driver->VmbusChannelInterface.EstablishGpadl(Device, ++ netDevice->ReceiveBuffer, ++ netDevice->ReceiveBufferSize, ++ &netDevice->ReceiveBufferGpadlHandle); ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to establish receive buffer's gpadl"); ++ goto Cleanup; ++ } ++ ++ //WaitEventWait(ext->ChannelInitEvent); ++ ++ // Notify the NetVsp of the gpadl handle ++ DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendReceiveBuffer..."); ++ ++ initPacket = &netDevice->ChannelInitPacket; ++ ++ memset(initPacket, 0, sizeof(NVSP_MESSAGE)); ++ ++ initPacket->Header.MessageType = NvspMessage1TypeSendReceiveBuffer; ++ initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->ReceiveBufferGpadlHandle; ++ initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; ++ ++ // Send the gpadl notification request ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ initPacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)initPacket, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send receive buffer's gpadl to netvsp"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(netDevice->ChannelInitEvent); ++ ++ // Check the response ++ if (initPacket->Messages.Version1Messages.SendReceiveBufferComplete.Status != NvspStatusSuccess) ++ { ++ DPRINT_ERR(NETVSC, ++ "Unable to complete receive buffer initialzation with NetVsp - status %d", ++ initPacket->Messages.Version1Messages.SendReceiveBufferComplete.Status); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Parse the response ++ ASSERT(netDevice->ReceiveSectionCount == 0); ++ ASSERT(netDevice->ReceiveSections == NULL); ++ ++ netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections; ++ ++ netDevice->ReceiveSections = MemAlloc(netDevice->ReceiveSectionCount * sizeof(NVSP_1_RECEIVE_BUFFER_SECTION)); ++ if (netDevice->ReceiveSections == NULL) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ memcpy(netDevice->ReceiveSections, ++ initPacket->Messages.Version1Messages.SendReceiveBufferComplete.Sections, ++ netDevice->ReceiveSectionCount * sizeof(NVSP_1_RECEIVE_BUFFER_SECTION)); ++ ++ DPRINT_INFO(NETVSC, ++ "Receive sections info (count %d, offset %d, endoffset %d, suballoc size %d, num suballocs %d)", ++ netDevice->ReceiveSectionCount, netDevice->ReceiveSections[0].Offset, netDevice->ReceiveSections[0].EndOffset, ++ netDevice->ReceiveSections[0].SubAllocationSize, netDevice->ReceiveSections[0].NumSubAllocations); ++ ++ ++ //For 1st release, there should only be 1 section that represents the entire receive buffer ++ if (netDevice->ReceiveSectionCount != 1 || ++ netDevice->ReceiveSections->Offset != 0 ) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ goto Exit; ++ ++Cleanup: ++ NetVscDestroyReceiveBuffer(netDevice); ++ ++Exit: ++ PutNetDevice(Device); ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++ ++static int ++NetVscInitializeSendBufferWithNetVsp( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret=0; ++ NETVSC_DEVICE *netDevice; ++ NVSP_MESSAGE *initPacket; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetOutboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ASSERT(netDevice->SendBufferSize > 0); ++ ASSERT((netDevice->SendBufferSize & (PAGE_SIZE-1)) == 0); // page-size grandularity ++ ++ netDevice->SendBuffer = PageAlloc(netDevice->SendBufferSize >> PAGE_SHIFT); ++ if (!netDevice->SendBuffer) ++ { ++ DPRINT_ERR(NETVSC, "unable to allocate send buffer of size %d", netDevice->SendBufferSize); ++ ret = -1; ++ goto Cleanup; ++ } ++ ASSERT(((ULONG_PTR)netDevice->SendBuffer & (PAGE_SIZE-1)) == 0); // page-aligned buffer ++ ++ DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL..."); ++ ++ // Establish the gpadl handle for this buffer on this channel. ++ // Note: This call uses the vmbus connection rather than the channel to establish ++ // the gpadl handle. ++ ret = Device->Driver->VmbusChannelInterface.EstablishGpadl(Device, ++ netDevice->SendBuffer, ++ netDevice->SendBufferSize, ++ &netDevice->SendBufferGpadlHandle); ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to establish send buffer's gpadl"); ++ goto Cleanup; ++ } ++ ++ //WaitEventWait(ext->ChannelInitEvent); ++ ++ // Notify the NetVsp of the gpadl handle ++ DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendSendBuffer..."); ++ ++ initPacket = &netDevice->ChannelInitPacket; ++ ++ memset(initPacket, 0, sizeof(NVSP_MESSAGE)); ++ ++ initPacket->Header.MessageType = NvspMessage1TypeSendSendBuffer; ++ initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->SendBufferGpadlHandle; ++ initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_SEND_BUFFER_ID; ++ ++ // Send the gpadl notification request ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ initPacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)initPacket, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send receive buffer's gpadl to netvsp"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(netDevice->ChannelInitEvent); ++ ++ // Check the response ++ if (initPacket->Messages.Version1Messages.SendSendBufferComplete.Status != NvspStatusSuccess) ++ { ++ DPRINT_ERR(NETVSC, ++ "Unable to complete send buffer initialzation with NetVsp - status %d", ++ initPacket->Messages.Version1Messages.SendSendBufferComplete.Status); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ netDevice->SendSectionSize = initPacket->Messages.Version1Messages.SendSendBufferComplete.SectionSize; ++ ++ goto Exit; ++ ++Cleanup: ++ NetVscDestroySendBuffer(netDevice); ++ ++Exit: ++ PutNetDevice(Device); ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++static int ++NetVscDestroyReceiveBuffer( ++ NETVSC_DEVICE *NetDevice ++ ) ++{ ++ NVSP_MESSAGE *revokePacket; ++ int ret=0; ++ ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // If we got a section count, it means we received a SendReceiveBufferComplete msg ++ // (ie sent NvspMessage1TypeSendReceiveBuffer msg) therefore, we need to send a revoke msg here ++ if (NetDevice->ReceiveSectionCount) ++ { ++ DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeRevokeReceiveBuffer..."); ++ ++ // Send the revoke receive buffer ++ revokePacket = &NetDevice->RevokePacket; ++ memset(revokePacket, 0, sizeof(NVSP_MESSAGE)); ++ ++ revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer; ++ revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; ++ ++ ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device, ++ revokePacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)revokePacket, ++ VmbusPacketTypeDataInBand, ++ 0); ++ // If we failed here, we might as well return and have a leak rather than continue and a bugchk ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send revoke receive buffer to netvsp"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ } ++ ++ // Teardown the gpadl on the vsp end ++ if (NetDevice->ReceiveBufferGpadlHandle) ++ { ++ DPRINT_INFO(NETVSC, "Tearing down receive buffer's GPADL..."); ++ ++ ret = NetDevice->Device->Driver->VmbusChannelInterface.TeardownGpadl(NetDevice->Device, ++ NetDevice->ReceiveBufferGpadlHandle); ++ ++ // If we failed here, we might as well return and have a leak rather than continue and a bugchk ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to teardown receive buffer's gpadl"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ NetDevice->ReceiveBufferGpadlHandle = 0; ++ } ++ ++ if (NetDevice->ReceiveBuffer) ++ { ++ DPRINT_INFO(NETVSC, "Freeing up receive buffer..."); ++ ++ // Free up the receive buffer ++ PageFree(NetDevice->ReceiveBuffer, NetDevice->ReceiveBufferSize >> PAGE_SHIFT); ++ NetDevice->ReceiveBuffer = NULL; ++ } ++ ++ if (NetDevice->ReceiveSections) ++ { ++ MemFree(NetDevice->ReceiveSections); ++ NetDevice->ReceiveSections = NULL; ++ NetDevice->ReceiveSectionCount = 0; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++ ++ ++ ++static int ++NetVscDestroySendBuffer( ++ NETVSC_DEVICE *NetDevice ++ ) ++{ ++ NVSP_MESSAGE *revokePacket; ++ int ret=0; ++ ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // If we got a section count, it means we received a SendReceiveBufferComplete msg ++ // (ie sent NvspMessage1TypeSendReceiveBuffer msg) therefore, we need to send a revoke msg here ++ if (NetDevice->SendSectionSize) ++ { ++ DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeRevokeSendBuffer..."); ++ ++ // Send the revoke send buffer ++ revokePacket = &NetDevice->RevokePacket; ++ memset(revokePacket, 0, sizeof(NVSP_MESSAGE)); ++ ++ revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer; ++ revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID; ++ ++ ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device, ++ revokePacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)revokePacket, ++ VmbusPacketTypeDataInBand, ++ 0); ++ // If we failed here, we might as well return and have a leak rather than continue and a bugchk ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send revoke send buffer to netvsp"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ } ++ ++ // Teardown the gpadl on the vsp end ++ if (NetDevice->SendBufferGpadlHandle) ++ { ++ DPRINT_INFO(NETVSC, "Tearing down send buffer's GPADL..."); ++ ++ ret = NetDevice->Device->Driver->VmbusChannelInterface.TeardownGpadl(NetDevice->Device, ++ NetDevice->SendBufferGpadlHandle); ++ ++ // If we failed here, we might as well return and have a leak rather than continue and a bugchk ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to teardown send buffer's gpadl"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ NetDevice->SendBufferGpadlHandle = 0; ++ } ++ ++ if (NetDevice->SendBuffer) ++ { ++ DPRINT_INFO(NETVSC, "Freeing up send buffer..."); ++ ++ // Free up the receive buffer ++ PageFree(NetDevice->SendBuffer, NetDevice->SendBufferSize >> PAGE_SHIFT); ++ NetDevice->SendBuffer = NULL; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++ ++ ++static int ++NetVscConnectToVsp( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret=0; ++ NETVSC_DEVICE *netDevice; ++ NVSP_MESSAGE *initPacket; ++ int ndisVersion; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetOutboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ++ initPacket = &netDevice->ChannelInitPacket; ++ ++ memset(initPacket, 0, sizeof(NVSP_MESSAGE)); ++ initPacket->Header.MessageType = NvspMessageTypeInit; ++ initPacket->Messages.InitMessages.Init.MinProtocolVersion = NVSP_MIN_PROTOCOL_VERSION; ++ initPacket->Messages.InitMessages.Init.MaxProtocolVersion = NVSP_MAX_PROTOCOL_VERSION; ++ ++ DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit..."); ++ ++ // Send the init request ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ initPacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)initPacket, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ ++ if( ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(netDevice->ChannelInitEvent); ++ ++ // Now, check the response ++ //ASSERT(initPacket->Messages.InitMessages.InitComplete.MaximumMdlChainLength <= MAX_MULTIPAGE_BUFFER_COUNT); ++ DPRINT_INFO(NETVSC, "NvspMessageTypeInit status(%d) max mdl chain (%d)", ++ initPacket->Messages.InitMessages.InitComplete.Status, ++ initPacket->Messages.InitMessages.InitComplete.MaximumMdlChainLength); ++ ++ if (initPacket->Messages.InitMessages.InitComplete.Status != NvspStatusSuccess) ++ { ++ DPRINT_ERR(NETVSC, "unable to initialize with netvsp (status 0x%x)", initPacket->Messages.InitMessages.InitComplete.Status); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ if (initPacket->Messages.InitMessages.InitComplete.NegotiatedProtocolVersion != NVSP_PROTOCOL_VERSION_1) ++ { ++ DPRINT_ERR(NETVSC, "unable to initialize with netvsp (version expected 1 got %d)", ++ initPacket->Messages.InitMessages.InitComplete.NegotiatedProtocolVersion); ++ ret = -1; ++ goto Cleanup; ++ } ++ DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendNdisVersion..."); ++ ++ // Send the ndis version ++ memset(initPacket, 0, sizeof(NVSP_MESSAGE)); ++ ++ ndisVersion = 0x00050000; ++ ++ initPacket->Header.MessageType = NvspMessage1TypeSendNdisVersion; ++ initPacket->Messages.Version1Messages.SendNdisVersion.NdisMajorVersion = (ndisVersion & 0xFFFF0000) >> 16; ++ initPacket->Messages.Version1Messages.SendNdisVersion.NdisMinorVersion = ndisVersion & 0xFFFF; ++ ++ // Send the init request ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ initPacket, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)initPacket, ++ VmbusPacketTypeDataInBand, ++ 0); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to send NvspMessage1TypeSendNdisVersion"); ++ ret = -1; ++ goto Cleanup; ++ } ++ // ++ // BUGBUG - We have to wait for the above msg since the netvsp uses KMCL which acknowledges packet (completion packet) ++ // since our Vmbus always set the VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED flag ++ //WaitEventWait(NetVscChannel->ChannelInitEvent); ++ ++ // Post the big receive buffer to NetVSP ++ ret = NetVscInitializeReceiveBufferWithNetVsp(Device); ++ if (ret == 0) ++ { ++ ret = NetVscInitializeSendBufferWithNetVsp(Device); ++ } ++ ++Cleanup: ++ PutNetDevice(Device); ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++static void ++NetVscDisconnectFromVsp( ++ NETVSC_DEVICE *NetDevice ++ ) ++{ ++ DPRINT_ENTER(NETVSC); ++ ++ NetVscDestroyReceiveBuffer(NetDevice); ++ NetVscDestroySendBuffer(NetDevice); ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++ ++/*++ ++ ++Name: ++ NetVscOnDeviceAdd() ++ ++Description: ++ Callback when the device belonging to this driver is added ++ ++--*/ ++int ++NetVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ) ++{ ++ int ret=0; ++ int i; ++ ++ NETVSC_DEVICE* netDevice; ++ NETVSC_PACKET* packet; ++ LIST_ENTRY *entry; ++ ++ NETVSC_DRIVER_OBJECT *netDriver = (NETVSC_DRIVER_OBJECT*) Device->Driver;; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = AllocNetDevice(Device); ++ if (!netDevice) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ DPRINT_DBG(NETVSC, "netvsc channel object allocated - %p", netDevice); ++ ++ // Initialize the NetVSC channel extension ++ netDevice->ReceiveBufferSize = NETVSC_RECEIVE_BUFFER_SIZE; ++ netDevice->ReceivePacketListLock = SpinlockCreate(); ++ ++ netDevice->SendBufferSize = NETVSC_SEND_BUFFER_SIZE; ++ ++ INITIALIZE_LIST_HEAD(&netDevice->ReceivePacketList); ++ ++ for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) ++ { ++ packet = MemAllocZeroed(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER))); ++ if (!packet) ++ { ++ DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i); ++ break; ++ } ++ ++ INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &packet->ListEntry); ++ } ++ netDevice->ChannelInitEvent = WaitEventCreate(); ++ ++ // Open the channel ++ ret = Device->Driver->VmbusChannelInterface.Open(Device, ++ netDriver->RingBufferSize, ++ netDriver->RingBufferSize, ++ NULL, 0, ++ NetVscOnChannelCallback, ++ Device ++ ); ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to open channel: %d", ret); ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Channel is opened ++ DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***"); ++ ++ // Connect with the NetVsp ++ ret = NetVscConnectToVsp(Device); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret); ++ ret = -1; ++ goto Close; ++ } ++ ++ DPRINT_INFO(NETVSC, "*** NetVSC channel handshake result - %d ***", ret); ++ ++ DPRINT_EXIT(NETVSC); ++ return ret; ++ ++Close: ++ // Now, we can close the channel safely ++ Device->Driver->VmbusChannelInterface.Close(Device); ++ ++Cleanup: ++ ++ if (netDevice) ++ { ++ WaitEventClose(netDevice->ChannelInitEvent); ++ ++ while (!IsListEmpty(&netDevice->ReceivePacketList)) ++ { ++ entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList); ++ packet = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); ++ MemFree(packet); ++ } ++ ++ SpinlockClose(netDevice->ReceivePacketListLock); ++ ++ ReleaseOutboundNetDevice(Device); ++ ReleaseInboundNetDevice(Device); ++ ++ FreeNetDevice(netDevice); ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ NetVscOnDeviceRemove() ++ ++Description: ++ Callback when the root bus device is removed ++ ++--*/ ++int ++NetVscOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ NETVSC_DEVICE *netDevice; ++ NETVSC_PACKET *netvscPacket; ++ int ret=0; ++ LIST_ENTRY *entry; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ DPRINT_INFO(NETVSC, "Disabling outbound traffic on net device (%p)...", Device->Extension); ++ ++ // Stop outbound traffic ie sends and receives completions ++ netDevice = ReleaseOutboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "No net device present!!"); ++ return -1; ++ } ++ ++ // Wait for all send completions ++ while (netDevice->NumOutstandingSends) ++ { ++ DPRINT_INFO(NETVSC, "waiting for %d requests to complete...", netDevice->NumOutstandingSends); ++ ++ Sleep(100); ++ } ++ ++ DPRINT_INFO(NETVSC, "Disconnecting from netvsp..."); ++ ++ NetVscDisconnectFromVsp(netDevice); ++ ++ DPRINT_INFO(NETVSC, "Disabling inbound traffic on net device (%p)...", Device->Extension); ++ ++ // Stop inbound traffic ie receives and sends completions ++ netDevice = ReleaseInboundNetDevice(Device); ++ ++ // At this point, no one should be accessing netDevice except in here ++ DPRINT_INFO(NETVSC, "net device (%p) safe to remove", netDevice); ++ ++ // Now, we can close the channel safely ++ Device->Driver->VmbusChannelInterface.Close(Device); ++ ++ // Release all resources ++ while (!IsListEmpty(&netDevice->ReceivePacketList)) ++ { ++ entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList); ++ netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); ++ ++ MemFree(netvscPacket); ++ } ++ ++ SpinlockClose(netDevice->ReceivePacketListLock); ++ WaitEventClose(netDevice->ChannelInitEvent); ++ FreeNetDevice(netDevice); ++ ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++ ++ ++/*++ ++ ++Name: ++ NetVscOnCleanup() ++ ++Description: ++ Perform any cleanup when the driver is removed ++ ++--*/ ++void ++NetVscOnCleanup( ++ DRIVER_OBJECT *drv ++ ) ++{ ++ DPRINT_ENTER(NETVSC); ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++static void ++NetVscOnSendCompletion( ++ DEVICE_OBJECT *Device, ++ VMPACKET_DESCRIPTOR *Packet ++ ) ++{ ++ NETVSC_DEVICE* netDevice; ++ NVSP_MESSAGE *nvspPacket; ++ NETVSC_PACKET *nvscPacket; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetInboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return; ++ } ++ ++ nvspPacket = (NVSP_MESSAGE*)((ULONG_PTR)Packet + (Packet->DataOffset8 << 3)); ++ ++ DPRINT_DBG(NETVSC, "send completion packet - type %d", nvspPacket->Header.MessageType); ++ ++ if (nvspPacket->Header.MessageType == NvspMessageTypeInitComplete || ++ nvspPacket->Header.MessageType == NvspMessage1TypeSendReceiveBufferComplete || ++ nvspPacket->Header.MessageType == NvspMessage1TypeSendSendBufferComplete) ++ { ++ // Copy the response back ++ memcpy(&netDevice->ChannelInitPacket, nvspPacket, sizeof(NVSP_MESSAGE)); ++ WaitEventSet(netDevice->ChannelInitEvent); ++ } ++ else if (nvspPacket->Header.MessageType == NvspMessage1TypeSendRNDISPacketComplete) ++ { ++ // Get the send context ++ nvscPacket = (NETVSC_PACKET *)(ULONG_PTR)Packet->TransactionId; ++ ASSERT(nvscPacket); ++ ++ // Notify the layer above us ++ nvscPacket->Completion.Send.OnSendCompletion(nvscPacket->Completion.Send.SendCompletionContext); ++ ++ InterlockedDecrement(&netDevice->NumOutstandingSends); ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC, "Unknown send completion packet type - %d received!!", nvspPacket->Header.MessageType); ++ } ++ ++ PutNetDevice(Device); ++ DPRINT_EXIT(NETVSC); ++} ++ ++ ++ ++static int ++NetVscOnSend( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ) ++{ ++ NETVSC_DEVICE* netDevice; ++ int ret=0; ++ ++ NVSP_MESSAGE sendMessage; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetOutboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "net device (%p) shutting down...ignoring outbound packets", netDevice); ++ DPRINT_EXIT(NETVSC); ++ return -2; ++ } ++ ++ sendMessage.Header.MessageType = NvspMessage1TypeSendRNDISPacket; ++ if (Packet->IsDataPacket) ++ sendMessage.Messages.Version1Messages.SendRNDISPacket.ChannelType = 0;// 0 is RMC_DATA; ++ else ++ sendMessage.Messages.Version1Messages.SendRNDISPacket.ChannelType = 1;// 1 is RMC_CONTROL; ++ ++ // Not using send buffer section ++ sendMessage.Messages.Version1Messages.SendRNDISPacket.SendBufferSectionIndex = 0xFFFFFFFF; ++ sendMessage.Messages.Version1Messages.SendRNDISPacket.SendBufferSectionSize = 0; ++ ++ if (Packet->PageBufferCount) ++ { ++ ret = Device->Driver->VmbusChannelInterface.SendPacketPageBuffer(Device, ++ Packet->PageBuffers, ++ Packet->PageBufferCount, ++ &sendMessage, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)Packet); ++ } ++ else ++ { ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ &sendMessage, ++ sizeof(NVSP_MESSAGE), ++ (ULONG_PTR)Packet, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ ++ } ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC, "Unable to send packet %p ret %d", Packet, ret); ++ } ++ ++ InterlockedIncrement(&netDevice->NumOutstandingSends); ++ PutNetDevice(Device); ++ ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++ ++static void ++NetVscOnReceive( ++ DEVICE_OBJECT *Device, ++ VMPACKET_DESCRIPTOR *Packet ++ ) ++{ ++ NETVSC_DEVICE* netDevice; ++ VMTRANSFER_PAGE_PACKET_HEADER *vmxferpagePacket; ++ NVSP_MESSAGE *nvspPacket; ++ NETVSC_PACKET *netvscPacket=NULL; ++ LIST_ENTRY* entry; ++ ULONG_PTR start; ++ ULONG_PTR end, endVirtual; ++ //NETVSC_DRIVER_OBJECT *netvscDriver; ++ XFERPAGE_PACKET *xferpagePacket=NULL; ++ LIST_ENTRY listHead; ++ ++ int i=0, j=0; ++ int count=0, bytesRemain=0; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ netDevice = GetInboundNetDevice(Device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return; ++ } ++ ++ // All inbound packets other than send completion should be xfer page packet ++ if (Packet->Type != VmbusPacketTypeDataUsingTransferPages) ++ { ++ DPRINT_ERR(NETVSC, "Unknown packet type received - %d", Packet->Type); ++ PutNetDevice(Device); ++ return; ++ } ++ ++ nvspPacket = (NVSP_MESSAGE*)((ULONG_PTR)Packet + (Packet->DataOffset8 << 3)); ++ ++ // Make sure this is a valid nvsp packet ++ if (nvspPacket->Header.MessageType != NvspMessage1TypeSendRNDISPacket ) ++ { ++ DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d", nvspPacket->Header.MessageType); ++ PutNetDevice(Device); ++ return; ++ } ++ ++ DPRINT_DBG(NETVSC, "NVSP packet received - type %d", nvspPacket->Header.MessageType); ++ ++ vmxferpagePacket = (VMTRANSFER_PAGE_PACKET_HEADER*)Packet; ++ ++ if (vmxferpagePacket->TransferPageSetId != NETVSC_RECEIVE_BUFFER_ID) ++ { ++ DPRINT_ERR(NETVSC, "Invalid xfer page set id - expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID, vmxferpagePacket->TransferPageSetId); ++ PutNetDevice(Device); ++ return; ++ } ++ ++ DPRINT_DBG(NETVSC, "xfer page - range count %d", vmxferpagePacket->RangeCount); ++ ++ INITIALIZE_LIST_HEAD(&listHead); ++ ++ // Grab free packets (range count + 1) to represent this xfer page packet. +1 to represent ++ // the xfer page packet itself. We grab it here so that we know exactly how many we can fulfil ++ SpinlockAcquire(netDevice->ReceivePacketListLock); ++ while (!IsListEmpty(&netDevice->ReceivePacketList)) ++ { ++ entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList); ++ netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); ++ ++ INSERT_TAIL_LIST(&listHead, &netvscPacket->ListEntry); ++ ++ if (++count == vmxferpagePacket->RangeCount + 1) ++ break; ++ } ++ SpinlockRelease(netDevice->ReceivePacketListLock); ++ ++ // We need at least 2 netvsc pkts (1 to represent the xfer page and at least 1 for the range) ++ // i.e. we can handled some of the xfer page packet ranges... ++ if (count < 2) ++ { ++ DPRINT_ERR(NETVSC, "Got only %d netvsc pkt...needed %d pkts. Dropping this xfer page packet completely!", count, vmxferpagePacket->RangeCount+1); ++ ++ // Return it to the freelist ++ SpinlockAcquire(netDevice->ReceivePacketListLock); ++ for (i=count; i != 0; i--) ++ { ++ entry = REMOVE_HEAD_LIST(&listHead); ++ netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); ++ ++ INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &netvscPacket->ListEntry); ++ } ++ SpinlockRelease(netDevice->ReceivePacketListLock); ++ ++ NetVscSendReceiveCompletion(Device, vmxferpagePacket->d.TransactionId); ++ ++ PutNetDevice(Device); ++ return; ++ } ++ ++ // Remove the 1st packet to represent the xfer page packet itself ++ entry = REMOVE_HEAD_LIST(&listHead); ++ xferpagePacket = CONTAINING_RECORD(entry, XFERPAGE_PACKET, ListEntry); ++ xferpagePacket->Count = count - 1; // This is how much we can satisfy ++ ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= vmxferpagePacket->RangeCount); ++ ++ if (xferpagePacket->Count != vmxferpagePacket->RangeCount) ++ { ++ DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer page...got %d", vmxferpagePacket->RangeCount, xferpagePacket->Count); ++ } ++ ++ // Each range represents 1 RNDIS pkt that contains 1 ethernet frame ++ for (i=0; i < (count - 1); i++) ++ { ++ entry = REMOVE_HEAD_LIST(&listHead); ++ netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry); ++ ++ // Initialize the netvsc packet ++ netvscPacket->XferPagePacket = xferpagePacket; ++ netvscPacket->Completion.Recv.OnReceiveCompletion = NetVscOnReceiveCompletion; ++ netvscPacket->Completion.Recv.ReceiveCompletionContext = netvscPacket; ++ netvscPacket->Device = Device; ++ netvscPacket->Completion.Recv.ReceiveCompletionTid = vmxferpagePacket->d.TransactionId; // Save this so that we can send it back ++ ++ netvscPacket->TotalDataBufferLength = vmxferpagePacket->Ranges[i].ByteCount; ++ netvscPacket->PageBufferCount = 1; ++ ++ ASSERT(vmxferpagePacket->Ranges[i].ByteOffset + vmxferpagePacket->Ranges[i].ByteCount < netDevice->ReceiveBufferSize); ++ ++ netvscPacket->PageBuffers[0].Length = vmxferpagePacket->Ranges[i].ByteCount; ++ ++ start = GetPhysicalAddress((void*)((ULONG_PTR)netDevice->ReceiveBuffer + vmxferpagePacket->Ranges[i].ByteOffset)); ++ ++ netvscPacket->PageBuffers[0].Pfn = start >> PAGE_SHIFT; ++ endVirtual = (ULONG_PTR)netDevice->ReceiveBuffer ++ + vmxferpagePacket->Ranges[i].ByteOffset ++ + vmxferpagePacket->Ranges[i].ByteCount -1; ++ end = GetPhysicalAddress((void*)endVirtual); ++ ++ // Calculate the page relative offset ++ netvscPacket->PageBuffers[0].Offset = vmxferpagePacket->Ranges[i].ByteOffset & (PAGE_SIZE -1); ++ if ((end >> PAGE_SHIFT) != (start>>PAGE_SHIFT)) { ++ //Handle frame across multiple pages: ++ netvscPacket->PageBuffers[0].Length = ++ (netvscPacket->PageBuffers[0].Pfn <TotalDataBufferLength - netvscPacket->PageBuffers[0].Length; ++ for (j=1; jPageBuffers[j].Offset = 0; ++ if (bytesRemain <= PAGE_SIZE) { ++ netvscPacket->PageBuffers[j].Length = bytesRemain; ++ bytesRemain = 0; ++ } else { ++ netvscPacket->PageBuffers[j].Length = PAGE_SIZE; ++ bytesRemain -= PAGE_SIZE; ++ } ++ netvscPacket->PageBuffers[j].Pfn = ++ GetPhysicalAddress((void*)(endVirtual - bytesRemain)) >> PAGE_SHIFT; ++ netvscPacket->PageBufferCount++; ++ if (bytesRemain == 0) ++ break; ++ } ++ ASSERT(bytesRemain == 0); ++ } ++ DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => (pfn %llx, offset %u, len %u)", ++ i, ++ vmxferpagePacket->Ranges[i].ByteOffset, ++ vmxferpagePacket->Ranges[i].ByteCount, ++ netvscPacket->PageBuffers[0].Pfn, ++ netvscPacket->PageBuffers[0].Offset, ++ netvscPacket->PageBuffers[0].Length); ++ ++ // Pass it to the upper layer ++ ((NETVSC_DRIVER_OBJECT*)Device->Driver)->OnReceiveCallback(Device, netvscPacket); ++ ++ NetVscOnReceiveCompletion(netvscPacket->Completion.Recv.ReceiveCompletionContext); ++ } ++ ++ ASSERT(IsListEmpty(&listHead)); ++ ++ PutNetDevice(Device); ++ DPRINT_EXIT(NETVSC); ++} ++ ++ ++static void ++NetVscSendReceiveCompletion( ++ DEVICE_OBJECT *Device, ++ UINT64 TransactionId ++ ) ++{ ++ NVSP_MESSAGE recvcompMessage; ++ int retries=0; ++ int ret=0; ++ ++ DPRINT_DBG(NETVSC, "Sending receive completion pkt - %llx", TransactionId); ++ ++ recvcompMessage.Header.MessageType = NvspMessage1TypeSendRNDISPacketComplete; ++ ++ // FIXME: Pass in the status ++ recvcompMessage.Messages.Version1Messages.SendRNDISPacketComplete.Status = NvspStatusSuccess; ++ ++retry_send_cmplt: ++ // Send the completion ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ &recvcompMessage, ++ sizeof(NVSP_MESSAGE), ++ TransactionId, ++ VmbusPacketTypeCompletion, ++ 0); ++ if (ret == 0) // success ++ { ++ // no-op ++ } ++ else if (ret == -1) // no more room...wait a bit and attempt to retry 3 times ++ { ++ retries++; ++ DPRINT_ERR(NETVSC, "unable to send receive completion pkt (tid %llx)...retrying %d", TransactionId, retries); ++ ++ if (retries < 4) ++ { ++ Sleep(100); ++ goto retry_send_cmplt; ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC, "unable to send receive completion pkt (tid %llx)...give up retrying", TransactionId); ++ } ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC, "unable to send receive completion pkt - %llx", TransactionId); ++ } ++} ++ ++// ++// Send a receive completion packet to RNDIS device (ie NetVsp) ++// ++static void ++NetVscOnReceiveCompletion( ++ PVOID Context) ++{ ++ NETVSC_PACKET *packet = (NETVSC_PACKET*)Context; ++ DEVICE_OBJECT *device = (DEVICE_OBJECT*)packet->Device; ++ NETVSC_DEVICE* netDevice; ++ UINT64 transactionId=0; ++ BOOL fSendReceiveComp = FALSE; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(packet->XferPagePacket); ++ ++ // Even though it seems logical to do a GetOutboundNetDevice() here to send out receive completion, ++ // we are using GetInboundNetDevice() since we may have disable outbound traffic already. ++ netDevice = GetInboundNetDevice(device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "unable to get net device...device being destroyed?"); ++ DPRINT_EXIT(NETVSC); ++ return; ++ } ++ ++ // Overloading use of the lock. ++ SpinlockAcquire(netDevice->ReceivePacketListLock); ++ ++ ASSERT(packet->XferPagePacket->Count > 0); ++ packet->XferPagePacket->Count--; ++ ++ // Last one in the line that represent 1 xfer page packet. ++ // Return the xfer page packet itself to the freelist ++ if (packet->XferPagePacket->Count == 0) ++ { ++ fSendReceiveComp = TRUE; ++ transactionId = packet->Completion.Recv.ReceiveCompletionTid; ++ ++ INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &packet->XferPagePacket->ListEntry); ++ } ++ ++ // Put the packet back ++ INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &packet->ListEntry); ++ SpinlockRelease(netDevice->ReceivePacketListLock); ++ ++ // Send a receive completion for the xfer page packet ++ if (fSendReceiveComp) ++ { ++ NetVscSendReceiveCompletion(device, transactionId); ++ } ++ ++ PutNetDevice(device); ++ DPRINT_EXIT(NETVSC); ++} ++ ++ ++ ++void ++NetVscOnChannelCallback( ++ PVOID Context ++ ) ++{ ++ const int netPacketSize=2048; ++ int ret=0; ++ DEVICE_OBJECT *device=(DEVICE_OBJECT*)Context; ++ NETVSC_DEVICE *netDevice; ++ ++ UINT32 bytesRecvd; ++ UINT64 requestId; ++ UCHAR packet[netPacketSize]; ++ VMPACKET_DESCRIPTOR *desc; ++ UCHAR *buffer=packet; ++ int bufferlen=netPacketSize; ++ ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(device); ++ ++ netDevice = GetInboundNetDevice(device); ++ if (!netDevice) ++ { ++ DPRINT_ERR(NETVSC, "net device (%p) shutting down...ignoring inbound packets", netDevice); ++ DPRINT_EXIT(NETVSC); ++ return; ++ } ++ ++ do ++ { ++ ret = device->Driver->VmbusChannelInterface.RecvPacketRaw(device, ++ buffer, ++ bufferlen, ++ &bytesRecvd, ++ &requestId); ++ ++ if (ret == 0) ++ { ++ if (bytesRecvd > 0) ++ { ++ DPRINT_DBG(NETVSC, "receive %d bytes, tid %llx", bytesRecvd, requestId); ++ ++ desc = (VMPACKET_DESCRIPTOR*)buffer; ++ switch (desc->Type) ++ { ++ case VmbusPacketTypeCompletion: ++ NetVscOnSendCompletion(device, desc); ++ break; ++ ++ case VmbusPacketTypeDataUsingTransferPages: ++ NetVscOnReceive(device, desc); ++ break; ++ ++ default: ++ DPRINT_ERR(NETVSC, "unhandled packet type %d, tid %llx len %d\n", desc->Type, requestId, bytesRecvd); ++ break; ++ } ++ ++ // reset ++ if (bufferlen > netPacketSize) ++ { ++ MemFree(buffer); ++ ++ buffer = packet; ++ bufferlen = netPacketSize; ++ } ++ } ++ else ++ { ++ //DPRINT_DBG(NETVSC, "nothing else to read..."); ++ ++ // reset ++ if (bufferlen > netPacketSize) ++ { ++ MemFree(buffer); ++ ++ buffer = packet; ++ bufferlen = netPacketSize; ++ } ++ ++ break; ++ } ++ } ++ else if (ret == -2) // Handle large packet ++ { ++ buffer = MemAllocAtomic(bytesRecvd); ++ if (buffer == NULL) ++ { ++ // Try again next time around ++ DPRINT_ERR(NETVSC, "unable to allocate buffer of size (%d)!!", bytesRecvd); ++ break; ++ } ++ ++ bufferlen = bytesRecvd; ++ } ++ else ++ { ++ ASSERT(0); ++ } ++ } while (1); ++ ++ PutNetDevice(device); ++ DPRINT_EXIT(NETVSC); ++ return; ++} +--- /dev/null ++++ b/drivers/staging/hv/netvsc_drv.c +@@ -0,0 +1,720 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#include ++#else ++#include ++#endif ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "logging.h" ++#include "vmbus.h" ++ ++#include "NetVscApi.h" ++ ++MODULE_LICENSE("GPL"); ++ ++// ++// Static decl ++// ++static int netvsc_probe(struct device *device); ++static int netvsc_remove(struct device *device); ++static int netvsc_open(struct net_device *net); ++static void netvsc_xmit_completion(void *context); ++static int netvsc_start_xmit (struct sk_buff *skb, struct net_device *net); ++static int netvsc_recv_callback(DEVICE_OBJECT *device_obj, NETVSC_PACKET* Packet); ++static int netvsc_close(struct net_device *net); ++static struct net_device_stats *netvsc_get_stats(struct net_device *net); ++static void netvsc_linkstatus_callback(DEVICE_OBJECT *device_obj, unsigned int status); ++ ++// ++// Data types ++// ++struct net_device_context { ++ struct device_context *device_ctx; // point back to our device context ++ struct net_device_stats stats; ++}; ++ ++struct netvsc_driver_context { ++ // !! These must be the first 2 fields !! ++ struct driver_context drv_ctx; ++ NETVSC_DRIVER_OBJECT drv_obj; ++}; ++ ++// ++// Globals ++// ++ ++static int netvsc_ringbuffer_size = NETVSC_DEVICE_RING_BUFFER_SIZE; ++ ++// The one and only one ++static struct netvsc_driver_context g_netvsc_drv; ++ ++// ++// Routines ++// ++ ++/*++ ++ ++Name: netvsc_drv_init() ++ ++Desc: NetVsc driver initialization ++ ++--*/ ++int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init) ++{ ++ int ret=0; ++ NETVSC_DRIVER_OBJECT *net_drv_obj=&g_netvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ vmbus_get_interface(&net_drv_obj->Base.VmbusChannelInterface); ++ ++ net_drv_obj->RingBufferSize = netvsc_ringbuffer_size; ++ net_drv_obj->OnReceiveCallback = netvsc_recv_callback; ++ net_drv_obj->OnLinkStatusChanged = netvsc_linkstatus_callback; ++ ++ // Callback to client driver to complete the initialization ++ pfn_drv_init(&net_drv_obj->Base); ++ ++ drv_ctx->driver.name = net_drv_obj->Base.name; ++ memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(GUID)); ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++ drv_ctx->driver.probe = netvsc_probe; ++ drv_ctx->driver.remove = netvsc_remove; ++#else ++ drv_ctx->probe = netvsc_probe; ++ drv_ctx->remove = netvsc_remove; ++#endif ++ ++ // The driver belongs to vmbus ++ vmbus_child_driver_register(drv_ctx); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: netvsc_get_stats() ++ ++Desc: Get the network stats ++ ++--*/ ++static struct net_device_stats *netvsc_get_stats(struct net_device *net) ++{ ++ struct net_device_context *net_device_ctx = netdev_priv(net); ++ ++ return &net_device_ctx->stats; ++} ++ ++/*++ ++ ++Name: netvsc_set_multicast_list() ++ ++Desc: Set the multicast list ++ ++Remark: No-op here ++--*/ ++static void netvsc_set_multicast_list(UNUSED_VAR(struct net_device *net)) ++{ ++} ++ ++ ++/*++ ++ ++Name: netvsc_probe() ++ ++Desc: Add the specified new device to this driver ++ ++--*/ ++static int netvsc_probe(struct device *device) ++{ ++ int ret=0; ++ ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; ++ NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ DEVICE_OBJECT *device_obj = &device_ctx->device_obj; ++ ++ struct net_device *net = NULL; ++ struct net_device_context *net_device_ctx; ++ NETVSC_DEVICE_INFO device_info; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ if (!net_drv_obj->Base.OnDeviceAdd) ++ { ++ return -1; ++ } ++ ++ net = alloc_netdev(sizeof(struct net_device_context), "seth%d", ether_setup); ++ //net = alloc_etherdev(sizeof(struct net_device_context)); ++ if (!net) ++ { ++ return -1; ++ } ++ ++ // Set initial state ++ netif_carrier_off(net); ++ netif_stop_queue(net); ++ ++ net_device_ctx = netdev_priv(net); ++ net_device_ctx->device_ctx = device_ctx; ++ device->driver_data = net; ++ ++ // Notify the netvsc driver of the new device ++ ret = net_drv_obj->Base.OnDeviceAdd(device_obj, (void*)&device_info); ++ if (ret != 0) ++ { ++ free_netdev(net); ++ device->driver_data = NULL; ++ ++ DPRINT_ERR(NETVSC_DRV, "unable to add netvsc device (ret %d)", ret); ++ return ret; ++ } ++ ++ // If carrier is still off ie we did not get a link status callback, update it if necessary ++ // FIXME: We should use a atomic or test/set instead to avoid getting out of sync with the device's link status ++ if (!netif_carrier_ok(net)) ++ { ++ if (!device_info.LinkState) ++ { ++ netif_carrier_on(net); ++ } ++ } ++ ++ memcpy(net->dev_addr, device_info.MacAddr, ETH_ALEN); ++ ++ net->open = netvsc_open; ++ net->hard_start_xmit = netvsc_start_xmit; ++ net->stop = netvsc_close; ++ net->get_stats = netvsc_get_stats; ++ net->set_multicast_list = netvsc_set_multicast_list; ++ ++#if !defined(KERNEL_2_6_27) ++ SET_MODULE_OWNER(net); ++#endif ++ SET_NETDEV_DEV(net, device); ++ ++ ret = register_netdev(net); ++ if (ret != 0) ++ { ++ // Remove the device and release the resource ++ net_drv_obj->Base.OnDeviceRemove(device_obj); ++ free_netdev(net); ++ } ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return ret; ++} ++ ++static int netvsc_remove(struct device *device) ++{ ++ int ret=0; ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; ++ NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ struct net_device *net = (struct net_device *)device_ctx->device.driver_data; ++ DEVICE_OBJECT *device_obj = &device_ctx->device_obj; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ if (net == NULL) ++ { ++ DPRINT_INFO(NETVSC, "no net device to remove"); ++ DPRINT_EXIT(NETVSC_DRV); ++ return 0; ++ } ++ ++ if (!net_drv_obj->Base.OnDeviceRemove) ++ { ++ DPRINT_EXIT(NETVSC_DRV); ++ return -1; ++ } ++ ++ // Stop outbound asap ++ netif_stop_queue(net); ++ //netif_carrier_off(net); ++ ++ unregister_netdev(net); ++ ++ // Call to the vsc driver to let it know that the device is being removed ++ ret = net_drv_obj->Base.OnDeviceRemove(device_obj); ++ if (ret != 0) ++ { ++ // TODO: ++ DPRINT_ERR(NETVSC, "unable to remove vsc device (ret %d)", ret); ++ } ++ ++ free_netdev(net); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: netvsc_open() ++ ++Desc: Open the specified interface device ++ ++--*/ ++static int netvsc_open(struct net_device *net) ++{ ++ int ret=0; ++ struct net_device_context *net_device_ctx = netdev_priv(net); ++ struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver); ++ struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; ++ NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj; ++ ++ DEVICE_OBJECT *device_obj = &net_device_ctx->device_ctx->device_obj; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ if (netif_carrier_ok(net)) ++ { ++ memset(&net_device_ctx->stats, 0 , sizeof(struct net_device_stats)); ++ ++ // Open up the device ++ ret = net_drv_obj->OnOpen(device_obj); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC_DRV, "unable to open device (ret %d).", ret); ++ return ret; ++ } ++ ++ netif_start_queue(net); ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC_DRV, "unable to open device...link is down."); ++ } ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ return ret; ++} ++ ++/*++ ++ ++Name: netvsc_close() ++ ++Desc: Close the specified interface device ++ ++--*/ ++static int netvsc_close(struct net_device *net) ++{ ++ int ret=0; ++ struct net_device_context *net_device_ctx = netdev_priv(net); ++ struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver); ++ struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; ++ NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj; ++ ++ DEVICE_OBJECT *device_obj = &net_device_ctx->device_ctx->device_obj; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ netif_stop_queue(net); ++ ++ ret = net_drv_obj->OnClose(device_obj); ++ if (ret != 0) ++ { ++ DPRINT_ERR(NETVSC_DRV, "unable to close device (ret %d).", ret); ++ } ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: netvsc_xmit_completion() ++ ++Desc: Send completion processing ++ ++--*/ ++static void netvsc_xmit_completion(void *context) ++{ ++ NETVSC_PACKET *packet = (NETVSC_PACKET *)context; ++ struct sk_buff *skb = (struct sk_buff *)(ULONG_PTR)packet->Completion.Send.SendCompletionTid; ++ struct net_device* net; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ kfree(packet); ++ ++ if (skb) ++ { ++ net = skb->dev; ++ ++ dev_kfree_skb_any(skb); ++ ++ if (netif_queue_stopped(net)) ++ { ++ DPRINT_INFO(NETVSC_DRV, "net device (%p) waking up...", net); ++ ++ netif_wake_queue(net); ++ } ++ } ++ ++ DPRINT_EXIT(NETVSC_DRV); ++} ++ ++/*++ ++ ++Name: netvsc_start_xmit() ++ ++Desc: Start a send ++ ++--*/ ++static int netvsc_start_xmit (struct sk_buff *skb, struct net_device *net) ++{ ++ int ret=0; ++ struct net_device_context *net_device_ctx = netdev_priv(net); ++ struct driver_context *driver_ctx = driver_to_driver_context(net_device_ctx->device_ctx->device.driver); ++ struct netvsc_driver_context *net_drv_ctx = (struct netvsc_driver_context*)driver_ctx; ++ NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj; ++ ++ int i=0; ++ NETVSC_PACKET* packet; ++ int num_frags; ++ int retries=0; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ // Support only 1 chain of frags ++ ASSERT(skb_shinfo(skb)->frag_list == NULL); ++ ASSERT(skb->dev == net); ++ ++ DPRINT_DBG(NETVSC_DRV, "xmit packet - len %d data_len %d", skb->len, skb->data_len); ++ ++ // Add 1 for skb->data and any additional ones requested ++ num_frags = skb_shinfo(skb)->nr_frags + 1 + net_drv_obj->AdditionalRequestPageBufferCount; ++ ++ // Allocate a netvsc packet based on # of frags. ++ packet = kzalloc(sizeof(NETVSC_PACKET) + (num_frags * sizeof(PAGE_BUFFER)) + net_drv_obj->RequestExtSize, GFP_ATOMIC); ++ if (!packet) ++ { ++ DPRINT_ERR(NETVSC_DRV, "unable to allocate NETVSC_PACKET"); ++ return -1; ++ } ++ ++ packet->Extension = (void*)(unsigned long)packet + sizeof(NETVSC_PACKET) + (num_frags * sizeof(PAGE_BUFFER)) ; ++ ++ // Setup the rndis header ++ packet->PageBufferCount = num_frags; ++ ++ // TODO: Flush all write buffers/ memory fence ??? ++ //wmb(); ++ ++ // Initialize it from the skb ++ ASSERT(skb->data); ++ packet->TotalDataBufferLength = skb->len; ++ ++ // Start filling in the page buffers starting at AdditionalRequestPageBufferCount offset ++ packet->PageBuffers[net_drv_obj->AdditionalRequestPageBufferCount].Pfn = virt_to_phys(skb->data) >> PAGE_SHIFT; ++ packet->PageBuffers[net_drv_obj->AdditionalRequestPageBufferCount].Offset = (unsigned long)skb->data & (PAGE_SIZE -1); ++ packet->PageBuffers[net_drv_obj->AdditionalRequestPageBufferCount].Length = skb->len - skb->data_len; ++ ++ ASSERT((skb->len - skb->data_len) <= PAGE_SIZE); ++ ++ for (i=net_drv_obj->AdditionalRequestPageBufferCount+1; iPageBuffers[i].Pfn = page_to_pfn(skb_shinfo(skb)->frags[i-(net_drv_obj->AdditionalRequestPageBufferCount+1)].page); ++ packet->PageBuffers[i].Offset = skb_shinfo(skb)->frags[i-(net_drv_obj->AdditionalRequestPageBufferCount+1)].page_offset; ++ packet->PageBuffers[i].Length = skb_shinfo(skb)->frags[i-(net_drv_obj->AdditionalRequestPageBufferCount+1)].size; ++ } ++ ++ // Set the completion routine ++ packet->Completion.Send.OnSendCompletion = netvsc_xmit_completion; ++ packet->Completion.Send.SendCompletionContext = packet; ++ packet->Completion.Send.SendCompletionTid = (ULONG_PTR)skb; ++ ++retry_send: ++ ret = net_drv_obj->OnSend(&net_device_ctx->device_ctx->device_obj, packet); ++ ++ if (ret == 0) ++ { ++#ifdef KERNEL_2_6_5 ++#define NETDEV_TX_OK 0 ++#define NETDEV_TX_BUSY 0 ++#endif ++ ret = NETDEV_TX_OK; ++ net_device_ctx->stats.tx_bytes += skb->len; ++ net_device_ctx->stats.tx_packets++; ++ } ++ else ++ { ++ retries++; ++ if (retries < 4) ++ { ++ DPRINT_ERR(NETVSC_DRV, "unable to send...retrying %d...", retries); ++ udelay(100); ++ goto retry_send; ++ } ++ ++ // no more room or we are shutting down ++ DPRINT_ERR(NETVSC_DRV, "unable to send (%d)...marking net device (%p) busy", ret, net); ++ DPRINT_INFO(NETVSC_DRV, "net device (%p) stopping", net); ++ ++ ret = NETDEV_TX_BUSY; ++ net_device_ctx->stats.tx_dropped++; ++ ++ netif_stop_queue(net); ++ ++ // Null it since the caller will free it instead of the completion routine ++ packet->Completion.Send.SendCompletionTid = 0; ++ ++ // Release the resources since we will not get any send completion ++ netvsc_xmit_completion((void*)packet); ++ } ++ ++ DPRINT_DBG(NETVSC_DRV, "# of xmits %lu total size %lu", net_device_ctx->stats.tx_packets, net_device_ctx->stats.tx_bytes); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: netvsc_linkstatus_callback() ++ ++Desc: Link up/down notification ++ ++--*/ ++static void netvsc_linkstatus_callback(DEVICE_OBJECT *device_obj, unsigned int status) ++{ ++ struct device_context* device_ctx = to_device_context(device_obj); ++ struct net_device* net = (struct net_device *)device_ctx->device.driver_data; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ if (!net) ++ { ++ DPRINT_ERR(NETVSC_DRV, "got link status but net device not initialized yet"); ++ return; ++ } ++ ++ if (status == 1) ++ { ++ netif_carrier_on(net); ++ netif_wake_queue(net); ++ } ++ else ++ { ++ netif_carrier_off(net); ++ netif_stop_queue(net); ++ } ++ DPRINT_EXIT(NETVSC_DRV); ++} ++ ++ ++/*++ ++ ++Name: netvsc_recv_callback() ++ ++Desc: Callback when we receive a packet from the "wire" on the specify device ++ ++--*/ ++static int netvsc_recv_callback(DEVICE_OBJECT *device_obj, NETVSC_PACKET* packet) ++{ ++ int ret=0; ++ struct device_context *device_ctx = to_device_context(device_obj); ++ struct net_device *net = (struct net_device *)device_ctx->device.driver_data; ++ struct net_device_context *net_device_ctx; ++ ++ struct sk_buff *skb; ++ void *data; ++ int i=0; ++ unsigned long flags; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ if (!net) ++ { ++ DPRINT_ERR(NETVSC_DRV, "got receive callback but net device not initialized yet"); ++ return 0; ++ } ++ ++ net_device_ctx = netdev_priv(net); ++ ++ // Allocate a skb - TODO preallocate this ++ //skb = alloc_skb(packet->TotalDataBufferLength, GFP_ATOMIC); ++ skb = dev_alloc_skb(packet->TotalDataBufferLength + 2); // Pad 2-bytes to align IP header to 16 bytes ++ ASSERT(skb); ++ skb_reserve(skb, 2); ++ skb->dev = net; ++ ++ // for kmap_atomic ++ local_irq_save(flags); ++ ++ // Copy to skb. This copy is needed here since the memory pointed by NETVSC_PACKET ++ // cannot be deallocated ++ for (i=0; iPageBufferCount; i++) ++ { ++ data = kmap_atomic(pfn_to_page(packet->PageBuffers[i].Pfn), KM_IRQ1); ++ data = (void*)(unsigned long)data + packet->PageBuffers[i].Offset; ++ ++ memcpy(skb_put(skb, packet->PageBuffers[i].Length), data, packet->PageBuffers[i].Length); ++ ++ kunmap_atomic((void*)((unsigned long)data - packet->PageBuffers[i].Offset), KM_IRQ1); ++ } ++ ++ local_irq_restore(flags); ++ ++ skb->protocol = eth_type_trans(skb, net); ++ ++ skb->ip_summed = CHECKSUM_NONE; ++ ++ // Pass the skb back up. Network stack will deallocate the skb when it is done ++ ret = netif_rx(skb); ++ ++ switch (ret) ++ { ++ case NET_RX_DROP: ++ net_device_ctx->stats.rx_dropped++; ++ break; ++ default: ++ net_device_ctx->stats.rx_packets++; ++ net_device_ctx->stats.rx_bytes += skb->len; ++ break; ++ ++ } ++ DPRINT_DBG(NETVSC_DRV, "# of recvs %lu total size %lu", net_device_ctx->stats.rx_packets, net_device_ctx->stats.rx_bytes); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return 0; ++} ++ ++static int netvsc_drv_exit_cb(struct device *dev, void *data) ++{ ++ struct device **curr = (struct device **)data; ++ *curr = dev; ++ return 1; // stop iterating ++} ++ ++/*++ ++ ++Name: netvsc_drv_exit() ++ ++Desc: ++ ++--*/ ++void netvsc_drv_exit(void) ++{ ++ NETVSC_DRIVER_OBJECT *netvsc_drv_obj=&g_netvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx; ++ ++ struct device *current_dev=NULL; ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#define driver_for_each_device(drv, start, data, fn) \ ++ struct list_head *ptr, *n; \ ++ list_for_each_safe(ptr, n, &((drv)->devices)) {\ ++ struct device *curr_dev;\ ++ curr_dev = list_entry(ptr, struct device, driver_list);\ ++ fn(curr_dev, data);\ ++ } ++#endif ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ while (1) ++ { ++ current_dev = NULL; ++ ++ // Get the device ++ driver_for_each_device(&drv_ctx->driver, NULL, (void*)¤t_dev, netvsc_drv_exit_cb); ++ ++ if (current_dev == NULL) ++ break; ++ ++ // Initiate removal from the top-down ++ DPRINT_INFO(NETVSC_DRV, "unregistering device (%p)...", current_dev); ++ ++ device_unregister(current_dev); ++ } ++ ++ if (netvsc_drv_obj->Base.OnCleanup) ++ netvsc_drv_obj->Base.OnCleanup(&netvsc_drv_obj->Base); ++ ++ vmbus_child_driver_unregister(drv_ctx); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return; ++} ++ ++static int __init netvsc_init(void) ++{ ++ int ret; ++ ++ DPRINT_ENTER(NETVSC_DRV); ++ DPRINT_INFO(NETVSC_DRV, "Netvsc initializing...."); ++ ++ ret = netvsc_drv_init(NetVscInitialize); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++ ++ return ret; ++} ++ ++static void __exit netvsc_exit(void) ++{ ++ DPRINT_ENTER(NETVSC_DRV); ++ ++ netvsc_drv_exit(); ++ ++ DPRINT_EXIT(NETVSC_DRV); ++} ++ ++module_param(netvsc_ringbuffer_size, int, S_IRUGO); ++ ++module_init(netvsc_init); ++module_exit(netvsc_exit); +--- /dev/null ++++ b/drivers/staging/hv/NetVsc.h +@@ -0,0 +1,91 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _NETVSC_H_ ++#define _NETVSC_H_ ++ ++#include "VmbusPacketFormat.h" ++#include "nvspprotocol.h" ++ ++#include "List.h" ++ ++#include "NetVscApi.h" ++// ++// #defines ++// ++//#define NVSC_MIN_PROTOCOL_VERSION 1 ++//#define NVSC_MAX_PROTOCOL_VERSION 1 ++ ++#define NETVSC_SEND_BUFFER_SIZE 64*1024 // 64K ++#define NETVSC_SEND_BUFFER_ID 0xface ++ ++ ++#define NETVSC_RECEIVE_BUFFER_SIZE 1024*1024 // 1MB ++ ++#define NETVSC_RECEIVE_BUFFER_ID 0xcafe ++ ++#define NETVSC_RECEIVE_SG_COUNT 1 ++ ++// Preallocated receive packets ++#define NETVSC_RECEIVE_PACKETLIST_COUNT 256 ++ ++// ++// Data types ++// ++ ++// Per netvsc channel-specific ++typedef struct _NETVSC_DEVICE { ++ DEVICE_OBJECT *Device; ++ ++ int RefCount; ++ ++ int NumOutstandingSends; ++ // List of free preallocated NETVSC_PACKET to represent receive packet ++ LIST_ENTRY ReceivePacketList; ++ HANDLE ReceivePacketListLock; ++ ++ // Send buffer allocated by us but manages by NetVSP ++ PVOID SendBuffer; ++ UINT32 SendBufferSize; ++ UINT32 SendBufferGpadlHandle; ++ UINT32 SendSectionSize; ++ ++ // Receive buffer allocated by us but manages by NetVSP ++ PVOID ReceiveBuffer; ++ UINT32 ReceiveBufferSize; ++ UINT32 ReceiveBufferGpadlHandle; ++ UINT32 ReceiveSectionCount; ++ PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections; ++ ++ // Used for NetVSP initialization protocol ++ HANDLE ChannelInitEvent; ++ NVSP_MESSAGE ChannelInitPacket; ++ ++ NVSP_MESSAGE RevokePacket; ++ //UCHAR HwMacAddr[HW_MACADDR_LEN]; ++ ++ // Holds rndis device info ++ void *Extension; ++} NETVSC_DEVICE; ++ ++#endif // _NETVSC_H_ +--- /dev/null ++++ b/drivers/staging/hv/RndisFilter.c +@@ -0,0 +1,1162 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++ ++#include "NetVscApi.h" ++#include "RndisFilter.h" ++ ++// ++// Data types ++// ++ ++typedef struct _RNDIS_FILTER_DRIVER_OBJECT { ++ // The original driver ++ NETVSC_DRIVER_OBJECT InnerDriver; ++ ++} RNDIS_FILTER_DRIVER_OBJECT; ++ ++typedef enum { ++ RNDIS_DEV_UNINITIALIZED = 0, ++ RNDIS_DEV_INITIALIZING, ++ RNDIS_DEV_INITIALIZED, ++ RNDIS_DEV_DATAINITIALIZED, ++} RNDIS_DEVICE_STATE; ++ ++typedef struct _RNDIS_DEVICE { ++ NETVSC_DEVICE *NetDevice; ++ ++ RNDIS_DEVICE_STATE State; ++ UINT32 LinkStatus; ++ UINT32 NewRequestId; ++ ++ HANDLE RequestLock; ++ LIST_ENTRY RequestList; ++ ++ UCHAR HwMacAddr[HW_MACADDR_LEN]; ++} RNDIS_DEVICE; ++ ++ ++typedef struct _RNDIS_REQUEST { ++ LIST_ENTRY ListEntry; ++ HANDLE WaitEvent; ++ ++ // FIXME: We assumed a fixed size response here. If we do ever need to handle a bigger response, ++ // we can either define a max response message or add a response buffer variable above this field ++ RNDIS_MESSAGE ResponseMessage; ++ ++ // Simplify allocation by having a netvsc packet inline ++ NETVSC_PACKET Packet; ++ PAGE_BUFFER Buffer; ++ // FIXME: We assumed a fixed size request here. ++ RNDIS_MESSAGE RequestMessage; ++} RNDIS_REQUEST; ++ ++ ++typedef struct _RNDIS_FILTER_PACKET { ++ void *CompletionContext; ++ PFN_ON_SENDRECVCOMPLETION OnCompletion; ++ ++ RNDIS_MESSAGE Message; ++} RNDIS_FILTER_PACKET; ++ ++// ++// Internal routines ++// ++static int ++RndisFilterSendRequest( ++ RNDIS_DEVICE *Device, ++ RNDIS_REQUEST *Request ++ ); ++ ++static void ++RndisFilterReceiveResponse( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Response ++ ); ++ ++static void ++RndisFilterReceiveIndicateStatus( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Response ++ ); ++ ++static void ++RndisFilterReceiveData( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Message, ++ NETVSC_PACKET *Packet ++ ); ++ ++static int ++RndisFilterOnReceive( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ); ++ ++static int ++RndisFilterQueryDevice( ++ RNDIS_DEVICE *Device, ++ UINT32 Oid, ++ VOID *Result, ++ UINT32 *ResultSize ++ ); ++ ++static inline int ++RndisFilterQueryDeviceMac( ++ RNDIS_DEVICE *Device ++ ); ++ ++static inline int ++RndisFilterQueryDeviceLinkStatus( ++ RNDIS_DEVICE *Device ++ ); ++ ++static int ++RndisFilterSetPacketFilter( ++ RNDIS_DEVICE *Device, ++ UINT32 NewFilter ++ ); ++ ++static int ++RndisFilterInitDevice( ++ RNDIS_DEVICE *Device ++ ); ++ ++static int ++RndisFilterOpenDevice( ++ RNDIS_DEVICE *Device ++ ); ++ ++static int ++RndisFilterCloseDevice( ++ RNDIS_DEVICE *Device ++ ); ++ ++static int ++RndisFilterOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ); ++ ++static int ++RndisFilterOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ); ++ ++static void ++RndisFilterOnCleanup( ++ DRIVER_OBJECT *Driver ++ ); ++ ++static int ++RndisFilterOnOpen( ++ DEVICE_OBJECT *Device ++ ); ++ ++static int ++RndisFilterOnClose( ++ DEVICE_OBJECT *Device ++ ); ++ ++static int ++RndisFilterOnSend( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ); ++ ++static void ++RndisFilterOnSendCompletion( ++ void *Context ++ ); ++ ++static void ++RndisFilterOnSendRequestCompletion( ++ void *Context ++ ); ++ ++// ++// Global var ++// ++ ++// The one and only ++RNDIS_FILTER_DRIVER_OBJECT gRndisFilter; ++ ++static inline RNDIS_DEVICE* GetRndisDevice(void) ++{ ++ RNDIS_DEVICE *device; ++ ++ device = MemAllocZeroed(sizeof(RNDIS_DEVICE)); ++ if (!device) ++ { ++ return NULL; ++ } ++ ++ device->RequestLock = SpinlockCreate(); ++ if (!device->RequestLock) ++ { ++ MemFree(device); ++ return NULL; ++ } ++ ++ INITIALIZE_LIST_HEAD(&device->RequestList); ++ ++ device->State = RNDIS_DEV_UNINITIALIZED; ++ ++ return device; ++} ++ ++static inline void PutRndisDevice(RNDIS_DEVICE *Device) ++{ ++ SpinlockClose(Device->RequestLock); ++ MemFree(Device); ++} ++ ++static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, UINT32 MessageType, UINT32 MessageLength) ++{ ++ RNDIS_REQUEST *request; ++ RNDIS_MESSAGE *rndisMessage; ++ RNDIS_SET_REQUEST *set; ++ ++ request = MemAllocZeroed(sizeof(RNDIS_REQUEST)); ++ if (!request) ++ { ++ return NULL; ++ } ++ ++ request->WaitEvent = WaitEventCreate(); ++ if (!request->WaitEvent) ++ { ++ MemFree(request); ++ return NULL; ++ } ++ ++ rndisMessage = &request->RequestMessage; ++ rndisMessage->NdisMessageType = MessageType; ++ rndisMessage->MessageLength = MessageLength; ++ ++ // Set the request id. This field is always after the rndis header for request/response packet types so ++ // we just used the SetRequest as a template ++ set = &rndisMessage->Message.SetRequest; ++ set->RequestId = InterlockedIncrement((int*)&Device->NewRequestId); ++ ++ // Add to the request list ++ SpinlockAcquire(Device->RequestLock); ++ INSERT_TAIL_LIST(&Device->RequestList, &request->ListEntry); ++ SpinlockRelease(Device->RequestLock); ++ ++ return request; ++} ++ ++static inline void PutRndisRequest(RNDIS_DEVICE *Device, RNDIS_REQUEST *Request) ++{ ++ SpinlockAcquire(Device->RequestLock); ++ REMOVE_ENTRY_LIST(&Request->ListEntry); ++ SpinlockRelease(Device->RequestLock); ++ ++ WaitEventClose(Request->WaitEvent); ++ MemFree(Request); ++} ++ ++static inline void DumpRndisMessage(RNDIS_MESSAGE *RndisMessage) ++{ ++ switch (RndisMessage->NdisMessageType) ++ { ++ case REMOTE_NDIS_PACKET_MSG: ++ DPRINT_DBG(NETVSC, "REMOTE_NDIS_PACKET_MSG (len %u, data offset %u data len %u, # oob %u, oob offset %u, oob len %u, pkt offset %u, pkt len %u", ++ RndisMessage->MessageLength, ++ RndisMessage->Message.Packet.DataOffset, ++ RndisMessage->Message.Packet.DataLength, ++ RndisMessage->Message.Packet.NumOOBDataElements, ++ RndisMessage->Message.Packet.OOBDataOffset, ++ RndisMessage->Message.Packet.OOBDataLength, ++ RndisMessage->Message.Packet.PerPacketInfoOffset, ++ RndisMessage->Message.Packet.PerPacketInfoLength); ++ break; ++ ++ case REMOTE_NDIS_INITIALIZE_CMPLT: ++ DPRINT_DBG(NETVSC, "REMOTE_NDIS_INITIALIZE_CMPLT (len %u, id 0x%x, status 0x%x, major %d, minor %d, device flags %d, max xfer size 0x%x, max pkts %u, pkt aligned %u)", ++ RndisMessage->MessageLength, ++ RndisMessage->Message.InitializeComplete.RequestId, ++ RndisMessage->Message.InitializeComplete.Status, ++ RndisMessage->Message.InitializeComplete.MajorVersion, ++ RndisMessage->Message.InitializeComplete.MinorVersion, ++ RndisMessage->Message.InitializeComplete.DeviceFlags, ++ RndisMessage->Message.InitializeComplete.MaxTransferSize, ++ RndisMessage->Message.InitializeComplete.MaxPacketsPerMessage, ++ RndisMessage->Message.InitializeComplete.PacketAlignmentFactor); ++ break; ++ ++ case REMOTE_NDIS_QUERY_CMPLT: ++ DPRINT_DBG(NETVSC, "REMOTE_NDIS_QUERY_CMPLT (len %u, id 0x%x, status 0x%x, buf len %u, buf offset %u)", ++ RndisMessage->MessageLength, ++ RndisMessage->Message.QueryComplete.RequestId, ++ RndisMessage->Message.QueryComplete.Status, ++ RndisMessage->Message.QueryComplete.InformationBufferLength, ++ RndisMessage->Message.QueryComplete.InformationBufferOffset); ++ break; ++ ++ case REMOTE_NDIS_SET_CMPLT: ++ DPRINT_DBG(NETVSC, "REMOTE_NDIS_SET_CMPLT (len %u, id 0x%x, status 0x%x)", ++ RndisMessage->MessageLength, ++ RndisMessage->Message.SetComplete.RequestId, ++ RndisMessage->Message.SetComplete.Status); ++ break; ++ ++ case REMOTE_NDIS_INDICATE_STATUS_MSG: ++ DPRINT_DBG(NETVSC, "REMOTE_NDIS_INDICATE_STATUS_MSG (len %u, status 0x%x, buf len %u, buf offset %u)", ++ RndisMessage->MessageLength, ++ RndisMessage->Message.IndicateStatus.Status, ++ RndisMessage->Message.IndicateStatus.StatusBufferLength, ++ RndisMessage->Message.IndicateStatus.StatusBufferOffset); ++ break; ++ ++ default: ++ DPRINT_DBG(NETVSC, "0x%x (len %u)", ++ RndisMessage->NdisMessageType, ++ RndisMessage->MessageLength); ++ break; ++ } ++} ++ ++static int ++RndisFilterSendRequest( ++ RNDIS_DEVICE *Device, ++ RNDIS_REQUEST *Request ++ ) ++{ ++ int ret=0; ++ NETVSC_PACKET *packet; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // Setup the packet to send it ++ packet = &Request->Packet; ++ ++ packet->IsDataPacket = FALSE; ++ packet->TotalDataBufferLength = Request->RequestMessage.MessageLength; ++ packet->PageBufferCount = 1; ++ ++ packet->PageBuffers[0].Pfn = GetPhysicalAddress(&Request->RequestMessage) >> PAGE_SHIFT; ++ packet->PageBuffers[0].Length = Request->RequestMessage.MessageLength; ++ packet->PageBuffers[0].Offset = (ULONG_PTR)&Request->RequestMessage & (PAGE_SIZE -1); ++ ++ packet->Completion.Send.SendCompletionContext = Request;//packet; ++ packet->Completion.Send.OnSendCompletion = RndisFilterOnSendRequestCompletion; ++ packet->Completion.Send.SendCompletionTid = (ULONG_PTR)Device; ++ ++ ret = gRndisFilter.InnerDriver.OnSend(Device->NetDevice->Device, packet); ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++ ++static void ++RndisFilterReceiveResponse( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Response ++ ) ++{ ++ LIST_ENTRY *anchor; ++ LIST_ENTRY *curr; ++ RNDIS_REQUEST *request=NULL; ++ BOOL found=FALSE; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ SpinlockAcquire(Device->RequestLock); ++ ITERATE_LIST_ENTRIES(anchor, curr, &Device->RequestList) ++ { ++ request = CONTAINING_RECORD(curr, RNDIS_REQUEST, ListEntry); ++ ++ // All request/response message contains RequestId as the 1st field ++ if (request->RequestMessage.Message.InitializeRequest.RequestId == Response->Message.InitializeComplete.RequestId) ++ { ++ DPRINT_DBG(NETVSC, "found rndis request for this response (id 0x%x req type 0x%x res type 0x%x)", ++ request->RequestMessage.Message.InitializeRequest.RequestId, request->RequestMessage.NdisMessageType, Response->NdisMessageType); ++ ++ found = TRUE; ++ break; ++ } ++ } ++ SpinlockRelease(Device->RequestLock); ++ ++ if (found) ++ { ++ if (Response->MessageLength <= sizeof(RNDIS_MESSAGE)) ++ { ++ memcpy(&request->ResponseMessage, Response, Response->MessageLength); ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC, "rndis response buffer overflow detected (size %u max %u)", Response->MessageLength, sizeof(RNDIS_FILTER_PACKET)); ++ ++ if (Response->NdisMessageType == REMOTE_NDIS_RESET_CMPLT) // does not have a request id field ++ { ++ request->ResponseMessage.Message.ResetComplete.Status = STATUS_BUFFER_OVERFLOW; ++ } ++ else ++ { ++ request->ResponseMessage.Message.InitializeComplete.Status = STATUS_BUFFER_OVERFLOW; ++ } ++ } ++ ++ WaitEventSet(request->WaitEvent); ++ } ++ else ++ { ++ DPRINT_ERR(NETVSC, "no rndis request found for this response (id 0x%x res type 0x%x)", ++ Response->Message.InitializeComplete.RequestId, Response->NdisMessageType); ++ } ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++static void ++RndisFilterReceiveIndicateStatus( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Response ++ ) ++{ ++ RNDIS_INDICATE_STATUS *indicate = &Response->Message.IndicateStatus; ++ ++ if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT) ++ { ++ gRndisFilter.InnerDriver.OnLinkStatusChanged(Device->NetDevice->Device, 1); ++ } ++ else if (indicate->Status == RNDIS_STATUS_MEDIA_DISCONNECT) ++ { ++ gRndisFilter.InnerDriver.OnLinkStatusChanged(Device->NetDevice->Device, 0); ++ } ++ else ++ { ++ // TODO: ++ } ++} ++ ++static void ++RndisFilterReceiveData( ++ RNDIS_DEVICE *Device, ++ RNDIS_MESSAGE *Message, ++ NETVSC_PACKET *Packet ++ ) ++{ ++ RNDIS_PACKET *rndisPacket; ++ UINT32 dataOffset; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // empty ethernet frame ?? ++ ASSERT(Packet->PageBuffers[0].Length > RNDIS_MESSAGE_SIZE(RNDIS_PACKET)); ++ ++ rndisPacket = &Message->Message.Packet; ++ ++ // FIXME: Handle multiple rndis pkt msgs that maybe enclosed in this ++ // netvsc packet (ie TotalDataBufferLength != MessageLength) ++ ++ // Remove the rndis header and pass it back up the stack ++ dataOffset = RNDIS_HEADER_SIZE + rndisPacket->DataOffset; ++ ++ Packet->TotalDataBufferLength -= dataOffset; ++ Packet->PageBuffers[0].Offset += dataOffset; ++ Packet->PageBuffers[0].Length -= dataOffset; ++ ++ Packet->IsDataPacket = TRUE; ++ ++ gRndisFilter.InnerDriver.OnReceiveCallback(Device->NetDevice->Device, Packet); ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++static int ++RndisFilterOnReceive( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ) ++{ ++ NETVSC_DEVICE *netDevice = (NETVSC_DEVICE*)Device->Extension; ++ RNDIS_DEVICE *rndisDevice; ++ RNDIS_MESSAGE rndisMessage; ++ RNDIS_MESSAGE *rndisHeader; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(netDevice); ++ //Make sure the rndis device state is initialized ++ if (!netDevice->Extension) ++ { ++ DPRINT_ERR(NETVSC, "got rndis message but no rndis device...dropping this message!"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ++ rndisDevice = (RNDIS_DEVICE*)netDevice->Extension; ++ if (rndisDevice->State == RNDIS_DEV_UNINITIALIZED) ++ { ++ DPRINT_ERR(NETVSC, "got rndis message but rndis device uninitialized...dropping this message!"); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ++ rndisHeader = (RNDIS_MESSAGE*)PageMapVirtualAddress(Packet->PageBuffers[0].Pfn); ++ ++ rndisHeader = (void*)((ULONG_PTR)rndisHeader + Packet->PageBuffers[0].Offset); ++ ++ // Make sure we got a valid rndis message ++ // FIXME: There seems to be a bug in set completion msg where its MessageLength is 16 bytes but ++ // the ByteCount field in the xfer page range shows 52 bytes ++#if 0 ++ if ( Packet->TotalDataBufferLength != rndisHeader->MessageLength ) ++ { ++ PageUnmapVirtualAddress((void*)(ULONG_PTR)rndisHeader - Packet->PageBuffers[0].Offset); ++ ++ DPRINT_ERR(NETVSC, "invalid rndis message? (expected %u bytes got %u)...dropping this message!", ++ rndisHeader->MessageLength, Packet->TotalDataBufferLength); ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++#endif ++ ++ if ((rndisHeader->NdisMessageType != REMOTE_NDIS_PACKET_MSG) && (rndisHeader->MessageLength > sizeof(RNDIS_MESSAGE))) ++ { ++ DPRINT_ERR(NETVSC, "incoming rndis message buffer overflow detected (got %u, max %u)...marking it an error!", ++ rndisHeader->MessageLength, sizeof(RNDIS_MESSAGE)); ++ } ++ ++ memcpy(&rndisMessage, rndisHeader, (rndisHeader->MessageLength > sizeof(RNDIS_MESSAGE))?sizeof(RNDIS_MESSAGE):rndisHeader->MessageLength); ++ ++ PageUnmapVirtualAddress((void*)(ULONG_PTR)rndisHeader - Packet->PageBuffers[0].Offset); ++ ++ DumpRndisMessage(&rndisMessage); ++ ++ switch (rndisMessage.NdisMessageType) ++ { ++ // data msg ++ case REMOTE_NDIS_PACKET_MSG: ++ RndisFilterReceiveData(rndisDevice, &rndisMessage, Packet); ++ break; ++ ++ // completion msgs ++ case REMOTE_NDIS_INITIALIZE_CMPLT: ++ case REMOTE_NDIS_QUERY_CMPLT: ++ case REMOTE_NDIS_SET_CMPLT: ++ //case REMOTE_NDIS_RESET_CMPLT: ++ //case REMOTE_NDIS_KEEPALIVE_CMPLT: ++ RndisFilterReceiveResponse(rndisDevice, &rndisMessage); ++ break; ++ ++ // notification msgs ++ case REMOTE_NDIS_INDICATE_STATUS_MSG: ++ RndisFilterReceiveIndicateStatus(rndisDevice, &rndisMessage); ++ break; ++ default: ++ DPRINT_ERR(NETVSC, "unhandled rndis message (type %u len %u)", rndisMessage.NdisMessageType, rndisMessage.MessageLength); ++ break; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ return 0; ++} ++ ++ ++static int ++RndisFilterQueryDevice( ++ RNDIS_DEVICE *Device, ++ UINT32 Oid, ++ VOID *Result, ++ UINT32 *ResultSize ++ ) ++{ ++ RNDIS_REQUEST *request; ++ UINT32 inresultSize = *ResultSize; ++ RNDIS_QUERY_REQUEST *query; ++ RNDIS_QUERY_COMPLETE *queryComplete; ++ int ret=0; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(Result); ++ ++ *ResultSize = 0; ++ request = GetRndisRequest(Device, REMOTE_NDIS_QUERY_MSG, RNDIS_MESSAGE_SIZE(RNDIS_QUERY_REQUEST)); ++ if (!request) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Setup the rndis query ++ query = &request->RequestMessage.Message.QueryRequest; ++ query->Oid = Oid; ++ query->InformationBufferOffset = sizeof(RNDIS_QUERY_REQUEST); ++ query->InformationBufferLength = 0; ++ query->DeviceVcHandle = 0; ++ ++ ret = RndisFilterSendRequest(Device, request); ++ if (ret != 0) ++ { ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ // Copy the response back ++ queryComplete = &request->ResponseMessage.Message.QueryComplete; ++ ++ if (queryComplete->InformationBufferLength > inresultSize) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ memcpy(Result, ++ (void*)((ULONG_PTR)queryComplete + queryComplete->InformationBufferOffset), ++ queryComplete->InformationBufferLength); ++ ++ *ResultSize = queryComplete->InformationBufferLength; ++ ++Cleanup: ++ if (request) ++ { ++ PutRndisRequest(Device, request); ++ } ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++static inline int ++RndisFilterQueryDeviceMac( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ UINT32 size=HW_MACADDR_LEN; ++ ++ return RndisFilterQueryDevice(Device, ++ RNDIS_OID_802_3_PERMANENT_ADDRESS, ++ Device->HwMacAddr, ++ &size); ++} ++ ++static inline int ++RndisFilterQueryDeviceLinkStatus( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ UINT32 size=sizeof(UINT32); ++ ++ return RndisFilterQueryDevice(Device, ++ RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, ++ &Device->LinkStatus, ++ &size); ++} ++ ++static int ++RndisFilterSetPacketFilter( ++ RNDIS_DEVICE *Device, ++ UINT32 NewFilter ++ ) ++{ ++ RNDIS_REQUEST *request; ++ RNDIS_SET_REQUEST *set; ++ RNDIS_SET_COMPLETE *setComplete; ++ UINT32 status; ++ int ret; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(RNDIS_MESSAGE_SIZE(RNDIS_SET_REQUEST) + sizeof(UINT32) <= sizeof(RNDIS_MESSAGE)); ++ ++ request = GetRndisRequest(Device, REMOTE_NDIS_SET_MSG, RNDIS_MESSAGE_SIZE(RNDIS_SET_REQUEST) + sizeof(UINT32)); ++ if (!request) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Setup the rndis set ++ set = &request->RequestMessage.Message.SetRequest; ++ set->Oid = RNDIS_OID_GEN_CURRENT_PACKET_FILTER; ++ set->InformationBufferLength = sizeof(UINT32); ++ set->InformationBufferOffset = sizeof(RNDIS_SET_REQUEST); ++ ++ memcpy((void*)(ULONG_PTR)set + sizeof(RNDIS_SET_REQUEST), &NewFilter, sizeof(UINT32)); ++ ++ ret = RndisFilterSendRequest(Device, request); ++ if (ret != 0) ++ { ++ goto Cleanup; ++ } ++ ++ ret = WaitEventWaitEx(request->WaitEvent, 2000/*2sec*/); ++ if (!ret) ++ { ++ ret = -1; ++ DPRINT_ERR(NETVSC, "timeout before we got a set response..."); ++ // We cant deallocate the request since we may still receive a send completion for it. ++ goto Exit; ++ } ++ else ++ { ++ if (ret > 0) ++ { ++ ret = 0; ++ } ++ setComplete = &request->ResponseMessage.Message.SetComplete; ++ status = setComplete->Status; ++ } ++ ++Cleanup: ++ if (request) ++ { ++ PutRndisRequest(Device, request); ++ } ++Exit: ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++int ++RndisFilterInit( ++ NETVSC_DRIVER_OBJECT *Driver ++ ) ++{ ++ DPRINT_ENTER(NETVSC); ++ ++ DPRINT_DBG(NETVSC, "sizeof(RNDIS_FILTER_PACKET) == %d", sizeof(RNDIS_FILTER_PACKET)); ++ ++ Driver->RequestExtSize = sizeof(RNDIS_FILTER_PACKET); ++ Driver->AdditionalRequestPageBufferCount = 1; // For rndis header ++ ++ //Driver->Context = rndisDriver; ++ ++ memset(&gRndisFilter, 0, sizeof(RNDIS_FILTER_DRIVER_OBJECT)); ++ ++ /*rndisDriver->Driver = Driver; ++ ++ ASSERT(Driver->OnLinkStatusChanged); ++ rndisDriver->OnLinkStatusChanged = Driver->OnLinkStatusChanged;*/ ++ ++ // Save the original dispatch handlers before we override it ++ gRndisFilter.InnerDriver.Base.OnDeviceAdd = Driver->Base.OnDeviceAdd; ++ gRndisFilter.InnerDriver.Base.OnDeviceRemove = Driver->Base.OnDeviceRemove; ++ gRndisFilter.InnerDriver.Base.OnCleanup = Driver->Base.OnCleanup; ++ ++ ASSERT(Driver->OnSend); ++ ASSERT(Driver->OnReceiveCallback); ++ gRndisFilter.InnerDriver.OnSend = Driver->OnSend; ++ gRndisFilter.InnerDriver.OnReceiveCallback = Driver->OnReceiveCallback; ++ gRndisFilter.InnerDriver.OnLinkStatusChanged = Driver->OnLinkStatusChanged; ++ ++ // Override ++ Driver->Base.OnDeviceAdd = RndisFilterOnDeviceAdd; ++ Driver->Base.OnDeviceRemove = RndisFilterOnDeviceRemove; ++ Driver->Base.OnCleanup = RndisFilterOnCleanup; ++ Driver->OnSend = RndisFilterOnSend; ++ Driver->OnOpen = RndisFilterOnOpen; ++ Driver->OnClose = RndisFilterOnClose; ++ //Driver->QueryLinkStatus = RndisFilterQueryDeviceLinkStatus; ++ Driver->OnReceiveCallback = RndisFilterOnReceive; ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return 0; ++} ++ ++static int ++RndisFilterInitDevice( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ RNDIS_REQUEST *request; ++ RNDIS_INITIALIZE_REQUEST *init; ++ RNDIS_INITIALIZE_COMPLETE *initComplete; ++ UINT32 status; ++ int ret; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ request = GetRndisRequest(Device, REMOTE_NDIS_INITIALIZE_MSG, RNDIS_MESSAGE_SIZE(RNDIS_INITIALIZE_REQUEST)); ++ if (!request) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Setup the rndis set ++ init = &request->RequestMessage.Message.InitializeRequest; ++ init->MajorVersion = RNDIS_MAJOR_VERSION; ++ init->MinorVersion = RNDIS_MINOR_VERSION; ++ init->MaxTransferSize = 2048; // FIXME: Use 1536 - rounded ethernet frame size ++ ++ Device->State = RNDIS_DEV_INITIALIZING; ++ ++ ret = RndisFilterSendRequest(Device, request); ++ if (ret != 0) ++ { ++ Device->State = RNDIS_DEV_UNINITIALIZED; ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ initComplete = &request->ResponseMessage.Message.InitializeComplete; ++ status = initComplete->Status; ++ if (status == RNDIS_STATUS_SUCCESS) ++ { ++ Device->State = RNDIS_DEV_INITIALIZED; ++ ret = 0; ++ } ++ else ++ { ++ Device->State = RNDIS_DEV_UNINITIALIZED; ++ ret = -1; ++ } ++ ++Cleanup: ++ if (request) ++ { ++ PutRndisRequest(Device, request); ++ } ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++static void ++RndisFilterHaltDevice( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ RNDIS_REQUEST *request; ++ RNDIS_HALT_REQUEST *halt; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // Attempt to do a rndis device halt ++ request = GetRndisRequest(Device, REMOTE_NDIS_HALT_MSG, RNDIS_MESSAGE_SIZE(RNDIS_HALT_REQUEST)); ++ if (!request) ++ { ++ goto Cleanup; ++ } ++ ++ // Setup the rndis set ++ halt = &request->RequestMessage.Message.HaltRequest; ++ halt->RequestId = InterlockedIncrement((int*)&Device->NewRequestId); ++ ++ // Ignore return since this msg is optional. ++ RndisFilterSendRequest(Device, request); ++ ++ Device->State = RNDIS_DEV_UNINITIALIZED; ++ ++Cleanup: ++ if (request) ++ { ++ PutRndisRequest(Device, request); ++ } ++ DPRINT_EXIT(NETVSC); ++ return; ++} ++ ++ ++static int ++RndisFilterOpenDevice( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ int ret=0; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ if (Device->State != RNDIS_DEV_INITIALIZED) ++ return 0; ++ ++ ret = RndisFilterSetPacketFilter(Device, NDIS_PACKET_TYPE_BROADCAST|NDIS_PACKET_TYPE_DIRECTED); ++ if (ret == 0) ++ { ++ Device->State = RNDIS_DEV_DATAINITIALIZED; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ return ret; ++} ++ ++static int ++RndisFilterCloseDevice( ++ RNDIS_DEVICE *Device ++ ) ++{ ++ int ret; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ if (Device->State != RNDIS_DEV_DATAINITIALIZED) ++ return 0; ++ ++ ret = RndisFilterSetPacketFilter(Device, 0); ++ if (ret == 0) ++ { ++ Device->State = RNDIS_DEV_INITIALIZED; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++ ++int ++RndisFilterOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ) ++{ ++ int ret; ++ NETVSC_DEVICE *netDevice; ++ RNDIS_DEVICE *rndisDevice; ++ NETVSC_DEVICE_INFO *deviceInfo = (NETVSC_DEVICE_INFO*)AdditionalInfo; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ //rndisDevice = MemAlloc(sizeof(RNDIS_DEVICE)); ++ rndisDevice = GetRndisDevice(); ++ if (!rndisDevice) ++ { ++ DPRINT_EXIT(NETVSC); ++ return -1; ++ } ++ ++ DPRINT_DBG(NETVSC, "rndis device object allocated - %p", rndisDevice); ++ ++ // Let the inner driver handle this first to create the netvsc channel ++ // NOTE! Once the channel is created, we may get a receive callback ++ // (RndisFilterOnReceive()) before this call is completed ++ ret = gRndisFilter.InnerDriver.Base.OnDeviceAdd(Device, AdditionalInfo); ++ if (ret != 0) ++ { ++ PutRndisDevice(rndisDevice); ++ DPRINT_EXIT(NETVSC); ++ return ret; ++ } ++ ++ // ++ // Initialize the rndis device ++ // ++ netDevice = (NETVSC_DEVICE*)Device->Extension; ++ ASSERT(netDevice); ++ ASSERT(netDevice->Device); ++ ++ netDevice->Extension = rndisDevice; ++ rndisDevice->NetDevice = netDevice; ++ ++ // Send the rndis initialization message ++ ret = RndisFilterInitDevice(rndisDevice); ++ if (ret != 0) ++ { ++ // TODO: If rndis init failed, we will need to shut down the channel ++ } ++ ++ // Get the mac address ++ ret = RndisFilterQueryDeviceMac(rndisDevice); ++ if (ret != 0) ++ { ++ // TODO: shutdown rndis device and the channel ++ } ++ ++ DPRINT_INFO(NETVSC, "Device 0x%p mac addr %02x%02x%02x%02x%02x%02x", ++ rndisDevice, ++ rndisDevice->HwMacAddr[0], ++ rndisDevice->HwMacAddr[1], ++ rndisDevice->HwMacAddr[2], ++ rndisDevice->HwMacAddr[3], ++ rndisDevice->HwMacAddr[4], ++ rndisDevice->HwMacAddr[5]); ++ ++ memcpy(deviceInfo->MacAddr, rndisDevice->HwMacAddr, HW_MACADDR_LEN); ++ ++ RndisFilterQueryDeviceLinkStatus(rndisDevice); ++ ++ deviceInfo->LinkState = rndisDevice->LinkStatus; ++ DPRINT_INFO(NETVSC, "Device 0x%p link state %s", rndisDevice, ((deviceInfo->LinkState)?("down"):("up"))); ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++ ++static int ++RndisFilterOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ NETVSC_DEVICE *netDevice = (NETVSC_DEVICE*)Device->Extension; ++ RNDIS_DEVICE *rndisDevice = (RNDIS_DEVICE*)netDevice->Extension; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // Halt and release the rndis device ++ RndisFilterHaltDevice(rndisDevice); ++ ++ PutRndisDevice(rndisDevice); ++ netDevice->Extension = NULL; ++ ++ // Pass control to inner driver to remove the device ++ gRndisFilter.InnerDriver.Base.OnDeviceRemove(Device); ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return 0; ++} ++ ++ ++static void ++RndisFilterOnCleanup( ++ DRIVER_OBJECT *Driver ++ ) ++{ ++ DPRINT_ENTER(NETVSC); ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++static int ++RndisFilterOnOpen( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret; ++ NETVSC_DEVICE *netDevice = (NETVSC_DEVICE*)Device->Extension; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(netDevice); ++ ret = RndisFilterOpenDevice((RNDIS_DEVICE*)netDevice->Extension); ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++static int ++RndisFilterOnClose( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret; ++ NETVSC_DEVICE *netDevice = (NETVSC_DEVICE*)Device->Extension; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ ASSERT(netDevice); ++ ret = RndisFilterCloseDevice((RNDIS_DEVICE*)netDevice->Extension); ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++ ++static int ++RndisFilterOnSend( ++ DEVICE_OBJECT *Device, ++ NETVSC_PACKET *Packet ++ ) ++{ ++ int ret=0; ++ RNDIS_FILTER_PACKET *filterPacket; ++ RNDIS_MESSAGE *rndisMessage; ++ RNDIS_PACKET *rndisPacket; ++ UINT32 rndisMessageSize; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // Add the rndis header ++ filterPacket = (RNDIS_FILTER_PACKET*)Packet->Extension; ++ ASSERT(filterPacket); ++ ++ memset(filterPacket, 0, sizeof(RNDIS_FILTER_PACKET)); ++ ++ rndisMessage = &filterPacket->Message; ++ rndisMessageSize = RNDIS_MESSAGE_SIZE(RNDIS_PACKET); ++ ++ rndisMessage->NdisMessageType = REMOTE_NDIS_PACKET_MSG; ++ rndisMessage->MessageLength = Packet->TotalDataBufferLength + rndisMessageSize; ++ ++ rndisPacket = &rndisMessage->Message.Packet; ++ rndisPacket->DataOffset = sizeof(RNDIS_PACKET); ++ rndisPacket->DataLength = Packet->TotalDataBufferLength; ++ ++ Packet->IsDataPacket = TRUE; ++ Packet->PageBuffers[0].Pfn = GetPhysicalAddress(rndisMessage) >> PAGE_SHIFT; ++ Packet->PageBuffers[0].Offset = (ULONG_PTR)rndisMessage & (PAGE_SIZE-1); ++ Packet->PageBuffers[0].Length = rndisMessageSize; ++ ++ // Save the packet send completion and context ++ filterPacket->OnCompletion = Packet->Completion.Send.OnSendCompletion; ++ filterPacket->CompletionContext = Packet->Completion.Send.SendCompletionContext; ++ ++ // Use ours ++ Packet->Completion.Send.OnSendCompletion = RndisFilterOnSendCompletion; ++ Packet->Completion.Send.SendCompletionContext = filterPacket; ++ ++ ret = gRndisFilter.InnerDriver.OnSend(Device, Packet); ++ if (ret != 0) ++ { ++ // Reset the completion to originals to allow retries from above ++ Packet->Completion.Send.OnSendCompletion = filterPacket->OnCompletion; ++ Packet->Completion.Send.SendCompletionContext = filterPacket->CompletionContext; ++ } ++ ++ DPRINT_EXIT(NETVSC); ++ ++ return ret; ++} ++ ++static void ++RndisFilterOnSendCompletion( ++ void *Context) ++{ ++ RNDIS_FILTER_PACKET *filterPacket = (RNDIS_FILTER_PACKET *)Context; ++ ++ DPRINT_ENTER(NETVSC); ++ ++ // Pass it back to the original handler ++ filterPacket->OnCompletion(filterPacket->CompletionContext); ++ ++ DPRINT_EXIT(NETVSC); ++} ++ ++ ++static void ++RndisFilterOnSendRequestCompletion( ++ void *Context ++ ) ++{ ++ DPRINT_ENTER(NETVSC); ++ ++ // Noop ++ DPRINT_EXIT(NETVSC); ++} +--- /dev/null ++++ b/drivers/staging/hv/RndisFilter.h +@@ -0,0 +1,61 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#ifndef _RNDISFILTER_H_ ++#define _RNDISFILTER_H_ ++ ++#define __struct_bcount(x) ++ ++#include "osd.h" ++#include "NetVsc.h" ++ ++#include "rndis.h" ++ ++#define RNDIS_HEADER_SIZE (sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER)) ++ ++#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 ++#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 ++#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 ++#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 ++#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 ++#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 ++#define NDIS_PACKET_TYPE_SMT 0x00000040 ++#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 ++#define NDIS_PACKET_TYPE_GROUP 0x00000100 ++#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200 ++#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 ++#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 ++ ++ ++ ++// ++// Interface ++// ++int ++RndisFilterInit( ++ NETVSC_DRIVER_OBJECT *Driver ++ ); ++ ++ ++#endif // _RNDISFILTER_H_ diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-scsi-driver-to-the-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-scsi-driver-to-the-build.patch new file mode 100644 index 000000000..77887945d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-scsi-driver-to-the-build.patch @@ -0,0 +1,39 @@ +From foo@baz Tue Jul 14 10:19:52 PDT 2009 +Date: Tue, 14 Jul 2009 10:19:52 -0700 +To: Greg KH +From: Greg Kroah-Hartman +Subject: Staging: hv: add the Hyper-V virtual scsi driver to the build + +From: Greg Kroah-Hartman + +Add the Hyper-V virtual scsi driver to the kernel build system. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/Kconfig | 6 ++++++ + drivers/staging/hv/Makefile | 2 ++ + 2 files changed, 8 insertions(+) + +--- a/drivers/staging/hv/Kconfig ++++ b/drivers/staging/hv/Kconfig +@@ -6,3 +6,9 @@ config HYPERV + Select this option to run Linux as a Hyper-V client operating + system. + ++config HYPERV_STORAGE ++ tristate "Microsoft Hyper-V virtual storage driver" ++ depends on HYPERV && SCSI ++ default n ++ help ++ Select this option to enable the Hyper-V virtual storage driver. +--- a/drivers/staging/hv/Makefile ++++ b/drivers/staging/hv/Makefile +@@ -1,3 +1,5 @@ + obj-$(CONFIG_HYPERV) += hv_vmbus.o ++obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o + + hv_vmbus-objs := vmbus_drv.o osd.o Sources.o ++hv_storvsc-objs := storvsc_drv.o osd.o StorVsc.o diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-storage-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-storage-driver.patch new file mode 100644 index 000000000..e10836dc7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-add-the-hyper-v-virtual-storage-driver.patch @@ -0,0 +1,2403 @@ +From foo@baz Mon Jul 13 16:01:31 PDT 2009 +Date: Mon, 13 Jul 2009 16:01:31 -0700 +From: Hank Janssen +Subject: Staging: hv: add the Hyper-V virtual storage driver + +From: Hank Janssen + +This is the virtual storage driver when running Linux on top of Hyper-V. + +Signed-off-by: Hank Janssen +Signed-off-by: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/hv/StorVsc.c | 967 ++++++++++++++++++++++++++ + drivers/staging/hv/storvsc_drv.c | 1413 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 2380 insertions(+) + +--- /dev/null ++++ b/drivers/staging/hv/StorVsc.c +@@ -0,0 +1,967 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include "logging.h" ++ ++#include "StorVscApi.h" ++#include "VmbusPacketFormat.h" ++#include "vstorage.h" ++ ++ ++// ++// #defines ++// ++ ++// ++// Data types ++// ++ ++typedef struct _STORVSC_REQUEST_EXTENSION { ++ //LIST_ENTRY ListEntry; ++ ++ STORVSC_REQUEST *Request; ++ DEVICE_OBJECT *Device; ++ ++ // Synchronize the request/response if needed ++ HANDLE WaitEvent; ++ ++ VSTOR_PACKET VStorPacket; ++} STORVSC_REQUEST_EXTENSION; ++ ++ ++// A storvsc device is a device object that contains a vmbus channel ++typedef struct _STORVSC_DEVICE{ ++ DEVICE_OBJECT *Device; ++ ++ int RefCount; // 0 indicates the device is being destroyed ++ ++ int NumOutstandingRequests; ++ ++ // Each unique Port/Path/Target represents 1 channel ie scsi controller. In reality, the pathid, targetid is always 0 ++ // and the port is set by us ++ ULONG PortNumber; ++ UCHAR PathId; ++ UCHAR TargetId; ++ ++ //LIST_ENTRY OutstandingRequestList; ++ //HANDLE OutstandingRequestLock; ++ ++ // Used for vsc/vsp channel reset process ++ STORVSC_REQUEST_EXTENSION InitRequest; ++ ++ STORVSC_REQUEST_EXTENSION ResetRequest; ++ ++} STORVSC_DEVICE; ++ ++ ++// ++// Globals ++// ++static const char* gDriverName="storvsc"; ++ ++//{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} ++static const GUID gStorVscDeviceType={ ++ .Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f} ++}; ++ ++// ++// Internal routines ++// ++static int ++StorVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ); ++ ++static int ++StorVscOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ); ++ ++static int ++StorVscOnIORequest( ++ DEVICE_OBJECT *Device, ++ STORVSC_REQUEST *Request ++ ); ++ ++static int ++StorVscOnHostReset( ++ DEVICE_OBJECT *Device ++ ); ++ ++static void ++StorVscOnCleanup( ++ DRIVER_OBJECT *Device ++ ); ++ ++static void ++StorVscOnChannelCallback( ++ PVOID Context ++ ); ++ ++static void ++StorVscOnIOCompletion( ++ DEVICE_OBJECT *Device, ++ VSTOR_PACKET *VStorPacket, ++ STORVSC_REQUEST_EXTENSION *RequestExt ++ ); ++ ++static void ++StorVscOnReceive( ++ DEVICE_OBJECT *Device, ++ VSTOR_PACKET *VStorPacket, ++ STORVSC_REQUEST_EXTENSION *RequestExt ++ ); ++ ++static int ++StorVscConnectToVsp( ++ DEVICE_OBJECT *Device ++ ); ++ ++static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = MemAllocZeroed(sizeof(STORVSC_DEVICE)); ++ if (!storDevice) ++ return NULL; ++ ++ // Set to 2 to allow both inbound and outbound traffics ++ // (ie GetStorDevice() and MustGetStorDevice()) to proceed. ++ InterlockedCompareExchange(&storDevice->RefCount, 2, 0); ++ ++ storDevice->Device = Device; ++ Device->Extension = storDevice; ++ ++ return storDevice; ++} ++ ++static inline void FreeStorDevice(STORVSC_DEVICE *Device) ++{ ++ ASSERT(Device->RefCount == 0); ++ MemFree(Device); ++} ++ ++// Get the stordevice object iff exists and its refcount > 1 ++static inline STORVSC_DEVICE* GetStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = (STORVSC_DEVICE*)Device->Extension; ++ if (storDevice && storDevice->RefCount > 1) ++ { ++ InterlockedIncrement(&storDevice->RefCount); ++ } ++ else ++ { ++ storDevice = NULL; ++ } ++ ++ return storDevice; ++} ++ ++// Get the stordevice object iff exists and its refcount > 0 ++static inline STORVSC_DEVICE* MustGetStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = (STORVSC_DEVICE*)Device->Extension; ++ if (storDevice && storDevice->RefCount) ++ { ++ InterlockedIncrement(&storDevice->RefCount); ++ } ++ else ++ { ++ storDevice = NULL; ++ } ++ ++ return storDevice; ++} ++ ++static inline void PutStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = (STORVSC_DEVICE*)Device->Extension; ++ ASSERT(storDevice); ++ ++ InterlockedDecrement(&storDevice->RefCount); ++ ASSERT(storDevice->RefCount); ++} ++ ++// Drop ref count to 1 to effectively disable GetStorDevice() ++static inline STORVSC_DEVICE* ReleaseStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = (STORVSC_DEVICE*)Device->Extension; ++ ASSERT(storDevice); ++ ++ // Busy wait until the ref drop to 2, then set it to 1 ++ while (InterlockedCompareExchange(&storDevice->RefCount, 1, 2) != 2) ++ { ++ Sleep(100); ++ } ++ ++ return storDevice; ++} ++ ++// Drop ref count to 0. No one can use StorDevice object. ++static inline STORVSC_DEVICE* FinalReleaseStorDevice(DEVICE_OBJECT *Device) ++{ ++ STORVSC_DEVICE *storDevice; ++ ++ storDevice = (STORVSC_DEVICE*)Device->Extension; ++ ASSERT(storDevice); ++ ++ // Busy wait until the ref drop to 1, then set it to 0 ++ while (InterlockedCompareExchange(&storDevice->RefCount, 0, 1) != 1) ++ { ++ Sleep(100); ++ } ++ ++ Device->Extension = NULL; ++ return storDevice; ++} ++ ++/*++; ++ ++ ++Name: ++ StorVscInitialize() ++ ++Description: ++ Main entry point ++ ++--*/ ++int ++StorVscInitialize( ++ DRIVER_OBJECT *Driver ++ ) ++{ ++ STORVSC_DRIVER_OBJECT* storDriver = (STORVSC_DRIVER_OBJECT*)Driver; ++ int ret=0; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%d sizeof(STORVSC_REQUEST_EXTENSION)=%d sizeof(VSTOR_PACKET)=%d, sizeof(VMSCSI_REQUEST)=%d", ++ sizeof(STORVSC_REQUEST), sizeof(STORVSC_REQUEST_EXTENSION), sizeof(VSTOR_PACKET), sizeof(VMSCSI_REQUEST)); ++ ++ // Make sure we are at least 2 pages since 1 page is used for control ++ ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); ++ ++ Driver->name = gDriverName; ++ memcpy(&Driver->deviceType, &gStorVscDeviceType, sizeof(GUID)); ++ ++ storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION); ++ ++ // Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) ++ // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + UINT64) ++ storDriver->MaxOutstandingRequestsPerChannel = ++ ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(UINT64),sizeof(UINT64))); ++ ++ DPRINT_INFO(STORVSC, "max io %u, currently %u\n", storDriver->MaxOutstandingRequestsPerChannel, STORVSC_MAX_IO_REQUESTS); ++ ++ // Setup the dispatch table ++ storDriver->Base.OnDeviceAdd = StorVscOnDeviceAdd; ++ storDriver->Base.OnDeviceRemove = StorVscOnDeviceRemove; ++ storDriver->Base.OnCleanup = StorVscOnCleanup; ++ ++ storDriver->OnIORequest = StorVscOnIORequest; ++ storDriver->OnHostReset = StorVscOnHostReset; ++ ++ DPRINT_EXIT(STORVSC); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: ++ StorVscOnDeviceAdd() ++ ++Description: ++ Callback when the device belonging to this driver is added ++ ++--*/ ++int ++StorVscOnDeviceAdd( ++ DEVICE_OBJECT *Device, ++ void *AdditionalInfo ++ ) ++{ ++ int ret=0; ++ STORVSC_DEVICE *storDevice; ++ //VMSTORAGE_CHANNEL_PROPERTIES *props; ++ STORVSC_DEVICE_INFO *deviceInfo = (STORVSC_DEVICE_INFO*)AdditionalInfo; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ storDevice = AllocStorDevice(Device); ++ if (!storDevice) ++ { ++ ret = -1; ++ goto Cleanup; ++ } ++ ++ // Save the channel properties to our storvsc channel ++ //props = (VMSTORAGE_CHANNEL_PROPERTIES*) channel->offerMsg.Offer.u.Standard.UserDefined; ++ ++ // FIXME: ++ // If we support more than 1 scsi channel, we need to set the port number here ++ // to the scsi channel but how do we get the scsi channel prior to the bus scan ++ /*storChannel->PortNumber = 0; ++ storChannel->PathId = props->PathId; ++ storChannel->TargetId = props->TargetId;*/ ++ ++ storDevice->PortNumber = deviceInfo->PortNumber; ++ // Send it back up ++ ret = StorVscConnectToVsp(Device); ++ ++ //deviceInfo->PortNumber = storDevice->PortNumber; ++ deviceInfo->PathId = storDevice->PathId; ++ deviceInfo->TargetId = storDevice->TargetId; ++ ++ DPRINT_DBG(STORVSC, "assigned port %u, path %u target %u\n", storDevice->PortNumber, storDevice->PathId, storDevice->TargetId); ++ ++Cleanup: ++ DPRINT_EXIT(STORVSC); ++ ++ return ret; ++} ++ ++static int StorVscChannelInit(DEVICE_OBJECT *Device) ++{ ++ int ret=0; ++ STORVSC_DEVICE *storDevice; ++ STORVSC_REQUEST_EXTENSION *request; ++ VSTOR_PACKET *vstorPacket; ++ ++ storDevice = GetStorDevice(Device); ++ if (!storDevice) ++ { ++ DPRINT_ERR(STORVSC, "unable to get stor device...device being destroyed?"); ++ DPRINT_EXIT(STORVSC); ++ return -1; ++ } ++ ++ request = &storDevice->InitRequest; ++ vstorPacket = &request->VStorPacket; ++ ++ // Now, initiate the vsc/vsp initialization protocol on the open channel ++ ++ memset(request, sizeof(STORVSC_REQUEST_EXTENSION), 0); ++ request->WaitEvent = WaitEventCreate(); ++ ++ vstorPacket->Operation = VStorOperationBeginInitialization; ++ vstorPacket->Flags = REQUEST_COMPLETION_FLAG; ++ ++ /*SpinlockAcquire(gDriverExt.packetListLock); ++ INSERT_TAIL_LIST(&gDriverExt.packetList, &packet->listEntry.entry); ++ SpinlockRelease(gDriverExt.packetListLock);*/ ++ ++ DPRINT_INFO(STORVSC, "BEGIN_INITIALIZATION_OPERATION..."); ++ ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)request, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ if ( ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "unable to send BEGIN_INITIALIZATION_OPERATION"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ if (vstorPacket->Operation != VStorOperationCompleteIo || vstorPacket->Status != 0) ++ { ++ DPRINT_ERR(STORVSC, "BEGIN_INITIALIZATION_OPERATION failed (op %d status 0x%x)", vstorPacket->Operation, vstorPacket->Status); ++ goto Cleanup; ++ } ++ ++ DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION..."); ++ ++ // reuse the packet for version range supported ++ memset(vstorPacket, sizeof(VSTOR_PACKET), 0); ++ vstorPacket->Operation = VStorOperationQueryProtocolVersion; ++ vstorPacket->Flags = REQUEST_COMPLETION_FLAG; ++ ++ vstorPacket->Version.MajorMinor = VMSTOR_PROTOCOL_VERSION_CURRENT; ++ FILL_VMSTOR_REVISION(vstorPacket->Version.Revision); ++ ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)request, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ if ( ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "unable to send BEGIN_INITIALIZATION_OPERATION"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ // TODO: Check returned version ++ if (vstorPacket->Operation != VStorOperationCompleteIo || vstorPacket->Status != 0) ++ { ++ DPRINT_ERR(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION failed (op %d status 0x%x)", vstorPacket->Operation, vstorPacket->Status); ++ goto Cleanup; ++ } ++ ++ // Query channel properties ++ DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); ++ ++ memset(vstorPacket, sizeof(VSTOR_PACKET), 0); ++ vstorPacket->Operation = VStorOperationQueryProperties; ++ vstorPacket->Flags = REQUEST_COMPLETION_FLAG; ++ vstorPacket->StorageChannelProperties.PortNumber = storDevice->PortNumber; ++ ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)request, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ ++ if ( ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "unable to send QUERY_PROPERTIES_OPERATION"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ // TODO: Check returned version ++ if (vstorPacket->Operation != VStorOperationCompleteIo || vstorPacket->Status != 0) ++ { ++ DPRINT_ERR(STORVSC, "QUERY_PROPERTIES_OPERATION failed (op %d status 0x%x)", vstorPacket->Operation, vstorPacket->Status); ++ goto Cleanup; ++ } ++ ++ //storDevice->PortNumber = vstorPacket->StorageChannelProperties.PortNumber; ++ storDevice->PathId = vstorPacket->StorageChannelProperties.PathId; ++ storDevice->TargetId = vstorPacket->StorageChannelProperties.TargetId; ++ ++ DPRINT_DBG(STORVSC, "channel flag 0x%x, max xfer len 0x%x", vstorPacket->StorageChannelProperties.Flags, vstorPacket->StorageChannelProperties.MaxTransferBytes); ++ ++ DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); ++ ++ memset(vstorPacket, sizeof(VSTOR_PACKET), 0); ++ vstorPacket->Operation = VStorOperationEndInitialization; ++ vstorPacket->Flags = REQUEST_COMPLETION_FLAG; ++ ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)request, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ ++ if ( ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "unable to send END_INITIALIZATION_OPERATION"); ++ goto Cleanup; ++ } ++ ++ WaitEventWait(request->WaitEvent); ++ ++ if (vstorPacket->Operation != VStorOperationCompleteIo || vstorPacket->Status != 0) ++ { ++ DPRINT_ERR(STORVSC, "END_INITIALIZATION_OPERATION failed (op %d status 0x%x)", vstorPacket->Operation, vstorPacket->Status); ++ goto Cleanup; ++ } ++ ++ DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****"); ++ ++Cleanup: ++ if (request->WaitEvent) ++ { ++ WaitEventClose(request->WaitEvent); ++ request->WaitEvent = NULL; ++ } ++ ++ PutStorDevice(Device); ++ ++ DPRINT_EXIT(STORVSC); ++ return ret; ++} ++ ++ ++int ++StorVscConnectToVsp( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret=0; ++ VMSTORAGE_CHANNEL_PROPERTIES props; ++ ++ STORVSC_DRIVER_OBJECT *storDriver = (STORVSC_DRIVER_OBJECT*) Device->Driver;; ++ ++ memset(&props, sizeof(VMSTORAGE_CHANNEL_PROPERTIES), 0); ++ ++ // Open the channel ++ ret = Device->Driver->VmbusChannelInterface.Open(Device, ++ storDriver->RingBufferSize, ++ storDriver->RingBufferSize, ++ (PVOID)&props, ++ sizeof(VMSTORAGE_CHANNEL_PROPERTIES), ++ StorVscOnChannelCallback, ++ Device ++ ); ++ ++ DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d", props.PathId, props.TargetId, props.MaxTransferBytes); ++ ++ if (ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "unable to open channel: %d", ret); ++ return -1; ++ } ++ ++ ret = StorVscChannelInit(Device); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: ++ StorVscOnDeviceRemove() ++ ++Description: ++ Callback when the our device is being removed ++ ++--*/ ++int ++StorVscOnDeviceRemove( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ STORVSC_DEVICE *storDevice; ++ int ret=0; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ DPRINT_INFO(STORVSC, "disabling storage device (%p)...", Device->Extension); ++ ++ storDevice = ReleaseStorDevice(Device); ++ ++ // At this point, all outbound traffic should be disable. We only allow inbound traffic (responses) to proceed ++ // so that outstanding requests can be completed. ++ while (storDevice->NumOutstandingRequests) ++ { ++ DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", storDevice->NumOutstandingRequests); ++ ++ Sleep(100); ++ } ++ ++ DPRINT_INFO(STORVSC, "removing storage device (%p)...", Device->Extension); ++ ++ storDevice = FinalReleaseStorDevice(Device); ++ ++ DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice); ++ ++ // Close the channel ++ Device->Driver->VmbusChannelInterface.Close(Device); ++ ++ FreeStorDevice(storDevice); ++ ++ DPRINT_EXIT(STORVSC); ++ return ret; ++} ++ ++ ++//static void ++//StorVscOnTargetRescan( ++// void *Context ++// ) ++//{ ++// DEVICE_OBJECT *device=(DEVICE_OBJECT*)Context; ++// STORVSC_DRIVER_OBJECT *storDriver; ++// ++// DPRINT_ENTER(STORVSC); ++// ++// storDriver = (STORVSC_DRIVER_OBJECT*) device->Driver; ++// storDriver->OnHostRescan(device); ++// ++// DPRINT_EXIT(STORVSC); ++//} ++ ++int ++StorVscOnHostReset( ++ DEVICE_OBJECT *Device ++ ) ++{ ++ int ret=0; ++ ++ STORVSC_DEVICE *storDevice; ++ STORVSC_REQUEST_EXTENSION *request; ++ VSTOR_PACKET *vstorPacket; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ DPRINT_INFO(STORVSC, "resetting host adapter..."); ++ ++ storDevice = GetStorDevice(Device); ++ if (!storDevice) ++ { ++ DPRINT_ERR(STORVSC, "unable to get stor device...device being destroyed?"); ++ DPRINT_EXIT(STORVSC); ++ return -1; ++ } ++ ++ request = &storDevice->ResetRequest; ++ vstorPacket = &request->VStorPacket; ++ ++ request->WaitEvent = WaitEventCreate(); ++ ++ vstorPacket->Operation = VStorOperationResetBus; ++ vstorPacket->Flags = REQUEST_COMPLETION_FLAG; ++ vstorPacket->VmSrb.PathId = storDevice->PathId; ++ ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)&storDevice->ResetRequest, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ if (ret != 0) ++ { ++ DPRINT_ERR(STORVSC, "Unable to send reset packet %p ret %d", vstorPacket, ret); ++ goto Cleanup; ++ } ++ ++ // FIXME: Add a timeout ++ WaitEventWait(request->WaitEvent); ++ ++ WaitEventClose(request->WaitEvent); ++ DPRINT_INFO(STORVSC, "host adapter reset completed"); ++ ++ // At this point, all outstanding requests in the adapter should have been flushed out and return to us ++ ++Cleanup: ++ PutStorDevice(Device); ++ DPRINT_EXIT(STORVSC); ++ return ret; ++} ++ ++/*++ ++ ++Name: ++ StorVscOnIORequest() ++ ++Description: ++ Callback to initiate an I/O request ++ ++--*/ ++int ++StorVscOnIORequest( ++ DEVICE_OBJECT *Device, ++ STORVSC_REQUEST *Request ++ ) ++{ ++ STORVSC_DEVICE *storDevice; ++ STORVSC_REQUEST_EXTENSION* requestExtension = (STORVSC_REQUEST_EXTENSION*) Request->Extension; ++ VSTOR_PACKET* vstorPacket =&requestExtension->VStorPacket; ++ int ret=0; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ storDevice = GetStorDevice(Device); ++ ++ DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, Extension %p", ++ Device, storDevice, Request, requestExtension); ++ ++ DPRINT_DBG(STORVSC, "req %p len %d bus %d, target %d, lun %d cdblen %d", ++ Request, Request->DataBuffer.Length, Request->Bus, Request->TargetId, Request->LunId, Request->CdbLen); ++ ++ if (!storDevice) ++ { ++ DPRINT_ERR(STORVSC, "unable to get stor device...device being destroyed?"); ++ DPRINT_EXIT(STORVSC); ++ return -2; ++ } ++ ++ //PrintBytes(Request->Cdb, Request->CdbLen); ++ ++ requestExtension->Request = Request; ++ requestExtension->Device = Device; ++ ++ memset(vstorPacket, 0 , sizeof(VSTOR_PACKET)); ++ ++ vstorPacket->Flags |= REQUEST_COMPLETION_FLAG; ++ ++ vstorPacket->VmSrb.Length = sizeof(VMSCSI_REQUEST); ++ ++ vstorPacket->VmSrb.PortNumber = Request->Host; ++ vstorPacket->VmSrb.PathId = Request->Bus; ++ vstorPacket->VmSrb.TargetId = Request->TargetId; ++ vstorPacket->VmSrb.Lun = Request->LunId; ++ ++ vstorPacket->VmSrb.SenseInfoLength = SENSE_BUFFER_SIZE; ++ ++ // Copy over the scsi command descriptor block ++ vstorPacket->VmSrb.CdbLength = Request->CdbLen; ++ memcpy(&vstorPacket->VmSrb.Cdb, Request->Cdb, Request->CdbLen); ++ ++ vstorPacket->VmSrb.DataIn = Request->Type; ++ vstorPacket->VmSrb.DataTransferLength = Request->DataBuffer.Length; ++ ++ vstorPacket->Operation = VStorOperationExecuteSRB; ++ ++ DPRINT_DBG(STORVSC, "srb - len %d port %d, path %d, target %d, lun %d senselen %d cdblen %d", ++ vstorPacket->VmSrb.Length, ++ vstorPacket->VmSrb.PortNumber, ++ vstorPacket->VmSrb.PathId, ++ vstorPacket->VmSrb.TargetId, ++ vstorPacket->VmSrb.Lun, ++ vstorPacket->VmSrb.SenseInfoLength, ++ vstorPacket->VmSrb.CdbLength); ++ ++ if (requestExtension->Request->DataBuffer.Length) ++ { ++ ret = Device->Driver->VmbusChannelInterface.SendPacketMultiPageBuffer(Device, ++ &requestExtension->Request->DataBuffer, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)requestExtension); ++ } ++ else ++ { ++ ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ++ vstorPacket, ++ sizeof(VSTOR_PACKET), ++ (ULONG_PTR)requestExtension, ++ VmbusPacketTypeDataInBand, ++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); ++ } ++ ++ if (ret != 0) ++ { ++ DPRINT_DBG(STORVSC, "Unable to send packet %p ret %d", vstorPacket, ret); ++ } ++ ++ InterlockedIncrement(&storDevice->NumOutstandingRequests); ++ ++ PutStorDevice(Device); ++ ++ DPRINT_EXIT(STORVSC); ++ return ret; ++} ++ ++/*++ ++ ++Name: ++ StorVscOnCleanup() ++ ++Description: ++ Perform any cleanup when the driver is removed ++ ++--*/ ++void ++StorVscOnCleanup( ++ DRIVER_OBJECT *Driver ++ ) ++{ ++ DPRINT_ENTER(STORVSC); ++ DPRINT_EXIT(STORVSC); ++} ++ ++ ++static void ++StorVscOnIOCompletion( ++ DEVICE_OBJECT *Device, ++ VSTOR_PACKET *VStorPacket, ++ STORVSC_REQUEST_EXTENSION *RequestExt ++ ) ++{ ++ STORVSC_REQUEST *request; ++ STORVSC_DEVICE *storDevice; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ storDevice = MustGetStorDevice(Device); ++ if (!storDevice) ++ { ++ DPRINT_ERR(STORVSC, "unable to get stor device...device being destroyed?"); ++ DPRINT_EXIT(STORVSC); ++ return; ++ } ++ ++ DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION - request extension %p completed bytes xfer %u", ++ RequestExt, VStorPacket->VmSrb.DataTransferLength); ++ ++ ASSERT(RequestExt != NULL); ++ ASSERT(RequestExt->Request != NULL); ++ ++ request = RequestExt->Request; ++ ++ ASSERT(request->OnIOCompletion != NULL); ++ ++ // Copy over the status...etc ++ request->Status = VStorPacket->VmSrb.ScsiStatus; ++ ++ if (request->Status != 0 || VStorPacket->VmSrb.SrbStatus != 1) ++ { ++ DPRINT_WARN(STORVSC, "cmd 0x%x scsi status 0x%x srb status 0x%x\n", ++ request->Cdb[0], ++ VStorPacket->VmSrb.ScsiStatus, ++ VStorPacket->VmSrb.SrbStatus); ++ } ++ ++ if ((request->Status & 0xFF) == 0x02) // CHECK_CONDITION ++ { ++ if (VStorPacket->VmSrb.SrbStatus & 0x80) // autosense data available ++ { ++ DPRINT_WARN(STORVSC, "storvsc pkt %p autosense data valid - len %d\n", ++ RequestExt, VStorPacket->VmSrb.SenseInfoLength); ++ ++ ASSERT(VStorPacket->VmSrb.SenseInfoLength <= request->SenseBufferSize); ++ memcpy(request->SenseBuffer, ++ VStorPacket->VmSrb.SenseData, ++ VStorPacket->VmSrb.SenseInfoLength); ++ ++ request->SenseBufferSize = VStorPacket->VmSrb.SenseInfoLength; ++ } ++ } ++ ++ // TODO: ++ request->BytesXfer = VStorPacket->VmSrb.DataTransferLength; ++ ++ request->OnIOCompletion(request); ++ ++ InterlockedDecrement(&storDevice->NumOutstandingRequests); ++ ++ PutStorDevice(Device); ++ ++ DPRINT_EXIT(STORVSC); ++} ++ ++ ++static void ++StorVscOnReceive( ++ DEVICE_OBJECT *Device, ++ VSTOR_PACKET *VStorPacket, ++ STORVSC_REQUEST_EXTENSION *RequestExt ++ ) ++{ ++ switch(VStorPacket->Operation) ++ { ++ case VStorOperationCompleteIo: ++ ++ DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION"); ++ StorVscOnIOCompletion(Device, VStorPacket, RequestExt); ++ break; ++ ++ //case ENUMERATE_DEVICE_OPERATION: ++ ++ // DPRINT_INFO(STORVSC, "ENUMERATE_DEVICE_OPERATION"); ++ ++ // StorVscOnTargetRescan(Device); ++ // break; ++ ++ case VStorOperationRemoveDevice: ++ ++ DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION"); ++ // TODO: ++ break; ++ ++ default: ++ DPRINT_INFO(STORVSC, "Unknown operation received - %d", VStorPacket->Operation); ++ break; ++ } ++} ++ ++void ++StorVscOnChannelCallback( ++ PVOID Context ++ ) ++{ ++ int ret=0; ++ DEVICE_OBJECT *device = (DEVICE_OBJECT*)Context; ++ STORVSC_DEVICE *storDevice; ++ UINT32 bytesRecvd; ++ UINT64 requestId; ++ UCHAR packet[ALIGN_UP(sizeof(VSTOR_PACKET),8)]; ++ STORVSC_REQUEST_EXTENSION *request; ++ ++ DPRINT_ENTER(STORVSC); ++ ++ ASSERT(device); ++ ++ storDevice = MustGetStorDevice(device); ++ if (!storDevice) ++ { ++ DPRINT_ERR(STORVSC, "unable to get stor device...device being destroyed?"); ++ DPRINT_EXIT(STORVSC); ++ return; ++ } ++ ++ do ++ { ++ ret = device->Driver->VmbusChannelInterface.RecvPacket(device, ++ packet, ++ ALIGN_UP(sizeof(VSTOR_PACKET),8), ++ &bytesRecvd, ++ &requestId); ++ if (ret == 0 && bytesRecvd > 0) ++ { ++ DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx", bytesRecvd, requestId); ++ ++ //ASSERT(bytesRecvd == sizeof(VSTOR_PACKET)); ++ ++ request = (STORVSC_REQUEST_EXTENSION*)(ULONG_PTR)requestId; ++ ASSERT(request); ++ ++ //if (vstorPacket.Flags & SYNTHETIC_FLAG) ++ if ((request == &storDevice->InitRequest) || (request == &storDevice->ResetRequest)) ++ { ++ //DPRINT_INFO(STORVSC, "reset completion - operation %u status %u", vstorPacket.Operation, vstorPacket.Status); ++ ++ memcpy(&request->VStorPacket, packet, sizeof(VSTOR_PACKET)); ++ ++ WaitEventSet(request->WaitEvent); ++ } ++ else ++ { ++ StorVscOnReceive(device, (VSTOR_PACKET*)packet, request); ++ } ++ } ++ else ++ { ++ //DPRINT_DBG(STORVSC, "nothing else to read..."); ++ break; ++ } ++ } while (1); ++ ++ PutStorDevice(device); ++ ++ DPRINT_EXIT(STORVSC); ++ return; ++} +--- /dev/null ++++ b/drivers/staging/hv/storvsc_drv.c +@@ -0,0 +1,1413 @@ ++/* ++ * ++ * Copyright (c) 2009, Microsoft 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. ++ * ++ * Authors: ++ * Haiyang Zhang ++ * Hank Janssen ++ * ++ */ ++ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef KERNEL_2_6_5 ++#else ++#include ++#endif ++ ++#include "logging.h" ++#include "vmbus.h" ++ ++#include "StorVscApi.h" ++ ++// ++// #defines ++// ++ ++// ++// Data types ++// ++struct host_device_context { ++ struct work_struct host_rescan_work; //must be 1st field ++ struct device_context *device_ctx; // point back to our device context ++#ifdef KERNEL_2_6_27 ++ struct kmem_cache *request_pool; ++#else ++ kmem_cache_t *request_pool; ++#endif ++ unsigned int port; ++ unsigned char path; ++ unsigned char target; ++}; ++ ++struct storvsc_cmd_request { ++ struct list_head entry; ++ struct scsi_cmnd *cmd; ++ ++ unsigned int bounce_sgl_count; ++ struct scatterlist *bounce_sgl; ++ ++ STORVSC_REQUEST request; ++ // !!!DO NOT ADD ANYTHING BELOW HERE!!! ++ // The extension buffer falls right here and is pointed to by request.Extension; ++}; ++ ++struct storvsc_driver_context { ++ // !! These must be the first 2 fields !! ++ struct driver_context drv_ctx; ++ STORVSC_DRIVER_OBJECT drv_obj; ++}; ++ ++// Static decl ++static int storvsc_probe(struct device *dev); ++static int storvsc_queuecommand(struct scsi_cmnd *scmnd, void (*done)(struct scsi_cmnd *)); ++static int storvsc_device_alloc(struct scsi_device *); ++static int storvsc_device_configure(struct scsi_device *); ++static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); ++#ifdef KERNEL_2_6_27 ++static void storvsc_host_rescan_callback(struct work_struct *work); ++#else ++static void storvsc_host_rescan_callback(void* context); ++#endif ++static void storvsc_host_rescan(DEVICE_OBJECT* device_obj); ++static int storvsc_remove(struct device *dev); ++ ++static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count, unsigned int len); ++static void destroy_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count); ++static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count); ++static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, struct scatterlist *bounce_sgl, unsigned int orig_sgl_count); ++static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl, struct scatterlist *bounce_sgl, unsigned int orig_sgl_count); ++ ++static int storvsc_report_luns(struct scsi_device *sdev, unsigned int luns[], unsigned int *lun_count); ++static int storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev, sector_t capacity, int *info); ++ ++ ++static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE; ++ ++// The one and only one ++static struct storvsc_driver_context g_storvsc_drv; ++ ++// Scsi driver ++static struct scsi_host_template scsi_driver = { ++ .module = THIS_MODULE, ++ .name = "storvsc_host_t", ++ .bios_param = storvsc_get_chs, ++ .queuecommand = storvsc_queuecommand, ++ .eh_host_reset_handler = storvsc_host_reset_handler, ++ .slave_alloc = storvsc_device_alloc, ++ .slave_configure = storvsc_device_configure, ++ .cmd_per_lun = 1, ++ .can_queue = STORVSC_MAX_IO_REQUESTS*STORVSC_MAX_TARGETS, // 64 max_queue * 1 target ++ .this_id = -1, ++ // no use setting to 0 since ll_blk_rw reset it to 1 ++ .sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT,// currently 32 ++ // ENABLE_CLUSTERING allows mutiple physically contig bio_vecs to merge into 1 sg element. If set, we must ++ // limit the max_segment_size to PAGE_SIZE, otherwise we may get 1 sg element that represents multiple ++ // physically contig pfns (ie sg[x].length > PAGE_SIZE). ++ .use_clustering = ENABLE_CLUSTERING, ++ // Make sure we dont get a sg segment crosses a page boundary ++ .dma_boundary = PAGE_SIZE-1, ++}; ++ ++ ++/*++ ++ ++Name: storvsc_drv_init() ++ ++Desc: StorVsc driver initialization. ++ ++--*/ ++int storvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init) ++{ ++ int ret=0; ++ STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_storvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_storvsc_drv.drv_ctx; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ vmbus_get_interface(&storvsc_drv_obj->Base.VmbusChannelInterface); ++ ++ storvsc_drv_obj->RingBufferSize = storvsc_ringbuffer_size; ++ storvsc_drv_obj->OnHostRescan = storvsc_host_rescan; ++ ++ // Callback to client driver to complete the initialization ++ pfn_drv_init(&storvsc_drv_obj->Base); ++ ++ DPRINT_INFO(STORVSC_DRV, "request extension size %u, max outstanding reqs %u", storvsc_drv_obj->RequestExtSize, storvsc_drv_obj->MaxOutstandingRequestsPerChannel); ++ ++ if (storvsc_drv_obj->MaxOutstandingRequestsPerChannel < STORVSC_MAX_IO_REQUESTS) ++ { ++ DPRINT_ERR(STORVSC_DRV, "The number of outstanding io requests (%d) is larger than that supported (%d) internally.", ++ STORVSC_MAX_IO_REQUESTS, storvsc_drv_obj->MaxOutstandingRequestsPerChannel); ++ return -1; ++ } ++ ++ drv_ctx->driver.name = storvsc_drv_obj->Base.name; ++ memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID)); ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++ drv_ctx->driver.probe = storvsc_probe; ++ drv_ctx->driver.remove = storvsc_remove; ++#else ++ drv_ctx->probe = storvsc_probe; ++ drv_ctx->remove = storvsc_remove; ++#endif ++ ++ // The driver belongs to vmbus ++ vmbus_child_driver_register(drv_ctx); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++ ++static int storvsc_drv_exit_cb(struct device *dev, void *data) ++{ ++ struct device **curr = (struct device **)data; ++ *curr = dev; ++ return 1; // stop iterating ++} ++ ++/*++ ++ ++Name: storvsc_drv_exit() ++ ++Desc: ++ ++--*/ ++void storvsc_drv_exit(void) ++{ ++ STORVSC_DRIVER_OBJECT *storvsc_drv_obj=&g_storvsc_drv.drv_obj; ++ struct driver_context *drv_ctx=&g_storvsc_drv.drv_ctx; ++ ++ struct device *current_dev=NULL; ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#define driver_for_each_device(drv, start, data, fn) \ ++ struct list_head *ptr, *n; \ ++ list_for_each_safe(ptr, n, &((drv)->devices)) {\ ++ struct device *curr_dev;\ ++ curr_dev = list_entry(ptr, struct device, driver_list);\ ++ fn(curr_dev, data);\ ++ } ++#endif // KERNEL_2_6_9 ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ while (1) ++ { ++ current_dev = NULL; ++ ++ // Get the device ++ driver_for_each_device(&drv_ctx->driver, NULL, (void*)¤t_dev, storvsc_drv_exit_cb); ++ ++ if (current_dev == NULL) ++ break; ++ ++ // Initiate removal from the top-down ++ device_unregister(current_dev); ++ } ++ ++ if (storvsc_drv_obj->Base.OnCleanup) ++ storvsc_drv_obj->Base.OnCleanup(&storvsc_drv_obj->Base); ++ ++ vmbus_child_driver_unregister(drv_ctx); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return; ++} ++ ++/*++ ++ ++Name: storvsc_probe() ++ ++Desc: Add a new device for this driver ++ ++--*/ ++static int storvsc_probe(struct device *device) ++{ ++ int ret=0; ++ ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &storvsc_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ DEVICE_OBJECT* device_obj = &device_ctx->device_obj; ++ ++ struct Scsi_Host *host; ++ struct host_device_context *host_device_ctx; ++ STORVSC_DEVICE_INFO device_info; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ if (!storvsc_drv_obj->Base.OnDeviceAdd) ++ return -1; ++ ++ host = scsi_host_alloc(&scsi_driver, sizeof(struct host_device_context)); ++ if (!host) ++ { ++ DPRINT_ERR(STORVSC_DRV, "unable to allocate scsi host object"); ++ return -ENOMEM; ++ } ++ ++ device->driver_data = host; ++ ++ host_device_ctx = (struct host_device_context*)host->hostdata; ++ memset(host_device_ctx, 0, sizeof(struct host_device_context)); ++ ++ host_device_ctx->port = host->host_no; ++ host_device_ctx->device_ctx = device_ctx; ++ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#elif defined(KERNEL_2_6_27) ++ INIT_WORK(&host_device_ctx->host_rescan_work, storvsc_host_rescan_callback); ++#else ++ INIT_WORK(&host_device_ctx->host_rescan_work, storvsc_host_rescan_callback, device_obj); ++#endif ++ ++#if defined(KERNEL_2_6_27) ++ host_device_ctx->request_pool = ++ kmem_cache_create ++ (device_ctx->device.bus_id, ++ sizeof(struct storvsc_cmd_request) + storvsc_drv_obj->RequestExtSize, ++ 0, ++ SLAB_HWCACHE_ALIGN, NULL); ++#else ++ host_device_ctx->request_pool = ++ kmem_cache_create ++ (device_ctx->device.bus_id, ++ sizeof(struct storvsc_cmd_request) + storvsc_drv_obj->RequestExtSize, ++ 0, ++ SLAB_HWCACHE_ALIGN, NULL, NULL); ++#endif ++ ++ if (!host_device_ctx->request_pool) ++ { ++ scsi_host_put(host); ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return -ENOMEM; ++ } ++ ++ device_info.PortNumber = host->host_no; ++ // Call to the vsc driver to add the device ++ ret = storvsc_drv_obj->Base.OnDeviceAdd(device_obj, (void*)&device_info); ++ if (ret != 0) ++ { ++ DPRINT_ERR(STORVSC_DRV, "unable to add scsi vsc device"); ++ kmem_cache_destroy(host_device_ctx->request_pool); ++ scsi_host_put(host); ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return -1; ++ } ++ ++ //host_device_ctx->port = device_info.PortNumber; ++ host_device_ctx->path = device_info.PathId; ++ host_device_ctx->target = device_info.TargetId; ++ ++ host->max_lun = STORVSC_MAX_LUNS_PER_TARGET; // max # of devices per target ++ host->max_id = STORVSC_MAX_TARGETS; // max # of targets per channel ++ host->max_channel = STORVSC_MAX_CHANNELS -1; // max # of channels ++ ++ // Register the HBA and start the scsi bus scan ++ ret = scsi_add_host(host, device); ++ if (ret != 0) ++ { ++ DPRINT_ERR(STORVSC_DRV, "unable to add scsi host device"); ++ ++ storvsc_drv_obj->Base.OnDeviceRemove(device_obj); ++ ++ kmem_cache_destroy(host_device_ctx->request_pool); ++ scsi_host_put(host); ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return -1; ++ } ++ ++ scsi_scan_host(host); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++ ++/*++ ++ ++Name: storvsc_remove() ++ ++Desc: Callback when our device is removed ++ ++--*/ ++static int storvsc_remove(struct device *device) ++{ ++ int ret=0; ++ ++ struct driver_context *driver_ctx = driver_to_driver_context(device->driver); ++ struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &storvsc_drv_ctx->drv_obj; ++ ++ struct device_context *device_ctx = device_to_device_context(device); ++ DEVICE_OBJECT* device_obj = &device_ctx->device_obj; ++ ++ struct Scsi_Host *host = (struct Scsi_Host *)device->driver_data; ++ struct host_device_context *host_device_ctx=(struct host_device_context*)host->hostdata; ++ ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ if (!storvsc_drv_obj->Base.OnDeviceRemove) ++ { ++ DPRINT_EXIT(STORVSC_DRV); ++ return -1; ++ } ++ ++ // Call to the vsc driver to let it know that the device is being removed ++ ret = storvsc_drv_obj->Base.OnDeviceRemove(device_obj); ++ if (ret != 0) ++ { ++ // TODO: ++ DPRINT_ERR(STORVSC, "unable to remove vsc device (ret %d)", ret); ++ } ++ ++ if (host_device_ctx->request_pool) ++ { ++ kmem_cache_destroy(host_device_ctx->request_pool); ++ host_device_ctx->request_pool = NULL; ++ } ++ ++ DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host); ++ scsi_remove_host(host); ++ ++ DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host); ++ scsi_host_put(host); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: storvsc_commmand_completion() ++ ++Desc: Command completion processing ++ ++--*/ ++static void storvsc_commmand_completion(STORVSC_REQUEST* request) ++{ ++ struct storvsc_cmd_request *cmd_request = (struct storvsc_cmd_request*)request->Context; ++ struct scsi_cmnd *scmnd = cmd_request->cmd; ++ struct host_device_context *host_device_ctx = (struct host_device_context*)scmnd->device->host->hostdata; ++ void (*scsi_done_fn)(struct scsi_cmnd *); ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#else ++ struct scsi_sense_hdr sense_hdr; ++#endif ++ ++ ASSERT(request == &cmd_request->request); ++ ASSERT((unsigned long)scmnd->host_scribble == (unsigned long)cmd_request); ++ ASSERT(scmnd); ++ ASSERT(scmnd->scsi_done); ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ if (cmd_request->bounce_sgl_count)// using bounce buffer ++ { ++ //printk("copy_from_bounce_buffer\n"); ++ ++ // FIXME: We can optimize on writes by just skipping this ++#ifdef KERNEL_2_6_27 ++ copy_from_bounce_buffer(scsi_sglist(scmnd), cmd_request->bounce_sgl, scsi_sg_count(scmnd)); ++#else ++ copy_from_bounce_buffer(scmnd->request_buffer, cmd_request->bounce_sgl, scmnd->use_sg); ++#endif ++ destroy_bounce_buffer(cmd_request->bounce_sgl, cmd_request->bounce_sgl_count); ++ } ++ ++ scmnd->result = request->Status; ++ ++ if (scmnd->result) ++ { ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++ DPRINT_INFO(STORVSC_DRV, "scsi result nonzero - %d", scmnd->result); ++#else ++ if (scsi_normalize_sense(scmnd->sense_buffer, request->SenseBufferSize, &sense_hdr)) ++ { ++ scsi_print_sense_hdr("storvsc", &sense_hdr); ++ } ++#endif ++ } ++ ++ ASSERT(request->BytesXfer <= request->DataBuffer.Length); ++#ifdef KERNEL_2_6_27 ++ scsi_set_resid(scmnd, request->DataBuffer.Length - request->BytesXfer); ++#else ++ scmnd->resid = request->DataBuffer.Length - request->BytesXfer; ++#endif ++ ++ scsi_done_fn = scmnd->scsi_done; ++ ++ scmnd->host_scribble = NULL; ++ scmnd->scsi_done = NULL; ++ ++ // !!DO NOT MODIFY the scmnd after this call ++ scsi_done_fn(scmnd); ++ ++ kmem_cache_free(host_device_ctx->request_pool, cmd_request); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++} ++ ++static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count) ++{ ++ int i=0; ++ ++ // No need to check ++ if (sg_count < 2) ++ return -1; ++ ++ // We have at least 2 sg entries ++ for ( i=0; i> PAGE_SHIFT; ++ ++ bounce_sgl = kzalloc(num_pages * sizeof(struct scatterlist), GFP_ATOMIC); ++ if (!bounce_sgl) ++ { ++ return NULL; ++ } ++ ++ for(i=0; idevice->host->hostdata; ++ struct device_context *device_ctx=host_device_ctx->device_ctx; ++ struct driver_context *driver_ctx = driver_to_driver_context(device_ctx->device.driver); ++ struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx; ++ STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &storvsc_drv_ctx->drv_obj; ++ ++ STORVSC_REQUEST *request; ++ struct storvsc_cmd_request *cmd_request; ++ unsigned int request_size=0; ++ int i; ++ struct scatterlist *sgl; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++#ifdef KERNEL_2_6_27 ++ DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d queue depth %d tagged %d", ++ scmnd, ++ scmnd->sc_data_direction, ++ scsi_sg_count(scmnd), ++ scsi_sglist(scmnd), ++ scsi_bufflen(scmnd), ++ scmnd->device->queue_depth, ++ scmnd->device->tagged_supported); ++#else ++ DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d queue depth %d tagged %d", ++ scmnd, ++ scmnd->sc_data_direction, ++ scmnd->use_sg, ++ scmnd->request_buffer, ++ scmnd->request_bufflen, ++ scmnd->device->queue_depth, ++ scmnd->device->tagged_supported); ++#endif ++ ++ // If retrying, no need to prep the cmd ++ if (scmnd->host_scribble) ++ { ++ ASSERT(scmnd->scsi_done != NULL); ++ ++ cmd_request = (struct storvsc_cmd_request* )scmnd->host_scribble; ++ DPRINT_INFO(STORVSC_DRV, "retrying scmnd %p cmd_request %p", scmnd, cmd_request); ++ ++ goto retry_request; ++ } ++ ++ ASSERT(scmnd->scsi_done == NULL); ++ ASSERT(scmnd->host_scribble == NULL); ++ ++ scmnd->scsi_done = done; ++ ++ request_size = sizeof(struct storvsc_cmd_request); ++ ++ cmd_request = kmem_cache_alloc(host_device_ctx->request_pool, GFP_ATOMIC); ++ if (!cmd_request) ++ { ++ DPRINT_ERR(STORVSC_DRV, "scmnd (%p) - unable to allocate storvsc_cmd_request...marking queue busy", scmnd); ++ ++ scmnd->scsi_done = NULL; ++ return SCSI_MLQUEUE_DEVICE_BUSY; ++ } ++ ++ // Setup the cmd request ++ cmd_request->bounce_sgl_count = 0; ++ cmd_request->bounce_sgl = NULL; ++ cmd_request->cmd = scmnd; ++ ++ scmnd->host_scribble = (unsigned char*)cmd_request; ++ ++ request = &cmd_request->request; ++ ++ request->Extension = (void*)((unsigned long)cmd_request + request_size); ++ DPRINT_DBG(STORVSC_DRV, "req %p size %d ext %d", request, request_size, storvsc_drv_obj->RequestExtSize); ++ ++ // Build the SRB ++ switch(scmnd->sc_data_direction) ++ { ++ case DMA_TO_DEVICE: ++ request->Type = WRITE_TYPE; ++ break; ++ case DMA_FROM_DEVICE: ++ request->Type = READ_TYPE; ++ break; ++ default: ++ request->Type = UNKNOWN_TYPE; ++ break; ++ } ++ ++ request->OnIOCompletion = storvsc_commmand_completion; ++ request->Context = cmd_request;//scmnd; ++ ++ //request->PortId = scmnd->device->channel; ++ request->Host = host_device_ctx->port; ++ request->Bus = scmnd->device->channel; ++ request->TargetId = scmnd->device->id; ++ request->LunId = scmnd->device->lun; ++ ++ ASSERT(scmnd->cmd_len <= 16); ++ request->CdbLen = scmnd->cmd_len; ++ request->Cdb = scmnd->cmnd; ++ ++ request->SenseBuffer = scmnd->sense_buffer; ++ request->SenseBufferSize = SCSI_SENSE_BUFFERSIZE; ++ ++ ++#ifdef KERNEL_2_6_27 ++ request->DataBuffer.Length = scsi_bufflen(scmnd); ++ if (scsi_sg_count(scmnd)) ++#else ++ request->DataBuffer.Length = scmnd->request_bufflen; ++ if (scmnd->use_sg) ++#endif ++ { ++#ifdef KERNEL_2_6_27 ++ sgl = (struct scatterlist*)scsi_sglist(scmnd); ++#else ++ sgl = (struct scatterlist*)(scmnd->request_buffer); ++#endif ++ ++ // check if we need to bounce the sgl ++#ifdef KERNEL_2_6_27 ++ if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) ++#else ++ if (do_bounce_buffer(sgl, scmnd->use_sg) != -1) ++#endif ++ { ++ DPRINT_INFO(STORVSC_DRV, "need to bounce buffer for this scmnd %p", scmnd); ++#ifdef KERNEL_2_6_27 ++ cmd_request->bounce_sgl = create_bounce_buffer(sgl, scsi_sg_count(scmnd), scsi_bufflen(scmnd)); ++#else ++ cmd_request->bounce_sgl = create_bounce_buffer( ++ sgl, ++ scmnd->use_sg, scmnd->request_bufflen); ++#endif ++ if (!cmd_request->bounce_sgl) ++ { ++ DPRINT_ERR(STORVSC_DRV, "unable to create bounce buffer for this scmnd %p", scmnd); ++ ++ scmnd->scsi_done = NULL; ++ scmnd->host_scribble = NULL; ++ kmem_cache_free(host_device_ctx->request_pool, cmd_request); ++ ++ return SCSI_MLQUEUE_HOST_BUSY; ++ } ++ ++#ifdef KERNEL_2_6_27 ++ cmd_request->bounce_sgl_count = ALIGN_UP(scsi_bufflen(scmnd), PAGE_SIZE) >> PAGE_SHIFT; ++#else ++ cmd_request->bounce_sgl_count = ALIGN_UP(scmnd->request_bufflen, PAGE_SIZE) >> PAGE_SHIFT; ++#endif ++ ++ //printk("bouncing buffer allocated %p original buffer %p\n", bounce_sgl, sgl); ++ //printk("copy_to_bounce_buffer\n"); ++ // FIXME: We can optimize on reads by just skipping this ++#ifdef KERNEL_2_6_27 ++ copy_to_bounce_buffer(sgl, cmd_request->bounce_sgl, scsi_sg_count(scmnd)); ++#else ++ copy_to_bounce_buffer(sgl, cmd_request->bounce_sgl, scmnd->use_sg); ++#endif ++ ++ sgl = cmd_request->bounce_sgl; ++ } ++ ++ request->DataBuffer.Offset = sgl[0].offset; ++ ++#ifdef KERNEL_2_6_27 ++ for (i = 0; i < scsi_sg_count(scmnd); i++ ) ++#else ++ for (i = 0; i < scmnd->use_sg; i++ ) ++#endif ++ { ++ DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d \n", i, sgl[i].length, sgl[i].offset); ++#ifdef KERNEL_2_6_27 ++ request->DataBuffer.PfnArray[i] = page_to_pfn(sg_page((&sgl[i]))); ++#else ++ request->DataBuffer.PfnArray[i] = page_to_pfn(sgl[i].page); ++#endif ++ } ++ } ++ ++#ifdef KERNEL_2_6_27 ++ else if (scsi_sglist(scmnd)) ++ { ++ ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); ++ request->DataBuffer.Offset = virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1); ++ request->DataBuffer.PfnArray[0] = virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT; ++ } ++ else ++ { ++ ASSERT(scsi_bufflen(scmnd) == 0); ++ } ++#else ++ else if (scmnd->request_buffer) ++ { ++ ASSERT(scmnd->request_bufflen <= PAGE_SIZE); ++ request->DataBuffer.Offset = virt_to_phys(scmnd->request_buffer) & (PAGE_SIZE-1); ++ request->DataBuffer.PfnArray[0] = virt_to_phys(scmnd->request_buffer) >> PAGE_SHIFT; ++ } ++ else ++ { ++ ASSERT(scmnd->request_bufflen == 0); ++ } ++#endif ++ ++retry_request: ++ ++ // Invokes the vsc to start an IO ++ ret = storvsc_drv_obj->OnIORequest(&device_ctx->device_obj, &cmd_request->request); ++ if (ret == -1) // no more space ++ { ++ DPRINT_ERR(STORVSC_DRV, "scmnd (%p) - queue FULL...marking queue busy", scmnd); ++ ++ if (cmd_request->bounce_sgl_count) ++ { ++ // FIXME: We can optimize on writes by just skipping this ++#ifdef KERNEL_2_6_27 ++ copy_from_bounce_buffer(scsi_sglist(scmnd), cmd_request->bounce_sgl, scsi_sg_count(scmnd)); ++#else ++ copy_from_bounce_buffer( ++ scmnd->request_buffer, ++ cmd_request->bounce_sgl, ++ scmnd->use_sg); ++#endif ++ destroy_bounce_buffer(cmd_request->bounce_sgl, cmd_request->bounce_sgl_count); ++ } ++ ++ kmem_cache_free(host_device_ctx->request_pool, cmd_request); ++ ++ scmnd->scsi_done = NULL; ++ scmnd->host_scribble = NULL; ++ ++ ret = SCSI_MLQUEUE_DEVICE_BUSY; ++ } ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++#ifdef KERNEL_2_6_27 ++static int storvsc_merge_bvec(struct request_queue *q, struct bvec_merge_data *bmd, struct bio_vec *bvec) ++{ ++ return bvec->bv_len; //checking done by caller. ++} ++#else ++static int storvsc_merge_bvec(struct request_queue *q, struct bio *bio, struct bio_vec *bvec) ++{ ++ // Check if we are adding a new bvec ++ if (bio->bi_vcnt > 0) ++ { ++ //printk("storvsc_merge_bvec() - cnt %u offset %u len %u\n", bio->bi_vcnt, bvec->bv_offset, bvec->bv_len); ++ ++ struct bio_vec *prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; ++ if (bvec == prev) ++ return bvec->bv_len; // success ++ ++ // Adding new bvec. Make sure the prev one is a complete page ++ if (prev->bv_len == PAGE_SIZE && prev->bv_offset == 0) ++ { ++ return bvec->bv_len; // success ++ } ++ else ++ { ++ // Dont reject if the new bvec starts off from the prev one since ++ // they will be merge into 1 bvec or blk_rq_map_sg() will merge them into 1 sg element ++ if ((bvec->bv_page == prev->bv_page) && ++ (bvec->bv_offset == prev->bv_offset + prev->bv_len)) ++ { ++ return bvec->bv_len; // success ++ } ++ else ++ { ++ DPRINT_INFO(STORVSC_DRV, "detected holes in bio request (%p) - cnt %u offset %u len %u", bio, bio->bi_vcnt, bvec->bv_offset, bvec->bv_len); ++ return 0; // dont add the bvec to this bio since we dont allow holes in the middle of a multi-pages bio ++ } ++ } ++ } ++ ++ return bvec->bv_len; // success ++ ++} ++ ++#endif ++ ++/*++ ++ ++Name: storvsc_device_configure() ++ ++Desc: Configure the specified scsi device ++ ++--*/ ++static int storvsc_device_alloc(struct scsi_device *sdevice) ++{ ++#ifdef KERNEL_2_6_5 ++#else ++ DPRINT_DBG(STORVSC_DRV, "sdev (%p) - setting device flag to %d", sdevice, BLIST_SPARSELUN); ++ // This enables luns to be located sparsely. Otherwise, we may not discovered them. ++ sdevice->sdev_bflags |= BLIST_SPARSELUN | BLIST_LARGELUN; ++#endif ++ return 0; ++} ++ ++static int storvsc_device_configure(struct scsi_device *sdevice) ++{ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) - curr queue depth %d", sdevice, sdevice->queue_depth); ++ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) - setting queue depth to %d", sdevice, STORVSC_MAX_IO_REQUESTS); ++ scsi_adjust_queue_depth(sdevice, MSG_SIMPLE_TAG, STORVSC_MAX_IO_REQUESTS); ++ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) - setting max segment size to %d", sdevice, PAGE_SIZE); ++ blk_queue_max_segment_size(sdevice->request_queue, PAGE_SIZE); ++ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) - adding merge bio vec routine", sdevice); ++ blk_queue_merge_bvec(sdevice->request_queue, storvsc_merge_bvec); ++ ++ blk_queue_bounce_limit(sdevice->request_queue, BLK_BOUNCE_ANY); ++ //sdevice->timeout = (2000 * HZ);//(75 * HZ); ++ ++ return 0; ++} ++ ++/*++ ++ ++Name: storvsc_host_reset_handler() ++ ++Desc: Reset the scsi HBA ++ ++--*/ ++static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) ++{ ++ int ret=SUCCESS; ++ struct host_device_context *host_device_ctx = (struct host_device_context*)scmnd->device->host->hostdata; ++ struct device_context *device_ctx = host_device_ctx->device_ctx; ++ struct driver_context *driver_ctx = driver_to_driver_context(device_ctx->device.driver); ++ struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx; ++ ++ STORVSC_DRIVER_OBJECT *storvsc_drv_obj = &storvsc_drv_ctx->drv_obj; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host resetting...", scmnd->device, &device_ctx->device_obj); ++ ++ // Invokes the vsc to reset the host/bus ++ ASSERT(storvsc_drv_obj->OnHostReset); ++ ret = storvsc_drv_obj->OnHostReset(&device_ctx->device_obj); ++ if (ret != 0) ++ { ++ DPRINT_EXIT(STORVSC_DRV); ++ return ret; ++ } ++ ++ DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host reseted", scmnd->device, &device_ctx->device_obj); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++/*++ ++ ++Name: storvsc_host_rescan ++ ++Desc: Rescan the scsi HBA ++ ++--*/ ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#else ++ ++#ifdef KERNEL_2_6_27 ++static void storvsc_host_rescan_callback(struct work_struct *work) ++{ ++ DEVICE_OBJECT* device_obj = ++ &((struct host_device_context*)work)->device_ctx->device_obj; ++#else ++static void storvsc_host_rescan_callback(void* context) ++{ ++ ++ DEVICE_OBJECT* device_obj = (DEVICE_OBJECT*)context; ++#endif ++ struct device_context* device_ctx = to_device_context(device_obj); ++ struct Scsi_Host *host = (struct Scsi_Host *)device_ctx->device.driver_data; ++ struct scsi_device *sdev; ++ struct host_device_context *host_device_ctx; ++ struct scsi_device **sdevs_remove_list; ++ unsigned int sdevs_count=0; ++ unsigned int found; ++ unsigned int i; ++ unsigned int lun_count=0; ++ unsigned int *lun_list; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ host_device_ctx = (struct host_device_context*)host->hostdata; ++ lun_list = kzalloc(sizeof(unsigned int)*STORVSC_MAX_LUNS_PER_TARGET, GFP_ATOMIC); ++ if (!lun_list) ++ { ++ DPRINT_ERR(STORVSC_DRV, "unable to allocate lun list"); ++ return; ++ } ++ ++ sdevs_remove_list = kzalloc(sizeof(void*)*STORVSC_MAX_LUNS_PER_TARGET, GFP_ATOMIC); ++ if (!sdevs_remove_list) ++ { ++ kfree(lun_list); ++ DPRINT_ERR(STORVSC_DRV, "unable to allocate lun remove list"); ++ return; ++ } ++ ++ DPRINT_INFO(STORVSC_DRV, "rescanning host for new scsi devices...", device_obj, host_device_ctx->target, host_device_ctx->path); ++ ++ // Rescan for new device ++ scsi_scan_target(&host->shost_gendev, host_device_ctx->path, host_device_ctx->target, SCAN_WILD_CARD, 1); ++ ++ DPRINT_INFO(STORVSC_DRV, "rescanning host for removed scsi device..."); ++ ++ // Use the 1st device to send the report luns cmd ++ shost_for_each_device(sdev, host) ++ { ++ lun_count=STORVSC_MAX_LUNS_PER_TARGET; ++ storvsc_report_luns(sdev, lun_list, &lun_count); ++ ++ DPRINT_INFO(STORVSC_DRV, "report luns on scsi device (%p) found %u luns ", sdev, lun_count); ++ DPRINT_INFO(STORVSC_DRV, "existing luns on scsi device (%p) host (%d)", sdev, host->host_no); ++ ++ scsi_device_put(sdev); ++ break; ++ } ++ ++ for (i=0; ilun == lun_list[i]) ++ { ++ found = 1; ++ break; ++ } ++ } ++ if (!found) ++ { ++ DPRINT_INFO(STORVSC_DRV, "lun (%u) does not exists", sdev->lun); ++ sdevs_remove_list[sdevs_count++] = sdev; ++ } ++ } ++ ++ // Now remove the devices ++ for (i=0; i< sdevs_count; i++) ++ { ++ DPRINT_INFO(STORVSC_DRV, "removing scsi device (%p) lun (%u)...", ++ sdevs_remove_list[i], sdevs_remove_list[i]->lun); ++ ++ // make sure it is not removed from underneath us ++ if (!scsi_device_get(sdevs_remove_list[i])) ++ { ++ scsi_remove_device(sdevs_remove_list[i]); ++ scsi_device_put(sdevs_remove_list[i]); ++ } ++ } ++ ++ DPRINT_INFO(STORVSC_DRV, "rescan completed on dev obj (%p) target (%u) bus (%u)", device_obj, host_device_ctx->target, host_device_ctx->path); ++ ++ kfree(lun_list); ++ kfree(sdevs_remove_list); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++} ++ ++static int storvsc_report_luns(struct scsi_device *sdev, unsigned int luns[], unsigned int *lun_count) ++{ ++ int i,j; ++ unsigned int lun=0; ++ unsigned int num_luns; ++ int result; ++ unsigned char *data; ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++#else ++ struct scsi_sense_hdr sshdr; ++#endif ++ unsigned char cmd[16]={0}; ++ unsigned int report_len = 8*(STORVSC_MAX_LUNS_PER_TARGET+1); // Add 1 to cover the report_lun header ++ unsigned long long *report_luns; ++ const unsigned int in_lun_count = *lun_count; ++ ++ *lun_count = 0; ++ ++ report_luns = kzalloc(report_len, GFP_ATOMIC); ++ if (!report_luns) ++ { ++ return -ENOMEM; ++ } ++ ++ cmd[0] = REPORT_LUNS; ++ ++ // cmd length ++ *(unsigned int*)&cmd[6] = cpu_to_be32(report_len); ++ ++ result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, (unsigned char*)report_luns, report_len, &sshdr, 30*HZ, 3); ++ if (result != 0) ++ { ++ kfree(report_luns); ++ return -EBUSY; ++ } ++ ++ // get the length from the first four bytes ++ report_len = be32_to_cpu(*(unsigned int*)&report_luns[0]); ++ ++ num_luns = (report_len / sizeof(unsigned long long)); ++ if (num_luns > in_lun_count) ++ { ++ kfree(report_luns); ++ return -EINVAL; ++ } ++ ++ *lun_count = num_luns; ++ ++ DPRINT_DBG(STORVSC_DRV, "report luns on scsi device (%p) found %u luns ", sdev, num_luns); ++ ++ // lun id starts at 1 ++ for (i=1; i< num_luns+1; i++) ++ { ++ lun = 0; ++ data = (unsigned char*)&report_luns[i]; ++ for (j = 0; j < sizeof(lun); j += 2) ++ { ++ lun = lun | (((data[j] << 8) | data[j + 1]) << (j * 8)); ++ } ++ ++ luns[i-1] = lun; ++ } ++ ++ kfree(report_luns); ++ return 0; ++} ++#endif // KERNEL_2_6_9 ++ ++static void storvsc_host_rescan(DEVICE_OBJECT* device_obj) ++{ ++ struct device_context* device_ctx = to_device_context(device_obj); ++ struct Scsi_Host *host = (struct Scsi_Host *)device_ctx->device.driver_data; ++ struct host_device_context *host_device_ctx; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++#if defined(KERNEL_2_6_5) || defined(KERNEL_2_6_9) ++ DPRINT_ERR(STORVSC_DRV, "rescan not supported on 2.6.9 kernels!! You will need to reboot if you have added or removed the scsi lun device"); ++#else ++ ++ host_device_ctx = (struct host_device_context*)host->hostdata; ++ ++ DPRINT_INFO(STORVSC_DRV, "initiating rescan on dev obj (%p) target (%u) bus (%u)...", device_obj, host_device_ctx->target, host_device_ctx->path); ++ ++ // We need to queue this since the scanning may block and the caller may be in an intr context ++ //scsi_queue_work(host, &host_device_ctx->host_rescan_work); ++ schedule_work(&host_device_ctx->host_rescan_work); ++#endif // KERNEL_2_6_9 ++ DPRINT_EXIT(STORVSC_DRV); ++} ++ ++static int storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev, sector_t capacity, int *info) ++{ ++ sector_t total_sectors = capacity; ++ sector_t cylinder_times_heads=0; ++ sector_t temp=0; ++ ++ int sectors_per_track=0; ++ int heads=0; ++ int cylinders=0; ++ int rem=0; ++ ++ if (total_sectors > (65535 * 16 * 255)) { ++ total_sectors = (65535 * 16 * 255); ++ } ++ ++ if (total_sectors >= (65535 * 16 * 63)) { ++ sectors_per_track = 255; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ else ++ { ++ sectors_per_track = 17; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ ++ temp = cylinder_times_heads + 1023; ++ rem = sector_div(temp, 1024); // sector_div stores the quotient in temp ++ ++ heads = temp; ++ ++ if (heads < 4) { ++ heads = 4; ++ } ++ ++ if (cylinder_times_heads >= (heads * 1024) || (heads > 16)) { ++ sectors_per_track = 31; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ ++ if (cylinder_times_heads >= (heads * 1024)) { ++ sectors_per_track = 63; ++ heads = 16; ++ ++ cylinder_times_heads = total_sectors; ++ rem = sector_div(cylinder_times_heads, sectors_per_track); // sector_div stores the quotient in cylinder_times_heads ++ } ++ } ++ ++ temp = cylinder_times_heads; ++ rem = sector_div(temp, heads); // sector_div stores the quotient in temp ++ cylinders = temp; ++ ++ info[0] = heads; ++ info[1] = sectors_per_track; ++ info[2] = cylinders; ++ ++ DPRINT_INFO(STORVSC_DRV, "CHS (%d, %d, %d)", cylinders, heads, sectors_per_track); ++ ++ return 0; ++} ++ ++MODULE_LICENSE("GPL"); ++ ++static int __init storvsc_init(void) ++{ ++ int ret; ++ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ DPRINT_INFO(STORVSC_DRV, "Storvsc initializing...."); ++ ++ ret = storvsc_drv_init(StorVscInitialize); ++ ++ DPRINT_EXIT(STORVSC_DRV); ++ ++ return ret; ++} ++ ++static void __exit storvsc_exit(void) ++{ ++ DPRINT_ENTER(STORVSC_DRV); ++ ++ storvsc_drv_exit(); ++ ++ DPRINT_ENTER(STORVSC_DRV); ++} ++ ++module_param(storvsc_ringbuffer_size, int, S_IRUGO); ++ ++module_init(storvsc_init); ++module_exit(storvsc_exit); ++ ++// eof diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-blkvsc-fix-up-driver_data-usage.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-blkvsc-fix-up-driver_data-usage.patch new file mode 100644 index 000000000..cbcd1b75d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-blkvsc-fix-up-driver_data-usage.patch @@ -0,0 +1,50 @@ +From foo@baz Fri Jul 24 11:00:10 PDT 2009 +Date: Fri, 24 Jul 2009 11:00:10 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: blkvsc: fix up driver_data usage + +From: Greg Kroah-Hartman + +driver_data is gone now from struct device, so use the proper functions +to access it instead. + +Thanks to Bill Pemberton for pointing out this build error. + +Cc: Bill Pemberton +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/blkvsc_drv.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/staging/hv/blkvsc_drv.c ++++ b/drivers/staging/hv/blkvsc_drv.c +@@ -341,7 +341,7 @@ static int blkvsc_probe(struct device *d + blkdev->target = device_info.TargetId; // this identified the device 0 or 1 + blkdev->path = device_info.PathId; // this identified the ide ctrl 0 or 1 + +- device->driver_data = blkdev; ++ dev_set_drvdata(device, blkdev); + + // Calculate the major and device num + if (blkdev->path == 0) +@@ -457,7 +457,7 @@ Cleanup: + + static void blkvsc_shutdown(struct device *device) + { +- struct block_device_context *blkdev = (struct block_device_context*)device->driver_data; ++ struct block_device_context *blkdev = dev_get_drvdata(device); + unsigned long flags; + + if (!blkdev) +@@ -786,7 +786,7 @@ static int blkvsc_remove(struct device * + + struct device_context *device_ctx = device_to_device_context(device); + DEVICE_OBJECT* device_obj = &device_ctx->device_obj; +- struct block_device_context *blkdev = (struct block_device_context*)device->driver_data; ++ struct block_device_context *blkdev = dev_get_drvdata(device); + unsigned long flags; + + DPRINT_ENTER(BLKVSC_DRV); diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-block-driver-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-block-driver-build.patch new file mode 100644 index 000000000..4aa3b3e92 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-block-driver-build.patch @@ -0,0 +1,71 @@ +From foo@baz Tue Jul 14 10:24:38 PDT 2009 +Date: Tue, 14 Jul 2009 10:24:38 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: make the Hyper-V virtual block driver build + +From: Greg Kroah-Hartman + +The #define KERNEL_2_6_27 needs to be set, and I adjusted the include +directories a bit to get things to build properly. + +I also fixed up the direct access of bus_id, as that field is now gone. +Lots of block api changes were needed, and I don't think I got it +all correct. It would be great of someone who knows the block api better +could review it. + +The hv_blkvsc code should now build, with no errors. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/staging/hv/BlkVsc.c | 2 +- + drivers/staging/hv/blkvsc_drv.c | 9 +++++---- + 2 files changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/staging/hv/BlkVsc.c ++++ b/drivers/staging/hv/BlkVsc.c +@@ -21,7 +21,7 @@ + */ + + +-#include "../storvsc/StorVsc.c" ++#include "StorVsc.c" + + static const char* gBlkDriverName="blkvsc"; + +--- a/drivers/staging/hv/blkvsc_drv.c ++++ b/drivers/staging/hv/blkvsc_drv.c +@@ -20,6 +20,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include + #include +@@ -34,10 +35,10 @@ + #include + #include + +-#include "logging.h" +-#include "vmbus.h" ++#include "include/logging.h" ++#include "include/vmbus.h" + +-#include "StorVscApi.h" ++#include "include/StorVscApi.h" + + // + // #defines +@@ -313,7 +314,7 @@ static int blkvsc_probe(struct device *d + ASSERT(sizeof(struct blkvsc_request_group) <= sizeof(struct blkvsc_request)); + + #ifdef KERNEL_2_6_27 +- blkdev->request_pool = kmem_cache_create(device_ctx->device.bus_id, ++ blkdev->request_pool = kmem_cache_create(dev_name(&device_ctx->device), + sizeof(struct blkvsc_request) + storvsc_drv_obj->RequestExtSize, 0, + SLAB_HWCACHE_ALIGN, NULL); + #else diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-bus-code-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-bus-code-build.patch new file mode 100644 index 000000000..afa55719b --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-bus-code-build.patch @@ -0,0 +1,311 @@ +From foo@baz Mon Jul 13 17:09:34 PDT 2009 +Date: Mon, 13 Jul 2009 17:09:34 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: make the Hyper-V virtual bus code build + +From: Greg Kroah-Hartman + +The #define KERNEL_2_6_27 needs to be set, and I adjusted the include +directories a bit to get things to build properly. + +I also fixed up the direct access of bus_id, as that field is now gone. + +The hv_vmbus code should now build properly, with no errors. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/Channel.c | 4 ++-- + drivers/staging/hv/Channel.h | 2 +- + drivers/staging/hv/ChannelInterface.h | 2 +- + drivers/staging/hv/ChannelMgmt.c | 4 ++-- + drivers/staging/hv/ChannelMgmt.h | 8 ++++---- + drivers/staging/hv/Connection.c | 2 +- + drivers/staging/hv/Hv.c | 2 +- + drivers/staging/hv/Hv.h | 16 ++++++++-------- + drivers/staging/hv/RingBuffer.c | 2 +- + drivers/staging/hv/RingBuffer.h | 2 +- + drivers/staging/hv/Sources.c | 1 + + drivers/staging/hv/Vmbus.c | 2 +- + drivers/staging/hv/VmbusPrivate.h | 4 ++-- + drivers/staging/hv/include/ChannelMessages.h | 2 +- + drivers/staging/hv/osd.c | 3 ++- + drivers/staging/hv/vmbus_drv.c | 15 ++++++++------- + 16 files changed, 37 insertions(+), 34 deletions(-) + +--- a/drivers/staging/hv/Channel.c ++++ b/drivers/staging/hv/Channel.c +@@ -22,8 +22,8 @@ + */ + + +-#include "osd.h" +-#include "logging.h" ++#include "include/osd.h" ++#include "include/logging.h" + + #include "VmbusPrivate.h" + +--- a/drivers/staging/hv/Channel.h ++++ b/drivers/staging/hv/Channel.h +@@ -25,7 +25,7 @@ + #ifndef _CHANNEL_H_ + #define _CHANNEL_H_ + +-#include "osd.h" ++#include "include/osd.h" + #include "ChannelMgmt.h" + + #pragma pack(push,1) +--- a/drivers/staging/hv/ChannelInterface.h ++++ b/drivers/staging/hv/ChannelInterface.h +@@ -25,7 +25,7 @@ + #ifndef _CHANNEL_INTERFACE_H_ + #define _CHANNEL_INTERFACE_H_ + +-#include "VmbusApi.h" ++#include "include/VmbusApi.h" + + INTERNAL void + GetChannelInterface( +--- a/drivers/staging/hv/ChannelMgmt.c ++++ b/drivers/staging/hv/ChannelMgmt.c +@@ -22,8 +22,8 @@ + */ + + +-#include "osd.h" +-#include "logging.h" ++#include "include/osd.h" ++#include "include/logging.h" + + #include "VmbusPrivate.h" + +--- a/drivers/staging/hv/ChannelMgmt.h ++++ b/drivers/staging/hv/ChannelMgmt.h +@@ -25,12 +25,12 @@ + #ifndef _CHANNEL_MGMT_H_ + #define _CHANNEL_MGMT_H_ + +-#include "osd.h" +-#include "List.h" ++#include "include/osd.h" ++#include "include/List.h" + #include "RingBuffer.h" + +-#include "VmbusChannelInterface.h" +-#include "ChannelMessages.h" ++#include "include/VmbusChannelInterface.h" ++#include "include/ChannelMessages.h" + + + +--- a/drivers/staging/hv/Connection.c ++++ b/drivers/staging/hv/Connection.c +@@ -22,7 +22,7 @@ + */ + + +-#include "logging.h" ++#include "include/logging.h" + + #include "VmbusPrivate.h" + +--- a/drivers/staging/hv/Hv.c ++++ b/drivers/staging/hv/Hv.c +@@ -22,7 +22,7 @@ + */ + + +-#include "logging.h" ++#include "include/logging.h" + #include "VmbusPrivate.h" + + // +--- a/drivers/staging/hv/Hv.h ++++ b/drivers/staging/hv/Hv.h +@@ -25,23 +25,23 @@ + #ifndef __HV_H__ + #define __HV_H__ + +-#include "osd.h" ++#include "include/osd.h" + +-#include "HvTypes.h" +-#include "HvStatus.h" ++#include "include/HvTypes.h" ++#include "include/HvStatus.h" + //#include "HvVmApi.h" + //#include "HvKeApi.h" + //#include "HvMmApi.h" + //#include "HvCpuApi.h" +-#include "HvHalApi.h" +-#include "HvVpApi.h" ++#include "include/HvHalApi.h" ++#include "include/HvVpApi.h" + //#include "HvTrApi.h" +-#include "HvSynicApi.h" ++#include "include/HvSynicApi.h" + //#include "HvAmApi.h" + //#include "HvHkApi.h" + //#include "HvValApi.h" +-#include "HvHcApi.h" +-#include "HvPtApi.h" ++#include "include/HvHcApi.h" ++#include "include/HvPtApi.h" + + enum + { +--- a/drivers/staging/hv/include/ChannelMessages.h ++++ b/drivers/staging/hv/include/ChannelMessages.h +@@ -24,7 +24,7 @@ + + #pragma once + +-#include ++#include "VmbusPacketFormat.h" + + #define C_ASSERT(x) + typedef UINT32 NTSTATUS; +--- a/drivers/staging/hv/osd.c ++++ b/drivers/staging/hv/osd.c +@@ -21,6 +21,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include + #include +@@ -46,7 +47,7 @@ + #include + #include + +-#include "osd.h" ++#include "include/osd.h" + + // + // Data types +--- a/drivers/staging/hv/RingBuffer.c ++++ b/drivers/staging/hv/RingBuffer.c +@@ -22,7 +22,7 @@ + */ + + +-#include "logging.h" ++#include "include/logging.h" + #include "RingBuffer.h" + + // +--- a/drivers/staging/hv/RingBuffer.h ++++ b/drivers/staging/hv/RingBuffer.h +@@ -25,7 +25,7 @@ + #ifndef _RING_BUFFER_H_ + #define _RING_BUFFER_H_ + +-#include "osd.h" ++#include "include/osd.h" + + typedef struct _SG_BUFFER_LIST { + PVOID Data; +--- a/drivers/staging/hv/Sources.c ++++ b/drivers/staging/hv/Sources.c +@@ -21,6 +21,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include "Vmbus.c" + #include "Hv.c" +--- a/drivers/staging/hv/Vmbus.c ++++ b/drivers/staging/hv/Vmbus.c +@@ -22,7 +22,7 @@ + */ + + +-#include "logging.h" ++#include "include/logging.h" + #include "VersionInfo.h" + #include "VmbusPrivate.h" + +--- a/drivers/staging/hv/vmbus_drv.c ++++ b/drivers/staging/hv/vmbus_drv.c +@@ -21,6 +21,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include + #include +@@ -29,8 +30,8 @@ + #include + #include + +-#include "logging.h" +-#include "vmbus.h" ++#include "include/logging.h" ++#include "include/vmbus.h" + + // + // Defines +@@ -451,7 +452,7 @@ int vmbus_bus_init(PFN_DRIVERINITIALIZE + goto cleanup; + } + //strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); +- sprintf(dev_ctx->device.bus_id, "vmbus_0_0"); ++ dev_set_name(&dev_ctx->device, "vmbus_0_0"); + memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(GUID)); + memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(GUID)); + +@@ -656,16 +657,16 @@ static int vmbus_child_device_register(D + // + // Make sure we are not registered already + // +- if (child_device_ctx->device.bus_id[0] != '\0') ++ if (strlen(dev_name(&child_device_ctx->device)) != 0) + { +- DPRINT_ERR(VMBUS_DRV, "child device (%p) already registered - busid %s", child_device_ctx, child_device_ctx->device.bus_id); ++ DPRINT_ERR(VMBUS_DRV, "child device (%p) already registered - busid %s", child_device_ctx, dev_name(&child_device_ctx->device)); + + ret = -1; + goto Cleanup; + } + + // Set the device bus id. Otherwise, device_register()will fail. +- sprintf(child_device_ctx->device.bus_id, "vmbus_0_%d", InterlockedIncrement(&device_num)); ++ dev_set_name(&child_device_ctx->device, "vmbus_0_%d", InterlockedIncrement(&device_num)); + + // The new device belongs to this bus + child_device_ctx->device.bus = &g_vmbus_drv.bus; //device->dev.bus; +@@ -924,7 +925,7 @@ static int vmbus_probe(struct device *ch + ret = device_ctx->probe_error = driver_ctx->probe(child_device); + if (ret != 0) + { +- DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s (%p) on driver %s (%d)...", child_device->bus_id, child_device, child_device->driver->name, ret); ++ DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s (%p) on driver %s (%d)...", dev_name(child_device), child_device, child_device->driver->name, ret); + + #ifdef KERNEL_2_6_27 + INIT_WORK(&device_ctx->probe_failed_work_item, vmbus_probe_failed_cb); +--- a/drivers/staging/hv/VmbusPrivate.h ++++ b/drivers/staging/hv/VmbusPrivate.h +@@ -30,14 +30,14 @@ + #endif + + #include "Hv.h" +-#include "VmbusApi.h" ++#include "include/VmbusApi.h" + #include "Channel.h" + #include "ChannelMgmt.h" + #include "ChannelInterface.h" + //#include "ChannelMessages.h" + #include "RingBuffer.h" + //#include "Packet.h" +-#include "List.h" ++#include "include/List.h" + + // + // Defines diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-network-driver-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-network-driver-build.patch new file mode 100644 index 000000000..9817df811 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-network-driver-build.patch @@ -0,0 +1,126 @@ +From foo@baz Tue Jul 14 10:59:56 PDT 2009 +Date: Tue, 14 Jul 2009 10:59:56 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: make the Hyper-V virtual network driver build + +From: Greg Kroah-Hartman + +The #define KERNEL_2_6_27 needs to be set, and I adjusted the include +directories a bit to get things to build properly. + +The driver was changed to use net_device_ops, as that is needed to build +and operate properly now. + +The hv_netvsc code should now build with no errors. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/NetVsc.c | 3 ++- + drivers/staging/hv/NetVsc.h | 8 ++++---- + drivers/staging/hv/RndisFilter.c | 5 +++-- + drivers/staging/hv/RndisFilter.h | 4 ++-- + drivers/staging/hv/include/nvspprotocol.h | 2 +- + drivers/staging/hv/netvsc_drv.c | 7 ++++--- + 6 files changed, 16 insertions(+), 13 deletions(-) + +--- a/drivers/staging/hv/NetVsc.c ++++ b/drivers/staging/hv/NetVsc.c +@@ -20,8 +20,9 @@ + * + */ + ++#define KERNEL_2_6_27 + +-#include "logging.h" ++#include "include/logging.h" + #include "NetVsc.h" + #include "RndisFilter.h" + +--- a/drivers/staging/hv/NetVsc.h ++++ b/drivers/staging/hv/NetVsc.h +@@ -24,12 +24,12 @@ + #ifndef _NETVSC_H_ + #define _NETVSC_H_ + +-#include "VmbusPacketFormat.h" +-#include "nvspprotocol.h" ++#include "include/VmbusPacketFormat.h" ++#include "include/nvspprotocol.h" + +-#include "List.h" ++#include "include/List.h" + +-#include "NetVscApi.h" ++#include "include/NetVscApi.h" + // + // #defines + // +--- a/drivers/staging/hv/RndisFilter.c ++++ b/drivers/staging/hv/RndisFilter.c +@@ -21,10 +21,11 @@ + * + */ + ++#define KERNEL_2_6_27 + +-#include "logging.h" ++#include "include/logging.h" + +-#include "NetVscApi.h" ++#include "include/NetVscApi.h" + #include "RndisFilter.h" + + // +--- a/drivers/staging/hv/RndisFilter.h ++++ b/drivers/staging/hv/RndisFilter.h +@@ -27,10 +27,10 @@ + + #define __struct_bcount(x) + +-#include "osd.h" ++#include "include/osd.h" + #include "NetVsc.h" + +-#include "rndis.h" ++#include "include/rndis.h" + + #define RNDIS_HEADER_SIZE (sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER)) + +--- a/drivers/staging/hv/include/nvspprotocol.h ++++ b/drivers/staging/hv/include/nvspprotocol.h +@@ -24,7 +24,7 @@ + + #pragma once + +-#include ++#include "VmbusChannelInterface.h" + + #define NVSP_INVALID_PROTOCOL_VERSION ((UINT32)0xFFFFFFFF) + +--- a/drivers/staging/hv/netvsc_drv.c ++++ b/drivers/staging/hv/netvsc_drv.c +@@ -20,6 +20,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include + #include +@@ -41,10 +42,10 @@ + #include + #include + +-#include "logging.h" +-#include "vmbus.h" ++#include "include/logging.h" ++#include "include/vmbus.h" + +-#include "NetVscApi.h" ++#include "include/NetVscApi.h" + + MODULE_LICENSE("GPL"); + diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-storage-driver-build.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-storage-driver-build.patch new file mode 100644 index 000000000..8185f9afa --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-make-the-hyper-v-virtual-storage-driver-build.patch @@ -0,0 +1,77 @@ +From foo@baz Tue Jul 14 10:18:50 PDT 2009 +Date: Tue, 14 Jul 2009 10:18:50 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: make the Hyper-V virtual storage driver build + +From: Greg Kroah-Hartman + +The #define KERNEL_2_6_27 needs to be set, and I adjusted the include +directories a bit to get things to build properly. + +I also fixed up the direct access of bus_id, as that field is now gone. +Some minor scsi api changes were needed as well. + +The hv_storvsc code should now build properly, with no errors. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/StorVsc.c | 9 +++++---- + drivers/staging/hv/storvsc_drv.c | 9 +++++---- + 2 files changed, 10 insertions(+), 8 deletions(-) + +--- a/drivers/staging/hv/StorVsc.c ++++ b/drivers/staging/hv/StorVsc.c +@@ -21,12 +21,13 @@ + * + */ + ++#define KERNEL_2_6_27 + +-#include "logging.h" ++#include "include/logging.h" + +-#include "StorVscApi.h" +-#include "VmbusPacketFormat.h" +-#include "vstorage.h" ++#include "include/StorVscApi.h" ++#include "include/VmbusPacketFormat.h" ++#include "include/vstorage.h" + + + // +--- a/drivers/staging/hv/storvsc_drv.c ++++ b/drivers/staging/hv/storvsc_drv.c +@@ -21,6 +21,7 @@ + * + */ + ++#define KERNEL_2_6_27 + + #include + #include +@@ -40,10 +41,10 @@ + #include + #endif + +-#include "logging.h" +-#include "vmbus.h" ++#include "include/logging.h" ++#include "include/vmbus.h" + +-#include "StorVscApi.h" ++#include "include/StorVscApi.h" + + // + // #defines +@@ -296,7 +297,7 @@ static int storvsc_probe(struct device * + #if defined(KERNEL_2_6_27) + host_device_ctx->request_pool = + kmem_cache_create +- (device_ctx->device.bus_id, ++ (dev_name(&device_ctx->device), + sizeof(struct storvsc_cmd_request) + storvsc_drv_obj->RequestExtSize, + 0, + SLAB_HWCACHE_ALIGN, NULL); diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-storvsc-fix-up-driver_data-usage.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-storvsc-fix-up-driver_data-usage.patch new file mode 100644 index 000000000..4327b2b2a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-storvsc-fix-up-driver_data-usage.patch @@ -0,0 +1,59 @@ +From foo@baz Fri Jul 24 10:58:22 PDT 2009 +Date: Fri, 24 Jul 2009 10:58:22 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: storvsc: fix up driver_data usage + +From: Greg Kroah-Hartman + +driver_data is gone now from struct device, so use the proper functions +to access it instead. + +Thanks to Bill Pemberton for pointing out this build error. + +Cc: Bill Pemberton +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/storvsc_drv.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/staging/hv/storvsc_drv.c ++++ b/drivers/staging/hv/storvsc_drv.c +@@ -279,7 +279,7 @@ static int storvsc_probe(struct device * + return -ENOMEM; + } + +- device->driver_data = host; ++ dev_set_drvdata(device, host); + + host_device_ctx = (struct host_device_context*)host->hostdata; + memset(host_device_ctx, 0, sizeof(struct host_device_context)); +@@ -380,7 +380,7 @@ static int storvsc_remove(struct device + struct device_context *device_ctx = device_to_device_context(device); + DEVICE_OBJECT* device_obj = &device_ctx->device_obj; + +- struct Scsi_Host *host = (struct Scsi_Host *)device->driver_data; ++ struct Scsi_Host *host = dev_get_drvdata(device); + struct host_device_context *host_device_ctx=(struct host_device_context*)host->hostdata; + + +@@ -1125,7 +1125,7 @@ static void storvsc_host_rescan_callback + DEVICE_OBJECT* device_obj = (DEVICE_OBJECT*)context; + #endif + struct device_context* device_ctx = to_device_context(device_obj); +- struct Scsi_Host *host = (struct Scsi_Host *)device_ctx->device.driver_data; ++ struct Scsi_Host *host = dev_get_drvdata(&device_ctx->device); + struct scsi_device *sdev; + struct host_device_context *host_device_ctx; + struct scsi_device **sdevs_remove_list; +@@ -1293,7 +1293,7 @@ static int storvsc_report_luns(struct sc + static void storvsc_host_rescan(DEVICE_OBJECT* device_obj) + { + struct device_context* device_ctx = to_device_context(device_obj); +- struct Scsi_Host *host = (struct Scsi_Host *)device_ctx->device.driver_data; ++ struct Scsi_Host *host = dev_get_drvdata(&device_ctx->device); + struct host_device_context *host_device_ctx; + + DPRINT_ENTER(STORVSC_DRV); diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-use-the-correct-ifdef-for-x86-64.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-use-the-correct-ifdef-for-x86-64.patch new file mode 100644 index 000000000..c76acd93f --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-hv-use-the-correct-ifdef-for-x86-64.patch @@ -0,0 +1,29 @@ +From foo@baz Thu Jul 16 22:31:14 PDT 2009 +Date: Thu, 16 Jul 2009 22:31:15 -0700 +From: Greg Kroah-Hartman +Subject: Staging: hv: use the correct #ifdef for x86-64 + +From: Greg Kroah-Hartman + +x86-64 needs a different config check. Thanks to Hank for the debugging +to determine the fix for this. + +Cc: Hank Janssen +Cc: Haiyang Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/hv/Hv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/hv/Hv.c ++++ b/drivers/staging/hv/Hv.c +@@ -165,7 +165,7 @@ HvDoHypercall ( + void* Output + ) + { +-#ifdef x86_64 ++#ifdef CONFIG_X86_64 + UINT64 hvStatus=0; + UINT64 inputAddress = (Input)? GetPhysicalAddress(Input) : 0; + UINT64 outputAddress = (Output)? GetPhysicalAddress(Output) : 0; diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-rt2860-sync-driver-up-with-2.6.30-version.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-rt2860-sync-driver-up-with-2.6.30-version.patch new file mode 100644 index 000000000..40e0f91a0 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-rt2860-sync-driver-up-with-2.6.30-version.patch @@ -0,0 +1,5283 @@ +From foo@baz Mon Jul 27 15:37:03 PDT 2009 +Date: Mon, 27 Jul 2009 15:37:03 -0700 +From: Greg Kroah-Hartman +Subject: Staging: rt2860: sync driver up with 2.6.30 version +References: bnc#512070 +Patch-mainline: 2.6.30 + +This is needed to get the driver to work properly with some hardware types. + +The 2.6.30 version was backported, minus the netdev_ops changes, which +will not work in the 2.6.27 kernel version. + +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/rt2860/2860_main_dev.c | 64 +---- + drivers/staging/rt2860/Makefile | 1 + drivers/staging/rt2860/TODO | 4 + drivers/staging/rt2860/common/ba_action.c | 18 - + drivers/staging/rt2860/common/cmm_data.c | 32 -- + drivers/staging/rt2860/common/cmm_data_2860.c | 150 +++++++++---- + drivers/staging/rt2860/common/cmm_info.c | 8 + drivers/staging/rt2860/common/cmm_sync.c | 2 + drivers/staging/rt2860/common/cmm_wpa.c | 40 +++ + drivers/staging/rt2860/common/dfs.c | 4 + drivers/staging/rt2860/common/mlme.c | 289 ++++++++++++++++++++------ + drivers/staging/rt2860/common/rtmp_init.c | 196 ++++++++++++----- + drivers/staging/rt2860/common/spectrum.c | 44 +-- + drivers/staging/rt2860/config.mk | 4 + drivers/staging/rt2860/oid.h | 2 + drivers/staging/rt2860/rt2860.h | 26 -- + drivers/staging/rt2860/rt28xx.h | 4 + drivers/staging/rt2860/rt_ate.c | 50 +--- + drivers/staging/rt2860/rt_ate.h | 6 + drivers/staging/rt2860/rt_config.h | 2 + drivers/staging/rt2860/rt_linux.c | 45 ---- + drivers/staging/rt2860/rt_linux.h | 51 +--- + drivers/staging/rt2860/rt_main_dev.c | 183 ++-------------- + drivers/staging/rt2860/rt_profile.c | 29 +- + drivers/staging/rt2860/rtmp.h | 61 ++--- + drivers/staging/rt2860/rtmp_def.h | 31 +- + drivers/staging/rt2860/sta/assoc.c | 23 -- + drivers/staging/rt2860/sta/connect.c | 45 ++-- + drivers/staging/rt2860/sta/dls.c | 4 + drivers/staging/rt2860/sta/rtmp_data.c | 29 +- + drivers/staging/rt2860/sta/sync.c | 18 - + drivers/staging/rt2860/sta/wpa.c | 10 + drivers/staging/rt2860/sta_ioctl.c | 278 ++++++++++++++----------- + drivers/staging/rt2860/wpa.h | 1 + 34 files changed, 935 insertions(+), 819 deletions(-) + +--- a/drivers/staging/rt2860/2860_main_dev.c ++++ b/drivers/staging/rt2860/2860_main_dev.c +@@ -90,12 +90,10 @@ void init_thread_task(PRTMP_ADAPTER pAd) + static void __exit rt2860_cleanup_module(void); + static int __init rt2860_init_module(void); + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #ifdef CONFIG_PM + static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state); + static int rt2860_resume(struct pci_dev *pci_dev); + #endif // CONFIG_PM // +-#endif + + + // +@@ -128,22 +126,15 @@ static struct pci_driver rt2860_driver = + name: "rt2860", + id_table: rt2860_pci_tbl, + probe: rt2860_init_one, +-#if LINUX_VERSION_CODE >= 0x20412 + remove: __devexit_p(rt2860_remove_one), +-#else +- remove: __devexit(rt2860_remove_one), +-#endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #ifdef CONFIG_PM + suspend: rt2860_suspend, + resume: rt2860_resume, + #endif +-#endif + }; + + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #ifdef CONFIG_PM + + VOID RT2860RejectPendingPackets( +@@ -170,7 +161,7 @@ static int rt2860_suspend( + } + else + { +- pAd = (PRTMP_ADAPTER)net_dev->priv; ++ pAd = net_dev->ml_priv; + + /* we can not use IFF_UP because ra0 down but ra1 up */ + /* and 1 suspend/resume function for 1 module, not for each interface */ +@@ -249,7 +240,7 @@ static int rt2860_resume( + DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n")); + } + else +- pAd = (PRTMP_ADAPTER)net_dev->priv; ++ pAd = net_dev->ml_priv; + + if (pAd != NULL) + { +@@ -284,16 +275,11 @@ static int rt2860_resume( + return 0; + } + #endif // CONFIG_PM // +-#endif + + + static INT __init rt2860_init_module(VOID) + { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + return pci_register_driver(&rt2860_driver); +-#else +- return pci_module_init(&rt2860_driver); +-#endif + } + + +@@ -336,7 +322,7 @@ static VOID __devexit rt2860_remove_one( + IN struct pci_dev *pci_dev) + { + struct net_device *net_dev = pci_get_drvdata(pci_dev); +- RTMP_ADAPTER *pAd = net_dev->priv; ++ RTMP_ADAPTER *pAd = net_dev->ml_priv; + + DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_remove_one\n")); + +@@ -374,11 +360,7 @@ static VOID __devexit rt2860_remove_one( + } + + // Free pre-allocated net_device memory +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + free_netdev(net_dev); +-#else +- kfree(net_dev); +-#endif + } + + // +@@ -758,16 +740,13 @@ static void ac0_dma_done_tasklet(unsigne + int print_int_count; + + IRQ_HANDLE_TYPE +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) + rt2860_interrupt(int irq, void *dev_instance) +-#else +-rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +-#endif + { + struct net_device *net_dev = (struct net_device *) dev_instance; +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; ++ PRTMP_ADAPTER pAd = net_dev->ml_priv; + INT_SOURCE_CSR_STRUC IntSource; + POS_COOKIE pObj; ++ BOOLEAN bOldValue; + + pObj = (POS_COOKIE) pAd->OS_Cookie; + +@@ -800,20 +779,19 @@ rt2860_interrupt(int irq, void *dev_inst + // RT2661 => when ASIC is sleeping, MAC register cannot be read and written. + // RT2860 => when ASIC is sleeping, MAC register can be read and written. + ++ bOldValue = pAd->bPCIclkOff; ++ pAd->bPCIclkOff = FALSE; + { + RTMP_IO_READ32(pAd, INT_SOURCE_CSR, &IntSource.word); + RTMP_IO_WRITE32(pAd, INT_SOURCE_CSR, IntSource.word); // write 1 to clear + } ++ pAd->bPCIclkOff = bOldValue; + + // Do nothing if Reset in progress + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) || + RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) + { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +- return IRQ_HANDLED; +-#else +- return; +-#endif ++ return IRQ_HANDLED; + } + + // +@@ -822,8 +800,6 @@ rt2860_interrupt(int irq, void *dev_inst + // The priority can be adjust by altering processing if statement + // + +- pAd->bPCIclkOff = FALSE; +- + // If required spinlock, each interrupt service routine has to acquire + // and release itself. + // +@@ -832,11 +808,8 @@ rt2860_interrupt(int irq, void *dev_inst + if (IntSource.word == 0xffffffff) + { + RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS); +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +- return IRQ_HANDLED; +-#else +- return; +-#endif ++ printk("snowpin - IntSource.word == 0xffffffff\n"); ++ return IRQ_HANDLED; + } + + if (IntSource.word & TxCoherent) +@@ -970,10 +943,7 @@ rt2860_interrupt(int irq, void *dev_inst + } + #endif // CONFIG_STA_SUPPORT // + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + return IRQ_HANDLED; +-#endif +- + } + + /* +@@ -1022,15 +992,11 @@ BOOLEAN RT28XXNetDevInit( + IN RTMP_ADAPTER *pAd) + { + struct pci_dev *pci_dev = (struct pci_dev *)_dev_p; +- CHAR *print_name; ++ const CHAR *print_name; + ULONG csr_addr; + + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +- print_name = pci_dev ? pci_name(pci_dev) : "rt2860"; +-#else +- print_name = pci_dev ? pci_dev->slot_name : "rt2860"; +-#endif // LINUX_VERSION_CODE // ++ print_name = pci_dev ? pci_name(pci_dev) : "rt2860"; + + net_dev->base_addr = 0; + net_dev->irq = 0; +@@ -1202,7 +1168,7 @@ VOID RT28xx_UpdateBeaconToAsic( + UCHAR bcn_idx = 0; + + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s() : No valid Interface be found.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s() : No valid Interface be found.\n", __func__)); + return; + } + +@@ -1300,7 +1266,7 @@ VOID rt2860_stop(struct net_device *net_ + DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n")); + } + else +- pAd = (PRTMP_ADAPTER)net_dev->priv; ++ pAd = net_dev->ml_priv; + + if (pAd != NULL) + { +--- a/drivers/staging/rt2860/Makefile ++++ b/drivers/staging/rt2860/Makefile +@@ -2,7 +2,6 @@ obj-$(CONFIG_RT2860) += rt2860sta.o + + # TODO: all of these should be removed + EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT +-EXTRA_CFLAGS += -DRT2860 + EXTRA_CFLAGS += -DCONFIG_STA_SUPPORT + EXTRA_CFLAGS += -DDBG + EXTRA_CFLAGS += -DDOT11_N_SUPPORT +--- a/drivers/staging/rt2860/TODO ++++ b/drivers/staging/rt2860/TODO +@@ -1,6 +1,6 @@ + I'm hesitant to add a TODO file here, as the wireless developers would + really have people help them out on the "clean" rt2860 driver that can +-be found at the rt2860.sf.net site. ++be found at the http://rt2x00.serialmonkey.com/ site. + + But, if you wish to clean up this driver instead, here's a short list of + things that need to be done to get it into a more mergable shape: +@@ -8,7 +8,7 @@ things that need to be done to get it in + TODO: + - checkpatch.pl clean + - sparse clean +- - port to in-kernel 80211 stack ++ - port to in-kernel 80211 stack and common rt2x00 infrastructure + - remove reading from /etc/ config files + - review by the wireless developer community + +--- a/drivers/staging/rt2860/common/ba_action.c ++++ b/drivers/staging/rt2860/common/ba_action.c +@@ -599,7 +599,7 @@ VOID BAOriSessionAdd( + + pBAEntry->ORIBATimer.TimerValue = 0; //pFrame->TimeOutValue; + +- DBGPRINT(RT_DEBUG_TRACE,("%s : TXBAbitmap = %x, BAWinSize = %d, TimeOut = %ld\n", __FUNCTION__, pEntry->TXBAbitmap, ++ DBGPRINT(RT_DEBUG_TRACE,("%s : TXBAbitmap = %x, BAWinSize = %d, TimeOut = %ld\n", __func__, pEntry->TXBAbitmap, + pBAEntry->BAWinSize, pBAEntry->ORIBATimer.TimerValue)); + + // SEND BAR ; +@@ -673,7 +673,7 @@ BOOLEAN BARecSessionAdd( + ba_refresh_reordering_mpdus(pAd, pBAEntry); + } + +- DBGPRINT(RT_DEBUG_TRACE,("%s(%ld): Idx = %d, BAWinSize(req %d) = %d\n", __FUNCTION__, pAd->BATable.numAsRecipient, Idx, ++ DBGPRINT(RT_DEBUG_TRACE,("%s(%ld): Idx = %d, BAWinSize(req %d) = %d\n", __func__, pAd->BATable.numAsRecipient, Idx, + pFrame->BaParm.BufSize, BAWinSize)); + + // Start fill in parameters. +@@ -915,7 +915,7 @@ VOID BAOriSessionTearDown( + return; + } + +- DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __FUNCTION__, Wcid, TID)); ++ DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __func__, Wcid, TID)); + + pBAEntry = &pAd->BATable.BAOriEntry[Idx]; + DBGPRINT(RT_DEBUG_TRACE,("\t===>Idx = %ld, Wcid=%d.TID=%d, ORI_BA_Status = %d \n", Idx, Wcid, TID, pBAEntry->ORI_BA_Status)); +@@ -974,7 +974,7 @@ VOID BARecSessionTearDown( + if (Idx == 0) + return; + +- DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __FUNCTION__, Wcid, TID)); ++ DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __func__, Wcid, TID)); + + + pBAEntry = &pAd->BATable.BARecEntry[Idx]; +@@ -1185,7 +1185,7 @@ VOID PeerAddBAReqAction( + PULONG ptemp; + PMAC_TABLE_ENTRY pMacEntry; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s ==> (Wcid = %d)\n", __FUNCTION__, Elem->Wcid)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s ==> (Wcid = %d)\n", __func__, Elem->Wcid)); + + //hex_dump("AddBAReq", Elem->Msg, Elem->MsgLen); + +@@ -1269,7 +1269,7 @@ VOID PeerAddBAReqAction( + MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen); + MlmeFreeMemory(pAd, pOutBuffer); + +- DBGPRINT(RT_DEBUG_TRACE, ("%s(%d): TID(%d), BufSize(%d) <== \n", __FUNCTION__, Elem->Wcid, ADDframe.BaParm.TID, ++ DBGPRINT(RT_DEBUG_TRACE, ("%s(%d): TID(%d), BufSize(%d) <== \n", __func__, Elem->Wcid, ADDframe.BaParm.TID, + ADDframe.BaParm.BufSize)); + } + +@@ -1288,7 +1288,7 @@ VOID PeerAddBARspAction( + if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) + return; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s ==> Wcid(%d)\n", __FUNCTION__, Elem->Wcid)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s ==> Wcid(%d)\n", __func__, Elem->Wcid)); + + //hex_dump("PeerAddBARspAction()", Elem->Msg, Elem->MsgLen); + +@@ -1329,7 +1329,7 @@ VOID PeerDelBAAction( + //PUCHAR pOutBuffer = NULL; + PFRAME_DELBA_REQ pDelFrame = NULL; + +- DBGPRINT(RT_DEBUG_TRACE,("%s ==>\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE,("%s ==>\n", __func__)); + //DELBA Request from unknown peer, ignore this. + if (PeerDelBAActionSanity(pAd, Elem->Wcid, Elem->Msg, Elem->MsgLen)) + { +@@ -1366,7 +1366,7 @@ BOOLEAN CntlEnqueueForRecv( + + TID = (UCHAR)pFrame->BARControl.TID; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s(): BAR-Wcid(%ld), Tid (%d)\n", __FUNCTION__, Wcid, TID)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s(): BAR-Wcid(%ld), Tid (%d)\n", __func__, Wcid, TID)); + //hex_dump("BAR", (PCHAR) pFrame, MsgLen); + // Do nothing if the driver is starting halt state. + // This might happen when timer already been fired before cancel timer with mlmehalt +--- a/drivers/staging/rt2860/common/cmm_data.c ++++ b/drivers/staging/rt2860/common/cmm_data.c +@@ -105,9 +105,7 @@ NDIS_STATUS MiniportMMRequest( + PNDIS_PACKET pPacket; + NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + ULONG FreeNum; +-#ifdef RT2860 + unsigned long IrqFlags = 0; +-#endif // RT2860 // + UCHAR IrqState; + UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN]; + +@@ -118,10 +116,9 @@ NDIS_STATUS MiniportMMRequest( + // 2860C use Tx Ring + + IrqState = pAd->irq_disabled; +-#ifdef RT2860 ++ + if ((pAd->MACVersion == 0x28600100) && (!IrqState)) + RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags); +-#endif // RT2860 // + + do + { +@@ -175,17 +172,14 @@ NDIS_STATUS MiniportMMRequest( + + } while (FALSE); + +-#ifdef RT2860 + // 2860C use Tx Ring + if ((pAd->MACVersion == 0x28600100) && (!IrqState)) + RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags); +-#endif // RT2860 // + + return Status; + } + + +-#ifdef RT2860 + NDIS_STATUS MiniportMMRequestUnlock( + IN PRTMP_ADAPTER pAd, + IN UCHAR QueIdx, +@@ -253,7 +247,6 @@ NDIS_STATUS MiniportMMRequestUnlock( + + return Status; + } +-#endif // RT2860 // + + + /* +@@ -290,17 +283,14 @@ NDIS_STATUS MlmeHardTransmit( + return NDIS_STATUS_FAILURE; + } + +-#ifdef RT2860 + if ( pAd->MACVersion == 0x28600100 ) + return MlmeHardTransmitTxRing(pAd,QueIdx,pPacket); + else +-#endif // RT2860 // + return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket); + + } + + +-#ifdef RT2860 + NDIS_STATUS MlmeHardTransmitTxRing( + IN PRTMP_ADAPTER pAd, + IN UCHAR QueIdx, +@@ -366,7 +356,7 @@ NDIS_STATUS MlmeHardTransmitTxRing( + { + // outgoing frame always wakeup PHY to prevent frame lost + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +- AsicForceWakeup(pAd, TRUE); ++ AsicForceWakeup(pAd, FROM_TX); + } + #endif // CONFIG_STA_SUPPORT // + pFirstTxWI =(PTXWI_STRUC)pSrcBufVA; +@@ -509,7 +499,6 @@ NDIS_STATUS MlmeHardTransmitTxRing( + + return NDIS_STATUS_SUCCESS; + } +-#endif // RT2860 // + + + NDIS_STATUS MlmeHardTransmitMgmtRing( +@@ -541,7 +530,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( + { + // outgoing frame always wakeup PHY to prevent frame lost + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +- AsicForceWakeup(pAd, TRUE); ++ AsicForceWakeup(pAd, FROM_TX); + } + #endif // CONFIG_STA_SUPPORT // + +@@ -943,9 +932,6 @@ BOOLEAN RTMP_FillTxBlkInfo( + } + + return TRUE; +- +-FillTxBlkErr: +- return FALSE; + } + + +@@ -1079,7 +1065,6 @@ VOID RTMPDeQueuePacket( + break; + } + +-#ifdef RT2860 + FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx); + + #ifdef DBG_DIAGNOSE +@@ -1104,7 +1089,6 @@ VOID RTMPDeQueuePacket( + RTMPFreeTXDUponTxDmaDone(pAd, QueIdx); + FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx); + } +-#endif // RT2860 // + + // probe the Queue Head + pQueue = &pAd->TxSwQueue[QueIdx]; +@@ -1183,12 +1167,10 @@ VOID RTMPDeQueuePacket( + Status = STAHardTransmit(pAd, pTxBlk, QueIdx); + #endif // CONFIG_STA_SUPPORT // + +-#ifdef RT2860 + DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags); + // static rate also need NICUpdateFifoStaCounters() function. + //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED)) + NICUpdateFifoStaCounters(pAd); +-#endif // RT2860 // + } + + RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags); +@@ -1767,7 +1749,6 @@ PQUEUE_HEADER RTMPCheckTxSwQueue( + } + + +-#ifdef RT2860 + BOOLEAN RTMPFreeTXDUponTxDmaDone( + IN PRTMP_ADAPTER pAd, + IN UCHAR QueIdx) +@@ -2312,7 +2293,6 @@ VOID DBGPRINT_RX_RING( + DBGPRINT_RAW(RT_DEBUG_TRACE,(" RxSwReadIdx [%d]=", AC0freeIdx)); + DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount)); + } +-#endif // RT2860 // + + /* + ======================================================================== +@@ -2637,9 +2617,7 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( + pEntry->AuthMode = pAd->StaCfg.AuthMode; + pEntry->WepStatus = pAd->StaCfg.WepStatus; + pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll; +-#ifdef RT2860 + AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)i); +-#endif // RT2860 // + } + #endif // CONFIG_STA_SUPPORT // + } +@@ -2790,7 +2768,7 @@ BOOLEAN MacTableDeleteEntry( + } + else + { +- printk("\n%s: Impossible Wcid = %d !!!!!\n", __FUNCTION__, wcid); ++ printk("\n%s: Impossible Wcid = %d !!!!!\n", __func__, wcid); + } + } + +@@ -2826,9 +2804,7 @@ VOID MacTableReset( + + for (i=1; iMacTab.Content[i].ValidAsCLI == TRUE) + { + +--- a/drivers/staging/rt2860/common/cmm_data_2860.c ++++ b/drivers/staging/rt2860/common/cmm_data_2860.c +@@ -634,7 +634,7 @@ VOID RT28xxPciAsicRadioOff( + } + + // Once go into this function, disable tx because don't want too many packets in queue to prevent HW stops. +- pAd->bPCIclkOffDisableTx = TRUE; ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_DISABLE_TX); + + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { +@@ -651,7 +651,7 @@ VOID RT28xxPciAsicRadioOff( + { + DBGPRINT(RT_DEBUG_TRACE, ("TbTTTime = 0x%x , give up this sleep. \n", TbTTTime)); + OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); +- pAd->bPCIclkOffDisableTx = FALSE; ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_DISABLE_TX); + return; + } + else +@@ -688,18 +688,25 @@ VOID RT28xxPciAsicRadioOff( + if (i >= 50) + { + DBGPRINT(RT_DEBUG_TRACE, ("DMA keeps busy. return on RT28xxPciAsicRadioOff ()\n")); +- pAd->bPCIclkOffDisableTx = FALSE; + RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word); + DmaCfg.field.EnableTxDMA = 1; + RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word); ++ pAd->CheckDmaBusyCount++; + return; + } ++ else ++ { ++ pAd->CheckDmaBusyCount = 0; ++ } + + RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF); + + // Set to 1R. +- tempBBP_R3 = (pAd->StaCfg.BBPR3 & 0xE7); +- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, tempBBP_R3); ++ if (pAd->Antenna.field.RxPath > 1) ++ { ++ tempBBP_R3 = (pAd->StaCfg.BBPR3 & 0xE7); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, tempBBP_R3); ++ } + + // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again. + if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel) +@@ -714,8 +721,15 @@ VOID RT28xxPciAsicRadioOff( + AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel); + } + +- // When PCI clock is off, don't want to service interrupt. +- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, AutoWakeupInt); ++ if (Level != RTMP_HALT) ++ { ++ // Change Interrupt bitmask. ++ RTMP_IO_WRITE32(pAd, INT_MASK_CSR, AutoWakeupInt); ++ } ++ else ++ { ++ NICDisableInterrupt(pAd); ++ } + + RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx); + // Disable MAC Rx +@@ -726,7 +740,8 @@ VOID RT28xxPciAsicRadioOff( + // 2. Send Sleep command + RTMP_IO_WRITE32(pAd, H2M_MAILBOX_STATUS, 0xffffffff); + RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CID, 0xffffffff); +- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x00); // send POWER-SAVE command to MCU. Timeout unit:40us. ++ // send POWER-SAVE command to MCU. high-byte = 1 save power as much as possible. high byte = 0 save less power ++ AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x1); + // 2-1. Wait command success + // Status = 1 : success, Status = 2, already sleep, Status = 3, Maybe MAC is busy so can't finish this task. + brc = AsicCheckCommanOk(pAd, PowerSafeCID); +@@ -734,7 +749,7 @@ VOID RT28xxPciAsicRadioOff( + if (brc == FALSE) + { + // try again +- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x00); // send POWER-SAVE command to MCU. Timeout unit:40us. ++ AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x01); // send POWER-SAVE command to MCU. Timeout unit:40us. + //RTMPusecDelay(200); + brc = AsicCheckCommanOk(pAd, PowerSafeCID); + } +@@ -759,7 +774,7 @@ VOID RT28xxPciAsicRadioOff( + do + { + RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word); +- if (DmaCfg.field.RxDMABusy == 0) ++ if ((DmaCfg.field.RxDMABusy == 0) && (DmaCfg.field.TxDMABusy == 0)) + break; + RTMPusecDelay(20); + i++; +@@ -767,13 +782,12 @@ VOID RT28xxPciAsicRadioOff( + + if (i >= 50) + { ++ pAd->CheckDmaBusyCount++; + DBGPRINT(RT_DEBUG_TRACE, ("DMA Rx keeps busy. on RT28xxPciAsicRadioOff ()\n")); + } +- // disable DMA Rx. ++ else + { +- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word); +- DmaCfg.field.EnableRxDMA = 0; +- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word); ++ pAd->CheckDmaBusyCount = 0; + } + + if (Level == DOT11POWERSAVE) +@@ -799,7 +813,7 @@ VOID RT28xxPciAsicRadioOff( + if (Level == RTMP_HALT) + { + if ((brc == TRUE) && (i < 50)) +- RTMPPCIeLinkCtrlSetting(pAd, 1); ++ RTMPPCIeLinkCtrlSetting(pAd, 0); + } + // 4. Set PCI configuration Space Link Comtrol fields. Only Radio Off needs to call this function + else +@@ -808,7 +822,7 @@ VOID RT28xxPciAsicRadioOff( + RTMPPCIeLinkCtrlSetting(pAd, 3); + } + +- pAd->bPCIclkOffDisableTx = FALSE; ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_DISABLE_TX); + } + + +@@ -835,7 +849,8 @@ BOOLEAN RT28xxPciAsicRadioOn( + { + pAd->Mlme.bPsPollTimerRunning = FALSE; + RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); +- if ((Level == GUIRADIO_OFF) || (Level == GUI_IDLE_POWER_SAVE)) ++ if ((Level == GUIRADIO_OFF) || (Level == GUI_IDLE_POWER_SAVE) ++ || (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))) + { + DBGPRINT(RT_DEBUG_TRACE, ("RT28xxPciAsicRadioOn ()\n")); + // 1. Set PCI Link Control in Configuration Space. +@@ -845,15 +860,14 @@ BOOLEAN RT28xxPciAsicRadioOn( + } + + pAd->bPCIclkOff = FALSE; +- ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x3a80); + // 2. Send wake up command. +- AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x00); ++ AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02); + + // 2-1. wait command ok. + brv = AsicCheckCommanOk(pAd, PowerWakeCID); + if (brv) + { +- //RTMP_IO_WRITE32(pAd, INT_MASK_CSR, (DELAYINTMASK|RxINT)); + NICEnableInterrupt(pAd); + + // 3. Enable Tx DMA. +@@ -893,13 +907,10 @@ BOOLEAN RT28xxPciAsicRadioOn( + + VOID RT28xxPciStaAsicForceWakeup( + IN PRTMP_ADAPTER pAd, +- IN BOOLEAN bFromTx) ++ IN UCHAR Level) + { + AUTO_WAKEUP_STRUC AutoWakeupCfg; + +- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +- return; +- + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW)) + { + DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n")); +@@ -907,38 +918,48 @@ VOID RT28xxPciStaAsicForceWakeup( + } + + OPSTATUS_SET_FLAG(pAd, fOP_STATUS_WAKEUP_NOW); ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); + + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + // Support PCIe Advance Power Save +- if (bFromTx == TRUE) ++ if (((Level == FROM_TX) && (pAd->Mlme.bPsPollTimerRunning == TRUE)) || ++ (Level == RTMP_HALT)) + { + pAd->Mlme.bPsPollTimerRunning = FALSE; + RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_WAKEUP); +- RTMPusecDelay(3000); ++ RTMPusecDelay(5000); + DBGPRINT(RT_DEBUG_TRACE, ("=======AsicForceWakeup===bFromTx\n")); + } + + AutoWakeupCfg.word = 0; + RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); + +- if (RT28xxPciAsicRadioOn(pAd, DOT11POWERSAVE)) +- { +- // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again. +- if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel) +- && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40)) +- { +- // Must using 40MHz. +- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); +- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); +- } +- else +- { +- // Must using 20MHz. +- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); +- AsicLockChannel(pAd, pAd->CommonCfg.Channel); +- } +- } ++ // If this is called from Halt. ALWAYS force wakeup!!! ++ if (Level == RTMP_HALT) ++ { ++ RT28xxPciAsicRadioOn(pAd, RTMP_HALT); ++ } ++ else ++ { ++ if (RT28xxPciAsicRadioOn(pAd, DOT11POWERSAVE)) ++ { ++ // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again. ++ if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel) ++ && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40)) ++ { ++ // Must using 40MHz. ++ AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); ++ AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); ++ } ++ else ++ { ++ // Must using 20MHz. ++ AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); ++ AsicLockChannel(pAd, pAd->CommonCfg.Channel); ++ } ++ } ++ } + } + else + { +@@ -1002,7 +1023,7 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup + AutoWakeupCfg.field.AutoLeadTime = 5; + RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); + AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x00); // send POWER-SAVE command to MCU. Timeout 40us. +- DBGPRINT(RT_DEBUG_TRACE, ("<-- %s, TbttNumToNextWakeUp=%d \n", __FUNCTION__, TbttNumToNextWakeUp)); ++ DBGPRINT(RT_DEBUG_TRACE, ("<-- %s, TbttNumToNextWakeUp=%d \n", __func__, TbttNumToNextWakeUp)); + } + OPSTATUS_SET_FLAG(pAd, fOP_STATUS_DOZE); + } +@@ -1115,13 +1136,14 @@ VOID RT28xxPciMlmeRadioOn( + if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) + return; + +- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__)); + + if ((pAd->OpMode == OPMODE_AP) || + ((pAd->OpMode == OPMODE_STA) && (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)))) + { + NICResetFromError(pAd); + ++ /* + RTMPRingCleanUp(pAd, QID_AC_BK); + RTMPRingCleanUp(pAd, QID_AC_BE); + RTMPRingCleanUp(pAd, QID_AC_VI); +@@ -1129,6 +1151,7 @@ VOID RT28xxPciMlmeRadioOn( + RTMPRingCleanUp(pAd, QID_HCCA); + RTMPRingCleanUp(pAd, QID_MGMT); + RTMPRingCleanUp(pAd, QID_RX); ++ */ + + // Enable Tx/Rx + RTMPEnableRxTx(pAd); +@@ -1162,20 +1185,25 @@ VOID RT28xxPciMlmeRadioOFF( + WPDMA_GLO_CFG_STRUC GloCfg; + UINT32 i; + ++ if (pAd->StaCfg.bRadio == TRUE) ++ { ++ DBGPRINT(RT_DEBUG_TRACE,("-->MlmeRadioOff() return on bRadio == TRUE; \n")); ++ return; ++ } ++ + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) + return; + +- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__)); + + // Set LED + RTMPSetLED(pAd, LED_RADIO_OFF); +- // Set Radio off flag +- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF); + + #ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { + BOOLEAN Cancelled; ++ + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) + { + RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled); +@@ -1185,6 +1213,15 @@ VOID RT28xxPciMlmeRadioOFF( + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + BOOLEAN Cancelled; ++ ++ // Always radio on since the NIC needs to set the MCU command (LED_RADIO_OFF). ++ if ((pAd->OpMode == OPMODE_STA) && ++ (IDLE_ON(pAd)) && ++ (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))) ++ { ++ RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE); ++ } ++ + pAd->Mlme.bPsPollTimerRunning = FALSE; + RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); + RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled); +@@ -1197,9 +1234,26 @@ VOID RT28xxPciMlmeRadioOFF( + //========================================== + // Clean up old bss table + BssTableInit(&pAd->ScanTab); ++ ++ RTMPRingCleanUp(pAd, QID_AC_BK); ++ RTMPRingCleanUp(pAd, QID_AC_BE); ++ RTMPRingCleanUp(pAd, QID_AC_VI); ++ RTMPRingCleanUp(pAd, QID_AC_VO); ++ RTMPRingCleanUp(pAd, QID_HCCA); ++ RTMPRingCleanUp(pAd, QID_MGMT); ++ RTMPRingCleanUp(pAd, QID_RX); ++ ++ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) ++ { ++ RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 500); ++ return; ++ } + } + #endif // CONFIG_STA_SUPPORT // + ++ // Set Radio off flag ++ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF); ++ + // Disable Tx/Rx DMA + RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA + GloCfg.field.EnableTxDMA = 0; +--- a/drivers/staging/rt2860/common/cmm_info.c ++++ b/drivers/staging/rt2860/common/cmm_info.c +@@ -814,7 +814,6 @@ INT Show_DescInfo_Proc( + IN PRTMP_ADAPTER pAd, + IN PUCHAR arg) + { +-#ifdef RT2860 + INT i, QueIdx=0; + PRT28XX_RXD_STRUC pRxD; + PTXD_STRUC pTxD; +@@ -845,7 +844,6 @@ INT Show_DescInfo_Proc( + hex_dump("Rx Descriptor", (char *)pRxD, 16); + printk("pRxD->DDONE = %x\n", pRxD->DDONE); + } +-#endif // RT2860 // + + return TRUE; + } +@@ -1803,9 +1801,7 @@ VOID RTMPAddWcidAttributeEntry( + } + + // For key index and ext IV bit, so only need to update the position(offset+3). +-#ifdef RT2860 + RTMP_IO_WRITE8(pAd, offset+3, IVEIV); +-#endif // RT2860 // + + DBGPRINT(RT_DEBUG_TRACE,("RTMPAddWcidAttributeEntry: WCID #%d, KeyIndex #%d, Alg=%s\n",Wcid, KeyIdx, CipherName[CipherAlg])); + DBGPRINT(RT_DEBUG_TRACE,(" WCIDAttri = 0x%x \n", WCIDAttri)); +@@ -2039,7 +2035,7 @@ VOID RTMPIoctlGetMacTable( + wrq->u.data.length = sizeof(RT_802_11_MAC_TABLE); + if (copy_to_user(wrq->u.data.pointer, &MacTab, wrq->u.data.length)) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s: copy_to_user() fail\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s: copy_to_user() fail\n", __func__)); + } + + msg = (CHAR *) kmalloc(sizeof(CHAR)*(MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN), MEM_ALLOC_FLAG); +@@ -2827,9 +2823,7 @@ INT Set_OpMode_Proc( + + Value = simple_strtol(arg, 0, 10); + +-#ifdef RT2860 + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +-#endif // RT2860 // + { + DBGPRINT(RT_DEBUG_ERROR, ("Can not switch operate mode on interface up !! \n")); + return FALSE; +--- a/drivers/staging/rt2860/common/cmm_sync.c ++++ b/drivers/staging/rt2860/common/cmm_sync.c +@@ -470,7 +470,7 @@ VOID ScanNextChannel( + { + // BBP and RF are not accessible in PS mode, we has to wake them up first + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +- AsicForceWakeup(pAd, TRUE); ++ AsicForceWakeup(pAd, FROM_TX); + + // leave PSM during scanning. otherwise we may lost ProbeRsp & BEACON + if (pAd->StaCfg.Psm == PWR_SAVE) +--- a/drivers/staging/rt2860/common/cmm_wpa.c ++++ b/drivers/staging/rt2860/common/cmm_wpa.c +@@ -39,8 +39,10 @@ + // WPA OUI + UCHAR OUI_WPA_NONE_AKM[4] = {0x00, 0x50, 0xF2, 0x00}; + UCHAR OUI_WPA_VERSION[4] = {0x00, 0x50, 0xF2, 0x01}; ++UCHAR OUI_WPA_WEP40[4] = {0x00, 0x50, 0xF2, 0x01}; + UCHAR OUI_WPA_TKIP[4] = {0x00, 0x50, 0xF2, 0x02}; + UCHAR OUI_WPA_CCMP[4] = {0x00, 0x50, 0xF2, 0x04}; ++UCHAR OUI_WPA_WEP104[4] = {0x00, 0x50, 0xF2, 0x05}; + UCHAR OUI_WPA_8021X_AKM[4] = {0x00, 0x50, 0xF2, 0x01}; + UCHAR OUI_WPA_PSK_AKM[4] = {0x00, 0x50, 0xF2, 0x02}; + // WPA2 OUI +@@ -49,6 +51,7 @@ UCHAR OUI_WPA2_TKIP[4] = {0 + UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04}; + UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01}; + UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02}; ++UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05}; + // MSA OUI + UCHAR OUI_MSA_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x05}; // Not yet final - IEEE 802.11s-D1.06 + UCHAR OUI_MSA_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x06}; // Not yet final - IEEE 802.11s-D1.06 +@@ -367,6 +370,24 @@ static VOID RTMPInsertRsnIeCipher( + break; + } + ++#ifdef CONFIG_STA_SUPPORT ++ if ((pAd->OpMode == OPMODE_STA) && ++ (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && ++ (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) ++ { ++ UINT GroupCipher = pAd->StaCfg.GroupCipher; ++ switch(GroupCipher) ++ { ++ case Ndis802_11GroupWEP40Enabled: ++ NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_WEP40, 4); ++ break; ++ case Ndis802_11GroupWEP104Enabled: ++ NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_WEP104, 4); ++ break; ++ } ++ } ++#endif // CONFIG_STA_SUPPORT // ++ + // swap for big-endian platform + pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version); + pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount); +@@ -427,11 +448,28 @@ static VOID RTMPInsertRsnIeCipher( + break; + } + ++#ifdef CONFIG_STA_SUPPORT ++ if ((pAd->OpMode == OPMODE_STA) && ++ (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && ++ (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) ++ { ++ UINT GroupCipher = pAd->StaCfg.GroupCipher; ++ switch(GroupCipher) ++ { ++ case Ndis802_11GroupWEP40Enabled: ++ NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_WEP40, 4); ++ break; ++ case Ndis802_11GroupWEP104Enabled: ++ NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_WEP104, 4); ++ break; ++ } ++ } ++#endif // CONFIG_STA_SUPPORT // ++ + // swap for big-endian platform + pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version); + pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount); + } +- + } + + /* +--- a/drivers/staging/rt2860/common/dfs.c ++++ b/drivers/staging/rt2860/common/dfs.c +@@ -428,7 +428,7 @@ INT Set_ChMovingTime_Proc( + + pAd->CommonCfg.RadarDetect.ChMovingTime = Value; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __FUNCTION__, ++ DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __func__, + pAd->CommonCfg.RadarDetect.ChMovingTime)); + + return TRUE; +@@ -444,7 +444,7 @@ INT Set_LongPulseRadarTh_Proc( + + pAd->CommonCfg.RadarDetect.LongPulseRadarTh = Value; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __FUNCTION__, ++ DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __func__, + pAd->CommonCfg.RadarDetect.LongPulseRadarTh)); + + return TRUE; +--- a/drivers/staging/rt2860/common/mlme.c ++++ b/drivers/staging/rt2860/common/mlme.c +@@ -527,7 +527,6 @@ NDIS_STATUS MlmeInit( + + + #ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) +@@ -537,7 +536,6 @@ NDIS_STATUS MlmeInit( + RTMPInitTimer(pAd, &pAd->Mlme.RadioOnOffTimer, GET_TIMER_FUNCTION(RadioOnExec), pAd, FALSE); + } + } +-#endif // RT2860 // + #endif // CONFIG_STA_SUPPORT // + + } while (FALSE); +@@ -711,13 +709,11 @@ VOID MlmeHalt( + RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &Cancelled); + RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled); + RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled); +-#ifdef RT2860 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); + RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled); + } +-#endif // RT2860 // + + #ifdef QOS_DLS_SUPPORT + for (i=0; iStaCfg.WepStatus)); ++ //If the STA security setting is OPEN or WEP, pAd->StaCfg.WpaSupplicantUP = 0. ++ //If the STA security setting is WPAPSK or WPA2PSK, pAd->StaCfg.WpaSupplicantUP = 1. ++ if(pAd->StaCfg.WepStatus<2) ++ { ++ pAd->StaCfg.WpaSupplicantUP = 0; ++ } ++ else ++ { ++ pAd->StaCfg.WpaSupplicantUP = 1; ++ } ++ + #ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { + // If Hardware controlled Radio enabled, we have to check GPIO pin2 every 2 second. + // Move code to here, because following code will return when radio is off +- if ((pAd->Mlme.PeriodicRound % (MLME_TASK_EXEC_MULTIPLE * 2) == 0) && (pAd->StaCfg.bHardwareRadio == TRUE) && ++ if ((pAd->Mlme.PeriodicRound % (MLME_TASK_EXEC_MULTIPLE * 2) == 0) && ++ (pAd->StaCfg.bHardwareRadio == TRUE) && ++ (RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP)) && + (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) && +- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) && +- (pAd->bPCIclkOff == FALSE)) ++ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) + { + UINT32 data = 0; + + // Read GPIO pin2 as Hardware controlled radio state +- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &data); ++ RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data); + if (data & 0x04) + { + pAd->StaCfg.bHwRadio = TRUE; +@@ -849,7 +858,6 @@ VOID MlmePeriodicExec( + } + } + } +-#endif // RT2860 // + #endif // CONFIG_STA_SUPPORT // + + // Do nothing if the driver is starting halt state. +@@ -860,6 +868,45 @@ VOID MlmePeriodicExec( + fRTMP_ADAPTER_RESET_IN_PROGRESS)))) + return; + ++ IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ++ { ++ if ((pAd->RalinkCounters.LastReceivedByteCount == pAd->RalinkCounters.ReceivedByteCount) && (pAd->StaCfg.bRadio == TRUE)) ++ { ++ // If ReceiveByteCount doesn't change, increase SameRxByteCount by 1. ++ pAd->SameRxByteCount++; ++ } ++ else ++ pAd->SameRxByteCount = 0; ++ ++ // If after BBP, still not work...need to check to reset PBF&MAC. ++ if (pAd->SameRxByteCount == 702) ++ { ++ pAd->SameRxByteCount = 0; ++ AsicResetPBF(pAd); ++ AsicResetMAC(pAd); ++ } ++ ++ // If SameRxByteCount keeps happens for 2 second in infra mode, or for 60 seconds in idle mode. ++ if (((INFRA_ON(pAd)) && (pAd->SameRxByteCount > 20)) || ((IDLE_ON(pAd)) && (pAd->SameRxByteCount > 600))) ++ { ++ if ((pAd->StaCfg.bRadio == TRUE) && (pAd->SameRxByteCount < 700)) ++ { ++ DBGPRINT(RT_DEBUG_TRACE, ("---> SameRxByteCount = %lu !!!!!!!!!!!!!!! \n", pAd->SameRxByteCount)); ++ pAd->SameRxByteCount = 700; ++ AsicResetBBP(pAd); ++ } ++ } ++ ++ // Update lastReceiveByteCount. ++ pAd->RalinkCounters.LastReceivedByteCount = pAd->RalinkCounters.ReceivedByteCount; ++ ++ if ((pAd->CheckDmaBusyCount > 3) && (IDLE_ON(pAd))) ++ { ++ pAd->CheckDmaBusyCount = 0; ++ AsicResetFromDMABusy(pAd); ++ } ++ } ++ + RT28XX_MLME_PRE_SANITY_CHECK(pAd); + + #ifdef RALINK_ATE +@@ -1022,9 +1069,7 @@ VOID MlmePeriodicExec( + #ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { +-#ifdef RT2860 + if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->bPCIclkOff == FALSE)) +-#endif // RT2860 // + { + // When Adhoc beacon is enabled and RTS/CTS is enabled, there is a chance that hardware MAC FSM will run into a deadlock + // and sending CTS-to-self over and over. +@@ -1081,6 +1126,19 @@ VOID STAMlmePeriodicExec( + pAd->StaCfg.bBlockAssoc = FALSE; + } + ++ //Baron 2008/07/10 ++ //printk("Baron_Test:\t%s", RTMPGetRalinkEncryModeStr(pAd->StaCfg.WepStatus)); ++ //If the STA security setting is OPEN or WEP, pAd->StaCfg.WpaSupplicantUP = 0. ++ //If the STA security setting is WPAPSK or WPA2PSK, pAd->StaCfg.WpaSupplicantUP = 1. ++ if(pAd->StaCfg.WepStatus<2) ++ { ++ pAd->StaCfg.WpaSupplicantUP = 0; ++ } ++ else ++ { ++ pAd->StaCfg.WpaSupplicantUP = 1; ++ } ++ + if ((pAd->PreMediaState != pAd->IndicateMediaState) && (pAd->CommonCfg.bWirelessEvent)) + { + if (pAd->IndicateMediaState == NdisMediaStateConnected) +@@ -1090,6 +1148,15 @@ VOID STAMlmePeriodicExec( + pAd->PreMediaState = pAd->IndicateMediaState; + } + ++ if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd)) && ++ (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) && ++ (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE) && ++ (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) && ++ (RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP)) && ++ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))) ++ { ++ RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0); ++ } + + + +@@ -2781,7 +2848,7 @@ VOID MlmeCheckPsmChange( + if (INFRA_ON(pAd) && + (PowerMode != Ndis802_11PowerModeCAM) && + (pAd->StaCfg.Psm == PWR_ACTIVE) && +- (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)) ++ RTMP_TEST_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP)) + { + NdisGetSystemUpTime(&pAd->Mlme.LastSendNULLpsmTime); + pAd->RalinkCounters.RxCountSinceLastNULL = 0; +@@ -4065,7 +4132,9 @@ VOID BssTableSsidSort( + continue; + + // check group cipher +- if (pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) ++ if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) && ++ (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled) && ++ (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled)) + continue; + + // check pairwise cipher, skip if none matched +@@ -4084,7 +4153,9 @@ VOID BssTableSsidSort( + continue; + + // check group cipher +- if (pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher) ++ if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) && ++ (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled) && ++ (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled)) + continue; + + // check pairwise cipher, skip if none matched +@@ -4371,8 +4442,10 @@ VOID BssCipherParse( + switch (*pTmp) + { + case 1: +- case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway +- pBss->WPA.GroupCipher = Ndis802_11Encryption1Enabled; ++ pBss->WPA.GroupCipher = Ndis802_11GroupWEP40Enabled; ++ break; ++ case 5: ++ pBss->WPA.GroupCipher = Ndis802_11GroupWEP104Enabled; + break; + case 2: + pBss->WPA.GroupCipher = Ndis802_11Encryption2Enabled; +@@ -4489,8 +4562,10 @@ VOID BssCipherParse( + switch (pCipher->Type) + { + case 1: +- case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway +- pBss->WPA2.GroupCipher = Ndis802_11Encryption1Enabled; ++ pBss->WPA2.GroupCipher = Ndis802_11GroupWEP40Enabled; ++ break; ++ case 5: ++ pBss->WPA2.GroupCipher = Ndis802_11GroupWEP104Enabled; + break; + case 2: + pBss->WPA2.GroupCipher = Ndis802_11Encryption2Enabled; +@@ -4953,16 +5028,13 @@ BOOLEAN MlmeDequeue( + VOID MlmeRestartStateMachine( + IN PRTMP_ADAPTER pAd) + { +-#ifdef RT2860 + MLME_QUEUE_ELEM *Elem = NULL; +-#endif // RT2860 // + #ifdef CONFIG_STA_SUPPORT + BOOLEAN Cancelled; + #endif // CONFIG_STA_SUPPORT // + + DBGPRINT(RT_DEBUG_TRACE, ("MlmeRestartStateMachine \n")); + +-#ifdef RT2860 + NdisAcquireSpinLock(&pAd->Mlme.TaskLock); + if(pAd->Mlme.bRunning) + { +@@ -4990,7 +5062,6 @@ VOID MlmeRestartStateMachine( + DBGPRINT_ERR(("MlmeRestartStateMachine: MlmeQueue empty\n")); + } + } +-#endif // RT2860 // + + #ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) +@@ -5039,12 +5110,10 @@ VOID MlmeRestartStateMachine( + } + #endif // CONFIG_STA_SUPPORT // + +-#ifdef RT2860 + // Remove running state + NdisAcquireSpinLock(&pAd->Mlme.TaskLock); + pAd->Mlme.bRunning = FALSE; + NdisReleaseSpinLock(&pAd->Mlme.TaskLock); +-#endif // RT2860 // + } + + /*! \brief test if the MLME Queue is empty +@@ -6149,6 +6218,12 @@ VOID AsicAdjustTxPower( + ULONG TxPwr[5]; + CHAR Value; + ++ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ++ || (pAd->bPCIclkOff == TRUE) ++ || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF) ++ || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ++ return; ++ + if (pAd->CommonCfg.BBPCurrentBW == BW_40) + { + if (pAd->CommonCfg.CentralChannel > 14) +@@ -6493,10 +6568,10 @@ VOID AsicForceSleep( + */ + VOID AsicForceWakeup( + IN PRTMP_ADAPTER pAd, +- IN BOOLEAN bFromTx) ++ IN UCHAR Level) + { + DBGPRINT(RT_DEBUG_TRACE, ("--> AsicForceWakeup \n")); +- RT28XX_STA_FORCE_WAKEUP(pAd, bFromTx); ++ RT28XX_STA_FORCE_WAKEUP(pAd, Level); + } + #endif // CONFIG_STA_SUPPORT // + /* +@@ -6710,7 +6785,6 @@ VOID AsicEnableIbssSync( + csr9.field.bTsfTicking = 0; + RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr9.word); + +-#ifdef RT2860 + // move BEACON TXD and frame content to on-chip memory + ptr = (PUCHAR)&pAd->BeaconTxWI; + for (i=0; iCommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU +@@ -7097,9 +7170,7 @@ VOID AsicAddSharedKeyEntry( + { + ULONG offset; //, csr0; + SHAREDKEY_MODE_STRUC csr1; +-#ifdef RT2860 + INT i; +-#endif // RT2860 // + + DBGPRINT(RT_DEBUG_TRACE, ("AsicAddSharedKeyEntry BssIndex=%d, KeyIdx=%d\n", BssIndex,KeyIdx)); + //============================================================================================ +@@ -7121,7 +7192,6 @@ VOID AsicAddSharedKeyEntry( + // + // fill key material - key + TX MIC + RX MIC + // +-#ifdef RT2860 + offset = SHARED_KEY_TABLE_BASE + (4*BssIndex + KeyIdx)*HW_KEY_ENTRY_SIZE; + for (i=0; iTxTsc; + UCHAR CipherAlg = pCipherKey->CipherAlg; + SHAREDKEY_MODE_STRUC csr1; +-#ifdef RT2860 + UCHAR i; +-#endif // RT2860 // + + DBGPRINT(RT_DEBUG_TRACE, ("==> AsicAddKeyEntry\n")); + // +@@ -7337,7 +7404,6 @@ VOID AsicAddKeyEntry( + // 2.) Set Key to Asic + // + //for (i = 0; i < KeyLen; i++) +-#ifdef RT2860 + for (i = 0; i < MAX_LEN_OF_PEER_KEY; i++) + { + RTMP_IO_WRITE8(pAd, offset + i, pKey[i]); +@@ -7363,7 +7429,6 @@ VOID AsicAddKeyEntry( + RTMP_IO_WRITE8(pAd, offset + i, pRxMic[i]); + } + } +-#endif // RT2860 // + + + // +@@ -7372,7 +7437,6 @@ VOID AsicAddKeyEntry( + // + if (bTxKey) + { +-#ifdef RT2860 + offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE); + // + // Write IV +@@ -7395,7 +7459,6 @@ VOID AsicAddKeyEntry( + { + RTMP_IO_WRITE8(pAd, offset + i, pTxtsc[i + 2]); + } +-#endif // RT2860 // + + AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg, bUsePairewiseKeyTable); + } +@@ -7461,12 +7524,10 @@ VOID AsicAddPairwiseKeyEntry( + + // EKEY + offset = PAIRWISE_KEY_TABLE_BASE + (WCID * HW_KEY_ENTRY_SIZE); +-#ifdef RT2860 + for (i=0; i= 100) + { +-#ifdef RT2860 + #ifdef RALINK_ATE + if (pAd->ate.bFWLoading == TRUE) + { +@@ -7583,14 +7637,33 @@ BOOLEAN AsicSendCommandToMcu( + } + else + #endif // RALINK_ATE // +-#endif // RT2860 // + { ++ UINT32 Data; ++ ++ // Reset DMA ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data |= 0x2; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ ++ // After Reset DMA, DMA index will become Zero. So Driver need to reset all ring indexs too. ++ // Reset DMA/CPU ring index ++ RTMPRingCleanUp(pAd, QID_AC_BK); ++ RTMPRingCleanUp(pAd, QID_AC_BE); ++ RTMPRingCleanUp(pAd, QID_AC_VI); ++ RTMPRingCleanUp(pAd, QID_AC_VO); ++ RTMPRingCleanUp(pAd, QID_HCCA); ++ RTMPRingCleanUp(pAd, QID_MGMT); ++ RTMPRingCleanUp(pAd, QID_RX); ++ ++ // Clear Reset ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data &= 0xfffffffd; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); + DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n")); + } +- return FALSE; ++ //return FALSE; + } + +-#ifdef RT2860 + #ifdef RALINK_ATE + else if (pAd->ate.bFWLoading == TRUE) + { +@@ -7600,7 +7673,6 @@ BOOLEAN AsicSendCommandToMcu( + j = 0; + } + #endif // RALINK_ATE // +-#endif // RT2860 // + + H2MMailbox.field.Owner = 1; // pass ownership to MCU + H2MMailbox.field.CmdToken = Token; +@@ -7619,7 +7691,6 @@ BOOLEAN AsicSendCommandToMcu( + return TRUE; + } + +-#ifdef RT2860 + BOOLEAN AsicCheckCommanOk( + IN PRTMP_ADAPTER pAd, + IN UCHAR Command) +@@ -7684,7 +7755,6 @@ BOOLEAN AsicCheckCommanOk( + + return FALSE; + } +-#endif // RT2860 // + + /* + ======================================================================== +@@ -8096,10 +8166,8 @@ VOID AsicEvaluateRxAnt( + } + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); + #ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + pAd->StaCfg.BBPR3 = BBPR3; +-#endif // RT2860 // + #endif // CONFIG_STA_SUPPORT // + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) + ) +@@ -8211,9 +8279,7 @@ VOID AsicRxAntEvalTimeout( + BBPR3 |= (0x0); + } + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); +-#ifdef RT2860 +- pAd->StaCfg.BBPR3 = BBPR3; +-#endif // RT2860 // ++ pAd->StaCfg.BBPR3 = BBPR3; + } + + #endif // CONFIG_STA_SUPPORT // +@@ -8439,10 +8505,7 @@ VOID AsicStaBbpTuning( + && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) + ) + && !(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +-#ifdef RT2860 +- && (pAd->bPCIclkOff == FALSE) +-#endif // RT2860 // +- ) ++ && (pAd->bPCIclkOff == FALSE)) + { + RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &OrigR66Value); + R66 = OrigR66Value; +@@ -8518,6 +8581,106 @@ VOID AsicStaBbpTuning( + + } + } ++ ++VOID AsicResetFromDMABusy( ++ IN PRTMP_ADAPTER pAd) ++{ ++ UINT32 Data; ++ BOOLEAN bCtrl = FALSE; ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("---> AsicResetFromDMABusy !!!!!!!!!!!!!!!!!!!!!!! \n")); ++ ++ // Be sure restore link control value so we can write register. ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) ++ { ++ DBGPRINT(RT_DEBUG_TRACE,("AsicResetFromDMABusy==>\n")); ++ RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT); ++ RTMPusecDelay(6000); ++ pAd->bPCIclkOff = FALSE; ++ bCtrl = TRUE; ++ } ++ // Reset DMA ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data |= 0x2; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ ++ // After Reset DMA, DMA index will become Zero. So Driver need to reset all ring indexs too. ++ // Reset DMA/CPU ring index ++ RTMPRingCleanUp(pAd, QID_AC_BK); ++ RTMPRingCleanUp(pAd, QID_AC_BE); ++ RTMPRingCleanUp(pAd, QID_AC_VI); ++ RTMPRingCleanUp(pAd, QID_AC_VO); ++ RTMPRingCleanUp(pAd, QID_HCCA); ++ RTMPRingCleanUp(pAd, QID_MGMT); ++ RTMPRingCleanUp(pAd, QID_RX); ++ ++ // Clear Reset ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data &= 0xfffffffd; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ ++ // If in Radio off, should call RTMPPCIePowerLinkCtrl again. ++ if ((bCtrl == TRUE) && (pAd->StaCfg.bRadio == FALSE)) ++ RTMPPCIeLinkCtrlSetting(pAd, 3); ++ ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS); ++ DBGPRINT(RT_DEBUG_TRACE, ("<--- AsicResetFromDMABusy !!!!!!!!!!!!!!!!!!!!!!! \n")); ++} ++ ++VOID AsicResetBBP( ++ IN PRTMP_ADAPTER pAd) ++{ ++ DBGPRINT(RT_DEBUG_TRACE, ("---> Asic HardReset BBP !!!!!!!!!!!!!!!!!!!!!!! \n")); ++ ++ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0); ++ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x2); ++ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0xc); ++ ++ // After hard-reset BBP, initialize all BBP values. ++ NICRestoreBBPValue(pAd); ++ DBGPRINT(RT_DEBUG_TRACE, ("<--- Asic HardReset BBP !!!!!!!!!!!!!!!!!!!!!!! \n")); ++} ++ ++VOID AsicResetMAC( ++ IN PRTMP_ADAPTER pAd) ++{ ++ ULONG Data; ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("---> AsicResetMAC !!!! \n")); ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data |= 0x4; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ Data &= 0xfffffffb; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("<--- AsicResetMAC !!!! \n")); ++} ++ ++VOID AsicResetPBF( ++ IN PRTMP_ADAPTER pAd) ++{ ++ ULONG Value1, Value2; ++ ULONG Data; ++ ++ RTMP_IO_READ32(pAd, TXRXQ_PCNT, &Value1); ++ RTMP_IO_READ32(pAd, PBF_DBG, &Value2); ++ ++ Value2 &= 0xff; ++ // sum should be equals to 0xff, which is the total buffer size. ++ if ((Value1 + Value2) < 0xff) ++ { ++ DBGPRINT(RT_DEBUG_TRACE, ("---> Asic HardReset PBF !!!! \n")); ++ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data); ++ Data |= 0x8; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ Data &= 0xfffffff7; ++ RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data); ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("<--- Asic HardReset PBF !!!! \n")); ++ } ++} + #endif // CONFIG_STA_SUPPORT // + + VOID RTMPSetAGCInitValue( +--- a/drivers/staging/rt2860/common/rtmp_init.c ++++ b/drivers/staging/rt2860/common/rtmp_init.c +@@ -39,6 +39,7 @@ + */ + #include "../rt_config.h" + #include "firmware.h" ++#include + + UCHAR BIT8[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; + ULONG BIT32[] = {0x00000001, 0x00000002, 0x00000004, 0x00000008, +@@ -89,20 +90,6 @@ const unsigned short ccitt_16Table[] = { + #define ByteCRC16(v, crc) \ + (unsigned short)((crc << 8) ^ ccitt_16Table[((crc >> 8) ^ (v)) & 255]) + +-unsigned char BitReverse(unsigned char x) +-{ +- int i; +- unsigned char Temp=0; +- for(i=0; ; i++) +- { +- if(x & 0x80) Temp |= 0x80; +- if(i==7) break; +- x <<= 1; +- Temp >>= 1; +- } +- return Temp; +-} +- + // + // BBP register initialization set + // +@@ -162,9 +149,7 @@ RTMP_REG_PAIR MACRegTable[] = { + {GF20_PROT_CFG, 0x01744004}, // set 19:18 --> Short NAV for MIMO PS + {GF40_PROT_CFG, 0x03F44084}, + {MM20_PROT_CFG, 0x01744004}, +-#ifdef RT2860 + {MM40_PROT_CFG, 0x03F54084}, +-#endif // RT2860 // + {TXOP_CTRL_CFG, 0x0000583f, /*0x0000243f*/ /*0x000024bf*/}, //Extension channel backoff. + {TX_RTS_CFG, 0x00092b20}, + {EXP_ACK_TIME, 0x002400ca}, // default value +@@ -201,9 +186,7 @@ RTMP_REG_PAIR STAMACRegTable[] = { + #define FIRMWAREIMAGEV1_LENGTH 0x1000 + #define FIRMWAREIMAGEV2_LENGTH 0x1000 + +-#ifdef RT2860 + #define FIRMWARE_MINOR_VERSION 2 +-#endif // RT2860 // + + + /* +@@ -261,9 +244,7 @@ NDIS_STATUS RTMPAllocAdapterBlock( + + // Init spin locks + NdisAllocateSpinLock(&pAd->MgmtRingLock); +-#ifdef RT2860 + NdisAllocateSpinLock(&pAd->RxRingLock); +-#endif // RT2860 // + + for (index =0 ; index < NUM_OF_TX_RING; index++) + { +@@ -1568,10 +1549,7 @@ VOID NICInitAsicFromEEPROM( + pAd->LedCntl.word = 0x01; + pAd->Led1 = 0x5555; + pAd->Led2 = 0x2221; +- +-#ifdef RT2860 + pAd->Led3 = 0xA9F8; +-#endif // RT2860 // + } + + AsicSendCommandToMcu(pAd, 0x52, 0xff, (UCHAR)pAd->Led1, (UCHAR)(pAd->Led1 >> 8)); +@@ -1607,12 +1585,10 @@ VOID NICInitAsicFromEEPROM( + else + { + RTMPSetLED(pAd, LED_RADIO_ON); +-#ifdef RT2860 + AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02); + AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x00); + // 2-1. wait command ok. + AsicCheckCommanOk(pAd, PowerWakeCID); +-#endif // RT2860 // + } + } + #endif // CONFIG_STA_SUPPORT // +@@ -1690,10 +1666,8 @@ NDIS_STATUS NICInitializeAdapter( + { + NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + WPDMA_GLO_CFG_STRUC GloCfg; +-#ifdef RT2860 + UINT32 Value; + DELAY_INT_CFG_STRUC IntCfg; +-#endif // RT2860 // + ULONG i =0, j=0; + AC_TXOP_CSR0_STRUC csr0; + +@@ -1732,11 +1706,9 @@ retry: + + // asic simulation sequence put this ahead before loading firmware. + // pbf hardware reset +-#ifdef RT2860 + RTMP_IO_WRITE32(pAd, WPDMA_RST_IDX, 0x1003f); // 0x10000 for reset rx, 0x3f resets all 6 tx rings. + RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe1f); + RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe00); +-#endif // RT2860 // + + // Initialze ASIC for TX & Rx operation + if (NICInitializeAsic(pAd , bHardReset) != NDIS_STATUS_SUCCESS) +@@ -1750,7 +1722,6 @@ retry: + } + + +-#ifdef RT2860 + // Write AC_BK base address register + Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_BK].Cell[0].AllocPa); + RTMP_IO_WRITE32(pAd, TX_BASE_PTR1, Value); +@@ -1823,7 +1794,6 @@ retry: + // Write RX_RING_CSR register + Value = RX_RING_SIZE; + RTMP_IO_WRITE32(pAd, RX_MAX_CNT, Value); +-#endif // RT2860 // + + + // WMM parameter +@@ -1842,7 +1812,6 @@ retry: + RTMP_IO_WRITE32(pAd, WMM_TXOP1_CFG, csr0.word); + + +-#ifdef RT2860 + // 3. Set DMA global configuration except TX_DMA_EN and RX_DMA_EN bits: + i = 0; + do +@@ -1861,7 +1830,6 @@ retry: + + IntCfg.word = 0; + RTMP_IO_WRITE32(pAd, DELAY_INT_CFG, IntCfg.word); +-#endif // RT2860 // + + + // reset action +@@ -1902,7 +1870,6 @@ NDIS_STATUS NICInitializeAsic( + + DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n")); + +-#ifdef RT2860 + if (bHardReset == TRUE) + { + RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x3); +@@ -1927,7 +1894,6 @@ NDIS_STATUS NICInitializeAsic( + } + } + #endif // CONFIG_STA_SUPPORT // +-#endif // RT2860 // + + + // +@@ -2054,6 +2020,131 @@ NDIS_STATUS NICInitializeAsic( + return NDIS_STATUS_SUCCESS; + } + ++ ++VOID NICRestoreBBPValue( ++ IN PRTMP_ADAPTER pAd) ++{ ++ UCHAR index; ++ UCHAR Value = 0; ++ ULONG Data; ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("---> NICRestoreBBPValue !!!!!!!!!!!!!!!!!!!!!!! \n")); ++ // Initialize BBP register to default value (rtmp_init.c) ++ for (index = 0; index < NUM_BBP_REG_PARMS; index++) ++ { ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[index].Register, BBPRegTable[index].Value); ++ } ++ // copy from (rtmp_init.c) ++ if (pAd->MACVersion == 0x28600100) ++ { ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x12); ++ } ++ ++ // copy from (connect.c LinkUp function) ++ if (INFRA_ON(pAd)) ++ { ++ // Change to AP channel ++ if ((pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40)) ++ { ++ // Must using 40MHz. ++ pAd->CommonCfg.BBPCurrentBW = BW_40; ++ AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); ++ AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); ++ ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); ++ Value &= (~0x18); ++ Value |= 0x10; ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); ++ ++ // RX : control channel at lower ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); ++ Value &= (~0x20); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); ++ // Record BBPR3 setting, But don't keep R Antenna # information. ++ pAd->StaCfg.BBPR3 = Value; ++ ++ RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); ++ Data &= 0xfffffffe; ++ RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); ++ ++ if (pAd->MACVersion == 0x28600100) ++ { ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16); ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); ++ } ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel )); ++ } ++ else if ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40)) ++ { ++ // Must using 40MHz. ++ pAd->CommonCfg.BBPCurrentBW = BW_40; ++ AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); ++ AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); ++ ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); ++ Value &= (~0x18); ++ Value |= 0x10; ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); ++ ++ RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); ++ Data |= 0x1; ++ RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); ++ ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); ++ Value |= (0x20); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); ++ // Record BBPR3 setting, But don't keep R Antenna # information. ++ pAd->StaCfg.BBPR3 = Value; ++ ++ if (pAd->MACVersion == 0x28600100) ++ { ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16); ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); ++ } ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel )); ++ } ++ else ++ { ++ pAd->CommonCfg.BBPCurrentBW = BW_20; ++ AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); ++ AsicLockChannel(pAd, pAd->CommonCfg.Channel); ++ ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value); ++ Value &= (~0x18); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value); ++ ++ RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); ++ Data &= 0xfffffffe; ++ RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data); ++ ++ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); ++ Value &= (~0x20); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); ++ // Record BBPR3 setting, But don't keep R Antenna # information. ++ pAd->StaCfg.BBPR3 = Value; ++ ++ if (pAd->MACVersion == 0x28600100) ++ { ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08); ++ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11); ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); ++ } ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz LINK UP !!! \n" )); ++ } ++ } ++ ++ DBGPRINT(RT_DEBUG_TRACE, ("<--- NICRestoreBBPValue !!!!!!!!!!!!!!!!!!!!!!! \n")); ++} ++ + /* + ======================================================================== + +@@ -2555,7 +2646,7 @@ NDIS_STATUS NICLoadFirmware( + #ifdef BIN_IN_FILE + #define NICLF_DEFAULT_USE() \ + flg_default_firm_use = TRUE; \ +- printk("%s - Use default firmware!\n", __FUNCTION__); ++ printk("%s - Use default firmware!\n", __func__); + + NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + PUCHAR src; +@@ -2570,7 +2661,7 @@ NDIS_STATUS NICLoadFirmware( + BOOLEAN flg_default_firm_use = FALSE; + + +- DBGPRINT(RT_DEBUG_TRACE, ("===> %s\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("===> %s\n", __func__)); + + /* init */ + pFirmwareImage = NULL; +@@ -2593,7 +2684,7 @@ NDIS_STATUS NICLoadFirmware( + if (pFirmwareImage == NULL) + { + /* allocate fail, use default firmware array in firmware.h */ +- printk("%s - Allocate memory fail!\n", __FUNCTION__); ++ printk("%s - Allocate memory fail!\n", __func__); + NICLF_DEFAULT_USE(); + } + else +@@ -2614,7 +2705,7 @@ NDIS_STATUS NICLoadFirmware( + if (IS_ERR(srcf)) + { + printk("%s - Error %ld opening %s\n", +- __FUNCTION__, -PTR_ERR(srcf), src); ++ __func__, -PTR_ERR(srcf), src); + NICLF_DEFAULT_USE(); + break; + } /* End of if */ +@@ -2622,7 +2713,7 @@ NDIS_STATUS NICLoadFirmware( + /* the object must have a read method */ + if ((srcf->f_op == NULL) || (srcf->f_op->read == NULL)) + { +- printk("%s - %s does not have a write method\n", __FUNCTION__, src); ++ printk("%s - %s does not have a write method\n", __func__, src); + NICLF_DEFAULT_USE(); + break; + } /* End of if */ +@@ -2636,7 +2727,7 @@ NDIS_STATUS NICLoadFirmware( + if (FileLength != MAX_FIRMWARE_IMAGE_SIZE) + { + printk("%s: error file length (=%d) in RT2860AP.BIN\n", +- __FUNCTION__, FileLength); ++ __func__, FileLength); + NICLF_DEFAULT_USE(); + break; + } +@@ -2648,18 +2739,18 @@ NDIS_STATUS NICLoadFirmware( + + /* calculate firmware CRC */ + for(i=0; i<(MAX_FIRMWARE_IMAGE_SIZE-2); i++, ptr++) +- crc = ByteCRC16(BitReverse(*ptr), crc); ++ crc = ByteCRC16(bitrev8(*ptr), crc); + /* End of for */ + + if ((pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-2] != \ +- (UCHAR)BitReverse((UCHAR)(crc>>8))) || ++ (UCHAR)bitrev8((UCHAR)(crc>>8))) || + (pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-1] != \ +- (UCHAR)BitReverse((UCHAR)crc))) ++ (UCHAR)bitrev8((UCHAR)crc))) + { + /* CRC fail */ + printk("%s: CRC = 0x%02x 0x%02x " + "error, should be 0x%02x 0x%02x\n", +- __FUNCTION__, ++ __func__, + pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-2], + pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-1], + (UCHAR)(crc>>8), (UCHAR)(crc)); +@@ -2678,7 +2769,7 @@ NDIS_STATUS NICLoadFirmware( + ((FIRMWARE_MAJOR_VERSION << 8) + + FIRMWARE_MINOR_VERSION)) + { +- printk("%s: firmware version too old!\n", __FUNCTION__); ++ printk("%s: firmware version too old!\n", __func__); + NICLF_DEFAULT_USE(); + break; + } /* End of if */ +@@ -2783,7 +2874,7 @@ NDIS_STATUS NICLoadFirmware( + } /* End of if */ + + DBGPRINT(RT_DEBUG_TRACE, +- ("<=== %s (status=%d)\n", __FUNCTION__, Status)); ++ ("<=== %s (status=%d)\n", __func__, Status)); + return Status; + } /* End of NICLoadFirmware */ + +@@ -3041,11 +3132,10 @@ VOID UserCfgInit( + pAd->CommonCfg.BBPCurrentBW = BW_20; + + pAd->LedCntl.word = 0; +-#ifdef RT2860 + pAd->LedIndicatorStregth = 0; + pAd->RLnkCtrlOffset = 0; + pAd->HostLnkCtrlOffset = 0; +-#endif // RT2860 // ++ pAd->CheckDmaBusyCount = 0; + + pAd->bAutoTxAgcA = FALSE; // Default is OFF + pAd->bAutoTxAgcG = FALSE; // Default is OFF +@@ -3305,9 +3395,7 @@ VOID UserCfgInit( + pAd->ate.bRxFer = 0; + pAd->ate.bQATxStart = FALSE; + pAd->ate.bQARxStart = FALSE; +-#ifdef RT2860 + pAd->ate.bFWLoading = FALSE; +-#endif // RT2860 // + #ifdef RALINK_28xx_QA + //pAd->ate.Repeat = 0; + pAd->ate.TxStatus = 0; +@@ -3317,11 +3405,9 @@ VOID UserCfgInit( + + + pAd->CommonCfg.bWiFiTest = FALSE; +-#ifdef RT2860 +- pAd->bPCIclkOff = FALSE; +-#endif // RT2860 // +- ++ pAd->bPCIclkOff = FALSE; + ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); + DBGPRINT(RT_DEBUG_TRACE, ("<-- UserCfgInit\n")); + } + +--- a/drivers/staging/rt2860/common/spectrum.c ++++ b/drivers/staging/rt2860/common/spectrum.c +@@ -49,7 +49,7 @@ VOID MeasureReqTabInit( + if (pAd->CommonCfg.pMeasureReqTab) + NdisZeroMemory(pAd->CommonCfg.pMeasureReqTab, sizeof(MEASURE_REQ_TAB)); + else +- DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pMeasureReqTab.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pMeasureReqTab.\n", __func__)); + + return; + } +@@ -77,7 +77,7 @@ static PMEASURE_REQ_ENTRY MeasureReqLook + + if (pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __func__)); + return NULL; + } + +@@ -114,7 +114,7 @@ static PMEASURE_REQ_ENTRY MeasureReqInse + + if(pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __func__)); + return NULL; + } + +@@ -175,7 +175,7 @@ static PMEASURE_REQ_ENTRY MeasureReqInse + else + { + pEntry = NULL; +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab tab full.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab tab full.\n", __func__)); + } + + // add this Neighbor entry into HASH table +@@ -210,7 +210,7 @@ static VOID MeasureReqDelete( + + if(pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __func__)); + return; + } + +@@ -267,7 +267,7 @@ VOID TpcReqTabInit( + if (pAd->CommonCfg.pTpcReqTab) + NdisZeroMemory(pAd->CommonCfg.pTpcReqTab, sizeof(TPC_REQ_TAB)); + else +- DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pTpcReqTab.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pTpcReqTab.\n", __func__)); + + return; + } +@@ -295,7 +295,7 @@ static PTPC_REQ_ENTRY TpcReqLookUp( + + if (pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __func__)); + return NULL; + } + +@@ -333,7 +333,7 @@ static PTPC_REQ_ENTRY TpcReqInsert( + + if(pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __func__)); + return NULL; + } + +@@ -394,7 +394,7 @@ static PTPC_REQ_ENTRY TpcReqInsert( + else + { + pEntry = NULL; +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab tab full.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab tab full.\n", __func__)); + } + + // add this Neighbor entry into HASH table +@@ -429,7 +429,7 @@ static VOID TpcReqDelete( + + if(pTab == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __func__)); + return; + } + +@@ -782,7 +782,7 @@ VOID EnqueueMeasurementReq( + NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory + if(NStatus != NDIS_STATUS_SUCCESS) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); + return; + } + NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11)); +@@ -844,7 +844,7 @@ VOID EnqueueMeasurementRep( + NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory + if(NStatus != NDIS_STATUS_SUCCESS) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); + return; + } + NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11)); +@@ -898,7 +898,7 @@ VOID EnqueueTPCReq( + NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory + if(NStatus != NDIS_STATUS_SUCCESS) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); + return; + } + NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11)); +@@ -950,7 +950,7 @@ VOID EnqueueTPCRep( + NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory + if(NStatus != NDIS_STATUS_SUCCESS) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); + return; + } + NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11)); +@@ -1003,7 +1003,7 @@ VOID EnqueueChSwAnn( + NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory + if(NStatus != NDIS_STATUS_SUCCESS) + { +- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); + return; + } + NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11)); +@@ -1596,7 +1596,7 @@ static VOID PeerMeasureReportAction( + + if ((pMeasureReportInfo = kmalloc(sizeof(MEASURE_RPI_REPORT), GFP_ATOMIC)) == NULL) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%d).\n", __FUNCTION__, sizeof(MEASURE_RPI_REPORT))); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%zu).\n", __func__, sizeof(MEASURE_RPI_REPORT))); + return; + } + +@@ -1705,7 +1705,7 @@ static VOID PeerTpcRepAction( + { + TpcReqDelete(pAd, pEntry->DialogToken); + DBGPRINT(RT_DEBUG_TRACE, ("%s: DialogToken=%x, TxPwr=%d, LinkMargin=%d\n", +- __FUNCTION__, DialogToken, TpcRepInfo.TxPwr, TpcRepInfo.LinkMargin)); ++ __func__, DialogToken, TpcRepInfo.TxPwr, TpcRepInfo.LinkMargin)); + } + } + +@@ -1821,7 +1821,7 @@ INT Set_MeasureReq_Proc( + MeasureReqType = simple_strtol(thisChar, 0, 16); + if (MeasureReqType > 3) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow MeasureReqType(%d)\n", __FUNCTION__, MeasureReqType)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow MeasureReqType(%d)\n", __func__, MeasureReqType)); + return TRUE; + } + break; +@@ -1833,10 +1833,10 @@ INT Set_MeasureReq_Proc( + ArgIdx++; + } + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d, MeasureReqType=%d MeasureCh=%d\n", __FUNCTION__, Aid, MeasureReqType, MeasureCh)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d, MeasureReqType=%d MeasureCh=%d\n", __func__, Aid, MeasureReqType, MeasureCh)); + if (!VALID_WCID(Aid)) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __FUNCTION__, Aid)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __func__, Aid)); + return TRUE; + } + +@@ -1861,10 +1861,10 @@ INT Set_TpcReq_Proc( + + Aid = simple_strtol(arg, 0, 16); + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __FUNCTION__, Aid)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __func__, Aid)); + if (!VALID_WCID(Aid)) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __FUNCTION__, Aid)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __func__, Aid)); + return TRUE; + } + +--- a/drivers/staging/rt2860/config.mk ++++ b/drivers/staging/rt2860/config.mk +@@ -108,10 +108,6 @@ ifeq ($(HAS_EXT_BUILD_CHANNEL_LIST),y) + WFLAGS += -DEXT_BUILD_CHANNEL_LIST + endif + +-ifeq ($(CHIPSET),2860) +-WFLAGS +=-DRT2860 +-endif +- + ifeq ($(CHIPSET),2870) + WFLAGS +=-DRT2870 + endif +--- a/drivers/staging/rt2860/oid.h ++++ b/drivers/staging/rt2860/oid.h +@@ -544,6 +544,8 @@ typedef enum _NDIS_802_11_WEP_STATUS + Ndis802_11Encryption3KeyAbsent, + Ndis802_11Encryption4Enabled, // TKIP or AES mix + Ndis802_11Encryption4KeyAbsent, ++ Ndis802_11GroupWEP40Enabled, ++ Ndis802_11GroupWEP104Enabled, + } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, + NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; + +--- a/drivers/staging/rt2860/rt2860.h ++++ b/drivers/staging/rt2860/rt2860.h +@@ -46,18 +46,10 @@ + Status = NDIS_STATUS_SUCCESS; + + /* function declarations */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #define IRQ_HANDLE_TYPE irqreturn_t +-#else +-#define IRQ_HANDLE_TYPE void +-#endif + + IRQ_HANDLE_TYPE +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) + rt2860_interrupt(int irq, void *dev_instance); +-#else +-rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); +-#endif + + /* ----------------- Frimware Related MACRO ----------------- */ + #define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \ +@@ -237,12 +229,10 @@ rt2860_interrupt(int irq, void *dev_inst + #define RTMP_MSI_DISABLE(_pAd) + #endif // PCI_MSI_SUPPORT // + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) + #define SA_SHIRQ IRQF_SHARED +-#endif + + #define RT28XX_IRQ_REQUEST(net_dev) \ +-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \ ++{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \ + POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ + RTMP_MSI_ENABLE(_pAd); \ + if ((retval = request_irq(_pObj->pci_dev->irq, \ +@@ -251,20 +241,12 @@ rt2860_interrupt(int irq, void *dev_inst + printk("RT2860: request_irq ERROR(%d)\n", retval); \ + return retval; } } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #define RT28XX_IRQ_RELEASE(net_dev) \ +-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \ ++{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \ + POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ + synchronize_irq(_pObj->pci_dev->irq); \ + free_irq(_pObj->pci_dev->irq, (net_dev)); \ + RTMP_MSI_DISABLE(_pAd); } +-#else +-#define RT28XX_IRQ_RELEASE(net_dev) \ +-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->priv); \ +- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ +- free_irq(_pObj->pci_dev->irq, (net_dev)); \ +- RTMP_MSI_DISABLE(_pAd); } +-#endif + + #define RT28XX_IRQ_INIT(pAd) \ + { pAd->int_enable_reg = ((DELAYINTMASK) | \ +@@ -333,8 +315,8 @@ rt2860_interrupt(int irq, void *dev_inst + reg16 = cpu2le16(Configuration); \ + pci_write_config_word(pci_dev, offset, reg16); \ + +-#define RT28XX_STA_FORCE_WAKEUP(pAd, bFromTx) \ +- RT28xxPciStaAsicForceWakeup(pAd, bFromTx); ++#define RT28XX_STA_FORCE_WAKEUP(pAd, Level) \ ++ RT28xxPciStaAsicForceWakeup(pAd, Level); + + #define RT28XX_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp) \ + RT28xxPciStaAsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp); +--- a/drivers/staging/rt2860/rt28xx.h ++++ b/drivers/staging/rt2860/rt28xx.h +@@ -1670,11 +1670,9 @@ typedef struct _HW_WCID_ENTRY { // 8-by + #define E2PROM_CSR 0x0004 + #define IO_CNTL_CSR 0x77d0 + +-#ifdef RT2860 + // 8051 firmware image for RT2860 - base address = 0x4000 + #define FIRMWARE_IMAGE_BASE 0x2000 + #define MAX_FIRMWARE_IMAGE_SIZE 0x2000 // 8kbyte +-#endif // RT2860 // + + + // ================================================================ +@@ -2029,7 +2027,6 @@ typedef struct PACKED _TXWI_STRUC { + // + // Rx descriptor format, Rx Ring + // +-#ifdef RT2860 + #ifdef RT_BIG_ENDIAN + typedef struct PACKED _RXD_STRUC { + // Word 0 +@@ -2098,7 +2095,6 @@ typedef struct PACKED _RXD_STRUC { + UINT32 Rsv1:13; + } RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC; + #endif +-#endif // RT2860 // + // + // RXWI wireless information format, in PBF. invisible in driver. + // +--- a/drivers/staging/rt2860/rt_ate.c ++++ b/drivers/staging/rt2860/rt_ate.c +@@ -68,7 +68,6 @@ static int CheckMCSValid( + IN UCHAR Mode, + IN UCHAR Mcs); + +-#ifdef RT2860 + static VOID ATEWriteTxWI( + IN PRTMP_ADAPTER pAd, + IN PTXWI_STRUC pOutTxWI, +@@ -87,7 +86,6 @@ static VOID ATEWriteTxWI( + IN UCHAR Txopmode, + IN BOOLEAN CfAck, + IN HTTRANSMIT_SETTING *pTransmit); +-#endif // RT2860 // + + + static VOID SetJapanFilter( +@@ -95,7 +93,6 @@ static VOID SetJapanFilter( + + /*=========================end of prototype=========================*/ + +-#ifdef RT2860 + static INT TxDmaBusy( + IN PRTMP_ADAPTER pAd) + { +@@ -153,7 +150,6 @@ static VOID RtmpDmaEnable( + + return; + } +-#endif // RT2860 // + + + static VOID BbpSoftReset( +@@ -291,7 +287,7 @@ static INT ATETxPwrHandler( + Bbp94 = BBPR94_DEFAULT; + } + +- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%ld, BBP_R94=%d)\n", __FUNCTION__, TxPower, R, Bbp94)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%ld, BBP_R94=%d)\n", __func__, TxPower, R, Bbp94)); + } + else// 5.5 GHz + { +@@ -318,7 +314,7 @@ static INT ATETxPwrHandler( + R = (ULONG) TxPower; + } + +- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%lu)\n", __FUNCTION__, TxPower, R)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%lu)\n", __func__, TxPower, R)); + } + + if (pAd->ate.Channel <= 14) +@@ -431,7 +427,7 @@ static INT ATETxPwrHandler( + Bbp94 = BBPR94_DEFAULT; + } + +- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R3=%ld, BBP_R94=%d)\n", __FUNCTION__, TxPower, R, Bbp94)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R3=%ld, BBP_R94=%d)\n", __func__, TxPower, R, Bbp94)); + + if (pAd->ate.Channel <= 14) + { +@@ -488,7 +484,6 @@ static INT ATETxPwrHandler( + TRUE if all parameters are OK, FALSE otherwise + ========================================================================== + */ +-#ifdef RT2860 + static INT ATECmdHandler( + IN PRTMP_ADAPTER pAd, + IN PUCHAR arg) +@@ -1297,7 +1292,6 @@ static INT ATECmdHandler( + + return TRUE; + } +-#endif // RT2860 // + /* */ + /* */ + /*=======================End of RT2860=======================*/ +@@ -2098,7 +2092,7 @@ INT Set_ATE_Load_E2P_Proc( + UINT32 FileLength = 0; + UINT32 value = simple_strtol(arg, 0, 10); + +- ATEDBGPRINT(RT_DEBUG_ERROR, ("===> %s (value=%d)\n\n", __FUNCTION__, value)); ++ ATEDBGPRINT(RT_DEBUG_ERROR, ("===> %s (value=%d)\n\n", __func__, value)); + + if (value > 0) + { +@@ -2122,14 +2116,14 @@ INT Set_ATE_Load_E2P_Proc( + + if (IS_ERR(srcf)) + { +- ate_print("%s - Error %ld opening %s\n", __FUNCTION__, -PTR_ERR(srcf), src); ++ ate_print("%s - Error %ld opening %s\n", __func__, -PTR_ERR(srcf), src); + break; + } + + /* the object must have a read method */ + if ((srcf->f_op == NULL) || (srcf->f_op->read == NULL)) + { +- ate_print("%s - %s does not have a read method\n", __FUNCTION__, src); ++ ate_print("%s - %s does not have a read method\n", __func__, src); + break; + } + +@@ -2142,7 +2136,7 @@ INT Set_ATE_Load_E2P_Proc( + if (FileLength != EEPROM_SIZE) + { + ate_print("%s: error file length (=%d) in e2p.bin\n", +- __FUNCTION__, FileLength); ++ __func__, FileLength); + break; + } + else +@@ -2174,7 +2168,7 @@ INT Set_ATE_Load_E2P_Proc( + current->fsuid = orgfsuid; + current->fsgid = orgfsgid; + } +- ATEDBGPRINT(RT_DEBUG_ERROR, ("<=== %s (ret=%d)\n", __FUNCTION__, ret)); ++ ATEDBGPRINT(RT_DEBUG_ERROR, ("<=== %s (ret=%d)\n", __func__, ret)); + + return ret; + +@@ -2187,12 +2181,12 @@ INT Set_ATE_Load_E2P_Proc( + USHORT WriteEEPROM[(EEPROM_SIZE/2)]; + struct iwreq *wrq = (struct iwreq *)arg; + +- ATEDBGPRINT(RT_DEBUG_TRACE, ("===> %s (wrq->u.data.length = %d)\n\n", __FUNCTION__, wrq->u.data.length)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("===> %s (wrq->u.data.length = %d)\n\n", __func__, wrq->u.data.length)); + + if (wrq->u.data.length != EEPROM_SIZE) + { + ate_print("%s: error length (=%d) from host\n", +- __FUNCTION__, wrq->u.data.length); ++ __func__, wrq->u.data.length); + return FALSE; + } + else/* (wrq->u.data.length == EEPROM_SIZE) */ +@@ -2211,7 +2205,7 @@ INT Set_ATE_Load_E2P_Proc( + } while(FALSE); + } + +- ATEDBGPRINT(RT_DEBUG_TRACE, ("<=== %s\n", __FUNCTION__)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("<=== %s\n", __func__)); + + return TRUE; + +@@ -2907,7 +2901,6 @@ VOID ATEAsicAdjustTxPower( + None + ======================================================================== + */ +-#ifdef RT2860 + static VOID ATEWriteTxWI( + IN PRTMP_ADAPTER pAd, + IN PTXWI_STRUC pOutTxWI, +@@ -2972,7 +2965,6 @@ static VOID ATEWriteTxWI( + + return; + } +-#endif // RT2860 // + + /* + ======================================================================== +@@ -3249,13 +3241,11 @@ VOID RTMPStationStart( + IN PRTMP_ADAPTER pAd) + { + ATEDBGPRINT(RT_DEBUG_TRACE, ("==> RTMPStationStart\n")); +-#ifdef RT2860 +- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; ++epAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; + // + // We did not cancel this timer when entering ATE mode. + // + // RTMPSetTimer(&pAd->Mlme.PeriodicTimer, MLME_TASK_EXEC_INTV); +-#endif // RT2860 // + ATEDBGPRINT(RT_DEBUG_TRACE, ("<== RTMPStationStart\n")); + } + #endif // CONFIG_STA_SUPPORT // +@@ -3268,7 +3258,6 @@ VOID RTMPStationStart( + This routine should only be used in ATE mode. + ========================================================================== + */ +-#ifdef RT2860 + static INT ATESetUpFrame( + IN PRTMP_ADAPTER pAd, + IN UINT32 TxIdx) +@@ -3353,7 +3342,7 @@ static INT ATESetUpFrame( + if (pPacket == NULL) + { + pAd->ate.TxCount = 0; +- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s fail to alloc packet space.\n", __FUNCTION__)); ++ ATEDBGPRINT(RT_DEBUG_TRACE, ("%s fail to alloc packet space.\n", __func__)); + return -1; + } + pTxRing->Cell[TxIdx].pNextNdisPacket = pPacket; +@@ -3455,7 +3444,6 @@ static INT ATESetUpFrame( + /* */ + /* */ + /*=======================End of RT2860=======================*/ +-#endif // RT2860 // + + + VOID rt_ee_read_all(PRTMP_ADAPTER pAd, USHORT *Data) +@@ -3646,7 +3634,7 @@ VOID RtmpDoAte( + + Command_Id = ntohs(pRaCfg->command_id); + +- ATEDBGPRINT(RT_DEBUG_TRACE,("\n%s: Command_Id = 0x%04x !\n", __FUNCTION__, Command_Id)); ++ ATEDBGPRINT(RT_DEBUG_TRACE,("\n%s: Command_Id = 0x%04x !\n", __func__, Command_Id)); + + switch (Command_Id) + { +@@ -4578,9 +4566,7 @@ VOID RtmpDoAte( + { + if (pAdapter->ate.TxCount == 0) + { +-#ifdef RT2860 + pAdapter->ate.TxCount = 0xFFFFFFFF; +-#endif // RT2860 // + } + ATEDBGPRINT(RT_DEBUG_TRACE,("START TXFRAME\n")); + pAdapter->ate.bQATxStart = TRUE; +@@ -5375,7 +5361,6 @@ TX_START_ERROR: + + memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2); + value = ntohs(value); +-#ifdef RT2860 + /* TX_FRAME_COUNT == 0 means tx infinitely */ + if (value == 0) + { +@@ -5387,7 +5372,6 @@ TX_START_ERROR: + + } + else +-#endif // RT2860 // + { + sprintf((PCHAR)str, "%d", value); + Set_ATE_TX_COUNT_Proc(pAdapter, str); +@@ -5690,7 +5674,7 @@ BOOLEAN SyncTxRxConfig(PRTMP_ADAPTER pAd + pAd->ate.TxAntennaSel = 2; + break; + default: +- DBGPRINT(RT_DEBUG_TRACE, ("%s -- Sth. wrong! : return FALSE; \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s -- Sth. wrong! : return FALSE; \n", __func__)); + return FALSE; + } + break;/* case BBP_R1 */ +@@ -5728,13 +5712,13 @@ BOOLEAN SyncTxRxConfig(PRTMP_ADAPTER pAd + pAd->ate.RxAntennaSel = 3; + break; + default: +- DBGPRINT(RT_DEBUG_ERROR, ("%s -- Impossible! : return FALSE; \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s -- Impossible! : return FALSE; \n", __func__)); + return FALSE; + } + break;/* case BBP_R3 */ + + default: +- DBGPRINT(RT_DEBUG_ERROR, ("%s -- Sth. wrong! : return FALSE; \n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s -- Sth. wrong! : return FALSE; \n", __func__)); + return FALSE; + + } +--- a/drivers/staging/rt2860/rt_ate.h ++++ b/drivers/staging/rt2860/rt_ate.h +@@ -31,12 +31,10 @@ + #ifndef UCOS + #define ate_print printk + #define ATEDBGPRINT DBGPRINT +-#ifdef RT2860 + #define EEPROM_SIZE 0x200 + #ifdef CONFIG_STA_SUPPORT + #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860STA/e2p.bin" + #endif // CONFIG_STA_SUPPORT // +-#endif // RT2860 // + + #else // !UCOS // + #define fATE_LOAD_EEPROM 0x0C43 +@@ -69,7 +67,6 @@ do{ int (*org_remote_display)(char *) + #define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP) + + /* RT2880_iNIC will define "RT2860". */ +-#ifdef RT2860 + #define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \ + { \ + BBP_CSR_CFG_STRUC BbpCsr; \ +@@ -131,10 +128,8 @@ do{ int (*org_remote_display)(char *) + ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP write R%d fail\n", _I)); \ + } \ + } +-#endif // RT2860 // + + /* RT2880_iNIC will define RT2860. */ +-#ifdef RT2860 + #define EEPROM_SIZE 0x200 + /* iNIC has its own EEPROM_BIN_FILE_NAME */ + #ifndef UCOS +@@ -142,7 +137,6 @@ do{ int (*org_remote_display)(char *) + #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860STA/e2p.bin" + #endif // CONFIG_STA_SUPPORT // + #endif // !UCOS // +-#endif // RT2860 // + + + +--- a/drivers/staging/rt2860/rt_config.h ++++ b/drivers/staging/rt2860/rt_config.h +@@ -53,9 +53,7 @@ + #include "rtmp_def.h" + #include "rt28xx.h" + +-#ifdef RT2860 + #include "rt2860.h" +-#endif // RT2860 // + + + #include "oid.h" +--- a/drivers/staging/rt2860/rt_linux.c ++++ b/drivers/staging/rt2860/rt_linux.c +@@ -48,10 +48,8 @@ BUILD_TIMER_FUNCTION(LeapAuthTimeout); + #endif + BUILD_TIMER_FUNCTION(StaQuickResponeForRateUpExec); + BUILD_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc); +-#ifdef RT2860 + BUILD_TIMER_FUNCTION(PsPollWakeExec); + BUILD_TIMER_FUNCTION(RadioOnExec); +-#endif // RT2860 // + #ifdef QOS_DLS_SUPPORT + BUILD_TIMER_FUNCTION(DlsTimeoutAction); + #endif // QOS_DLS_SUPPORT // +@@ -293,9 +291,7 @@ VOID RTMPFreeAdapter( + + NdisFreeSpinLock(&pAd->MgmtRingLock); + +-#ifdef RT2860 + NdisFreeSpinLock(&pAd->RxRingLock); +-#endif // RT2860 // + + for (index =0 ; index < NUM_OF_TX_RING; index++) + { +@@ -406,7 +402,7 @@ NDIS_STATUS RTMPAllocateNdisPacket( + skb_put(GET_OS_PKT_TYPE(pPacket), HeaderLen+DataLen); + + RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS); +-// printk("%s : pPacket = %p, len = %d\n", __FUNCTION__, pPacket, GET_OS_PKT_LEN(pPacket)); ++// printk("%s : pPacket = %p, len = %d\n", __func__, pPacket, GET_OS_PKT_LEN(pPacket)); + *ppPacket = pPacket; + return NDIS_STATUS_SUCCESS; + } +@@ -773,13 +769,13 @@ VOID RTMPSendWirelessEvent( + + if (event_table_len == 0) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s : The type(%0x02x) is not valid.\n", __FUNCTION__, type)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : The type(%0x02x) is not valid.\n", __func__, type)); + return; + } + + if (event >= event_table_len) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s : The event(%0x02x) is not valid.\n", __FUNCTION__, event)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : The event(%0x02x) is not valid.\n", __func__, event)); + return; + } + +@@ -817,14 +813,14 @@ VOID RTMPSendWirelessEvent( + //send wireless event + wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, pBuf); + +- //DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __FUNCTION__, pBuf)); ++ //DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __func__, pBuf)); + + kfree(pBuf); + } + else +- DBGPRINT(RT_DEBUG_ERROR, ("%s : Can't allocate memory for wireless event.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : Can't allocate memory for wireless event.\n", __func__)); + #else +- DBGPRINT(RT_DEBUG_ERROR, ("%s : The Wireless Extension MUST be v15 or newer.\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : The Wireless Extension MUST be v15 or newer.\n", __func__)); + #endif /* WIRELESS_EXT >= 15 */ + } + +@@ -848,13 +844,13 @@ void send_monitor_packets( + ASSERT(pRxBlk->pRxPacket); + if (pRxBlk->DataSize < 10) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too small! (%d)\n", __FUNCTION__, pRxBlk->DataSize)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too small! (%d)\n", __func__, pRxBlk->DataSize)); + goto err_free_sk_buff; + } + + if (pRxBlk->DataSize + sizeof(wlan_ng_prism2_header) > RX_BUFFER_AGGRESIZE) + { +- DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too large! (%d)\n", __FUNCTION__, pRxBlk->DataSize + sizeof(wlan_ng_prism2_header))); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too large! (%zu)\n", __func__, pRxBlk->DataSize + sizeof(wlan_ng_prism2_header))); + goto err_free_sk_buff; + } + +@@ -910,7 +906,7 @@ void send_monitor_packets( + + if (skb_headroom(pOSPkt) < (sizeof(wlan_ng_prism2_header)+ header_len)) { + if (pskb_expand_head(pOSPkt, (sizeof(wlan_ng_prism2_header) + header_len), 0, GFP_ATOMIC)) { +- DBGPRINT(RT_DEBUG_ERROR, ("%s : Reallocate header size of sk_buff fail!\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s : Reallocate header size of sk_buff fail!\n", __func__)); + goto err_free_sk_buff; + } //end if + } //end if +@@ -1005,35 +1001,14 @@ err_free_sk_buff: + + void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify) + { +- +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + daemonize(pThreadName /*"%s",pAd->net_dev->name*/); + + allow_signal(SIGTERM); + allow_signal(SIGKILL); + current->flags |= PF_NOFREEZE; +-#else +- unsigned long flags; +- +- daemonize(); +- reparent_to_init(); +- strcpy(current->comm, pThreadName); +- +- siginitsetinv(¤t->blocked, sigmask(SIGTERM) | sigmask(SIGKILL)); +- +- /* Allow interception of SIGKILL only +- * Don't allow other signals to interrupt the transmission */ +-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) +- spin_lock_irqsave(¤t->sigmask_lock, flags); +- flush_signals(current); +- recalc_sigpending(current); +- spin_unlock_irqrestore(¤t->sigmask_lock, flags); +-#endif +-#endif + +- /* signal that we've started the thread */ ++ /* signal that we've started the thread */ + complete(pNotify); +- + } + + void RTMP_IndicateMediaState( +--- a/drivers/staging/rt2860/rt_linux.h ++++ b/drivers/staging/rt2860/rt_linux.h +@@ -65,7 +65,6 @@ + #include + + +-#include + #include + + // load firmware +@@ -90,28 +89,22 @@ typedef int (*HARD_START_XMIT_FUNC)(stru + // add by kathy + + #ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 + #define STA_PROFILE_PATH "/etc/Wireless/RT2860STA/RT2860STA.dat" + #define STA_RTMP_FIRMWARE_FILE_NAME "/etc/Wireless/RT2860STA/RT2860STA.bin" + #define STA_NIC_DEVICE_NAME "RT2860STA" +-#define STA_DRIVER_VERSION "1.8.0.0" ++#define STA_DRIVER_VERSION "1.8.1.1" + #ifdef MULTIPLE_CARD_SUPPORT + #define CARD_INFO_PATH "/etc/Wireless/RT2860STA/RT2860STACard.dat" + #endif // MULTIPLE_CARD_SUPPORT // +-#endif // RT2860 // + + + #endif // CONFIG_STA_SUPPORT // + +-#ifdef RT2860 + #ifndef PCI_DEVICE + #define PCI_DEVICE(vend,dev) \ + .vendor = (vend), .device = (dev), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID + #endif // PCI_DEVICE // +-#endif // RT2860 // +- +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + + #define RTMP_TIME_AFTER(a,b) \ + (typecheck(unsigned long, (unsigned long)a) && \ +@@ -123,23 +116,15 @@ typedef int (*HARD_START_XMIT_FUNC)(stru + typecheck(unsigned long, (unsigned long)b) && \ + ((long)(a) - (long)(b) >= 0)) + #define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a) +-#else +-#define RTMP_TIME_AFTER(a,b) time_after(a, b) +-#endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + #define RT_MOD_INC_USE_COUNT() \ + if (!try_module_get(THIS_MODULE)) \ + { \ +- DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot reserve module\n", __FUNCTION__)); \ ++ DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot reserve module\n", __func__)); \ + return -1; \ + } + + #define RT_MOD_DEC_USE_COUNT() module_put(THIS_MODULE); +-#else +-#define RT_MOD_INC_USE_COUNT() MOD_INC_USE_COUNT; +-#define RT_MOD_DEC_USE_COUNT() MOD_DEC_USE_COUNT; +-#endif + + #define OS_HZ HZ + +@@ -171,21 +156,12 @@ typedef int (*HARD_START_XMIT_FUNC)(stru + #define NDIS_PACKET_TYPE_ALL_MULTICAST 3 + #endif // CONFIG_STA_SUPPORT // + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) + typedef struct pid * THREAD_PID; + #define THREAD_PID_INIT_VALUE NULL + #define GET_PID(_v) find_get_pid(_v) + #define GET_PID_NUMBER(_v) pid_nr(_v) + #define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0) + #define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C) +-#else +-typedef pid_t THREAD_PID; +-#define THREAD_PID_INIT_VALUE -1 +-#define GET_PID(_v) _v +-#define GET_PID_NUMBER(_v) _v +-#define CHECK_PID_LEGALITY(_pid) if (_pid >= 0) +-#define KILL_THREAD_PID(_A, _B, _C) kill_proc(_A, _B, _C) +-#endif + + struct os_lock { + spinlock_t lock; +@@ -194,11 +170,9 @@ struct os_lock { + + + struct os_cookie { +-#ifdef RT2860 + struct pci_dev *pci_dev; + struct pci_dev *parent_pci_dev; + dma_addr_t pAd_pa; +-#endif // RT2860 // + + + struct tasklet_struct rx_done_task; +@@ -209,9 +183,7 @@ struct os_cookie { + struct tasklet_struct ac3_dma_done_task; + struct tasklet_struct hcca_dma_done_task; + struct tasklet_struct tbtt_task; +-#ifdef RT2860 + struct tasklet_struct fifo_statistic_full_task; +-#endif // RT2860 // + + + unsigned long apd_pid; //802.1x daemon pid +@@ -266,7 +238,6 @@ void linux_pci_unmap_single(void *handle + + #define RT2860_PCI_DEVICE_ID 0x0601 + +-#ifdef RT2860 + #define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \ + linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir) + +@@ -281,7 +252,6 @@ void linux_pci_unmap_single(void *handle + + #define DEV_ALLOC_SKB(_length) \ + dev_alloc_skb(_length) +-#endif // RT2860 // + + + +@@ -401,7 +371,6 @@ extern ULONG RTDebugLevel; + spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \ + } + +-#ifdef RT2860 + #if defined(INF_TWINPASS) || defined(INF_DANUBE) || defined(IKANOS_VX_1X0) + //Patch for ASIC turst read/write bug, needs to remove after metel fix + #define RTMP_IO_READ32(_A, _R, _pV) \ +@@ -413,6 +382,12 @@ extern ULONG RTDebugLevel; + (*_pV = SWAP32(*((UINT32 *)(_pV)))); \ + } \ + } ++#define RTMP_IO_FORCE_READ32(_A, _R, _pV) \ ++{ \ ++ (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \ ++ (*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \ ++ (*_pV = SWAP32(*((UINT32 *)(_pV)))); \ ++} + #define RTMP_IO_READ8(_A, _R, _pV) \ + { \ + (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \ +@@ -452,6 +427,11 @@ extern ULONG RTDebugLevel; + else \ + *_pV = 0; \ + } ++#define RTMP_IO_FORCE_READ32(_A, _R, _pV) \ ++{ \ ++ (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \ ++ (*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \ ++} + #define RTMP_IO_READ8(_A, _R, _pV) \ + { \ + (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \ +@@ -492,7 +472,6 @@ extern ULONG RTDebugLevel; + writew((_V), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \ + } + #endif +-#endif // RT2860 // + + + #ifndef wait_event_interruptible_timeout +@@ -544,7 +523,6 @@ typedef void (*TIMER_FUNCTION)(unsigned + #define MlmeAllocateMemory(_pAd, _ppVA) os_alloc_mem(_pAd, _ppVA, MGMT_DMA_BUFFER_SIZE) + #define MlmeFreeMemory(_pAd, _pVA) os_free_mem(_pAd, _pVA) + +-#ifdef RT2860 + #define BUILD_TIMER_FUNCTION(_func) \ + void linux_##_func(unsigned long data) \ + { \ +@@ -554,7 +532,6 @@ void linux_##_func(unsigned long data) + if (pTimer->Repeat) \ + RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \ + } +-#endif // RT2860 // + + + +@@ -907,7 +884,6 @@ int rt28xx_packet_xmit(struct sk_buff *s + + void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify); + +-#ifdef RT2860 + #if !defined(PCI_CAP_ID_EXP) + #define PCI_CAP_ID_EXP 0x10 + #endif +@@ -921,6 +897,5 @@ void rtmp_os_thread_init(PUCHAR pThreadN + #endif + + #define PCIBUS_INTEL_VENDOR 0x8086 +-#endif // RT2860 // + + +--- a/drivers/staging/rt2860/rt_main_dev.c ++++ b/drivers/staging/rt2860/rt_main_dev.c +@@ -58,11 +58,7 @@ UINT32 CW_MAX_IN_BITS; + + char *mac = ""; // default 00:00:00:00:00:00 + char *hostname = ""; // default CMPC +-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12) +-MODULE_PARM (mac, "s"); +-#else + module_param (mac, charp, 0); +-#endif + MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr"); + + +@@ -75,9 +71,7 @@ extern void ba_reordering_resource_relea + #endif // DOT11_N_SUPPORT // + extern NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd); + +-#ifdef RT2860 + extern void init_thread_task(PRTMP_ADAPTER pAd); +-#endif // RT2860 // + + // public function prototype + INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p, +@@ -87,13 +81,6 @@ INT __devinit rt28xx_probe(IN void *_dev + static int rt28xx_init(IN struct net_device *net_dev); + INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev); + +-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 +-struct net_device *alloc_netdev( +- int sizeof_priv, +- const char *mask, +- void (*setup)(struct net_device *)); +-#endif // LINUX_VERSION_CODE // +- + static void CfgInitHook(PRTMP_ADAPTER pAd); + + #ifdef CONFIG_STA_SUPPORT +@@ -135,7 +122,7 @@ Note: + */ + int MainVirtualIF_close(IN struct net_device *net_dev) + { +- RTMP_ADAPTER *pAd = net_dev->priv; ++ RTMP_ADAPTER *pAd = net_dev->ml_priv; + + // Sanity check for pAd + if (pAd == NULL) +@@ -174,7 +161,7 @@ Note: + */ + int MainVirtualIF_open(IN struct net_device *net_dev) + { +- RTMP_ADAPTER *pAd = net_dev->priv; ++ RTMP_ADAPTER *pAd = net_dev->ml_priv; + + // Sanity check for pAd + if (pAd == NULL) +@@ -216,7 +203,7 @@ Note: + int rt28xx_close(IN PNET_DEV dev) + { + struct net_device * net_dev = (struct net_device *)dev; +- RTMP_ADAPTER *pAd = net_dev->priv; ++ RTMP_ADAPTER *pAd = net_dev->ml_priv; + BOOLEAN Cancelled = FALSE; + UINT32 i = 0; + +@@ -235,15 +222,13 @@ int rt28xx_close(IN PNET_DEV dev) + #ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { +-#ifdef RT2860 +- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_CLOSE); +-#endif // RT2860 // +- + // If dirver doesn't wake up firmware here, + // NICLoadFirmware will hang forever when interface is up again. +- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) ++ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) || ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) || ++ RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)) + { +- AsicForceWakeup(pAd, TRUE); ++ AsicForceWakeup(pAd, RTMP_HALT); + } + + #ifdef QOS_DLS_SUPPORT +@@ -323,9 +308,7 @@ int rt28xx_close(IN PNET_DEV dev) + #endif // WPA_SUPPLICANT_SUPPORT // + + MlmeRadioOff(pAd); +-#ifdef RT2860 + pAd->bPCIclkOff = FALSE; +-#endif // RT2860 // + } + #endif // CONFIG_STA_SUPPORT // + +@@ -359,7 +342,6 @@ int rt28xx_close(IN PNET_DEV dev) + TpcReqTabExit(pAd); + + +-#ifdef RT2860 + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) + { + NICDisableInterrupt(pAd); +@@ -375,7 +357,6 @@ int rt28xx_close(IN PNET_DEV dev) + RT28XX_IRQ_RELEASE(net_dev) + RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE); + } +-#endif // RT2860 // + + + // Free Ring or USB buffers +@@ -396,7 +377,7 @@ int rt28xx_close(IN PNET_DEV dev) + + static int rt28xx_init(IN struct net_device *net_dev) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; ++ PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->ml_priv; + UINT index; + UCHAR TmpPhy; + NDIS_STATUS Status; +@@ -439,12 +420,10 @@ static int rt28xx_init(IN struct net_dev + + // Disable interrupts here which is as soon as possible + // This statement should never be true. We might consider to remove it later +-#ifdef RT2860 + if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) + { + NICDisableInterrupt(pAd); + } +-#endif // RT2860 // + + Status = RTMPAllocTxRxRingMemory(pAd); + if (Status != NDIS_STATUS_SUCCESS) +@@ -605,8 +584,8 @@ err1: + #endif // DOT11_N_SUPPORT // + RT28XX_IRQ_RELEASE(net_dev); + +- // shall not set priv to NULL here because the priv didn't been free yet. +- //net_dev->priv = 0; ++ // shall not set ml_priv to NULL here because the ml_priv didn't been free yet. ++ //net_dev->ml_priv = 0; + #ifdef INF_AMAZON_SE + err0: + #endif // INF_AMAZON_SE // +@@ -633,7 +612,7 @@ Note: + int rt28xx_open(IN PNET_DEV dev) + { + struct net_device * net_dev = (struct net_device *)dev; +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->priv; ++ PRTMP_ADAPTER pAd = net_dev->ml_priv; + int retval = 0; + POS_COOKIE pObj; + +@@ -642,7 +621,7 @@ int rt28xx_open(IN PNET_DEV dev) + if (pAd == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -1; + } + +@@ -667,26 +646,6 @@ int rt28xx_open(IN PNET_DEV dev) + #endif // WIRELESS_EXT >= 12 // + #endif // CONFIG_APSTA_MIXED_SUPPORT // + +-#ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 +- IF_DEV_CONFIG_OPMODE_ON_STA(pAd) +- { +- // If dirver doesn't wake up firmware here, +- // NICLoadFirmware will hang forever when interface is up again. +- // RT2860 PCI +- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) && +- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) +- { +- AUTO_WAKEUP_STRUC AutoWakeupCfg; +- AsicForceWakeup(pAd, TRUE); +- AutoWakeupCfg.word = 0; +- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); +- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); +- } +- } +-#endif // RT2860 // +-#endif // CONFIG_STA_SUPPORT // +- + // Init + pObj = (POS_COOKIE)pAd->OS_Cookie; + +@@ -753,10 +712,8 @@ int rt28xx_open(IN PNET_DEV dev) + } + + #ifdef CONFIG_STA_SUPPORT +-#ifdef RT2860 + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + RTMPInitPCIeLinkCtrlValue(pAd); +-#endif // RT2860 // + #endif // CONFIG_STA_SUPPORT // + + return (retval); +@@ -808,9 +765,7 @@ static NDIS_STATUS rt_ieee80211_if_setup + dev->stop = MainVirtualIF_close; //rt28xx_close; + dev->priv_flags = INT_MAIN; + dev->do_ioctl = rt28xx_ioctl; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) +- dev->validate_addr = NULL; +-#endif ++ dev->validate_addr = NULL; + // find available device name + for (i = 0; i < 8; i++) + { +@@ -821,25 +776,11 @@ static NDIS_STATUS rt_ieee80211_if_setup + #endif // MULTIPLE_CARD_SUPPORT // + sprintf(slot_name, "ra%d", i); + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +- device = dev_get_by_name(dev_net(dev), slot_name); +-#else +- device = dev_get_by_name(dev->nd_net, slot_name); +-#endif +-#else +- device = dev_get_by_name(slot_name); +-#endif +- if (device != NULL) dev_put(device); +-#else +- for (device = dev_base; device != NULL; device = device->next) +- { +- if (strncmp(device->name, slot_name, 4) == 0) +- break; +- } +-#endif +- if(device == NULL) ++ device = dev_get_by_name(dev_net(dev), slot_name); ++ if (device != NULL) ++ dev_put(device); ++ ++ if (device == NULL) + break; + } + +@@ -1252,47 +1193,28 @@ INT __devinit rt28xx_probe( + PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL; + INT status; + PVOID handle; +-#ifdef RT2860 + struct pci_dev *dev_p = (struct pci_dev *)_dev_p; +-#endif // RT2860 // + + + #ifdef CONFIG_STA_SUPPORT + DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); + #endif // CONFIG_STA_SUPPORT // + +-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 +- net_dev = alloc_netdev(sizeof(PRTMP_ADAPTER), "eth%d", ether_setup); +-#else + net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER)); +-#endif + if (net_dev == NULL) + { + printk("alloc_netdev failed\n"); + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) +- module_put(THIS_MODULE); +-#endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) +-#else +- MOD_DEC_USE_COUNT; +-#endif + goto err_out; + } + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +- SET_MODULE_OWNER(net_dev); +-#endif +- + netif_stop_queue(net_dev); + #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT + /* for supporting Network Manager */ + /* Set the sysfs physical device reference for the network logical device + * if set prior to registration will cause a symlink during initialization. + */ +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) + SET_NETDEV_DEV(net_dev, &(dev_p->dev)); +-#endif + #endif // NATIVE_WPA_SUPPLICANT_SUPPORT // + + // Allocate RTMP_ADAPTER miniport adapter structure +@@ -1303,7 +1225,7 @@ INT __devinit rt28xx_probe( + if (status != NDIS_STATUS_SUCCESS) + goto err_out_free_netdev; + +- net_dev->priv = (PVOID)pAd; ++ net_dev->ml_priv = (PVOID)pAd; + pAd->net_dev = net_dev; // must be before RT28XXNetDevInit() + + RT28XXNetDevInit(_dev_p, net_dev, pAd); +@@ -1313,13 +1235,8 @@ INT __devinit rt28xx_probe( + #endif // CONFIG_STA_SUPPORT // + + // Post config +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +- if (RT28XXProbePostConfig(_dev_p, pAd, argc) == FALSE) +- goto err_out_unmap; +-#else + if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE) + goto err_out_unmap; +-#endif // LINUX_VERSION_CODE // + + #ifdef CONFIG_STA_SUPPORT + pAd->OpMode = OPMODE_STA; +@@ -1362,20 +1279,12 @@ err_out_unmap: + RT28XX_UNMAP(); + + err_out_free_netdev: +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +- free_netdev(net_dev); +-#else +- kfree(net_dev); +-#endif ++ free_netdev(net_dev); + + err_out: + RT28XX_PUT_DEVICE(dev_p); + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +- return (LONG)NULL; +-#else +- return -ENODEV; /* probe fail */ +-#endif // LINUX_VERSION_CODE // ++ return -ENODEV; /* probe fail */ + } /* End of rt28xx_probe */ + + +@@ -1399,7 +1308,7 @@ Note: + int rt28xx_packet_xmit(struct sk_buff *skb) + { + struct net_device *net_dev = skb->dev; +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; ++ PRTMP_ADAPTER pAd = net_dev->ml_priv; + int status = 0; + PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; + +@@ -1478,7 +1387,7 @@ INT rt28xx_send_packets( + IN struct sk_buff *skb_p, + IN struct net_device *net_dev) + { +- RTMP_ADAPTER *pAd = net_dev->priv; ++ RTMP_ADAPTER *pAd = net_dev->ml_priv; + if (!(net_dev->flags & IFF_UP)) + { + RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE); +@@ -1495,40 +1404,6 @@ INT rt28xx_send_packets( + + + +-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1 +-struct net_device *alloc_netdev( +- int sizeof_priv, +- const char *mask, +- void (*setup)(struct net_device *)) +-{ +- struct net_device *dev; +- INT alloc_size; +- +- +- /* ensure 32-byte alignment of the private area */ +- alloc_size = sizeof (*dev) + sizeof_priv + 31; +- +- dev = (struct net_device *) kmalloc(alloc_size, GFP_KERNEL); +- if (dev == NULL) +- { +- DBGPRINT(RT_DEBUG_ERROR, +- ("alloc_netdev: Unable to allocate device memory.\n")); +- return NULL; +- } +- +- memset(dev, 0, alloc_size); +- +- if (sizeof_priv) +- dev->priv = (void *) (((long)(dev + 1) + 31) & ~31); +- +- setup(dev); +- strcpy(dev->name, mask); +- +- return dev; +-} +-#endif // LINUX_VERSION_CODE // +- +- + void CfgInitHook(PRTMP_ADAPTER pAd) + { + pAd->bBroadComHT = TRUE; +@@ -1540,7 +1415,7 @@ void CfgInitHook(PRTMP_ADAPTER pAd) + struct iw_statistics *rt28xx_get_wireless_stats( + IN struct net_device *net_dev) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) net_dev->priv; ++ PRTMP_ADAPTER pAd = net_dev->ml_priv; + + + DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n")); +@@ -1592,18 +1467,18 @@ INT rt28xx_ioctl( + + if (net_dev->priv_flags == INT_MAIN) + { +- pAd = net_dev->priv; ++ pAd = net_dev->ml_priv; + } + else + { +- pVirtualAd = net_dev->priv; +- pAd = pVirtualAd->RtmpDev->priv; ++ pVirtualAd = net_dev->ml_priv; ++ pAd = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAd == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1640,7 +1515,7 @@ struct net_device_stats *RT28xx_get_ethe + RTMP_ADAPTER *pAd = NULL; + + if (net_dev) +- pAd = net_dev->priv; ++ pAd = net_dev->ml_priv; + + if (pAd) + { +--- a/drivers/staging/rt2860/rt_profile.c ++++ b/drivers/staging/rt2860/rt_profile.c +@@ -925,9 +925,11 @@ NDIS_STATUS RTMPReadParametersHook( + + // Save uid and gid used for filesystem access. + // Set user and group to 0 (root) +- orgfsuid = current->fsuid; +- orgfsgid = current->fsgid; +- current->fsuid=current->fsgid = 0; ++ orgfsuid = current_fsuid(); ++ orgfsgid = current_fsgid(); ++ /* Hm, can't really do this nicely anymore, so rely on these files ++ * being set to the proper permission to read them... */ ++ /* current->cred->fsuid = current->cred->fsgid = 0; */ + orgfs = get_fs(); + set_fs(KERNEL_DS); + +@@ -1022,7 +1024,7 @@ NDIS_STATUS RTMPReadParametersHook( + pAd->MlmeAux.SsidLen = pAd->CommonCfg.SsidLen; + NdisZeroMemory(pAd->MlmeAux.Ssid, NDIS_802_11_LENGTH_SSID); + NdisMoveMemory(pAd->MlmeAux.Ssid, tmpbuf, pAd->MlmeAux.SsidLen); +- DBGPRINT(RT_DEBUG_TRACE, ("%s::(SSID=%s)\n", __FUNCTION__, tmpbuf)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::(SSID=%s)\n", __func__, tmpbuf)); + } + } + } +@@ -1041,7 +1043,7 @@ NDIS_STATUS RTMPReadParametersHook( + pAd->StaCfg.BssType = BSS_INFRA; + // Reset Ralink supplicant to not use, it will be set to start when UI set PMK key + pAd->StaCfg.WpaState = SS_NOTUSE; +- DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __FUNCTION__, pAd->StaCfg.BssType)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __func__, pAd->StaCfg.BssType)); + } + } + #endif // CONFIG_STA_SUPPORT // +@@ -1335,7 +1337,7 @@ NDIS_STATUS RTMPReadParametersHook( + + pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __FUNCTION__, pAd->StaCfg.WepStatus)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus)); + } + #endif // CONFIG_STA_SUPPORT // + } +@@ -1361,7 +1363,7 @@ NDIS_STATUS RTMPReadParametersHook( + pAd->StaCfg.OrigWepStatus = pAd->StaCfg.WepStatus; + pAd->StaCfg.bMixCipher = FALSE; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __FUNCTION__, pAd->StaCfg.WepStatus)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus)); + } + #endif // CONFIG_STA_SUPPORT // + } +@@ -1398,7 +1400,7 @@ NDIS_STATUS RTMPReadParametersHook( + else + { + err = 1; +- DBGPRINT(RT_DEBUG_ERROR, ("%s::(WPAPSK key-string required 8 ~ 64 characters!)\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_ERROR, ("%s::(WPAPSK key-string required 8 ~ 64 characters!)\n", __func__)); + } + + if (err == 0) +@@ -1414,7 +1416,7 @@ NDIS_STATUS RTMPReadParametersHook( + pAd->StaCfg.WpaState = SS_NOTUSE; + } + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::(WPAPSK=%s)\n", __FUNCTION__, tmpbuf)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::(WPAPSK=%s)\n", __func__, tmpbuf)); + } + } + } +@@ -1449,7 +1451,7 @@ NDIS_STATUS RTMPReadParametersHook( + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + { + //PSMode +- if (RTMPGetKeyParameter("PSMode", tmpbuf, 10, buffer)) ++ if (RTMPGetKeyParameter("PSMode", tmpbuf, 32, buffer)) + { + if (pAd->StaCfg.BssType == BSS_INFRA) + { +@@ -1551,8 +1553,11 @@ NDIS_STATUS RTMPReadParametersHook( + } + + set_fs(orgfs); +- current->fsuid = orgfsuid; +- current->fsgid = orgfsgid; ++ ++#if 0 ++ current->cred->fsuid = orgfsuid; ++ current->cred->fsgid = orgfsgid; ++#endif + + kfree(buffer); + kfree(tmpbuf); +--- a/drivers/staging/rt2860/rtmp.h ++++ b/drivers/staging/rt2860/rtmp.h +@@ -203,9 +203,7 @@ typedef struct _ATE_INFO { + BOOLEAN bRxFer; + BOOLEAN bQATxStart; // Have compiled QA in and use it to ATE tx. + BOOLEAN bQARxStart; // Have compiled QA in and use it to ATE rx. +-#ifdef RT2860 + BOOLEAN bFWLoading; // Reload firmware when ATE is done. +-#endif // RT2860 // + UINT32 RxTotalCnt; + UINT32 RxCntPerSec; + +@@ -366,6 +364,13 @@ typedef struct _QUEUE_HEADER { + #define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0) + #define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F)) + ++// Macro for power save flag. ++#define RTMP_SET_PSFLAG(_M, _F) ((_M)->PSFlags |= (_F)) ++#define RTMP_CLEAR_PSFLAG(_M, _F) ((_M)->PSFlags &= ~(_F)) ++#define RTMP_CLEAR_PSFLAGS(_M) ((_M)->PSFlags = 0) ++#define RTMP_TEST_PSFLAG(_M, _F) (((_M)->PSFlags & (_F)) != 0) ++#define RTMP_TEST_PSFLAGS(_M, _F) (((_M)->PSFlags & (_F)) == (_F)) ++ + #define OPSTATUS_SET_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags |= (_F)) + #define OPSTATUS_CLEAR_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags &= ~(_F)) + #define OPSTATUS_TEST_FLAG(_pAd, _F) (((_pAd)->CommonCfg.OpStatusFlags & (_F)) != 0) +@@ -478,7 +483,6 @@ typedef struct _QUEUE_HEADER { + // + #define MAX_BUSY_COUNT 100 // Number of retry before failing access BBP & RF indirect register + // +-#ifdef RT2860 + #define RTMP_RF_IO_WRITE32(_A, _V) \ + { \ + PHY_CSR4_STRUC Value; \ +@@ -642,7 +646,6 @@ typedef struct _QUEUE_HEADER { + } \ + } \ + } +-#endif // RT2860 // + + + #define MAP_CHANNEL_ID_TO_KHZ(ch, khz) { \ +@@ -894,7 +897,6 @@ typedef struct _RTMP_SCATTER_GATHER_LIST + // Enqueue this frame to MLME engine + // We need to enqueue the whole frame because MLME need to pass data type + // information from 802.11 header +-#ifdef RT2860 + #define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \ + { \ + UINT32 High32TSF, Low32TSF; \ +@@ -902,7 +904,6 @@ typedef struct _RTMP_SCATTER_GATHER_LIST + RTMP_IO_READ32(_pAd, TSF_TIMER_DW0, &Low32TSF); \ + MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \ + } +-#endif // RT2860 // + + #define NDIS_QUERY_BUFFER(_NdisBuf, _ppVA, _pBufLen) \ + NdisQueryBuffer(_NdisBuf, _ppVA, _pBufLen) +@@ -919,9 +920,10 @@ typedef struct _RTMP_SCATTER_GATHER_LIST + #define STA_PORT_SECURED(_pAd) \ + { \ + _pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \ +- NdisAcquireSpinLock(&_pAd->MacTabLock); \ ++ RTMP_SET_PSFLAG(_pAd, fRTMP_PS_CAN_GO_SLEEP); \ ++ NdisAcquireSpinLock(&(_pAd)->MacTabLock); \ + _pAd->MacTab.Content[BSSID_WCID].PortSecured = _pAd->StaCfg.PortSecured; \ +- NdisReleaseSpinLock(&_pAd->MacTabLock); \ ++ NdisReleaseSpinLock(&(_pAd)->MacTabLock); \ + } + #endif // CONFIG_STA_SUPPORT // + +@@ -1000,9 +1002,7 @@ typedef struct _RTMP_REORDERBUF + UCHAR DataOffset; + USHORT Datasize; + ULONG AllocSize; +-#ifdef RT2860 + NDIS_PHYSICAL_ADDRESS AllocPa; // TxBuf physical address +-#endif // RT2860 // + } RTMP_REORDERBUF, *PRTMP_REORDERBUF; + + // +@@ -1101,6 +1101,7 @@ typedef struct _COUNTER_802_11 { + + typedef struct _COUNTER_RALINK { + ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput ++ ULONG LastReceivedByteCount; + ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput + ULONG BeenDisassociatedCount; + ULONG BadCQIAutoRecoveryCount; +@@ -1436,11 +1437,9 @@ typedef struct _MLME_STRUCT { + RALINK_TIMER_STRUCT APSDPeriodicTimer; + RALINK_TIMER_STRUCT LinkDownTimer; + RALINK_TIMER_STRUCT LinkUpTimer; +-#ifdef RT2860 + UCHAR bPsPollTimerRunning; + RALINK_TIMER_STRUCT PsPollTimer; + RALINK_TIMER_STRUCT RadioOnOffTimer; +-#endif // RT2860 // + ULONG PeriodicRound; + ULONG OneSecPeriodicRound; + +@@ -2228,9 +2227,7 @@ typedef struct _STA_ADMIN_CONFIG { + RT_HT_PHY_INFO DesiredHtPhyInfo; + BOOLEAN bAutoTxRateSwitch; + +-#ifdef RT2860 + UCHAR BBPR3; +-#endif // RT2860 // + + #ifdef EXT_BUILD_CHANNEL_LIST + UCHAR IEEE80211dClientMode; +@@ -2663,7 +2660,6 @@ typedef struct _RTMP_ADAPTER + PNET_DEV net_dev; + ULONG VirtualIfCnt; + +-#ifdef RT2860 + USHORT LnkCtrlBitMask; + USHORT RLnkCtrlConfiguration; + USHORT RLnkCtrlOffset; +@@ -2671,7 +2667,9 @@ typedef struct _RTMP_ADAPTER + USHORT HostLnkCtrlOffset; + USHORT PCIePowerSaveLevel; + BOOLEAN bPCIclkOff; // flag that indicate if the PICE power status in Configuration SPace.. +- BOOLEAN bPCIclkOffDisableTx; // ++ ULONG CheckDmaBusyCount; // Check Interrupt Status Register Count. ++ USHORT ThisTbttNumToNextWakeUp; ++ ULONG SameRxByteCount; + + + /*****************************************************************************************/ +@@ -2688,7 +2686,6 @@ typedef struct _RTMP_ADAPTER + RTMP_DMABUF RxDescRing; // Shared memory for RX descriptors + RTMP_DMABUF TxDescRing[NUM_OF_TX_RING]; // Shared memory for Tx descriptors + RTMP_TX_RING TxRing[NUM_OF_TX_RING]; // AC0~4 + HCCA +-#endif // RT2860 // + + + NDIS_SPIN_LOCK irq_lock; +@@ -2721,10 +2718,8 @@ typedef struct _RTMP_ADAPTER + /* Rx related parameters */ + /*****************************************************************************************/ + +-#ifdef RT2860 + RTMP_RX_RING RxRing; + NDIS_SPIN_LOCK RxRingLock; // Rx Ring spinlock +-#endif // RT2860 // + + + +@@ -2895,6 +2890,7 @@ typedef struct _RTMP_ADAPTER + + // flags, see fRTMP_ADAPTER_xxx flags + ULONG Flags; // Represent current device status ++ ULONG PSFlags; // Power Save operation flag. + + // current TX sequence # + USHORT Sequence; +@@ -3181,7 +3177,6 @@ typedef struct _TX_BLK_ + //------------------------------------------------------------------------------------------ + + +-#ifdef RT2860 + // + // Enable & Disable NIC interrupt via writing interrupt mask register + // Since it use ADAPTER structure, it have to be put after structure definition. +@@ -3214,7 +3209,6 @@ __inline VOID NICEnableInterrupt( + //RTMP_IO_WRITE32(pAd, PBF_INT_ENA, 0x00000030); // 1 : enable + RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE); + } +-#endif // RT2860 // + + #ifdef RT_BIG_ENDIAN + static inline VOID WriteBackToDescriptor( +@@ -3291,7 +3285,6 @@ static inline VOID RTMPWIEndianChange( + Call this function when read or update descriptor + ======================================================================== + */ +-#ifdef RT2860 + static inline VOID RTMPDescriptorEndianChange( + IN PUCHAR pData, + IN ULONG DescriptorType) +@@ -3301,7 +3294,6 @@ static inline VOID RTMPDescriptorEndianC + *((UINT32 *)(pData +12)) = SWAP32(*((UINT32 *)(pData + 12))); // Byte 12~15 + *((UINT32 *)(pData + 4)) = SWAP32(*((UINT32 *)(pData + 4))); // Byte 4~7, this must be swapped last + } +-#endif // RT2860 // + + /* + ======================================================================== +@@ -3550,6 +3542,9 @@ NDIS_STATUS NICInitializeAsic( + IN PRTMP_ADAPTER pAd, + IN BOOLEAN bHardReset); + ++VOID NICRestoreBBPValue( ++ IN PRTMP_ADAPTER pAd); ++ + VOID NICIssueReset( + IN PRTMP_ADAPTER pAd); + +@@ -4208,7 +4203,7 @@ VOID AsicForceSleep( + + VOID AsicForceWakeup( + IN PRTMP_ADAPTER pAd, +- IN BOOLEAN bFromTx); ++ IN UCHAR Level); + #endif // CONFIG_STA_SUPPORT // + + VOID AsicSetBssid( +@@ -4304,11 +4299,9 @@ BOOLEAN AsicSendCommandToMcu( + IN UCHAR Arg0, + IN UCHAR Arg1); + +-#ifdef RT2860 + BOOLEAN AsicCheckCommanOk( + IN PRTMP_ADAPTER pAd, + IN UCHAR Command); +-#endif // RT2860 // + + VOID MacAddrRandomBssid( + IN PRTMP_ADAPTER pAd, +@@ -6978,7 +6971,6 @@ void kill_thread_task(PRTMP_ADAPTER pAd) + + void tbtt_tasklet(unsigned long data); + +-#ifdef RT2860 + // + // Function Prototype in cmm_data_2860.c + // +@@ -7069,7 +7061,7 @@ BOOLEAN RT28xxPciAsicRadioOn( + + VOID RT28xxPciStaAsicForceWakeup( + IN PRTMP_ADAPTER pAd, +- IN BOOLEAN bFromTx); ++ IN UCHAR Level); + + VOID RT28xxPciStaAsicSleepThenAutoWakeup( + IN PRTMP_ADAPTER pAd, +@@ -7093,7 +7085,6 @@ VOID RT28xxPciMlmeRadioOn( + + VOID RT28xxPciMlmeRadioOFF( + IN PRTMP_ADAPTER pAd); +-#endif // RT2860 // + + VOID AsicTurnOffRFClk( + IN PRTMP_ADAPTER pAd, +@@ -7132,6 +7123,18 @@ PCHAR RTMPGetRalinkEncryModeStr( + #ifdef CONFIG_STA_SUPPORT + VOID AsicStaBbpTuning( + IN PRTMP_ADAPTER pAd); ++ ++VOID AsicResetFromDMABusy( ++ IN PRTMP_ADAPTER pAd); ++ ++VOID AsicResetBBP( ++ IN PRTMP_ADAPTER pAd); ++ ++VOID AsicResetMAC( ++ IN PRTMP_ADAPTER pAd); ++ ++VOID AsicResetPBF( ++ IN PRTMP_ADAPTER pAd); + #endif // CONFIG_STA_SUPPORT // + + void RTMP_IndicateMediaState( +--- a/drivers/staging/rt2860/rtmp_def.h ++++ b/drivers/staging/rt2860/rtmp_def.h +@@ -111,7 +111,6 @@ + // Entry number for each DMA descriptor ring + // + +-#ifdef RT2860 + #define TX_RING_SIZE 64 //64 + #define MGMT_RING_SIZE 128 + #define RX_RING_SIZE 128 //64 +@@ -119,7 +118,6 @@ + #define MAX_DMA_DONE_PROCESS TX_RING_SIZE + #define MAX_TX_DONE_PROCESS TX_RING_SIZE //8 + #define LOCAL_TXBUF_SIZE 2 +-#endif // RT2860 // + + + #ifdef MULTIPLE_CARD_SUPPORT +@@ -212,6 +210,19 @@ + #define fOP_STATUS_WAKEUP_NOW 0x00008000 + #define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000 + ++// ++// RTMP_ADAPTER PSFlags : related to advanced power save. ++// ++// Indicate whether driver can go to sleep mode from now. This flag is useful AFTER link up ++#define fRTMP_PS_CAN_GO_SLEEP 0x00000001 ++// Indicate whether driver has issue a LinkControl command to PCIe L1 ++#define fRTMP_PS_SET_PCI_CLK_OFF_COMMAND 0x00000002 ++// Indicate driver should disable kick off hardware to send packets from now. ++#define fRTMP_PS_DISABLE_TX 0x00000004 ++// Indicate driver should IMMEDIATELY fo to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me ++//. This flag is used ONLY in RTMPHandleRxDoneInterrupt routine. ++#define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008 ++ + #ifdef DOT11N_DRAFT3 + #define fOP_STATUS_SCAN_2040 0x00040000 + #endif // DOT11N_DRAFT3 // +@@ -333,7 +344,7 @@ + /* sanity check for apidx */ + #define MBSS_MR_APIDX_SANITY_CHECK(apidx) \ + { if (apidx > MAX_MBSSID_NUM) { \ +- printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __FUNCTION__, apidx); \ ++ printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx); \ + apidx = MAIN_MBSSID; } } + + #define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE ) +@@ -1514,12 +1525,14 @@ + #define MCAST_HTMIX 3 + #endif // MCAST_RATE_SPECIFIC // + +-// For AsicRadioOff/AsicRadioOn function +-#define DOT11POWERSAVE 0 +-#define GUIRADIO_OFF 1 +-#define RTMP_HALT 2 +-#define GUI_IDLE_POWER_SAVE 3 +-// -- ++// For AsicRadioOff/AsicRadioOn/AsicForceWakeup function ++// This is to indicate from where to call this function. ++#define DOT11POWERSAVE 0 // TO do .11 power save sleep ++#define GUIRADIO_OFF 1 // To perform Radio OFf command from GUI ++#define RTMP_HALT 2 // Called from Halt handler. ++#define GUI_IDLE_POWER_SAVE 3 // Call to sleep before link up with AP ++#define FROM_TX 4 // Force wake up from Tx packet. ++ + + + // definition for WpaSupport flag +--- a/drivers/staging/rt2860/sta/assoc.c ++++ b/drivers/staging/rt2860/sta/assoc.c +@@ -473,12 +473,7 @@ VOID MlmeAssocReqAction( + RSNIe = IE_WPA2; + } + +-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT +-#ifdef SIOCSIWGENIE +- if (pAd->StaCfg.WpaSupplicantUP != 1) +-#endif // SIOCSIWGENIE // +-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // +- RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0); ++ RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0); + + // Check for WPA PMK cache list + if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) +@@ -504,17 +499,6 @@ VOID MlmeAssocReqAction( + } + } + +-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT +-#ifdef SIOCSIWGENIE +- if (pAd->StaCfg.WpaSupplicantUP == 1) +- { +- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, +- pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE, +- END_OF_ARGS); +- } +- else +-#endif +-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // + { + MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, + 1, &RSNIe, +@@ -525,11 +509,6 @@ VOID MlmeAssocReqAction( + + FrameLen += tmp; + +-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT +-#ifdef SIOCSIWGENIE +- if (pAd->StaCfg.WpaSupplicantUP != 1) +-#endif +-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // + { + // Append Variable IE + NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &RSNIe, 1); +--- a/drivers/staging/rt2860/sta/connect.c ++++ b/drivers/staging/rt2860/sta/connect.c +@@ -337,6 +337,10 @@ VOID CntlOidSsidProc( + MLME_DISASSOC_REQ_STRUCT DisassocReq; + ULONG Now; + ++ // BBP and RF are not accessible in PS mode, we has to wake them up first ++ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) ++ AsicForceWakeup(pAd, RTMP_HALT); ++ + // Step 1. record the desired user settings to MlmeAux + NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID); + NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength); +@@ -1240,6 +1244,13 @@ VOID LinkUp( + UCHAR Value = 0, idx; + MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry; + ++ if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) ++ { ++ RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT); ++ RTMPusecDelay(6000); ++ pAd->bPCIclkOff = FALSE; ++ } ++ + pEntry = &pAd->MacTab.Content[BSSID_WCID]; + + // +@@ -1264,7 +1275,6 @@ VOID LinkUp( + //rt2860b. Don't know why need this + SwitchBetweenWepAndCkip(pAd); + +-#ifdef RT2860 + // Before power save before link up function, We will force use 1R. + // So after link up, check Rx antenna # again. + RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); +@@ -1282,7 +1292,6 @@ VOID LinkUp( + } + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); + pAd->StaCfg.BBPR3 = Value; +-#endif // RT2860 // + + if (BssType == BSS_ADHOC) + { +@@ -1330,9 +1339,7 @@ VOID LinkUp( + RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); + Value &= (~0x20); + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); +-#ifdef RT2860 + pAd->StaCfg.BBPR3 = Value; +-#endif // RT2860 // + + RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data); + Data &= 0xfffffffe; +@@ -1367,9 +1374,7 @@ VOID LinkUp( + RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); + Value |= (0x20); + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); +-#ifdef RT2860 + pAd->StaCfg.BBPR3 = Value; +-#endif // RT2860 // + + if (pAd->MACVersion == 0x28600100) + { +@@ -1400,9 +1405,7 @@ VOID LinkUp( + RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value); + Value &= (~0x20); + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value); +-#ifdef RT2860 + pAd->StaCfg.BBPR3 = Value; +-#endif // RT2860 // + + if (pAd->MACVersion == 0x28600100) + { +@@ -1598,6 +1601,8 @@ VOID LinkUp( + IV = 0; + IV |= (pAd->StaCfg.DefaultKeyId << 30); + AsicUpdateWCIDIVEIV(pAd, BSSID_WCID, IV, 0); ++ ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); + } + // NOTE: + // the decision of using "short slot time" or not may change dynamically due to +@@ -1919,6 +1924,7 @@ VOID LinkUp( + } + + RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); + + #ifdef DOT11_N_SUPPORT + #ifdef DOT11N_DRAFT3 +@@ -1961,6 +1967,7 @@ VOID LinkDown( + IN BOOLEAN IsReqFromAP) + { + UCHAR i, ByteValue = 0; ++ BOOLEAN Cancelled; + + // Do nothing if monitor mode is on + if (MONITOR_ON(pAd)) +@@ -1972,6 +1979,12 @@ VOID LinkDown( + return; + #endif // RALINK_ATE // + ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); ++ RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); ++ ++ // Not allow go to sleep within linkdown function. ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ + if (pAd->CommonCfg.bWirelessEvent) + { + RTMPSendWirelessEvent(pAd, IW_STA_LINKDOWN_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0); +@@ -1980,7 +1993,6 @@ VOID LinkDown( + DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN !!!\n")); + OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED); + +-#ifdef RT2860 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + BOOLEAN Cancelled; +@@ -1988,17 +2000,15 @@ VOID LinkDown( + RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); + } + +- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) ++ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) || ++ RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) || ++ RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)) + { +- AUTO_WAKEUP_STRUC AutoWakeupCfg; +- AsicForceWakeup(pAd, TRUE); +- AutoWakeupCfg.word = 0; +- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); ++ AsicForceWakeup(pAd, RTMP_HALT); + OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); + } + + pAd->bPCIclkOff = FALSE; +-#endif // RT2860 // + if (ADHOC_ON(pAd)) // Adhoc mode link down + { + DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 1!!!\n")); +@@ -2266,6 +2276,9 @@ VOID LinkDown( + RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff); + RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); + ++ // Allow go to sleep after linkdown steps. ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ + #ifdef WPA_SUPPLICANT_SUPPORT + #ifndef NATIVE_WPA_SUPPLICANT_SUPPORT + if (pAd->StaCfg.WpaSupplicantUP) { +@@ -2510,7 +2523,6 @@ VOID AuthParmFill( + + ========================================================================== + */ +-#ifdef RT2860 + VOID ComposePsPoll( + IN PRTMP_ADAPTER pAd) + { +@@ -2534,7 +2546,6 @@ VOID ComposeNullFrame( + COPY_MAC_ADDR(pAd->NullFrame.Addr2, pAd->CurrentAddress); + COPY_MAC_ADDR(pAd->NullFrame.Addr3, pAd->CommonCfg.Bssid); + } +-#endif // RT2860 // + + + +--- a/drivers/staging/rt2860/sta/dls.c ++++ b/drivers/staging/rt2860/sta/dls.c +@@ -1419,7 +1419,6 @@ BOOLEAN RTMPRcvFrameDLSCheck( + //AsicAddKeyEntry(pAd, (USHORT)(i + 2), BSS0, 0, &PairwiseKey, TRUE, TRUE); // reserve 0 for multicast, 1 for unicast + //AsicUpdateRxWCIDTable(pAd, (USHORT)(i + 2), pAddr); + // Add Pair-wise key to Asic +-#ifdef RT2860 + AsicAddPairwiseKeyEntry(pAd, + pAd->StaCfg.DLSEntry[i].MacAddr, + (UCHAR)pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, +@@ -1431,7 +1430,6 @@ BOOLEAN RTMPRcvFrameDLSCheck( + PairwiseKey.CipherAlg, + pEntry); + +-#endif // RT2860 // + NdisMoveMemory(&pEntry->PairwiseKey, &PairwiseKey, sizeof(CIPHER_KEY)); + DBGPRINT(RT_DEBUG_TRACE,("DLS - Receive STAKey Message-1 (Peer STA MAC Address STAKey) \n")); + +@@ -1477,7 +1475,6 @@ BOOLEAN RTMPRcvFrameDLSCheck( + //AsicAddKeyEntry(pAd, (USHORT)(i + 2), BSS0, 0, &PairwiseKey, TRUE, TRUE); // reserve 0 for multicast, 1 for unicast + //AsicUpdateRxWCIDTable(pAd, (USHORT)(i + 2), pAddr); + // Add Pair-wise key to Asic +-#ifdef RT2860 + AsicAddPairwiseKeyEntry(pAd, + pAd->StaCfg.DLSEntry[i].MacAddr, + (UCHAR)pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, +@@ -1488,7 +1485,6 @@ BOOLEAN RTMPRcvFrameDLSCheck( + 0, + PairwiseKey.CipherAlg, + pEntry); +-#endif // RT2860 // + NdisMoveMemory(&pEntry->PairwiseKey, &PairwiseKey, sizeof(CIPHER_KEY)); + DBGPRINT(RT_DEBUG_TRACE,("DLS - Receive STAKey Message-1 (Initiator STA MAC Address STAKey)\n")); + +--- a/drivers/staging/rt2860/sta/rtmp_data.c ++++ b/drivers/staging/rt2860/sta/rtmp_data.c +@@ -75,7 +75,6 @@ VOID STARxEAPOLFrameIndicate( + + if (pAd->StaCfg.DesireSharedKey[idx].KeyLen > 0) + { +-#ifdef RT2860 + MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[BSSID_WCID]; + + // Set key material and cipherAlg to Asic +@@ -89,7 +88,6 @@ VOID STARxEAPOLFrameIndicate( + + pAd->IndicateMediaState = NdisMediaStateConnected; + pAd->ExtraInfo = GENERAL_LINK_UP; +-#endif // RT2860 // + // For Preventing ShardKey Table is cleared by remove key procedure. + pAd->SharedKey[BSS0][idx].CipherAlg = CipherAlg; + pAd->SharedKey[BSS0][idx].KeyLen = pAd->StaCfg.DesireSharedKey[idx].KeyLen; +@@ -693,14 +691,12 @@ BOOLEAN STARxDoneInterruptHandle( + break; + } + +-#ifdef RT2860 + if (RxProcessed++ > MAX_RX_PROCESS_CNT) + { + // need to reschedule rx handle + bReschedule = TRUE; + break; + } +-#endif // RT2860 // + + RxProcessed ++; // test + +@@ -811,6 +807,13 @@ BOOLEAN STARxDoneInterruptHandle( + } + } + ++ // fRTMP_PS_GO_TO_SLEEP_NOW is set if receiving beacon. ++ if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW) && (INFRA_ON(pAd))) ++ { ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); ++ AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp); ++ bReschedule = FALSE; ++ } + return bReschedule; + } + +@@ -828,7 +831,7 @@ BOOLEAN STARxDoneInterruptHandle( + VOID RTMPHandleTwakeupInterrupt( + IN PRTMP_ADAPTER pAd) + { +- AsicForceWakeup(pAd, FALSE); ++ AsicForceWakeup(pAd, DOT11POWERSAVE); + } + + /* +@@ -1220,7 +1223,6 @@ NDIS_STATUS STASendPacket( + + ======================================================================== + */ +-#ifdef RT2860 + NDIS_STATUS RTMPFreeTXDRequest( + IN PRTMP_ADAPTER pAd, + IN UCHAR QueIdx, +@@ -1264,7 +1266,6 @@ NDIS_STATUS RTMPFreeTXDRequest( + + return (Status); + } +-#endif // RT2860 // + + + +@@ -1889,7 +1890,8 @@ VOID STA_AMPDU_Frame_Tx( + // + // Kick out Tx + // +- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); ++ if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) ++ HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + + pAd->RalinkCounters.KickTxCount++; + pAd->RalinkCounters.OneSecTxDoneCount++; +@@ -2019,7 +2021,8 @@ VOID STA_AMSDU_Frame_Tx( + // + // Kick out Tx + // +- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); ++ if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) ++ HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + } + #endif // DOT11_N_SUPPORT // + +@@ -2139,7 +2142,8 @@ VOID STA_Legacy_Frame_Tx( + // + // Kick out Tx + // +- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); ++ if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) ++ HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + } + + +@@ -2249,7 +2253,8 @@ VOID STA_ARalink_Frame_Tx( + // + // Kick out Tx + // +- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); ++ if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) ++ HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + + } + +@@ -2526,7 +2531,7 @@ NDIS_STATUS STAHardTransmit( + if ((pAd->StaCfg.Psm == PWR_SAVE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) + { + DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicForceWakeup At HardTx\n")); +- AsicForceWakeup(pAd, TRUE); ++ AsicForceWakeup(pAd, FROM_TX); + } + + // It should not change PSM bit, when APSD turn on. +--- a/drivers/staging/rt2860/sta/sync.c ++++ b/drivers/staging/rt2860/sta/sync.c +@@ -228,7 +228,6 @@ VOID MlmeScanReqAction( + // Increase the scan retry counters. + pAd->StaCfg.ScanCnt++; + +-#ifdef RT2860 + if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) && + (IDLE_ON(pAd)) && + (pAd->StaCfg.bRadio == TRUE) && +@@ -236,7 +235,6 @@ VOID MlmeScanReqAction( + { + RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE); + } +-#endif // RT2860 // + + // first check the parameter sanity + if (MlmeScanReqSanity(pAd, +@@ -349,7 +347,6 @@ VOID MlmeJoinReqAction( + + DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeJoinReqAction(BSS #%ld)\n", pInfo->BssIdx)); + +-#ifdef RT2860 + if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) && + (IDLE_ON(pAd)) && + (pAd->StaCfg.bRadio == TRUE) && +@@ -357,7 +354,6 @@ VOID MlmeJoinReqAction( + { + RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE); + } +-#endif // RT2860 // + + // reset all the timers + RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled); +@@ -1300,8 +1296,6 @@ VOID PeerBeacon( + { + if (pAd->StaCfg.Adhoc20NJoined == FALSE) + { +- UCHAR ByteValue = 0; +- + pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel; + + pAd->StaCfg.Adhoc20NJoined = TRUE; +@@ -1534,13 +1528,10 @@ VOID PeerBeacon( + // 5. otherwise, put PHY back to sleep to save battery. + if (MessageToMe) + { +-#ifdef RT2860 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); +- // Turn clk to 80Mhz. + } +-#endif // RT2860 // + if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && + pAd->CommonCfg.bAPSDAC_BE && pAd->CommonCfg.bAPSDAC_BK && pAd->CommonCfg.bAPSDAC_VI && pAd->CommonCfg.bAPSDAC_VO) + { +@@ -1551,12 +1542,10 @@ VOID PeerBeacon( + } + else if (BcastFlag && (DtimCount == 0) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM)) + { +-#ifdef RT2860 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); + } +-#endif // RT2860 // + } + else if ((pAd->TxSwQueue[QID_AC_BK].Number != 0) || + (pAd->TxSwQueue[QID_AC_BE].Number != 0) || +@@ -1570,12 +1559,10 @@ VOID PeerBeacon( + { + // TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme + // can we cheat here (i.e. just check MGMT & AC_BE) for better performance? +-#ifdef RT2860 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) + { + RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); + } +-#endif // RT2860 // + } + else + { +@@ -1590,7 +1577,10 @@ VOID PeerBeacon( + + if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) + { +- AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp); ++ // Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode. ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); ++ pAd->ThisTbttNumToNextWakeUp = TbttNumToNextWakeUp; ++ //AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp); + } + } + } +--- a/drivers/staging/rt2860/sta/wpa.c ++++ b/drivers/staging/rt2860/sta/wpa.c +@@ -1384,6 +1384,10 @@ VOID WpaGroupMsg1Action( + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP; + else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES; ++ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled) ++ pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64; ++ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled) ++ pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128; + + //hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK); + } +@@ -1760,7 +1764,7 @@ BOOLEAN ParseKeyData( + // Get GTK length - refer to IEEE 802.11i-2004 p.82 + GTKLEN = pKDE->Len -6; + +- if (GTKLEN < LEN_AES_KEY) ++ if (GTKLEN < MIN_LEN_OF_GTK) + { + DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN)); + return FALSE; +@@ -1786,6 +1790,10 @@ BOOLEAN ParseKeyData( + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP; + else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES; ++ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled) ++ pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64; ++ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled) ++ pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128; + + return TRUE; + +--- a/drivers/staging/rt2860/sta_ioctl.c ++++ b/drivers/staging/rt2860/sta_ioctl.c +@@ -49,15 +49,9 @@ extern ULONG RTDebugLevel; + + #define GROUP_KEY_NO 4 + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) + #define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_A, _B, _C, _D, _E) + #define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_A, _B, _C, _D, _E) + #define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_A, _B, _C, _D, _E, _F) +-#else +-#define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_B, _C, _D, _E) +-#define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_B, _C, _D, _E) +-#define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_B, _C, _D, _E, _F) +-#endif + + extern UCHAR CipherWpa2Template[]; + extern UCHAR CipherWpaPskTkip[]; +@@ -358,6 +352,20 @@ VOID RTMPAddKey( + + DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n")); + ++ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) ++ { ++ if (pAd->StaCfg.bRadio == FALSE) ++ { ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ return; ++ } ++ DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n")); ++ RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT); ++ RTMPusecDelay(6000); ++ pAd->bPCIclkOff = FALSE; ++ } ++ + if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) + { + if (pKey->KeyIndex & 0x80000000) +@@ -551,6 +559,8 @@ VOID RTMPAddKey( + } + } + end: ++ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); ++ DBGPRINT(RT_DEBUG_INFO, ("<------ RTMPAddKey\n")); + return; + } + +@@ -571,11 +581,9 @@ rt_ioctl_giwname(struct net_device *dev, + struct iw_request_info *info, + char *name, char *extra) + { +-// PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++// PRTMP_ADAPTER pAdapter = dev->ml_priv; + +-#ifdef RT2860 + strncpy(name, "RT2860 Wireless", IFNAMSIZ); +-#endif // RT2860 // + return 0; + } + +@@ -583,7 +591,7 @@ int rt_ioctl_siwfreq(struct net_device * + struct iw_request_info *info, + struct iw_freq *freq, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + int chan = -1; + + //check if the interface is down +@@ -623,19 +631,19 @@ int rt_ioctl_giwfreq(struct net_device * + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -653,7 +661,7 @@ int rt_ioctl_siwmode(struct net_device * + struct iw_request_info *info, + __u32 *mode, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + //check if the interface is down + if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +@@ -670,11 +678,9 @@ int rt_ioctl_siwmode(struct net_device * + case IW_MODE_INFRA: + Set_NetworkType_Proc(pAdapter, "Infra"); + break; +-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) + case IW_MODE_MONITOR: + Set_NetworkType_Proc(pAdapter, "Monitor"); + break; +-#endif + default: + DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_siwmode::SIOCSIWMODE (unknown %d)\n", *mode)); + return -EINVAL; +@@ -695,19 +701,19 @@ int rt_ioctl_giwmode(struct net_device * + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -715,12 +721,10 @@ int rt_ioctl_giwmode(struct net_device * + *mode = IW_MODE_ADHOC; + else if (INFRA_ON(pAdapter)) + *mode = IW_MODE_INFRA; +-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) + else if (MONITOR_ON(pAdapter)) + { + *mode = IW_MODE_MONITOR; + } +-#endif + else + *mode = IW_MODE_AUTO; + +@@ -732,7 +736,7 @@ int rt_ioctl_siwsens(struct net_device * + struct iw_request_info *info, + char *name, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + //check if the interface is down + if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +@@ -763,19 +767,19 @@ int rt_ioctl_giwrange(struct net_device + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -857,7 +861,7 @@ int rt_ioctl_siwap(struct net_device *de + struct iw_request_info *info, + struct sockaddr *ap_addr, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + NDIS_802_11_MAC_ADDRESS Bssid; + + //check if the interface is down +@@ -902,19 +906,19 @@ int rt_ioctl_giwap(struct net_device *de + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -984,7 +988,7 @@ int rt_ioctl_iwaplist(struct net_device + struct iw_request_info *info, + struct iw_point *data, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + struct sockaddr addr[IW_MAX_AP]; + struct iw_quality qual[IW_MAX_AP]; +@@ -1020,7 +1024,7 @@ int rt_ioctl_siwscan(struct net_device * + struct iw_request_info *info, + struct iw_point *data, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + ULONG Now; + int Status = NDIS_STATUS_SUCCESS; +@@ -1038,6 +1042,15 @@ int rt_ioctl_siwscan(struct net_device * + return -EINVAL; + } + ++ if ((pAdapter->OpMode == OPMODE_STA) && (IDLE_ON(pAdapter)) ++ && (pAdapter->StaCfg.bRadio == TRUE) ++ && (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_IDLE_RADIO_OFF))) ++ { ++ RT28xxPciAsicRadioOn(pAdapter, GUI_IDLE_POWER_SAVE); ++ } ++ // Check if still radio off. ++ else if (pAdapter->bPCIclkOff == TRUE) ++ return 0; + + #ifdef WPA_SUPPLICANT_SUPPORT + if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) +@@ -1102,7 +1115,7 @@ int rt_ioctl_giwscan(struct net_device * + struct iw_point *data, char *extra) + { + +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + int i=0; + char *current_ev = extra, *previous_ev = extra; + char *end_buf; +@@ -1391,7 +1404,7 @@ int rt_ioctl_siwessid(struct net_device + struct iw_request_info *info, + struct iw_point *data, char *essid) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + //check if the interface is down + if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +@@ -1437,19 +1450,19 @@ int rt_ioctl_giwessid(struct net_device + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1480,7 +1493,7 @@ int rt_ioctl_siwnickn(struct net_device + struct iw_request_info *info, + struct iw_point *data, char *nickname) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + //check if the interface is down + if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +@@ -1508,19 +1521,19 @@ int rt_ioctl_giwnickn(struct net_device + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1537,7 +1550,7 @@ int rt_ioctl_siwrts(struct net_device *d + struct iw_request_info *info, + struct iw_param *rts, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + u16 val; + + //check if the interface is down +@@ -1571,19 +1584,19 @@ int rt_ioctl_giwrts(struct net_device *d + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1605,7 +1618,7 @@ int rt_ioctl_siwfrag(struct net_device * + struct iw_request_info *info, + struct iw_param *frag, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + u16 val; + + //check if the interface is down +@@ -1637,19 +1650,19 @@ int rt_ioctl_giwfrag(struct net_device * + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1673,7 +1686,7 @@ int rt_ioctl_siwencode(struct net_device + struct iw_request_info *info, + struct iw_point *erq, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + //check if the interface is down + if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE)) +@@ -1756,7 +1769,7 @@ int rt_ioctl_siwencode(struct net_device + } + else + /* Don't complain if only change the mode */ +- if(!erq->flags & IW_ENCODE_MODE) { ++ if (!(erq->flags & IW_ENCODE_MODE)) { + return -EINVAL; + } + } +@@ -1780,19 +1793,19 @@ rt_ioctl_giwencode(struct net_device *de + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; ++ pVirtualAd = dev->ml_priv; + if (pVirtualAd && pVirtualAd->RtmpDev) +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1860,19 +1873,19 @@ rt_ioctl_setparam(struct net_device *dev + + if (dev->priv_flags == INT_MAIN) + { +- pAdapter = dev->priv; ++ pAdapter = dev->ml_priv; + } + else + { +- pVirtualAd = dev->priv; +- pAdapter = pVirtualAd->RtmpDev->priv; ++ pVirtualAd = dev->ml_priv; ++ pAdapter = pVirtualAd->RtmpDev->ml_priv; + } + pObj = (POS_COOKIE) pAdapter->OS_Cookie; + + if (pAdapter == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -1928,7 +1941,7 @@ rt_private_get_statistics(struct net_dev + struct iw_point *wrq, char *extra) + { + INT Status = 0; +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + + if (extra == NULL) + { +@@ -2055,18 +2068,18 @@ rt_private_show(struct net_device *dev, + u32 subcmd = wrq->flags; + + if (dev->priv_flags == INT_MAIN) +- pAd = dev->priv; ++ pAd = dev->ml_priv; + else + { +- pVirtualAd = dev->priv; +- pAd = pVirtualAd->RtmpDev->priv; ++ pVirtualAd = dev->ml_priv; ++ pAd = pVirtualAd->RtmpDev->ml_priv; + } + pObj = (POS_COOKIE) pAd->OS_Cookie; + + if (pAd == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +@@ -2161,12 +2174,6 @@ rt_private_show(struct net_device *dev, + wrq->length = strlen(extra) + 1; // 1: size of '\0' + break; + case RAIO_ON: +- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) +- { +- sprintf(extra, "Scanning\n"); +- wrq->length = strlen(extra) + 1; // 1: size of '\0' +- break; +- } + pAd->StaCfg.bSwRadio = TRUE; + //if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio)) + { +@@ -2200,7 +2207,7 @@ rt_private_show(struct net_device *dev, + } + break; + default: +- DBGPRINT(RT_DEBUG_TRACE, ("%s - unknow subcmd = %d\n", __FUNCTION__, subcmd)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s - unknow subcmd = %d\n", __func__, subcmd)); + break; + } + +@@ -2213,13 +2220,13 @@ int rt_ioctl_siwmlme(struct net_device * + union iwreq_data *wrqu, + char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer; + MLME_QUEUE_ELEM MsgElem; + MLME_DISASSOC_REQ_STRUCT DisAssocReq; + MLME_DEAUTH_REQ_STRUCT DeAuthReq; + +- DBGPRINT(RT_DEBUG_TRACE, ("====> %s\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("====> %s\n", __func__)); + + if (pMlme == NULL) + return -EINVAL; +@@ -2228,7 +2235,7 @@ int rt_ioctl_siwmlme(struct net_device * + { + #ifdef IW_MLME_DEAUTH + case IW_MLME_DEAUTH: +- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DEAUTH\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DEAUTH\n", __func__)); + COPY_MAC_ADDR(DeAuthReq.Addr, pAd->CommonCfg.Bssid); + DeAuthReq.Reason = pMlme->reason_code; + MsgElem.MsgLen = sizeof(MLME_DEAUTH_REQ_STRUCT); +@@ -2243,7 +2250,7 @@ int rt_ioctl_siwmlme(struct net_device * + #endif // IW_MLME_DEAUTH // + #ifdef IW_MLME_DISASSOC + case IW_MLME_DISASSOC: +- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DISASSOC\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DISASSOC\n", __func__)); + COPY_MAC_ADDR(DisAssocReq.Addr, pAd->CommonCfg.Bssid); + DisAssocReq.Reason = pMlme->reason_code; + +@@ -2257,7 +2264,7 @@ int rt_ioctl_siwmlme(struct net_device * + break; + #endif // IW_MLME_DISASSOC // + default: +- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - Unknow Command\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("====> %s - Unknow Command\n", __func__)); + break; + } + +@@ -2270,7 +2277,7 @@ int rt_ioctl_siwauth(struct net_device * + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + struct iw_param *param = &wrqu->param; + + //check if the interface is down +@@ -2290,7 +2297,7 @@ int rt_ioctl_siwauth(struct net_device * + else if (param->value == IW_AUTH_WPA_VERSION_WPA2) + pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK; + +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_CIPHER_PAIRWISE: + if (param->value == IW_AUTH_CIPHER_NONE) +@@ -2321,7 +2328,7 @@ int rt_ioctl_siwauth(struct net_device * + pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus; + pAdapter->StaCfg.PairCipher = Ndis802_11Encryption3Enabled; + } +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_PAIRWISE - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_PAIRWISE - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_CIPHER_GROUP: + if (param->value == IW_AUTH_CIPHER_NONE) +@@ -2341,7 +2348,7 @@ int rt_ioctl_siwauth(struct net_device * + { + pAdapter->StaCfg.GroupCipher = Ndis802_11Encryption3Enabled; + } +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_GROUP - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_GROUP - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_KEY_MGMT: + if (param->value == IW_AUTH_KEY_MGMT_802_1X) +@@ -2370,12 +2377,12 @@ int rt_ioctl_siwauth(struct net_device * + { + STA_PORT_SECURED(pAdapter); + } +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_RX_UNENCRYPTED_EAPOL: + break; + case IW_AUTH_PRIVACY_INVOKED: +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_DROP_UNENCRYPTED: + if (param->value != 0) +@@ -2384,7 +2391,7 @@ int rt_ioctl_siwauth(struct net_device * + { + STA_PORT_SECURED(pAdapter); + } +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_80211_AUTH_ALG: + if (param->value & IW_AUTH_ALG_SHARED_KEY) +@@ -2397,10 +2404,10 @@ int rt_ioctl_siwauth(struct net_device * + } + else + return -EINVAL; +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_80211_AUTH_ALG - param->value = %d!\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_80211_AUTH_ALG - param->value = %d!\n", __func__, param->value)); + break; + case IW_AUTH_WPA_ENABLED: +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_ENABLED - Driver supports WPA!(param->value = %d)\n", __FUNCTION__, param->value)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_ENABLED - Driver supports WPA!(param->value = %d)\n", __func__, param->value)); + break; + default: + return -EOPNOTSUPP; +@@ -2413,7 +2420,7 @@ int rt_ioctl_giwauth(struct net_device * + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + struct iw_param *param = &wrqu->param; + + //check if the interface is down +@@ -2450,6 +2457,20 @@ void fnSetCipherKey( + IN BOOLEAN bGTK, + IN struct iw_encode_ext *ext) + { ++ RTMP_CLEAR_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP); ++ if (RTMP_TEST_PSFLAG(pAdapter, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) ++ { ++ if (pAdapter->StaCfg.bRadio == FALSE) ++ { ++ RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP); ++ return; ++ } ++ DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n")); ++ RTMPPCIeLinkCtrlValueRestore(pAdapter, RESTORE_HALT); ++ RTMPusecDelay(6000); ++ pAdapter->bPCIclkOff = FALSE; ++ } ++ + NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY)); + pAdapter->SharedKey[BSS0][keyIdx].KeyLen = LEN_TKIP_EK; + NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, LEN_TKIP_EK); +@@ -2480,6 +2501,8 @@ void fnSetCipherKey( + keyIdx, + pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, + &pAdapter->MacTab.Content[BSSID_WCID]); ++ ++ RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP); + } + + int rt_ioctl_siwencodeext(struct net_device *dev, +@@ -2487,7 +2510,7 @@ int rt_ioctl_siwencodeext(struct net_dev + union iwreq_data *wrqu, + char *extra) + { +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + struct iw_point *encoding = &wrqu->encoding; + struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; + int keyIdx, alg = ext->alg; +@@ -2508,7 +2531,7 @@ int rt_ioctl_siwencodeext(struct net_dev + pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_NONE; + AsicRemoveSharedKeyEntry(pAdapter, 0, (UCHAR)keyIdx); + NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY)); +- DBGPRINT(RT_DEBUG_TRACE, ("%s::Remove all keys!(encoding->flags = %x)\n", __FUNCTION__, encoding->flags)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::Remove all keys!(encoding->flags = %x)\n", __func__, encoding->flags)); + } + else + { +@@ -2520,15 +2543,15 @@ int rt_ioctl_siwencodeext(struct net_dev + if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) + { + pAdapter->StaCfg.DefaultKeyId = keyIdx; +- DBGPRINT(RT_DEBUG_TRACE, ("%s::DefaultKeyId = %d\n", __FUNCTION__, pAdapter->StaCfg.DefaultKeyId)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::DefaultKeyId = %d\n", __func__, pAdapter->StaCfg.DefaultKeyId)); + } + + switch (alg) { + case IW_ENCODE_ALG_NONE: +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_NONE\n", __FUNCTION__)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_NONE\n", __func__)); + break; + case IW_ENCODE_ALG_WEP: +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_WEP - ext->key_len = %d, keyIdx = %d\n", __FUNCTION__, ext->key_len, keyIdx)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_WEP - ext->key_len = %d, keyIdx = %d\n", __func__, ext->key_len, keyIdx)); + if (ext->key_len == MAX_WEP_KEY_SIZE) + { + pAdapter->SharedKey[BSS0][keyIdx].KeyLen = MAX_WEP_KEY_SIZE; +@@ -2544,9 +2567,24 @@ int rt_ioctl_siwencodeext(struct net_dev + + NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16); + NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, ext->key_len); ++ ++ if (pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled || ++ pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled) ++ { ++ // Set Group key material to Asic ++ AsicAddSharedKeyEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, pAdapter->SharedKey[BSS0][keyIdx].Key, NULL, NULL); ++ ++ // Update WCID attribute table and IVEIV table for this group key table ++ RTMPAddWcidAttributeEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, NULL); ++ ++ STA_PORT_SECURED(pAdapter); ++ ++ // Indicate Connected for GUI ++ pAdapter->IndicateMediaState = NdisMediaStateConnected; ++ } + break; + case IW_ENCODE_ALG_TKIP: +- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __FUNCTION__, keyIdx, ext->key_len)); ++ DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __func__, keyIdx, ext->key_len)); + if (ext->key_len == 32) + { + if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) +@@ -2596,7 +2634,7 @@ rt_ioctl_giwencodeext(struct net_device + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + PCHAR pKey = NULL; + struct iw_point *encoding = &wrqu->encoding; + struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; +@@ -2680,7 +2718,7 @@ int rt_ioctl_siwgenie(struct net_device + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + + if (wrqu->data.length > MAX_LEN_OF_RSNIE || + (wrqu->data.length && extra == NULL)) +@@ -2705,7 +2743,7 @@ int rt_ioctl_giwgenie(struct net_device + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + + if ((pAd->StaCfg.RSNIE_Len == 0) || + (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)) +@@ -2751,7 +2789,7 @@ int rt_ioctl_siwpmksa(struct net_device + union iwreq_data *wrqu, + char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer; + INT CachedIdx = 0, idx = 0; + +@@ -2834,7 +2872,7 @@ rt_private_ioctl_bbp(struct net_device * + UINT32 bbpValue; + BOOLEAN bIsPrintAllBBP = FALSE; + INT Status = 0; +- PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAdapter = dev->ml_priv; + + + memset(extra, 0x00, IW_PRIV_SIZE_MASK); +@@ -2961,7 +2999,7 @@ int rt_ioctl_siwrate(struct net_device * + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed; + + //check if the interface is down +@@ -3019,7 +3057,7 @@ int rt_ioctl_giwrate(struct net_device * + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { +- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) dev->priv; ++ PRTMP_ADAPTER pAd = dev->ml_priv; + int rate_index = 0, rate_count = 0; + HTTRANSMIT_SETTING ht_setting; + __s32 ralinkrate[] = +@@ -4259,7 +4297,23 @@ INT RTMPSetInformation( + } + + #ifdef WPA_SUPPLICANT_SUPPORT +- if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED) ++ if ((pAdapter->StaCfg.WpaSupplicantUP != 0) && ++ (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)) ++ { ++ Key = pWepKey->KeyMaterial; ++ ++ // Set Group key material to Asic ++ AsicAddSharedKeyEntry(pAdapter, BSS0, KeyIdx, CipherAlg, Key, NULL, NULL); ++ ++ // Update WCID attribute table and IVEIV table for this group key table ++ RTMPAddWcidAttributeEntry(pAdapter, BSS0, KeyIdx, CipherAlg, NULL); ++ ++ STA_PORT_SECURED(pAdapter); ++ ++ // Indicate Connected for GUI ++ pAdapter->IndicateMediaState = NdisMediaStateConnected; ++ } ++ else if (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED) + #endif // WPA_SUPPLICANT_SUPPORT + { + Key = pAdapter->SharedKey[BSS0][KeyIdx].Key; +@@ -5265,7 +5319,6 @@ INT RTMPQueryInformation( + case RT_OID_802_11_PRODUCTID: + DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_PRODUCTID \n")); + +-#ifdef RT2860 + { + + USHORT device_id; +@@ -5275,7 +5328,6 @@ INT RTMPQueryInformation( + DBGPRINT(RT_DEBUG_TRACE, (" pci_dev = NULL\n")); + sprintf(tmp, "%04x %04x\n", NIC_PCI_VENDOR_ID, device_id); + } +-#endif // RT2860 // + wrq->u.data.length = strlen(tmp); + Status = copy_to_user(wrq->u.data.pointer, tmp, wrq->u.data.length); + break; +@@ -5409,19 +5461,19 @@ INT rt28xx_sta_ioctl( + + if (net_dev->priv_flags == INT_MAIN) + { +- pAd = net_dev->priv; ++ pAd = net_dev->ml_priv; + } + else + { +- pVirtualAd = net_dev->priv; +- pAd = pVirtualAd->RtmpDev->priv; ++ pVirtualAd = net_dev->ml_priv; ++ pAd = pVirtualAd->RtmpDev->ml_priv; + } + pObj = (POS_COOKIE) pAd->OS_Cookie; + + if (pAd == NULL) + { + /* if 1st open fail, pAd will be free; +- So the net_dev->priv will be NULL in 2rd open */ ++ So the net_dev->ml_priv will be NULL in 2rd open */ + return -ENETDOWN; + } + +--- a/drivers/staging/rt2860/wpa.h ++++ b/drivers/staging/rt2860/wpa.h +@@ -90,6 +90,7 @@ + #define TKIP_AP_RXMICK_OFFSET (TKIP_AP_TXMICK_OFFSET+LEN_TKIP_TXMICK) + #define TKIP_GTK_LENGTH ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK)) + #define LEN_PTK ((LEN_EAP_KEY)+(LEN_TKIP_KEY)) ++#define MIN_LEN_OF_GTK 5 + + // RSN IE Length definition + #define MAX_LEN_OF_RSNIE 90 diff --git a/src/patches/suse-2.6.27.31/patches.drivers/staging-rtl8192e-backport-net_device_ops-conversion.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-rtl8192e-backport-net_device_ops-conversion.patch new file mode 100644 index 000000000..f27721eca --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/staging-rtl8192e-backport-net_device_ops-conversion.patch @@ -0,0 +1,64 @@ +From foo@baz Wed Aug 12 09:28:09 PDT 2009 +Date: Wed, 12 Aug 2009 09:28:09 -0700 +To: Greg KH +From: Greg Kroah-Hartman +Subject: Staging: rtl8192e: backport net_device_ops conversion + +2.6.27 does not have struct net_device_ops, so backport the changes +needed to get things to work here. + +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8192e/ieee80211/ieee80211_module.c | 2 -- + drivers/staging/rtl8192e/r8192E_core.c | 6 ++++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c ++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c +@@ -118,9 +118,7 @@ struct net_device *alloc_ieee80211(int s + #else + ieee = (struct ieee80211_device *)dev->priv; + #endif +-#if 0 + dev->hard_start_xmit = ieee80211_xmit; +-#endif + + memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); + ieee->dev = dev; +--- a/drivers/staging/rtl8192e/r8192E_core.c ++++ b/drivers/staging/rtl8192e/r8192E_core.c +@@ -6231,6 +6231,7 @@ void rtl8192_irq_rx_tasklet(struct r8192 + write_nic_dword(priv->ieee80211->dev, INTA_MASK,read_nic_dword(priv->ieee80211->dev, INTA_MASK) | IMR_RDU); + } + ++#if 0 + static const struct net_device_ops rtl8192_netdev_ops = { + .ndo_open = rtl8192_open, + .ndo_stop = rtl8192_close, +@@ -6241,6 +6242,7 @@ static const struct net_device_ops rtl81 + .ndo_set_mac_address = r8192_set_mac_adr, + .ndo_start_xmit = ieee80211_xmit, + }; ++#endif + + /**************************************************************************** + ---------------------------- PCI_STUFF--------------------------- +@@ -6362,8 +6364,9 @@ static int __devinit rtl8192_pci_probe(s + dev->irq = pdev->irq; + priv->irq = 0; + +- dev->netdev_ops = &rtl8192_netdev_ops; + #if 0 ++ dev->netdev_ops = &rtl8192_netdev_ops; ++#endif + dev->open = rtl8192_open; + dev->stop = rtl8192_close; + //dev->hard_start_xmit = rtl8192_8023_hard_start_xmit; +@@ -6372,7 +6375,6 @@ static int __devinit rtl8192_pci_probe(s + dev->do_ioctl = rtl8192_ioctl; + dev->set_multicast_list = r8192_set_multicast; + dev->set_mac_address = r8192_set_mac_adr; +-#endif + + //DMESG("Oops: i'm coming\n"); + #if WIRELESS_EXT >= 12 diff --git a/src/patches/suse-2.6.27.25/patches.drivers/staging-workaround-build-system-bug.patch b/src/patches/suse-2.6.27.31/patches.drivers/staging-workaround-build-system-bug.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/staging-workaround-build-system-bug.patch rename to src/patches/suse-2.6.27.31/patches.drivers/staging-workaround-build-system-bug.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/sysfs-crash-debugging.patch b/src/patches/suse-2.6.27.31/patches.drivers/sysfs-crash-debugging.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/sysfs-crash-debugging.patch rename to src/patches/suse-2.6.27.31/patches.drivers/sysfs-crash-debugging.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/tg3-Add-57780-ASIC-revision.patch b/src/patches/suse-2.6.27.31/patches.drivers/tg3-Add-57780-ASIC-revision.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/tg3-Add-57780-ASIC-revision.patch rename to src/patches/suse-2.6.27.31/patches.drivers/tg3-Add-57780-ASIC-revision.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/tg3_libphy_workaround b/src/patches/suse-2.6.27.31/patches.drivers/tg3_libphy_workaround similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/tg3_libphy_workaround rename to src/patches/suse-2.6.27.31/patches.drivers/tg3_libphy_workaround diff --git a/src/patches/suse-2.6.27.25/patches.drivers/tpm-bcm0102-workaround.patch b/src/patches/suse-2.6.27.31/patches.drivers/tpm-bcm0102-workaround.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/tpm-bcm0102-workaround.patch rename to src/patches/suse-2.6.27.31/patches.drivers/tpm-bcm0102-workaround.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/tpm-correct-timeouts.patch b/src/patches/suse-2.6.27.31/patches.drivers/tpm-correct-timeouts.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/tpm-correct-timeouts.patch rename to src/patches/suse-2.6.27.31/patches.drivers/tpm-correct-timeouts.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/usb-serial-add-qualcomm-wireless-modem-driver.patch b/src/patches/suse-2.6.27.31/patches.drivers/usb-serial-add-qualcomm-wireless-modem-driver.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/usb-serial-add-qualcomm-wireless-modem-driver.patch rename to src/patches/suse-2.6.27.31/patches.drivers/usb-serial-add-qualcomm-wireless-modem-driver.patch diff --git a/src/patches/suse-2.6.27.31/patches.drivers/usb-storage-increase-the-bcd-range-in-sony-s-bad-device-table.patch b/src/patches/suse-2.6.27.31/patches.drivers/usb-storage-increase-the-bcd-range-in-sony-s-bad-device-table.patch new file mode 100644 index 000000000..b138bb295 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.drivers/usb-storage-increase-the-bcd-range-in-sony-s-bad-device-table.patch @@ -0,0 +1,29 @@ +From foo@baz Tue Aug 18 09:31:28 PDT 2009 +Date: Tue, 18 Aug 2009 09:31:28 -0700 +To: Greg KH +From: Greg Kroah-Hartman +Subject: USB: storage: increase the bcd range in Sony's bad device table. +Patch-mainline: 2.6.32 +References: bnc#466554 + +Another Sony device in the wild is needing this hack. You would think +they would fix their firmware one of these days... + +Cc: Maciej Pilichowski +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/storage/unusual_devs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -568,7 +568,7 @@ UNUSUAL_DEV( 0x052b, 0x1911, 0x0100, 0x + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + +-UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450, ++UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0500, + "Sony", + "DSC-S30/S70/S75/505V/F505/F707/F717/P8", + US_SC_SCSI, US_PR_DEVICE, NULL, diff --git a/src/patches/suse-2.6.27.25/patches.drivers/uvcvideo-ignore-hue-control-for-5986-0241.patch b/src/patches/suse-2.6.27.31/patches.drivers/uvcvideo-ignore-hue-control-for-5986-0241.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/uvcvideo-ignore-hue-control-for-5986-0241.patch rename to src/patches/suse-2.6.27.31/patches.drivers/uvcvideo-ignore-hue-control-for-5986-0241.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/v4l-dvb-uvcvideo-implement-the-usb-power-management-reset_resume-method.patch b/src/patches/suse-2.6.27.31/patches.drivers/v4l-dvb-uvcvideo-implement-the-usb-power-management-reset_resume-method.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/v4l-dvb-uvcvideo-implement-the-usb-power-management-reset_resume-method.patch rename to src/patches/suse-2.6.27.31/patches.drivers/v4l-dvb-uvcvideo-implement-the-usb-power-management-reset_resume-method.patch diff --git a/src/patches/suse-2.6.27.25/patches.drivers/via-unichrome-drm-bugfixes.patch b/src/patches/suse-2.6.27.31/patches.drivers/via-unichrome-drm-bugfixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.drivers/via-unichrome-drm-bugfixes.patch rename to src/patches/suse-2.6.27.31/patches.drivers/via-unichrome-drm-bugfixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch b/src/patches/suse-2.6.27.31/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch similarity index 85% rename from src/patches/suse-2.6.27.25/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch index 4fc6cb2b7..41987bb3f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0001-md-Relax-minimum-size-restrictions-on-chunk_size.patch @@ -24,9 +24,9 @@ Signed-off-by: NeilBrown drivers/md/raid5.c | 7 +++++++ 3 files changed, 11 insertions(+), 13 deletions(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -3578,22 +3578,12 @@ static int do_md_run(mddev_t * mddev) +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -3580,22 +3580,12 @@ static int do_md_run(mddev_t * mddev) return -EINVAL; } /* @@ -50,8 +50,8 @@ Signed-off-by: NeilBrown /* devices must have minimum size of one chunk */ rdev_for_each(rdev, tmp, mddev) { ---- a/drivers/md/raid10.c -+++ b/drivers/md/raid10.c +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/raid10.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/raid10.c @@ -2025,8 +2025,9 @@ static int run(mddev_t *mddev) int nc, fc, fo; sector_t stride, size; @@ -64,9 +64,9 @@ Signed-off-by: NeilBrown return -EINVAL; } ---- a/drivers/md/raid5.c -+++ b/drivers/md/raid5.c -@@ -4009,6 +4009,13 @@ static int run(mddev_t *mddev) +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/raid5.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/raid5.c +@@ -4010,6 +4010,13 @@ static int run(mddev_t *mddev) return -EIO; } diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0002-md-fix-input-truncation-in-safe_delay_store.patch b/src/patches/suse-2.6.27.31/patches.fixes/0002-md-fix-input-truncation-in-safe_delay_store.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0002-md-fix-input-truncation-in-safe_delay_store.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0002-md-fix-input-truncation-in-safe_delay_store.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch b/src/patches/suse-2.6.27.31/patches.fixes/0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch b/src/patches/suse-2.6.27.31/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch similarity index 93% rename from src/patches/suse-2.6.27.25/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch index d273c981c..152b7d811 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0004-md-fix-deadlock-when-stopping-arrays.patch @@ -60,9 +60,9 @@ Acked-by: NeilBrown drivers/md/md.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -305,9 +305,14 @@ static inline int mddev_trylock(mddev_t +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -305,9 +305,14 @@ static inline int mddev_trylock(mddev_t return mutex_trylock(&mddev->reconfig_mutex); } @@ -77,7 +77,7 @@ Acked-by: NeilBrown md_wakeup_thread(mddev->thread); } -@@ -3903,10 +3908,9 @@ static int do_md_stop(mddev_t * mddev, i +@@ -3905,10 +3910,9 @@ static int do_md_stop(mddev_t * mddev, i mddev->queue->merge_bvec_fn = NULL; mddev->queue->unplug_fn = NULL; mddev->queue->backing_dev_info.congested_fn = NULL; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch b/src/patches/suse-2.6.27.31/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch similarity index 85% rename from src/patches/suse-2.6.27.25/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch index b0ea4e9e8..bb64290db 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0005-md-Fix-is_mddev_idle-test-again.patch @@ -27,9 +27,9 @@ Signed-off-by: NeilBrown drivers/md/md.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -5580,11 +5580,11 @@ int unregister_md_personality(struct mdk +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -5582,11 +5582,11 @@ int unregister_md_personality(struct mdk return 0; } @@ -43,7 +43,7 @@ Signed-off-by: NeilBrown idle = 1; rcu_read_lock(); -@@ -5615,7 +5615,7 @@ static int is_mddev_idle(mddev_t *mddev) +@@ -5617,7 +5617,7 @@ static int is_mddev_idle(mddev_t *mddev) * always make curr_events less than last_events. * */ @@ -52,7 +52,7 @@ Signed-off-by: NeilBrown rdev->last_events = curr_events; idle = 0; } -@@ -5859,7 +5859,7 @@ void md_do_sync(mddev_t *mddev) +@@ -5861,7 +5861,7 @@ void md_do_sync(mddev_t *mddev) "(but not more than %d KB/sec) for %s.\n", speed_max(mddev), desc); @@ -61,7 +61,7 @@ Signed-off-by: NeilBrown io_sectors = 0; for (m = 0; m < SYNC_MARKS; m++) { -@@ -5961,7 +5961,7 @@ void md_do_sync(mddev_t *mddev) +@@ -5963,7 +5963,7 @@ void md_do_sync(mddev_t *mddev) if (currspeed > speed_min(mddev)) { if ((currspeed > speed_max(mddev)) || diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch b/src/patches/suse-2.6.27.31/patches.fixes/0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0006-md-never-clear-bit-from-the-write-intent-bitmap-when.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0007-md-write-bitmap-information-to-devices-that-are-unde.patch b/src/patches/suse-2.6.27.31/patches.fixes/0007-md-write-bitmap-information-to-devices-that-are-unde.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0007-md-write-bitmap-information-to-devices-that-are-unde.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0007-md-write-bitmap-information-to-devices-that-are-unde.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch b/src/patches/suse-2.6.27.31/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch similarity index 88% rename from src/patches/suse-2.6.27.25/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch index b38023df3..390345412 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch @@ -24,9 +24,9 @@ Signed-off-by: NeilBrown drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -4349,6 +4349,8 @@ static int add_new_disk(mddev_t * mddev, +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -4351,6 +4351,8 @@ static int add_new_disk(mddev_t * mddev, clear_bit(In_sync, &rdev->flags); /* just to be sure */ if (info->state & (1<flags); diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch b/src/patches/suse-2.6.27.31/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch similarity index 95% rename from src/patches/suse-2.6.27.25/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch index 56f192667..c383dcf28 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0009-md-raid5-simplify-interface-for-init_stripe-and-get_.patch @@ -113,7 +113,7 @@ Signed-off-by: NeilBrown if (sh) { if (unlikely(conf->expand_progress != MaxSector)) { /* expansion might have moved on while waiting for a -@@ -3581,9 +3587,7 @@ static sector_t reshape_request(mddev_t +@@ -3582,9 +3588,7 @@ static sector_t reshape_request(mddev_t for (i=0; i < conf->chunk_size/512; i+= STRIPE_SECTORS) { int j; int skipped = 0; @@ -124,7 +124,7 @@ Signed-off-by: NeilBrown set_bit(STRIPE_EXPANDING, &sh->state); atomic_inc(&conf->reshape_stripes); /* If any of this stripe is beyond the end of the old -@@ -3631,10 +3635,7 @@ static sector_t reshape_request(mddev_t +@@ -3632,10 +3636,7 @@ static sector_t reshape_request(mddev_t if (last_sector >= (mddev->size<<1)) last_sector = (mddev->size<<1)-1; while (first_sector <= last_sector) { @@ -136,7 +136,7 @@ Signed-off-by: NeilBrown set_bit(STRIPE_EXPAND_SOURCE, &sh->state); set_bit(STRIPE_HANDLE, &sh->state); release_stripe(sh); -@@ -3724,9 +3725,9 @@ static inline sector_t sync_request(mdde +@@ -3725,9 +3726,9 @@ static inline sector_t sync_request(mdde bitmap_cond_end_sync(mddev->bitmap, sector_nr); pd_idx = stripe_to_pdidx(sector_nr, conf, raid_disks); @@ -148,7 +148,7 @@ Signed-off-by: NeilBrown /* make sure we don't swamp the stripe cache if someone else * is trying to get access */ -@@ -3792,7 +3793,7 @@ static int retry_aligned_read(raid5_con +@@ -3793,7 +3794,7 @@ static int retry_aligned_read(raid5_con /* already done this stripe */ continue; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch b/src/patches/suse-2.6.27.31/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch index c19b977b5..257b17fc5 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0010-md-raid5-change-raid5_compute_sector-and-stripe_to_p.patch @@ -158,7 +158,7 @@ Signed-off-by: NeilBrown pr_debug("raid5: make_request, sector %llu logical %llu\n", (unsigned long long)new_sector, (unsigned long long)logical_sector); -@@ -3624,14 +3623,12 @@ static sector_t reshape_request(mddev_t +@@ -3625,14 +3624,12 @@ static sector_t reshape_request(mddev_t * block on the destination stripes. */ first_sector = @@ -178,7 +178,7 @@ Signed-off-by: NeilBrown if (last_sector >= (mddev->size<<1)) last_sector = (mddev->size<<1)-1; while (first_sector <= last_sector) { -@@ -3668,8 +3665,6 @@ static inline sector_t sync_request(mdde +@@ -3669,8 +3666,6 @@ static inline sector_t sync_request(mdde { raid5_conf_t *conf = (raid5_conf_t *) mddev->private; struct stripe_head *sh; @@ -187,7 +187,7 @@ Signed-off-by: NeilBrown sector_t max_sector = mddev->size << 1; int sync_blocks; int still_degraded = 0; -@@ -3724,7 +3719,6 @@ static inline sector_t sync_request(mdde +@@ -3725,7 +3720,6 @@ static inline sector_t sync_request(mdde bitmap_cond_end_sync(mddev->bitmap, sector_nr); @@ -195,7 +195,7 @@ Signed-off-by: NeilBrown sh = get_active_stripe(conf, sector_nr, 0, 1); if (sh == NULL) { sh = get_active_stripe(conf, sector_nr, 0, 0); -@@ -3776,12 +3770,8 @@ static int retry_aligned_read(raid5_con +@@ -3777,12 +3771,8 @@ static int retry_aligned_read(raid5_con int handled = 0; logical_sector = raid_bio->bi_sector & ~((sector_t)STRIPE_SECTORS-1); diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch b/src/patches/suse-2.6.27.31/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch index a8f18ffd5..3c53fc605 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0011-md-raid6-remove-expectation-that-Q-device-is-immedia.patch @@ -448,7 +448,7 @@ Signed-off-by: NeilBrown pr_debug("raid5: make_request, sector %llu logical %llu\n", (unsigned long long)new_sector, (unsigned long long)logical_sector); -@@ -3534,7 +3571,7 @@ static sector_t reshape_request(mddev_t +@@ -3535,7 +3572,7 @@ static sector_t reshape_request(mddev_t */ raid5_conf_t *conf = (raid5_conf_t *) mddev->private; struct stripe_head *sh; @@ -457,7 +457,7 @@ Signed-off-by: NeilBrown sector_t first_sector, last_sector; int raid_disks = conf->previous_raid_disks; int data_disks = raid_disks - conf->max_degraded; -@@ -3597,7 +3634,7 @@ static sector_t reshape_request(mddev_t +@@ -3598,7 +3635,7 @@ static sector_t reshape_request(mddev_t if (j == sh->pd_idx) continue; if (conf->level == 6 && @@ -466,7 +466,7 @@ Signed-off-by: NeilBrown continue; s = compute_blocknr(sh, j); if (s < mddev->array_sectors) { -@@ -3624,11 +3661,11 @@ static sector_t reshape_request(mddev_t +@@ -3625,11 +3662,11 @@ static sector_t reshape_request(mddev_t */ first_sector = raid5_compute_sector(conf, sector_nr*(new_data_disks), @@ -480,7 +480,7 @@ Signed-off-by: NeilBrown if (last_sector >= (mddev->size<<1)) last_sector = (mddev->size<<1)-1; while (first_sector <= last_sector) { -@@ -3763,7 +3800,7 @@ static int retry_aligned_read(raid5_con +@@ -3764,7 +3801,7 @@ static int retry_aligned_read(raid5_con * it will be only one 'dd_idx' and only need one call to raid5_compute_sector. */ struct stripe_head *sh; @@ -489,7 +489,7 @@ Signed-off-by: NeilBrown sector_t sector, logical_sector, last_sector; int scnt = 0; int remaining; -@@ -3771,7 +3808,7 @@ static int retry_aligned_read(raid5_con +@@ -3772,7 +3809,7 @@ static int retry_aligned_read(raid5_con logical_sector = raid_bio->bi_sector & ~((sector_t)STRIPE_SECTORS-1); sector = raid5_compute_sector(conf, logical_sector, diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch b/src/patches/suse-2.6.27.31/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch index 0be556729..97e617f2f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0012-md-raid5-simplify-raid5_compute_sector-interface.patch @@ -284,7 +284,7 @@ Signed-off-by: NeilBrown pr_debug("raid5: make_request, sector %llu logical %llu\n", (unsigned long long)new_sector, (unsigned long long)logical_sector); -@@ -3571,7 +3570,6 @@ static sector_t reshape_request(mddev_t +@@ -3572,7 +3571,6 @@ static sector_t reshape_request(mddev_t */ raid5_conf_t *conf = (raid5_conf_t *) mddev->private; struct stripe_head *sh; @@ -292,7 +292,7 @@ Signed-off-by: NeilBrown sector_t first_sector, last_sector; int raid_disks = conf->previous_raid_disks; int data_disks = raid_disks - conf->max_degraded; -@@ -3661,11 +3659,11 @@ static sector_t reshape_request(mddev_t +@@ -3662,11 +3660,11 @@ static sector_t reshape_request(mddev_t */ first_sector = raid5_compute_sector(conf, sector_nr*(new_data_disks), @@ -306,7 +306,7 @@ Signed-off-by: NeilBrown if (last_sector >= (mddev->size<<1)) last_sector = (mddev->size<<1)-1; while (first_sector <= last_sector) { -@@ -3800,7 +3798,7 @@ static int retry_aligned_read(raid5_con +@@ -3801,7 +3799,7 @@ static int retry_aligned_read(raid5_con * it will be only one 'dd_idx' and only need one call to raid5_compute_sector. */ struct stripe_head *sh; @@ -315,7 +315,7 @@ Signed-off-by: NeilBrown sector_t sector, logical_sector, last_sector; int scnt = 0; int remaining; -@@ -3808,7 +3806,7 @@ static int retry_aligned_read(raid5_con +@@ -3809,7 +3807,7 @@ static int retry_aligned_read(raid5_con logical_sector = raid_bio->bi_sector & ~((sector_t)STRIPE_SECTORS-1); sector = raid5_compute_sector(conf, logical_sector, diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch b/src/patches/suse-2.6.27.31/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch index 2dbc2d72e..5d2c7aac5 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0013-md-raid5-Add-support-for-new-layouts-for-raid5-and-r.patch @@ -254,7 +254,7 @@ Signed-off-by: NeilBrown logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1); last_sector = bi->bi_sector + (bi->bi_size>>9); -@@ -4034,6 +4155,12 @@ static int run(mddev_t *mddev) +@@ -4035,6 +4156,12 @@ static int run(mddev_t *mddev) mdname(mddev), mddev->level); return -EIO; } @@ -267,7 +267,7 @@ Signed-off-by: NeilBrown if (mddev->chunk_size < PAGE_SIZE) { printk(KERN_ERR "md/raid5: chunk_size must be at least " -@@ -4185,12 +4312,6 @@ static int run(mddev_t *mddev) +@@ -4186,12 +4313,6 @@ static int run(mddev_t *mddev) conf->chunk_size, mdname(mddev)); goto abort; } diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0014-md-raid5-finish-support-for-DDF-raid6.patch b/src/patches/suse-2.6.27.31/patches.fixes/0014-md-raid5-finish-support-for-DDF-raid6.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0014-md-raid5-finish-support-for-DDF-raid6.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0014-md-raid5-finish-support-for-DDF-raid6.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0015-md-add-size-as-a-personality-method.patch b/src/patches/suse-2.6.27.31/patches.fixes/0015-md-add-size-as-a-personality-method.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0015-md-add-size-as-a-personality-method.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0015-md-add-size-as-a-personality-method.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0016-md-centralize-array_sectors-modifications.patch b/src/patches/suse-2.6.27.31/patches.fixes/0016-md-centralize-array_sectors-modifications.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0016-md-centralize-array_sectors-modifications.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0016-md-centralize-array_sectors-modifications.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0017-md-array_size-sysfs-attribute.patch b/src/patches/suse-2.6.27.31/patches.fixes/0017-md-array_size-sysfs-attribute.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0017-md-array_size-sysfs-attribute.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0017-md-array_size-sysfs-attribute.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/0017A-md-array_size-sysfs-arrtibute.patch b/src/patches/suse-2.6.27.31/patches.fixes/0017A-md-array_size-sysfs-arrtibute.patch new file mode 100644 index 000000000..40d74ea91 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/0017A-md-array_size-sysfs-arrtibute.patch @@ -0,0 +1,222 @@ +From: NeilBrown +Subject: [PATCH] md: 'array_size' sysfs attribute +References: bnc#498358 + +Allow userspace to set the size of the array according to the following +semantics: + +1/ size must be <= to the size stored in mddev->array_size + a) If size is set before the array is running, do_md_run will fail + if size is greater than the default size + b) A reshape attempt that reduces the default size to less than the set + array size should be blocked +2/ once userspace sets the size the kernel will not change it +3/ writing 'default' to this attribute returns control of the size to the + kernel and reverts to the size reported by the personality + +To avoid kabi break we store the user-specified size in ->queue->end_sector +which is otherwise unused by md devices. + +(based on a patch which was) +Signed-off-by: Dan Williams +Signed-off-by: NeilBrown +Acked-by: NeilBrown +--- + drivers/md/linear.c | 3 + + drivers/md/md.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++-- + drivers/md/raid1.c | 14 ++++---- + drivers/md/raid5.c | 9 +++-- + 4 files changed, 99 insertions(+), 12 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/linear.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/linear.c +@@ -295,7 +295,8 @@ static int linear_add(mddev_t *mddev, md + mddev->private = newconf; + mddev->raid_disks++; + mddev->array_sectors = newconf->array_sectors; +- set_capacity(mddev->gendisk, mddev->array_sectors); ++ if (mddev->queue->end_sector == 0) ++ set_capacity(mddev->gendisk, mddev->array_sectors); + return 0; + } + +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -287,6 +287,7 @@ static mddev_t * mddev_find(dev_t unit) + kfree(new); + return NULL; + } ++ new->queue->end_sector = 0; + /* Can be unlocked because the queue is new: no concurrency */ + queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, new->queue); + +@@ -2136,6 +2137,25 @@ rdev_size_show(mdk_rdev_t *rdev, char *p + return sprintf(page, "%llu\n", (unsigned long long)rdev->size); + } + ++static int strict_blocks_to_sectors(const char *buf, sector_t *sectors) ++{ ++ unsigned long long blocks; ++ sector_t new; ++ ++ if (strict_strtoull(buf, 10, &blocks) < 0) ++ return -EINVAL; ++ ++ if (blocks & 1ULL << (8 * sizeof(blocks) - 1)) ++ return -EINVAL; /* sector conversion overflow */ ++ ++ new = blocks * 2; ++ if (new != blocks * 2) ++ return -EINVAL; /* unsigned long long to sector_t overflow */ ++ ++ *sectors = new; ++ return 0; ++} ++ + static int overlaps(sector_t s1, sector_t l1, sector_t s2, sector_t l2) + { + /* check if two start/length pairs overlap */ +@@ -3397,6 +3417,55 @@ static struct md_sysfs_entry md_reshape_ + __ATTR(reshape_position, S_IRUGO|S_IWUSR, reshape_position_show, + reshape_position_store); + ++static ssize_t ++array_size_show(mddev_t *mddev, char *page) ++{ ++ if (mddev->queue->end_sector) ++ return sprintf(page, "%llu\n", ++ (unsigned long long)mddev->queue->end_sector/2); ++ else ++ return sprintf(page, "default\n"); ++} ++ ++static ssize_t ++array_size_store(mddev_t *mddev, const char *buf, size_t len) ++{ ++ sector_t sectors; ++ ++ if (strncmp(buf, "default", 7) == 0) { ++ sectors = mddev->array_sectors; ++ ++ mddev->queue->end_sector = 0; ++ } else { ++ if (strict_blocks_to_sectors(buf, §ors) < 0) ++ return -EINVAL; ++ if (sectors < 2) ++ return -EINVAL; ++ if (mddev->pers && mddev->array_sectors < sectors) ++ return -E2BIG; ++ ++ mddev->queue->end_sector = sectors; ++ } ++ ++ set_capacity(mddev->gendisk, sectors); ++ if (mddev->pers) { ++ struct block_device *bdev = bdget_disk(mddev->gendisk, 0); ++ ++ if (bdev) { ++ mutex_lock(&bdev->bd_inode->i_mutex); ++ i_size_write(bdev->bd_inode, ++ (loff_t)sectors << 9); ++ mutex_unlock(&bdev->bd_inode->i_mutex); ++ bdput(bdev); ++ } ++ } ++ ++ return len; ++} ++ ++static struct md_sysfs_entry md_array_size = ++__ATTR(array_size, S_IRUGO|S_IWUSR, array_size_show, ++ array_size_store); + + static struct attribute *md_default_attrs[] = { + &md_level.attr, +@@ -3410,6 +3479,7 @@ static struct attribute *md_default_attr + &md_safe_delay.attr, + &md_array_state.attr, + &md_reshape_position.attr, ++ &md_array_size.attr, + NULL, + }; + +@@ -3721,7 +3791,15 @@ static int do_md_run(mddev_t * mddev) + err = mddev->pers->run(mddev); + if (err) + printk(KERN_ERR "md: pers->run() failed ...\n"); +- else if (mddev->pers->sync_request) { ++ else if (mddev->queue->end_sector && ++ mddev->queue->end_sector > mddev->array_sectors) { ++ printk(KERN_ERR ++ "md: invalid array_size %llu > default size %llu\n", ++ (unsigned long long)mddev->queue->end_sector / 2, ++ (unsigned long long)mddev->array_sectors / 2); ++ err = -EINVAL; ++ mddev->pers->stop(mddev); ++ } else if (mddev->pers->sync_request) { + err = bitmap_create(mddev); + if (err) { + printk(KERN_ERR "%s: failed to create bitmap (%d)\n", +@@ -3764,7 +3842,10 @@ static int do_md_run(mddev_t * mddev) + if (mddev->flags) + md_update_sb(mddev, 0); + +- set_capacity(disk, mddev->array_sectors); ++ if (mddev->queue->end_sector) ++ set_capacity(disk, mddev->queue->end_sector); ++ else ++ set_capacity(disk, mddev->array_sectors); + + /* If we call blk_queue_make_request here, it will + * re-initialise max_sectors etc which may have been +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/raid1.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/raid1.c +@@ -2108,12 +2108,14 @@ static int raid1_resize(mddev_t *mddev, + * worth it. + */ + mddev->array_sectors = sectors; +- set_capacity(mddev->gendisk, mddev->array_sectors); +- mddev->changed = 1; +- if (mddev->array_sectors / 2 > mddev->size && +- mddev->recovery_cp == MaxSector) { +- mddev->recovery_cp = mddev->size << 1; +- set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); ++ if (mddev->queue->end_sector == 0) { ++ set_capacity(mddev->gendisk, mddev->array_sectors); ++ mddev->changed = 1; ++ if (mddev->array_sectors / 2 > mddev->size && ++ mddev->recovery_cp == MaxSector) { ++ mddev->recovery_cp = mddev->size << 1; ++ set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); ++ } + } + mddev->size = mddev->array_sectors / 2; + mddev->resync_max_sectors = sectors; +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/raid5.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/raid5.c +@@ -4650,7 +4650,8 @@ static int raid5_resize(mddev_t *mddev, + sectors &= ~((sector_t)mddev->chunk_size/512 - 1); + mddev->array_sectors = sectors * (mddev->raid_disks + - conf->max_degraded); +- set_capacity(mddev->gendisk, mddev->array_sectors); ++ if (mddev->queue->end_sector == 0) ++ set_capacity(mddev->gendisk, mddev->array_sectors); + mddev->changed = 1; + if (sectors/2 > mddev->size && mddev->recovery_cp == MaxSector) { + mddev->recovery_cp = mddev->size << 1; +@@ -4788,11 +4789,13 @@ static void end_reshape(raid5_conf_t *co + if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { + conf->mddev->array_sectors = 2 * conf->mddev->size * + (conf->raid_disks - conf->max_degraded); +- set_capacity(conf->mddev->gendisk, conf->mddev->array_sectors); ++ if (conf->mddev->queue->end_sector == 0) ++ set_capacity(conf->mddev->gendisk, ++ conf->mddev->array_sectors); + conf->mddev->changed = 1; + + bdev = bdget_disk(conf->mddev->gendisk, 0); +- if (bdev) { ++ if (bdev && conf->mddev->queue->end_sector == 0) { + mutex_lock(&bdev->bd_inode->i_mutex); + i_size_write(bdev->bd_inode, + (loff_t)conf->mddev->array_sectors << 9); diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch b/src/patches/suse-2.6.27.31/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch similarity index 81% rename from src/patches/suse-2.6.27.25/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch index e1c2b8f00..f9c44bc10 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch @@ -11,9 +11,9 @@ Signed-off-by: NeilBrown drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---- a/drivers/md/raid5.c -+++ b/drivers/md/raid5.c -@@ -4199,7 +4199,7 @@ static int run(mddev_t *mddev) +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/raid5.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/raid5.c +@@ -4200,7 +4200,7 @@ static int run(mddev_t *mddev) */ sector_t here_new, here_old; int old_disks; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch b/src/patches/suse-2.6.27.31/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch similarity index 81% rename from src/patches/suse-2.6.27.25/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch index 304f5dcb4..841551aad 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch @@ -14,9 +14,9 @@ Signed-off-by: NeilBrown drivers/md/md.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -1949,6 +1949,7 @@ state_store(mdk_rdev_t *rdev, const char +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -1950,6 +1950,7 @@ state_store(mdk_rdev_t *rdev, const char * -writemostly - clears write_mostly * blocked - sets the Blocked flag * -blocked - clears the Blocked flag @@ -24,7 +24,7 @@ Signed-off-by: NeilBrown */ int err = -EINVAL; if (cmd_match(buf, "faulty") && rdev->mddev->pers) { -@@ -1981,6 +1982,9 @@ state_store(mdk_rdev_t *rdev, const char +@@ -1982,6 +1983,9 @@ state_store(mdk_rdev_t *rdev, const char md_wakeup_thread(rdev->mddev->thread); err = 0; @@ -34,7 +34,7 @@ Signed-off-by: NeilBrown } if (!err) sysfs_notify(&rdev->kobj, NULL, "state"); -@@ -2054,7 +2058,7 @@ slot_store(mdk_rdev_t *rdev, const char +@@ -2055,7 +2059,7 @@ slot_store(mdk_rdev_t *rdev, const char mdk_rdev_t *rdev2; struct list_head *tmp; /* Activating a spare .. or possibly reactivating diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch b/src/patches/suse-2.6.27.31/patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch b/src/patches/suse-2.6.27.31/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch similarity index 93% rename from src/patches/suse-2.6.27.25/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch index 8c1a81c69..c94297d42 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0024-md-tidy-up-status_resync-to-handle-large-arrays.patch @@ -27,9 +27,9 @@ Signed-off-by: NeilBrown drivers/md/md.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -5257,37 +5257,38 @@ static void status_unused(struct seq_fil +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -5340,37 +5340,38 @@ static void status_unused(struct seq_fil static void status_resync(struct seq_file *seq, mddev_t * mddev) { @@ -49,7 +49,7 @@ Signed-off-by: NeilBrown + max_sectors = mddev->resync_max_sectors; else - max_blocks = mddev->size; -+ max_sectors = mddev->size; ++ max_sectors = mddev->size << 1; /* * Should not happen. @@ -77,7 +77,7 @@ Signed-off-by: NeilBrown per_milli = res; { -@@ -5308,25 +5309,35 @@ static void status_resync(struct seq_fil +@@ -5391,25 +5392,35 @@ static void status_resync(struct seq_fil (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ? "resync" : "recovery"))), per_milli/10, per_milli % 10, diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch b/src/patches/suse-2.6.27.31/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch similarity index 84% rename from src/patches/suse-2.6.27.25/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch index d9e6d2ee8..c370e1d4f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/0026-md-remove-rd-d-links-immediately-after-stopping-an-a.patch @@ -24,9 +24,9 @@ Signed-off-by: NeilBrown drivers/md/md.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -3877,6 +3877,7 @@ static int do_md_stop(mddev_t * mddev, i +--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c ++++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c +@@ -3960,6 +3960,7 @@ static int do_md_stop(mddev_t * mddev, i { int err = 0; struct gendisk *disk = mddev->gendisk; @@ -34,7 +34,7 @@ Signed-off-by: NeilBrown if (atomic_read(&mddev->openers) > is_open) { printk("md: %s still in use.\n",mdname(mddev)); -@@ -3919,6 +3920,13 @@ static int do_md_stop(mddev_t * mddev, i +@@ -4002,6 +4003,13 @@ static int do_md_stop(mddev_t * mddev, i /* tell userspace to handle 'inactive' */ sysfs_notify(&mddev->kobj, NULL, "array_state"); @@ -48,7 +48,7 @@ Signed-off-by: NeilBrown set_capacity(disk, 0); mddev->changed = 1; -@@ -3939,8 +3947,6 @@ static int do_md_stop(mddev_t * mddev, i +@@ -4022,8 +4030,6 @@ static int do_md_stop(mddev_t * mddev, i * Free resources if final stop */ if (mode == 0) { @@ -57,7 +57,7 @@ Signed-off-by: NeilBrown printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); -@@ -3952,13 +3958,6 @@ static int do_md_stop(mddev_t * mddev, i +@@ -4035,13 +4041,6 @@ static int do_md_stop(mddev_t * mddev, i } mddev->bitmap_offset = 0; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0027-md-improve-errno-return-when-setting-array_size.patch b/src/patches/suse-2.6.27.31/patches.fixes/0027-md-improve-errno-return-when-setting-array_size.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0027-md-improve-errno-return-when-setting-array_size.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0027-md-improve-errno-return-when-setting-array_size.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/0028-md-add-explicit-method-to-signal-the-end-of-a-reshap.patch b/src/patches/suse-2.6.27.31/patches.fixes/0028-md-add-explicit-method-to-signal-the-end-of-a-reshap.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/0028-md-add-explicit-method-to-signal-the-end-of-a-reshap.patch rename to src/patches/suse-2.6.27.31/patches.fixes/0028-md-add-explicit-method-to-signal-the-end-of-a-reshap.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/Hibernate-Take-overlapping-zones-into-account-rev-2.patch b/src/patches/suse-2.6.27.31/patches.fixes/Hibernate-Take-overlapping-zones-into-account-rev-2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/Hibernate-Take-overlapping-zones-into-account-rev-2.patch rename to src/patches/suse-2.6.27.31/patches.fixes/Hibernate-Take-overlapping-zones-into-account-rev-2.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch b/src/patches/suse-2.6.27.31/patches.fixes/NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch new file mode 100644 index 000000000..0fadf39fa --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch @@ -0,0 +1,38 @@ +Patch-mainline: 2.6.31 +From: b64aec8d1e1d8482a7b6cca60c8105c756bf1fe4 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Tue, 21 Jul 2009 16:47:46 -0400 +Subject: [PATCH] NFSv4: Fix an Oops in nfs4_free_lock_state + +The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to +be due to the nfs4_lock_state->ls_state field being uninitialised. This +happens if the call to nfs4_free_lock_state() is triggered at the end of +nfs4_get_lock_state(). + +The fix is to move the initialisation of ls_state into the allocator. + +Signed-off-by: Trond Myklebust +Acked-by: NeilBrown + +--- + fs/nfs/nfs4state.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/nfs4state.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfs/nfs4state.c +@@ -545,6 +545,7 @@ static struct nfs4_lock_state *nfs4_allo + INIT_LIST_HEAD(&lsp->ls_sequence.list); + lsp->ls_seqid.sequence = &lsp->ls_sequence; + atomic_set(&lsp->ls_count, 1); ++ lsp->ls_state = state; + lsp->ls_owner = fl_owner; + spin_lock(&clp->cl_lock); + nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64); +@@ -580,7 +581,6 @@ static struct nfs4_lock_state *nfs4_get_ + if (lsp != NULL) + break; + if (new != NULL) { +- new->ls_state = state; + list_add(&new->ls_locks, &state->lock_states); + set_bit(LK_STATE_IN_USE, &state->flags); + lsp = new; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/acpi_assure_unique_processor_proc_creation.patch b/src/patches/suse-2.6.27.31/patches.fixes/acpi_assure_unique_processor_proc_creation.patch new file mode 100644 index 000000000..43c6d19c5 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/acpi_assure_unique_processor_proc_creation.patch @@ -0,0 +1,71 @@ +From: Zhao Yakui +Subject: ACPI: Rename ACPI processor device bus ID +References: bnc#528769 +Patch-Mainline: yes +Commit-ID: 7a04b8491a077471a34938b8ca060c37220953be + +Signed-off-by: Thomas Renninger + +Some BIOS re-use the same processor bus id +in different scope: + + \_SB.SCK0.CPU0 + \_SB.SCK1.CPU0 + +But the (deprecated) /proc/acpi/ interface +assumes the bus-id's are unique, resulting in an OOPS +when the processor driver is loaded: + +WARNING: at fs/proc/generic.c:590 proc_register+0x148/0x180() +Hardware name: Sunrise Ridge +proc_dir_entry 'processor/CPU0' already registered +Call Trace: + [] warn_slowpath+0xb1/0xe5 + [] ? ida_get_new_above+0x190/0x1b1 + [] ? idr_pre_get+0x5f/0x75 + [] proc_register+0x148/0x180 + [] proc_mkdir_mode+0x3d/0x52 + [] proc_mkdir+0x11/0x13 + [] acpi_processor_start+0x755/0x9bc [processor] + +Rename the processor device bus id. And the new bus id will be +generated as the following format: + CPU+ CPU ID + +For example: If the cpu ID is 5, then the bus ID will be "CPU5". + If the CPU ID is 10, then the bus ID will be "CPUA". + +Yes, this will change the directory names seen +in /proc/acpi/processor/* on some systems. +Before this patch, those directory names where +totally arbitrary strings based on the interal AML device strings. + +http://bugzilla.kernel.org/show_bug.cgi?id=13612 + +Signed-off-by: Zhao Yakui +Signed-off-by: Len Brown + +--- + drivers/acpi/processor_core.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/processor_core.c ++++ b/drivers/acpi/processor_core.c +@@ -624,7 +624,16 @@ static int acpi_processor_get_info(struc + return -ENODEV; + } + } +- ++ /* ++ * On some boxes several processors use the same processor bus id. ++ * But they are located in different scope. For example: ++ * \_SB.SCK0.CPU0 ++ * \_SB.SCK1.CPU0 ++ * Rename the processor device bus id. And the new bus id will be ++ * generated as the following format: ++ * CPU+CPU ID. ++ */ ++ sprintf(acpi_device_bid(device), "CPU%X", pr->id); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, + pr->acpi_id)); + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/acpi_use_acpi_exception.patch b/src/patches/suse-2.6.27.31/patches.fixes/acpi_use_acpi_exception.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/acpi_use_acpi_exception.patch rename to src/patches/suse-2.6.27.31/patches.fixes/acpi_use_acpi_exception.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/aggressive-zone-reclaim.patch b/src/patches/suse-2.6.27.31/patches.fixes/aggressive-zone-reclaim.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/aggressive-zone-reclaim.patch rename to src/patches/suse-2.6.27.31/patches.fixes/aggressive-zone-reclaim.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/aic7xxx-leaves-timer-running-on-init-failure b/src/patches/suse-2.6.27.31/patches.fixes/aic7xxx-leaves-timer-running-on-init-failure similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/aic7xxx-leaves-timer-running-on-init-failure rename to src/patches/suse-2.6.27.31/patches.fixes/aic7xxx-leaves-timer-running-on-init-failure diff --git a/src/patches/suse-2.6.27.31/patches.fixes/altstack-avoid-copying-stack_t-as-a-structure-to-userspace b/src/patches/suse-2.6.27.31/patches.fixes/altstack-avoid-copying-stack_t-as-a-structure-to-userspace new file mode 100644 index 000000000..e15279999 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/altstack-avoid-copying-stack_t-as-a-structure-to-userspace @@ -0,0 +1,66 @@ +From: Linus Torvalds +Date: Sat, 1 Aug 2009 17:34:56 +0000 (-0700) +Subject: do_sigaltstack: avoid copying 'stack_t' as a structure to user space +Git-commit: 0083fc2c50e6c5127c2802ad323adf8143ab7856 +Patch-mainline: 2.6.31 +References: bnc#527848 + +do_sigaltstack: avoid copying 'stack_t' as a structure to user space + +Ulrich Drepper correctly points out that there is generally padding in +the structure on 64-bit hosts, and that copying the structure from +kernel to user space can leak information from the kernel stack in those +padding bytes. + +Avoid the whole issue by just copying the three members one by one +instead, which also means that the function also can avoid the need for +a stack frame. This also happens to match how we copy the new structure +from user space, so it all even makes sense. + +[ The obvious solution of adding a memset() generates horrid code, gcc + does really stupid things. ] + +Reported-by: Ulrich Drepper +Signed-off-by: Linus Torvalds +Acked-by: Jeff Mahoney +--- + + kernel/signal.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/kernel/signal.c ++++ b/kernel/signal.c +@@ -2353,11 +2353,9 @@ do_sigaltstack (const stack_t __user *us + stack_t oss; + int error; + +- if (uoss) { +- oss.ss_sp = (void __user *) current->sas_ss_sp; +- oss.ss_size = current->sas_ss_size; +- oss.ss_flags = sas_ss_flags(sp); +- } ++ oss.ss_sp = (void __user *) current->sas_ss_sp; ++ oss.ss_size = current->sas_ss_size; ++ oss.ss_flags = sas_ss_flags(sp); + + if (uss) { + void __user *ss_sp; +@@ -2400,13 +2398,16 @@ do_sigaltstack (const stack_t __user *us + current->sas_ss_size = ss_size; + } + ++ error = 0; + if (uoss) { + error = -EFAULT; +- if (copy_to_user(uoss, &oss, sizeof(oss))) ++ if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) + goto out; ++ error = __put_user(oss.ss_sp, &uoss->ss_sp) | ++ __put_user(oss.ss_size, &uoss->ss_size) | ++ __put_user(oss.ss_flags, &uoss->ss_flags); + } + +- error = 0; + out: + return error; + } diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ath5k-5211-protected-fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/ath5k-5211-protected-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ath5k-5211-protected-fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ath5k-5211-protected-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ath5k-aspire-one-led.patch b/src/patches/suse-2.6.27.31/patches.fixes/ath5k-aspire-one-led.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ath5k-aspire-one-led.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ath5k-aspire-one-led.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ath5k-ignore-calibration-return-value.patch b/src/patches/suse-2.6.27.31/patches.fixes/ath5k-ignore-calibration-return-value.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ath5k-ignore-calibration-return-value.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ath5k-ignore-calibration-return-value.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/b43legacy-fix-led_device_naming.diff b/src/patches/suse-2.6.27.31/patches.fixes/b43legacy-fix-led_device_naming.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/b43legacy-fix-led_device_naming.diff rename to src/patches/suse-2.6.27.31/patches.fixes/b43legacy-fix-led_device_naming.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue b/src/patches/suse-2.6.27.31/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue similarity index 93% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue rename to src/patches/suse-2.6.27.31/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue index aa9c42adf..ba237225f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue +++ b/src/patches/suse-2.6.27.31/patches.fixes/blk-dont-invoke-request_fn-on-stopped-queue @@ -72,7 +72,7 @@ Signed-off-by: Hannes Reinecke */ --- a/block/elevator.c +++ b/block/elevator.c -@@ -612,7 +612,7 @@ void elv_insert(struct request_queue *q, +@@ -620,7 +620,7 @@ void elv_insert(struct request_queue *q, * processing. */ blk_remove_plug(q); @@ -81,7 +81,7 @@ Signed-off-by: Hannes Reinecke break; case ELEVATOR_INSERT_SORT: -@@ -943,7 +943,7 @@ void elv_completed_request(struct reques +@@ -951,7 +951,7 @@ void elv_completed_request(struct reques blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN && blk_ordered_req_seq(first_rq) > QUEUE_ORDSEQ_DRAIN) { blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0); @@ -90,7 +90,7 @@ Signed-off-by: Hannes Reinecke } } } -@@ -1102,8 +1102,7 @@ static int elevator_switch(struct reques +@@ -1110,8 +1110,7 @@ static int elevator_switch(struct reques elv_drain_elevator(q); while (q->rq.elvpriv) { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-get-extra-reference-before-unmap b/src/patches/suse-2.6.27.31/patches.fixes/blk-get-extra-reference-before-unmap similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-get-extra-reference-before-unmap rename to src/patches/suse-2.6.27.31/patches.fixes/blk-get-extra-reference-before-unmap diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-leave-sync-timer-running b/src/patches/suse-2.6.27.31/patches.fixes/blk-leave-sync-timer-running similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-leave-sync-timer-running rename to src/patches/suse-2.6.27.31/patches.fixes/blk-leave-sync-timer-running diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-move-unplug_work-init b/src/patches/suse-2.6.27.31/patches.fixes/blk-move-unplug_work-init similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-move-unplug_work-init rename to src/patches/suse-2.6.27.31/patches.fixes/blk-move-unplug_work-init diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-set-segment-boundary-mask b/src/patches/suse-2.6.27.31/patches.fixes/blk-set-segment-boundary-mask similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-set-segment-boundary-mask rename to src/patches/suse-2.6.27.31/patches.fixes/blk-set-segment-boundary-mask diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-timeout-readd-timeout-list b/src/patches/suse-2.6.27.31/patches.fixes/blk-timeout-readd-timeout-list similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-timeout-readd-timeout-list rename to src/patches/suse-2.6.27.31/patches.fixes/blk-timeout-readd-timeout-list diff --git a/src/patches/suse-2.6.27.25/patches.fixes/blk-timeout-splice-timeout-list b/src/patches/suse-2.6.27.31/patches.fixes/blk-timeout-splice-timeout-list similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/blk-timeout-splice-timeout-list rename to src/patches/suse-2.6.27.31/patches.fixes/blk-timeout-splice-timeout-list diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-add-comment-in-blk_rq_timed_out b/src/patches/suse-2.6.27.31/patches.fixes/block-add-comment-in-blk_rq_timed_out similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-add-comment-in-blk_rq_timed_out rename to src/patches/suse-2.6.27.31/patches.fixes/block-add-comment-in-blk_rq_timed_out diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-discard-requests b/src/patches/suse-2.6.27.31/patches.fixes/block-discard-requests similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-discard-requests rename to src/patches/suse-2.6.27.31/patches.fixes/block-discard-requests diff --git a/src/patches/suse-2.6.27.31/patches.fixes/block-failfast-merge-fix b/src/patches/suse-2.6.27.31/patches.fixes/block-failfast-merge-fix new file mode 100644 index 000000000..33e4fb9f2 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/block-failfast-merge-fix @@ -0,0 +1,67 @@ +From ab0fd1debe730ec9998678a0c53caefbd121ed10 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 3 Jul 2009 12:56:18 +0200 +Subject: [PATCH] block: don't merge requests of different failfast settings +References: bnc#519111 + +Block layer used to merge requests and bios with different failfast +settings. This caused regular IOs to fail prematurely when they were +merged into failfast requests for readahead. + +Niel Lambrechts could trigger the problem semi-reliably on ext4 when +resuming from STR. ext4 uses readahead when reading inodes and +combined with the deterministic extra SATA PHY exception cycle during +resume on the specific configuration, non-readahead inode read would +fail causing ext4 errors. Please read the following thread for +details. + + http://lkml.org/lkml/2009/5/23/21 + +This patch makes block layer reject merging if the failfast settings +don't match. This is correct but likely to lower IO performance by +preventing regular IOs from mingling into surrounding readahead +requests. Changes to allow such mixed merges and handle errors +correctly will be added later. + +Signed-off-by: Tejun Heo +Reported-by: Niel Lambrechts +Cc: Theodore Tso +Signed-off-by: Jens Axboe +Signed-off-by: Tejun Heo +--- + block/blk-merge.c | 6 ++++++ + block/elevator.c | 8 ++++++++ + 2 files changed, 14 insertions(+) + +--- a/block/blk-merge.c ++++ b/block/blk-merge.c +@@ -376,6 +376,12 @@ static int attempt_merge(struct request_ + if (blk_integrity_rq(req) != blk_integrity_rq(next)) + return 0; + ++ /* don't merge requests of different failfast settings */ ++ if (blk_failfast_dev(req) != blk_failfast_dev(next) || ++ blk_failfast_transport(req) != blk_failfast_transport(next) || ++ blk_failfast_driver(req) != blk_failfast_driver(next)) ++ return 0; ++ + /* + * If we are allowed to merge, then append bio list + * from next to rq and release next. merge_requests_fn +--- a/block/elevator.c ++++ b/block/elevator.c +@@ -97,6 +97,14 @@ int elv_rq_merge_ok(struct request *rq, + if (bio_integrity(bio) != blk_integrity_rq(rq)) + return 0; + ++ /* ++ * Don't merge if failfast settings don't match ++ */ ++ if (!bio_failfast_dev(bio) != !blk_failfast_dev(rq) || ++ !bio_failfast_transport(bio) != !blk_failfast_transport(rq) || ++ !bio_failfast_driver(bio) != !blk_failfast_driver(rq)) ++ return 0; ++ + if (!elv_iosched_allow_merge(rq, bio)) + return 0; + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-fix-blk_start_queueing b/src/patches/suse-2.6.27.31/patches.fixes/block-fix-blk_start_queueing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-fix-blk_start_queueing rename to src/patches/suse-2.6.27.31/patches.fixes/block-fix-blk_start_queueing diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-get-rid-of-the-manual-directory-counting-in-blktrace.patch b/src/patches/suse-2.6.27.31/patches.fixes/block-get-rid-of-the-manual-directory-counting-in-blktrace.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-get-rid-of-the-manual-directory-counting-in-blktrace.patch rename to src/patches/suse-2.6.27.31/patches.fixes/block-get-rid-of-the-manual-directory-counting-in-blktrace.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-git-fixes b/src/patches/suse-2.6.27.31/patches.fixes/block-git-fixes similarity index 98% rename from src/patches/suse-2.6.27.25/patches.fixes/block-git-fixes rename to src/patches/suse-2.6.27.31/patches.fixes/block-git-fixes index bce592bf5..9958f7ff2 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/block-git-fixes +++ b/src/patches/suse-2.6.27.31/patches.fixes/block-git-fixes @@ -47,6 +47,57 @@ Signed-off-by: Hannes Reinecke include/linux/blkdev.h | 18 +-- 23 files changed, 310 insertions(+), 374 deletions(-) +--- a/Documentation/DocBook/kernel-api.tmpl ++++ b/Documentation/DocBook/kernel-api.tmpl +@@ -364,6 +364,10 @@ X!Edrivers/pnp/system.c + !Eblock/blk-barrier.c + !Eblock/blk-tag.c + !Iblock/blk-tag.c ++!Eblock/blk-integrity.c ++!Iblock/blktrace.c ++!Iblock/genhd.c ++!Eblock/genhd.c + + + +--- a/Documentation/block/deadline-iosched.txt ++++ b/Documentation/block/deadline-iosched.txt +@@ -30,12 +30,18 @@ write_expire (in ms) + Similar to read_expire mentioned above, but for writes. + + +-fifo_batch ++fifo_batch (number of requests) + ---------- + +-When a read request expires its deadline, we must move some requests from +-the sorted io scheduler list to the block device dispatch queue. fifo_batch +-controls how many requests we move. ++Requests are grouped into ``batches'' of a particular data direction (read or ++write) which are serviced in increasing sector order. To limit extra seeking, ++deadline expiries are only checked between batches. fifo_batch controls the ++maximum number of requests per batch. ++ ++This parameter tunes the balance between per-request latency and aggregate ++throughput. When low latency is the primary concern, smaller is better (where ++a value of 1 yields first-come first-served behaviour). Increasing fifo_batch ++generally improves throughput, at the cost of latency variation. + + + writes_starved (number of dispatches) +--- a/block/Makefile ++++ b/block/Makefile +@@ -4,8 +4,8 @@ + + obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ + blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \ +- blk-exec.o blk-merge.o ioctl.o genhd.o scsi_ioctl.o \ +- cmd-filter.o ++ blk-exec.o blk-merge.o blk-softirq.o ioctl.o genhd.o \ ++ scsi_ioctl.o cmd-filter.o + + obj-$(CONFIG_BLK_DEV_BSG) += bsg.o + obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o --- a/block/blk-core.c +++ b/block/blk-core.c @@ -26,8 +26,6 @@ @@ -976,7 +1027,7 @@ Signed-off-by: Hannes Reinecke /* * idle window management -@@ -654,15 +662,6 @@ static void cfq_activate_request(struct +@@ -654,15 +662,6 @@ static void cfq_activate_request(struct cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d", cfqd->rq_in_driver); @@ -1099,7 +1150,7 @@ Signed-off-by: Hannes Reinecke } static inline void -@@ -91,7 +91,7 @@ deadline_del_rq_rb(struct deadline_data +@@ -91,7 +91,7 @@ deadline_del_rq_rb(struct deadline_data if (dd->next_rq[data_dir] == rq) dd->next_rq[data_dir] = deadline_latter_request(rq); @@ -1177,7 +1228,7 @@ Signed-off-by: Hannes Reinecke static DEFINE_SPINLOCK(elv_list_lock); static LIST_HEAD(elv_list); -@@ -790,7 +789,6 @@ struct request *elv_next_request(struct +@@ -790,7 +789,6 @@ struct request *elv_next_request(struct * device can handle */ rq->nr_phys_segments++; @@ -1185,7 +1236,7 @@ Signed-off-by: Hannes Reinecke } if (!q->prep_rq_fn) -@@ -813,7 +811,6 @@ struct request *elv_next_request(struct +@@ -813,7 +811,6 @@ struct request *elv_next_request(struct * so that we don't add it again */ --rq->nr_phys_segments; @@ -1209,57 +1260,6 @@ Signed-off-by: Hannes Reinecke */ struct gendisk *get_gendisk(dev_t devt, int *part) { ---- a/block/Makefile -+++ b/block/Makefile -@@ -4,8 +4,8 @@ - - obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ - blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \ -- blk-exec.o blk-merge.o ioctl.o genhd.o scsi_ioctl.o \ -- cmd-filter.o -+ blk-exec.o blk-merge.o blk-softirq.o ioctl.o genhd.o \ -+ scsi_ioctl.o cmd-filter.o - - obj-$(CONFIG_BLK_DEV_BSG) += bsg.o - obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o ---- a/Documentation/block/deadline-iosched.txt -+++ b/Documentation/block/deadline-iosched.txt -@@ -30,12 +30,18 @@ write_expire (in ms) - Similar to read_expire mentioned above, but for writes. - - --fifo_batch -+fifo_batch (number of requests) - ---------- - --When a read request expires its deadline, we must move some requests from --the sorted io scheduler list to the block device dispatch queue. fifo_batch --controls how many requests we move. -+Requests are grouped into ``batches'' of a particular data direction (read or -+write) which are serviced in increasing sector order. To limit extra seeking, -+deadline expiries are only checked between batches. fifo_batch controls the -+maximum number of requests per batch. -+ -+This parameter tunes the balance between per-request latency and aggregate -+throughput. When low latency is the primary concern, smaller is better (where -+a value of 1 yields first-come first-served behaviour). Increasing fifo_batch -+generally improves throughput, at the cost of latency variation. - - - writes_starved (number of dispatches) ---- a/Documentation/DocBook/kernel-api.tmpl -+++ b/Documentation/DocBook/kernel-api.tmpl -@@ -364,6 +364,10 @@ X!Edrivers/pnp/system.c - !Eblock/blk-barrier.c - !Eblock/blk-tag.c - !Iblock/blk-tag.c -+!Eblock/blk-integrity.c -+!Iblock/blktrace.c -+!Iblock/genhd.c -+!Eblock/genhd.c - - - --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -199,7 +199,8 @@ static void ps3disk_do_request(struct ps @@ -1294,7 +1294,7 @@ Signed-off-by: Hannes Reinecke static unsigned long ps3disk_mask; --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c -@@ -84,11 +84,11 @@ static bool do_req(struct request_queue +@@ -84,11 +84,11 @@ static bool do_req(struct request_queue if (blk_fs_request(vbr->req)) { vbr->out_hdr.type = 0; vbr->out_hdr.sector = vbr->req->sector; @@ -1308,26 +1308,6 @@ Signed-off-by: Hannes Reinecke } else { /* We don't put anything else in the queue. */ BUG(); ---- a/drivers/md/raid10.c -+++ b/drivers/md/raid10.c -@@ -1346,9 +1346,6 @@ static void sync_request_write(mddev_t * - tbio->bi_size = r10_bio->sectors << 9; - tbio->bi_idx = 0; - tbio->bi_phys_segments = 0; -- tbio->bi_hw_segments = 0; -- tbio->bi_hw_front_size = 0; -- tbio->bi_hw_back_size = 0; - tbio->bi_flags &= ~(BIO_POOL_MASK - 1); - tbio->bi_flags |= 1 << BIO_UPTODATE; - tbio->bi_next = NULL; -@@ -1948,7 +1945,6 @@ static sector_t sync_request(mddev_t *md - bio->bi_vcnt = 0; - bio->bi_idx = 0; - bio->bi_phys_segments = 0; -- bio->bi_hw_segments = 0; - bio->bi_size = 0; - } - --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1303,9 +1303,6 @@ static void sync_request_write(mddev_t * @@ -1348,6 +1328,26 @@ Signed-off-by: Hannes Reinecke bio->bi_size = 0; bio->bi_end_io = NULL; bio->bi_private = NULL; +--- a/drivers/md/raid10.c ++++ b/drivers/md/raid10.c +@@ -1346,9 +1346,6 @@ static void sync_request_write(mddev_t * + tbio->bi_size = r10_bio->sectors << 9; + tbio->bi_idx = 0; + tbio->bi_phys_segments = 0; +- tbio->bi_hw_segments = 0; +- tbio->bi_hw_front_size = 0; +- tbio->bi_hw_back_size = 0; + tbio->bi_flags &= ~(BIO_POOL_MASK - 1); + tbio->bi_flags |= 1 << BIO_UPTODATE; + tbio->bi_next = NULL; +@@ -1948,7 +1945,6 @@ static sector_t sync_request(mddev_t *md + bio->bi_vcnt = 0; + bio->bi_idx = 0; + bio->bi_phys_segments = 0; +- bio->bi_hw_segments = 0; + bio->bi_size = 0; + } + --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -101,6 +101,40 @@ @@ -1477,7 +1477,7 @@ Signed-off-by: Hannes Reinecke return 0; if (q->merge_bvec_fn) -@@ -3468,7 +3504,7 @@ static int make_request(struct request_q +@@ -3469,7 +3505,7 @@ static int make_request(struct request_q } spin_lock_irq(&conf->device_lock); @@ -1486,7 +1486,7 @@ Signed-off-by: Hannes Reinecke spin_unlock_irq(&conf->device_lock); if (remaining == 0) { -@@ -3752,7 +3788,7 @@ static int retry_aligned_read(raid5_con +@@ -3753,7 +3789,7 @@ static int retry_aligned_read(raid5_con sector += STRIPE_SECTORS, scnt++) { @@ -1495,7 +1495,7 @@ Signed-off-by: Hannes Reinecke /* already done this stripe */ continue; -@@ -3760,7 +3796,7 @@ static int retry_aligned_read(raid5_con +@@ -3761,7 +3797,7 @@ static int retry_aligned_read(raid5_con if (!sh) { /* failed to get a stripe - must wait */ @@ -1504,7 +1504,7 @@ Signed-off-by: Hannes Reinecke conf->retry_read_aligned = raid_bio; return handled; } -@@ -3768,7 +3804,7 @@ static int retry_aligned_read(raid5_con +@@ -3769,7 +3805,7 @@ static int retry_aligned_read(raid5_con set_bit(R5_ReadError, &sh->dev[dd_idx].flags); if (!add_stripe_bio(sh, raid_bio, dd_idx, 0)) { release_stripe(sh); @@ -1513,7 +1513,7 @@ Signed-off-by: Hannes Reinecke conf->retry_read_aligned = raid_bio; return handled; } -@@ -3778,7 +3814,7 @@ static int retry_aligned_read(raid5_con +@@ -3779,7 +3815,7 @@ static int retry_aligned_read(raid5_con handled++; } spin_lock_irq(&conf->device_lock); @@ -1634,7 +1634,7 @@ Signed-off-by: Hannes Reinecke #define BIO_CLONED 4 /* doesn't own data */ #define BIO_BOUNCED 5 /* bio is a bounce bio */ #define BIO_USER_MAPPED 6 /* contains user pages */ -@@ -247,8 +221,6 @@ static inline void *bio_data(struct bio +@@ -247,8 +221,6 @@ static inline void *bio_data(struct bio ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) #endif diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-integrity-update b/src/patches/suse-2.6.27.31/patches.fixes/block-integrity-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-integrity-update rename to src/patches/suse-2.6.27.31/patches.fixes/block-integrity-update diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-optimizations-in-blk_rq_timed_out_timer b/src/patches/suse-2.6.27.31/patches.fixes/block-optimizations-in-blk_rq_timed_out_timer similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-optimizations-in-blk_rq_timed_out_timer rename to src/patches/suse-2.6.27.31/patches.fixes/block-optimizations-in-blk_rq_timed_out_timer diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-rq-affinity b/src/patches/suse-2.6.27.31/patches.fixes/block-rq-affinity similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-rq-affinity rename to src/patches/suse-2.6.27.31/patches.fixes/block-rq-affinity diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-sanitize-invalid-partition-table-entries b/src/patches/suse-2.6.27.31/patches.fixes/block-sanitize-invalid-partition-table-entries similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-sanitize-invalid-partition-table-entries rename to src/patches/suse-2.6.27.31/patches.fixes/block-sanitize-invalid-partition-table-entries diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-suppress-buffer-IO-errors b/src/patches/suse-2.6.27.31/patches.fixes/block-suppress-buffer-IO-errors similarity index 98% rename from src/patches/suse-2.6.27.25/patches.fixes/block-suppress-buffer-IO-errors rename to src/patches/suse-2.6.27.31/patches.fixes/block-suppress-buffer-IO-errors index e281f13cb..2c9ca3934 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/block-suppress-buffer-IO-errors +++ b/src/patches/suse-2.6.27.31/patches.fixes/block-suppress-buffer-IO-errors @@ -116,7 +116,7 @@ Signed-off-by: Hannes Reinecke buffer_io_error(bh); printk(KERN_WARNING "lost page write due to " "I/O error on %s\n", -@@ -2923,6 +2931,9 @@ static void end_bio_bh_io_sync(struct bi +@@ -2958,6 +2966,9 @@ static void end_bio_bh_io_sync(struct bi set_bit(BH_Eopnotsupp, &bh->b_state); } diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-use-bio_has_data b/src/patches/suse-2.6.27.31/patches.fixes/block-use-bio_has_data similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-use-bio_has_data rename to src/patches/suse-2.6.27.31/patches.fixes/block-use-bio_has_data diff --git a/src/patches/suse-2.6.27.25/patches.fixes/block-use-round_jiffies_up b/src/patches/suse-2.6.27.31/patches.fixes/block-use-round_jiffies_up similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/block-use-round_jiffies_up rename to src/patches/suse-2.6.27.31/patches.fixes/block-use-round_jiffies_up diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bnx2x-block-nvram-access-when-device-is-inactive b/src/patches/suse-2.6.27.31/patches.fixes/bnx2x-block-nvram-access-when-device-is-inactive similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bnx2x-block-nvram-access-when-device-is-inactive rename to src/patches/suse-2.6.27.31/patches.fixes/bnx2x-block-nvram-access-when-device-is-inactive diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bridge-module-get-put.patch b/src/patches/suse-2.6.27.31/patches.fixes/bridge-module-get-put.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bridge-module-get-put.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bridge-module-get-put.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bug-437171_1_sched_clock_lock.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_1_sched_clock_lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bug-437171_1_sched_clock_lock.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bug-437171_1_sched_clock_lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bug-437171_2_sched_delta_weight.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_2_sched_delta_weight.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bug-437171_2_sched_delta_weight.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bug-437171_2_sched_delta_weight.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bug-437171_3_rework_wakeup_preemption.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_3_rework_wakeup_preemption.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bug-437171_3_rework_wakeup_preemption.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bug-437171_3_rework_wakeup_preemption.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bug-437171_4_sched_reinstate_vruntime_wakeup.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-437171_4_sched_reinstate_vruntime_wakeup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bug-437171_4_sched_reinstate_vruntime_wakeup.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bug-437171_4_sched_reinstate_vruntime_wakeup.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/bug-502026_fix_apicid_panic.patch b/src/patches/suse-2.6.27.31/patches.fixes/bug-502026_fix_apicid_panic.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/bug-502026_fix_apicid_panic.patch rename to src/patches/suse-2.6.27.31/patches.fixes/bug-502026_fix_apicid_panic.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/cgroups-suppress-cloning-warning.patch b/src/patches/suse-2.6.27.31/patches.fixes/cgroups-suppress-cloning-warning.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/cgroups-suppress-cloning-warning.patch rename to src/patches/suse-2.6.27.31/patches.fixes/cgroups-suppress-cloning-warning.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/cpufreq_export_latency.patch b/src/patches/suse-2.6.27.31/patches.fixes/cpufreq_export_latency.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/cpufreq_export_latency.patch rename to src/patches/suse-2.6.27.31/patches.fixes/cpufreq_export_latency.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/cpufreq_ondemand_adjust_sampling_rate_limit.patch b/src/patches/suse-2.6.27.31/patches.fixes/cpufreq_ondemand_adjust_sampling_rate_limit.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/cpufreq_ondemand_adjust_sampling_rate_limit.patch rename to src/patches/suse-2.6.27.31/patches.fixes/cpufreq_ondemand_adjust_sampling_rate_limit.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/cpufreq_ondemand_performance_optimise_default_settings.patch b/src/patches/suse-2.6.27.31/patches.fixes/cpufreq_ondemand_performance_optimise_default_settings.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/cpufreq_ondemand_performance_optimise_default_settings.patch rename to src/patches/suse-2.6.27.31/patches.fixes/cpufreq_ondemand_performance_optimise_default_settings.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dcb-fix-setpfcstate b/src/patches/suse-2.6.27.31/patches.fixes/dcb-fix-setpfcstate similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dcb-fix-setpfcstate rename to src/patches/suse-2.6.27.31/patches.fixes/dcb-fix-setpfcstate diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dcb-setting-pg-will-cause-tx-hang b/src/patches/suse-2.6.27.31/patches.fixes/dcb-setting-pg-will-cause-tx-hang similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dcb-setting-pg-will-cause-tx-hang rename to src/patches/suse-2.6.27.31/patches.fixes/dcb-setting-pg-will-cause-tx-hang diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-Fix-uninitialised-variable-warning-in-lock.c.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-Fix-uninitialised-variable-warning-in-lock.c.patch new file mode 100644 index 000000000..6b5aad4fa --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-Fix-uninitialised-variable-warning-in-lock.c.patch @@ -0,0 +1,37 @@ +From a566a6b11c86147fe9fc9db7ab15f9eecca3e862 Mon Sep 17 00:00:00 2001 +From: Steven Whitehouse +Date: Mon, 15 Jun 2009 08:26:48 +0100 +Subject: [PATCH] dlm: Fix uninitialised variable warning in lock.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + + CC [M] fs/dlm/lock.o +fs/dlm/lock.c: In function ‘find_rsb’: +fs/dlm/lock.c:438: warning: ‘r’ may be used uninitialized in this function + +Since r is used on the error path to set r_ret, set it to NULL. + +Signed-off-by: Steven Whitehouse +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/lock.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c +index 205ec95..eb507c4 100644 +--- a/fs/dlm/lock.c ++++ b/fs/dlm/lock.c +@@ -435,7 +435,7 @@ static int search_rsb(struct dlm_ls *ls, char *name, int len, int b, + static int find_rsb(struct dlm_ls *ls, char *name, int namelen, + unsigned int flags, struct dlm_rsb **r_ret) + { +- struct dlm_rsb *r, *tmp; ++ struct dlm_rsb *r = NULL, *tmp; + uint32_t hash, bucket; + int error = -EINVAL; + +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dlm-allow-multiple-lockspaces.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-allow-multiple-lockspaces.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dlm-allow-multiple-lockspaces.patch rename to src/patches/suse-2.6.27.31/patches.fixes/dlm-allow-multiple-lockspaces.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-connect-to-nodes-earlier.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-connect-to-nodes-earlier.patch new file mode 100644 index 000000000..48a14d7e7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-connect-to-nodes-earlier.patch @@ -0,0 +1,120 @@ +From 391fbdc5d527149578490db2f1619951d91f3561 Mon Sep 17 00:00:00 2001 +From: Christine Caulfield +Date: Thu, 7 May 2009 10:54:16 -0500 +Subject: [PATCH] dlm: connect to nodes earlier + +Make network connections to other nodes earlier, in the context of +dlm_recoverd. This avoids connecting to nodes from dlm_send where we +try to avoid allocations which could possibly deadlock if memory reclaim +goes into the cluster fs which may try to do a dlm operation. + +Signed-off-by: Christine Caulfield +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/lowcomms.c | 16 +++++++++++++++- + fs/dlm/lowcomms.h | 3 ++- + fs/dlm/member.c | 11 +++++++++-- + 3 files changed, 26 insertions(+), 4 deletions(-) + +diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c +index 609108a..2559a97 100644 +--- a/fs/dlm/lowcomms.c ++++ b/fs/dlm/lowcomms.c +@@ -309,6 +309,20 @@ static void lowcomms_state_change(struct sock *sk) + lowcomms_write_space(sk); + } + ++int dlm_lowcomms_connect_node(int nodeid) ++{ ++ struct connection *con; ++ ++ if (nodeid == dlm_our_nodeid()) ++ return 0; ++ ++ con = nodeid2con(nodeid, GFP_NOFS); ++ if (!con) ++ return -ENOMEM; ++ lowcomms_connect_sock(con); ++ return 0; ++} ++ + /* Make a socket active */ + static int add_sock(struct socket *sock, struct connection *con) + { +@@ -1421,7 +1435,7 @@ static int work_start(void) + static void stop_conn(struct connection *con) + { + con->flags |= 0x0F; +- if (con->sock) ++ if (con->sock && con->sock->sk) + con->sock->sk->sk_user_data = NULL; + } + +diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h +index a9a9618..1311e64 100644 +--- a/fs/dlm/lowcomms.h ++++ b/fs/dlm/lowcomms.h +@@ -2,7 +2,7 @@ + ******************************************************************************* + ** + ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. +-** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. ++** Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. + ** + ** This copyrighted material is made available to anyone wishing to use, + ** modify, copy, or redistribute it subject to the terms and conditions +@@ -19,6 +19,7 @@ void dlm_lowcomms_stop(void); + int dlm_lowcomms_close(int nodeid); + void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc); + void dlm_lowcomms_commit_buffer(void *mh); ++int dlm_lowcomms_connect_node(int nodeid); + + #endif /* __LOWCOMMS_DOT_H__ */ + +diff --git a/fs/dlm/member.c b/fs/dlm/member.c +index 26133f0..2afb770 100644 +--- a/fs/dlm/member.c ++++ b/fs/dlm/member.c +@@ -1,7 +1,7 @@ + /****************************************************************************** + ******************************************************************************* + ** +-** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved. ++** Copyright (C) 2005-2009 Red Hat, Inc. All rights reserved. + ** + ** This copyrighted material is made available to anyone wishing to use, + ** modify, copy, or redistribute it subject to the terms and conditions +@@ -17,6 +17,7 @@ + #include "recover.h" + #include "rcom.h" + #include "config.h" ++#include "lowcomms.h" + + static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new) + { +@@ -45,7 +46,7 @@ static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new) + static int dlm_add_member(struct dlm_ls *ls, int nodeid) + { + struct dlm_member *memb; +- int w; ++ int w, error; + + memb = kzalloc(sizeof(struct dlm_member), GFP_KERNEL); + if (!memb) +@@ -57,6 +58,12 @@ static int dlm_add_member(struct dlm_ls *ls, int nodeid) + return w; + } + ++ error = dlm_lowcomms_connect_node(nodeid); ++ if (error < 0) { ++ kfree(memb); ++ return error; ++ } ++ + memb->nodeid = nodeid; + memb->weight = w; + add_ordered_member(ls, memb); +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-plock-use-after-free.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-plock-use-after-free.patch new file mode 100644 index 000000000..6cc707abb --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-plock-use-after-free.patch @@ -0,0 +1,67 @@ +From c78a87d0a1fc885dfdbe21fd5e07787691dfb068 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Thu, 18 Jun 2009 13:20:24 -0500 +Subject: [PATCH] dlm: fix plock use-after-free + +Fix a regression from the original addition of nfs lock support +586759f03e2e9031ac5589912a51a909ed53c30a. When a synchronous +(non-nfs) plock completes, the waiting thread will wake up and +free the op struct. This races with the user thread in +dev_write() which goes on to read the op's callback field to +check if the lock is async and needs a callback. This check +can happen on the freed op. The fix is to note the callback +value before the op can be freed. + +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/plock.c | 17 ++++++++++------- + 1 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c +index 894a32d..16f682e 100644 +--- a/fs/dlm/plock.c ++++ b/fs/dlm/plock.c +@@ -353,7 +353,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, + { + struct dlm_plock_info info; + struct plock_op *op; +- int found = 0; ++ int found = 0, do_callback = 0; + + if (count != sizeof(info)) + return -EINVAL; +@@ -366,21 +366,24 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, + + spin_lock(&ops_lock); + list_for_each_entry(op, &recv_list, list) { +- if (op->info.fsid == info.fsid && op->info.number == info.number && ++ if (op->info.fsid == info.fsid && ++ op->info.number == info.number && + op->info.owner == info.owner) { ++ struct plock_xop *xop = (struct plock_xop *)op; + list_del_init(&op->list); +- found = 1; +- op->done = 1; + memcpy(&op->info, &info, sizeof(info)); ++ if (xop->callback) ++ do_callback = 1; ++ else ++ op->done = 1; ++ found = 1; + break; + } + } + spin_unlock(&ops_lock); + + if (found) { +- struct plock_xop *xop; +- xop = (struct plock_xop *)op; +- if (xop->callback) ++ if (do_callback) + dlm_plock_callback(op); + else + wake_up(&recv_wq); +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dlm-fix-shutdown-cleanup.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-shutdown-cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dlm-fix-shutdown-cleanup.patch rename to src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-shutdown-cleanup.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-use-count-with-multiple-joins.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-use-count-with-multiple-joins.patch new file mode 100644 index 000000000..868b40a24 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-fix-use-count-with-multiple-joins.patch @@ -0,0 +1,62 @@ +From 8511a2728ab82cab398e39d019f5cf1246021c1c Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Wed, 8 Apr 2009 15:38:43 -0500 +Subject: [PATCH] dlm: fix use count with multiple joins + +When a lockspace was joined multiple times, the global dlm +use count was incremented when it should not have been. This +caused the global dlm threads to not be stopped when all +lockspaces were eventually be removed. + +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/lockspace.c | 13 ++++++------- + 1 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c +index 82528d9..d489fcc 100644 +--- a/fs/dlm/lockspace.c ++++ b/fs/dlm/lockspace.c +@@ -419,16 +419,14 @@ static int new_lockspace(const char *name, int namelen, void **lockspace, + break; + } + ls->ls_create_count++; +- module_put(THIS_MODULE); +- error = 1; /* not an error, return 0 */ ++ *lockspace = ls; ++ error = 1; + break; + } + spin_unlock(&lslist_lock); + +- if (error < 0) +- goto out; + if (error) +- goto ret_zero; ++ goto out; + + error = -ENOMEM; + +@@ -583,7 +581,6 @@ static int new_lockspace(const char *name, int namelen, void **lockspace, + dlm_create_debug_file(ls); + + log_debug(ls, "join complete"); +- ret_zero: + *lockspace = ls; + return 0; + +@@ -628,7 +625,9 @@ int dlm_new_lockspace(const char *name, int namelen, void **lockspace, + error = new_lockspace(name, namelen, lockspace, flags, lvblen); + if (!error) + ls_count++; +- else if (!ls_count) ++ if (error > 0) ++ error = 0; ++ if (!ls_count) + threads_stop(); + out: + mutex_unlock(&ls_lock); +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-free-socket-in-error-exit-path.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-free-socket-in-error-exit-path.patch new file mode 100644 index 000000000..c74c5a9a6 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-free-socket-in-error-exit-path.patch @@ -0,0 +1,40 @@ +From a89d63a159b1ba5833be2bef00adf8ad8caac8be Mon Sep 17 00:00:00 2001 +From: Casey Dahlin +Date: Tue, 14 Jul 2009 12:17:51 -0500 +Subject: [PATCH] dlm: free socket in error exit path + +In the tcp_connect_to_sock() error exit path, the socket +allocated at the top of the function was not being freed. + +Signed-off-by: Casey Dahlin +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/lowcomms.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c +index cdb580a..618a60f 100644 +--- a/fs/dlm/lowcomms.c ++++ b/fs/dlm/lowcomms.c +@@ -902,7 +902,7 @@ static void tcp_connect_to_sock(struct connection *con) + int result = -EHOSTUNREACH; + struct sockaddr_storage saddr, src_addr; + int addr_len; +- struct socket *sock; ++ struct socket *sock = NULL; + + if (con->nodeid == 0) { + log_print("attempt to connect sock 0 foiled"); +@@ -962,6 +962,8 @@ out_err: + if (con->sock) { + sock_release(con->sock); + con->sock = NULL; ++ } else if (sock) { ++ sock_release(sock); + } + /* + * Some errors are fatal and this list might need adjusting. For other +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dlm-use-more-NOFS-allocation.patch b/src/patches/suse-2.6.27.31/patches.fixes/dlm-use-more-NOFS-allocation.patch new file mode 100644 index 000000000..093d90e42 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dlm-use-more-NOFS-allocation.patch @@ -0,0 +1,138 @@ +From 748285ccf7ea76d3d76d0d5f2945ad6fb91f5329 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Fri, 15 May 2009 10:50:57 -0500 +Subject: [PATCH] dlm: use more NOFS allocation + +Change some GFP_KERNEL allocations to use either GFP_NOFS or +ls_allocation (when available) which the fs sets to GFP_NOFS. +The point is to prevent allocations from going back into the +cluster fs in places where that might lead to deadlock. + +Signed-off-by: David Teigland +Signed-off-by: Coly Li +--- + fs/dlm/dir.c | 7 ++++--- + fs/dlm/lowcomms.c | 6 +++--- + fs/dlm/member.c | 8 ++++---- + fs/dlm/requestqueue.c | 2 +- + 4 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c +index 858fba1..c4dfa1d 100644 +--- a/fs/dlm/dir.c ++++ b/fs/dlm/dir.c +@@ -49,7 +49,8 @@ static struct dlm_direntry *get_free_de(struct dlm_ls *ls, int len) + spin_unlock(&ls->ls_recover_list_lock); + + if (!found) +- de = kzalloc(sizeof(struct dlm_direntry) + len, GFP_KERNEL); ++ de = kzalloc(sizeof(struct dlm_direntry) + len, ++ ls->ls_allocation); + return de; + } + +@@ -211,7 +212,7 @@ int dlm_recover_directory(struct dlm_ls *ls) + + dlm_dir_clear(ls); + +- last_name = kmalloc(DLM_RESNAME_MAXLEN, GFP_KERNEL); ++ last_name = kmalloc(DLM_RESNAME_MAXLEN, ls->ls_allocation); + if (!last_name) + goto out; + +@@ -322,7 +323,7 @@ static int get_entry(struct dlm_ls *ls, int nodeid, char *name, + if (namelen > DLM_RESNAME_MAXLEN) + return -EINVAL; + +- de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_KERNEL); ++ de = kzalloc(sizeof(struct dlm_direntry) + namelen, ls->ls_allocation); + if (!de) + return -ENOMEM; + +diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c +index 2559a97..cdb580a 100644 +--- a/fs/dlm/lowcomms.c ++++ b/fs/dlm/lowcomms.c +@@ -500,7 +500,7 @@ static void process_sctp_notification(struct connection *con, + return; + } + +- new_con = nodeid2con(nodeid, GFP_KERNEL); ++ new_con = nodeid2con(nodeid, GFP_NOFS); + if (!new_con) + return; + +@@ -736,7 +736,7 @@ static int tcp_accept_from_sock(struct connection *con) + * the same time and the connections cross on the wire. + * In this case we store the incoming one in "othercon" + */ +- newcon = nodeid2con(nodeid, GFP_KERNEL); ++ newcon = nodeid2con(nodeid, GFP_NOFS); + if (!newcon) { + result = -ENOMEM; + goto accept_err; +@@ -746,7 +746,7 @@ static int tcp_accept_from_sock(struct connection *con) + struct connection *othercon = newcon->othercon; + + if (!othercon) { +- othercon = kmem_cache_zalloc(con_cache, GFP_KERNEL); ++ othercon = kmem_cache_zalloc(con_cache, GFP_NOFS); + if (!othercon) { + log_print("failed to allocate incoming socket"); + mutex_unlock(&newcon->sock_mutex); +diff --git a/fs/dlm/member.c b/fs/dlm/member.c +index 2afb770..b128775 100644 +--- a/fs/dlm/member.c ++++ b/fs/dlm/member.c +@@ -48,7 +48,7 @@ static int dlm_add_member(struct dlm_ls *ls, int nodeid) + struct dlm_member *memb; + int w, error; + +- memb = kzalloc(sizeof(struct dlm_member), GFP_KERNEL); ++ memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); + if (!memb) + return -ENOMEM; + +@@ -143,7 +143,7 @@ static void make_member_array(struct dlm_ls *ls) + + ls->ls_total_weight = total; + +- array = kmalloc(sizeof(int) * total, GFP_KERNEL); ++ array = kmalloc(sizeof(int) * total, ls->ls_allocation); + if (!array) + return; + +@@ -226,7 +226,7 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out) + continue; + log_debug(ls, "new nodeid %d is a re-added member", rv->new[i]); + +- memb = kzalloc(sizeof(struct dlm_member), GFP_KERNEL); ++ memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); + if (!memb) + return -ENOMEM; + memb->nodeid = rv->new[i]; +@@ -341,7 +341,7 @@ int dlm_ls_start(struct dlm_ls *ls) + int *ids = NULL, *new = NULL; + int error, ids_count = 0, new_count = 0; + +- rv = kzalloc(sizeof(struct dlm_recover), GFP_KERNEL); ++ rv = kzalloc(sizeof(struct dlm_recover), ls->ls_allocation); + if (!rv) + return -ENOMEM; + +diff --git a/fs/dlm/requestqueue.c b/fs/dlm/requestqueue.c +index daa4183..7a2307c 100644 +--- a/fs/dlm/requestqueue.c ++++ b/fs/dlm/requestqueue.c +@@ -35,7 +35,7 @@ void dlm_add_requestqueue(struct dlm_ls *ls, int nodeid, struct dlm_message *ms) + struct rq_entry *e; + int length = ms->m_header.h_length - sizeof(struct dlm_message); + +- e = kmalloc(sizeof(struct rq_entry) + length, GFP_KERNEL); ++ e = kmalloc(sizeof(struct rq_entry) + length, ls->ls_allocation); + if (!e) { + log_print("dlm_add_requestqueue: out of memory len %d", length); + return; +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-avoid-put-table-dm_any_congested b/src/patches/suse-2.6.27.31/patches.fixes/dm-avoid-put-table-dm_any_congested similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-avoid-put-table-dm_any_congested rename to src/patches/suse-2.6.27.31/patches.fixes/dm-avoid-put-table-dm_any_congested diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-leastpending-correction b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-leastpending-correction similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-leastpending-correction rename to src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-leastpending-correction diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-reattach-dh b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-reattach-dh similarity index 97% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-reattach-dh rename to src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-reattach-dh index 82ee7414d..a60eaf701 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-reattach-dh +++ b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-reattach-dh @@ -27,7 +27,7 @@ Signed-off-by: Hannes Reinecke path.dev); spin_lock_irqsave(&m->lock, flags); if (m->pgpath_to_activate == pgpath) -@@ -593,9 +591,19 @@ static struct pgpath *parse_path(struct +@@ -599,9 +597,19 @@ static struct pgpath *parse_path(struct } if (m->hw_handler_name) { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-remove-is_active b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-remove-is_active similarity index 90% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-remove-is_active rename to src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-remove-is_active index 555c7264b..bb7c6132e 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-remove-is_active +++ b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-remove-is_active @@ -38,7 +38,7 @@ Conflicts: INIT_WORK(&pgpath->deactivate_path, deactivate_path); } -@@ -869,13 +870,13 @@ static int fail_path(struct pgpath *pgpa +@@ -880,13 +881,13 @@ static int fail_path(struct pgpath *pgpa spin_lock_irqsave(&m->lock, flags); @@ -54,7 +54,7 @@ Conflicts: pgpath->fail_count++; m->nr_valid_paths--; -@@ -906,7 +907,7 @@ static int reinstate_path(struct pgpath +@@ -917,7 +918,7 @@ static int reinstate_path(struct pgpath spin_lock_irqsave(&m->lock, flags); @@ -63,7 +63,7 @@ Conflicts: goto out; if (!pgpath->pg->ps.type->reinstate_path) { -@@ -920,7 +921,7 @@ static int reinstate_path(struct pgpath +@@ -931,7 +932,7 @@ static int reinstate_path(struct pgpath if (r) goto out; @@ -72,7 +72,7 @@ Conflicts: m->current_pgpath = NULL; if (!m->nr_valid_paths++ && m->queue_size) -@@ -1295,7 +1296,7 @@ static int multipath_status(struct dm_ta +@@ -1306,7 +1307,7 @@ static int multipath_status(struct dm_ta list_for_each_entry(p, &pg->pgpaths, list) { DMEMIT("%s %s %u ", p->path.dev->name, diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-send-activate-to-every-path b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-send-activate-to-every-path similarity index 88% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-send-activate-to-every-path rename to src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-send-activate-to-every-path index 556f338c4..0144d202f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/dm-mpath-send-activate-to-every-path +++ b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-send-activate-to-every-path @@ -20,10 +20,8 @@ Acked-by: "Moger, Babu" Signed-off-by: Hannes Reinecke --- drivers/md/dm-mpath.c | 48 ++++++++++++++++-------------------------------- - 1 files changed, 16 insertions(+), 32 deletions(-) + 1 file changed, 16 insertions(+), 32 deletions(-) -diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c -index fa4a362..510fd26 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -33,6 +33,7 @@ struct pgpath { @@ -51,7 +49,7 @@ index fa4a362..510fd26 100644 } return pgpath; -@@ -165,10 +165,6 @@ static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti) +@@ -165,10 +165,6 @@ static void free_pgpaths(struct list_hea list_for_each_entry_safe(pgpath, tmp, pgpaths, list) { list_del(&pgpath->list); dm_put_device(ti, pgpath->path.dev); @@ -62,7 +60,7 @@ index fa4a362..510fd26 100644 free_pgpath(pgpath); } } -@@ -199,7 +195,6 @@ static struct multipath *alloc_multipath(struct dm_target *ti) +@@ -199,7 +195,6 @@ static struct multipath *alloc_multipath m->queue_io = 1; INIT_WORK(&m->process_queued_ios, process_queued_ios); INIT_WORK(&m->trigger_event, trigger_event); @@ -70,7 +68,7 @@ index fa4a362..510fd26 100644 m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache); if (!m->mpio_pool) { kfree(m); -@@ -435,8 +430,8 @@ static void process_queued_ios(struct work_struct *work) +@@ -435,8 +430,8 @@ static void process_queued_ios(struct wo { struct multipath *m = container_of(work, struct multipath, process_queued_ios); @@ -81,7 +79,7 @@ index fa4a362..510fd26 100644 unsigned long flags; spin_lock_irqsave(&m->lock, flags); -@@ -454,19 +449,15 @@ static void process_queued_ios(struct work_struct *work) +@@ -454,19 +449,15 @@ static void process_queued_ios(struct wo must_queue = 0; if (m->pg_init_required && !m->pg_init_in_progress && pgpath) { @@ -105,7 +103,7 @@ index fa4a362..510fd26 100644 if (!must_queue) dispatch_queued_ios(m); } -@@ -1125,27 +1116,20 @@ static void pg_init_done(struct dm_path *path, int errors) +@@ -1136,27 +1127,20 @@ static void pg_init_done(struct dm_path pg->bypassed = 0; } @@ -141,6 +139,3 @@ index fa4a362..510fd26 100644 } /* --- -1.5.3.2 - diff --git a/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-skip-inactive-paths-during-activation b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-skip-inactive-paths-during-activation new file mode 100644 index 000000000..f42717407 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/dm-mpath-skip-inactive-paths-during-activation @@ -0,0 +1,37 @@ +From: Hannes Reinecke +Date: Fri, 14 Aug 2009 16:04:05 +0200 +Subject: dm-mpath: Skip inactive paths when activating pathgroup +References: bnc#524797 + +Whenever switch pathgroup happens device mapper will try to activate all the +paths in the new path group. There is no check to see if the path has already +failed. Eventually the failed path will report error. This will reset the +current_pgpath and current_pg. The will result in infinite loop. I have added a +check to skip the activate_path for the failed path. This fixes the problem. + +Signed-off-by: Babu Moger +Signed-off-by: Hannes Reinecke +--- + drivers/md/dm-mpath.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c +index ffe3a30..642f85f 100644 +--- a/drivers/md/dm-mpath.c ++++ b/drivers/md/dm-mpath.c +@@ -465,9 +465,10 @@ static void process_queued_ios(struct work_struct *work) + m->pg_init_count++; + m->pg_init_required = 0; + list_for_each_entry(tmp, &pgpath->pg->pgpaths, list) { +- /* Skip disabled paths */ +- if (!tmp->path.dev) ++ /* Skip disabled or failed paths */ ++ if (!tmp->path.dev || !tmp->is_active) + continue; ++ + queue_work(kmpath_handlerd, &tmp->activate_path); + m->pg_init_in_progress++; + } +-- +1.6.0.2 + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-path-selector-ref-count b/src/patches/suse-2.6.27.31/patches.fixes/dm-path-selector-ref-count similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-path-selector-ref-count rename to src/patches/suse-2.6.27.31/patches.fixes/dm-path-selector-ref-count diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-release-map_lock-before-set_disk_ro b/src/patches/suse-2.6.27.31/patches.fixes/dm-release-map_lock-before-set_disk_ro similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-release-map_lock-before-set_disk_ro rename to src/patches/suse-2.6.27.31/patches.fixes/dm-release-map_lock-before-set_disk_ro diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-table-ref-count b/src/patches/suse-2.6.27.31/patches.fixes/dm-table-ref-count similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-table-ref-count rename to src/patches/suse-2.6.27.31/patches.fixes/dm-table-ref-count diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-table-switch-to-readonly b/src/patches/suse-2.6.27.31/patches.fixes/dm-table-switch-to-readonly similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-table-switch-to-readonly rename to src/patches/suse-2.6.27.31/patches.fixes/dm-table-switch-to-readonly diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-table-upgrade-mode-race-fix b/src/patches/suse-2.6.27.31/patches.fixes/dm-table-upgrade-mode-race-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-table-upgrade-mode-race-fix rename to src/patches/suse-2.6.27.31/patches.fixes/dm-table-upgrade-mode-race-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm-unbind-drop-ref b/src/patches/suse-2.6.27.31/patches.fixes/dm-unbind-drop-ref similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm-unbind-drop-ref rename to src/patches/suse-2.6.27.31/patches.fixes/dm-unbind-drop-ref diff --git a/src/patches/suse-2.6.27.25/patches.fixes/dm_flag_queue_barrier_support b/src/patches/suse-2.6.27.31/patches.fixes/dm_flag_queue_barrier_support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/dm_flag_queue_barrier_support rename to src/patches/suse-2.6.27.31/patches.fixes/dm_flag_queue_barrier_support diff --git a/src/patches/suse-2.6.27.25/patches.fixes/do_anonymous_page-race b/src/patches/suse-2.6.27.31/patches.fixes/do_anonymous_page-race similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/do_anonymous_page-race rename to src/patches/suse-2.6.27.31/patches.fixes/do_anonymous_page-race diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ds1682-build-fix b/src/patches/suse-2.6.27.31/patches.fixes/ds1682-build-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ds1682-build-fix rename to src/patches/suse-2.6.27.31/patches.fixes/ds1682-build-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext2_mtime_update_on_rename.diff b/src/patches/suse-2.6.27.31/patches.fixes/ext2_mtime_update_on_rename.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext2_mtime_update_on_rename.diff rename to src/patches/suse-2.6.27.31/patches.fixes/ext2_mtime_update_on_rename.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext3-mark-super-uptodate b/src/patches/suse-2.6.27.31/patches.fixes/ext3-mark-super-uptodate similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext3-mark-super-uptodate rename to src/patches/suse-2.6.27.31/patches.fixes/ext3-mark-super-uptodate diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext3_false_EIO_fix.diff b/src/patches/suse-2.6.27.31/patches.fixes/ext3_false_EIO_fix.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext3_false_EIO_fix.diff rename to src/patches/suse-2.6.27.31/patches.fixes/ext3_false_EIO_fix.diff diff --git a/src/patches/suse-2.6.27.31/patches.fixes/ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate b/src/patches/suse-2.6.27.31/patches.fixes/ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate new file mode 100644 index 000000000..c649263a4 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate @@ -0,0 +1,47 @@ +From: Aneesh Kumar K.V +Date: Wed, 10 Jun 2009 18:22:55 +0000 (-0400) +Subject: ext4: Avoid corrupting the uninitialized bit in the extent during truncate +Patch-mainline: 2.6.31-rc1 +Git-commit: a41f20716975910d9beb90b7efc61107901492b8 +References: bnc#514265 + +ext4: Avoid corrupting the uninitialized bit in the extent during truncate + +The unitialized bit was not properly getting preserved in in an extent +which is partially truncated because the it was geting set to the +value of the first extent to be removed or truncated as part of the +truncate operation, and if there are multiple extents are getting +removed or modified as part of the truncate operation, it is only the +last extent which will might be partially truncated, and its +uninitalized bit is not necessarily the same as the first extent to be +truncated. + +Signed-off-by: Aneesh Kumar K.V +Signed-off-by: "Theodore Ts'o" +Acked-by: Jeff Mahoney +--- + + fs/ext4/extents.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -1877,12 +1877,16 @@ ext4_ext_rm_leaf(handle_t *handle, struc + ex = EXT_LAST_EXTENT(eh); + + ex_ee_block = le32_to_cpu(ex->ee_block); +- if (ext4_ext_is_uninitialized(ex)) +- uninitialized = 1; + ex_ee_len = ext4_ext_get_actual_len(ex); + + while (ex >= EXT_FIRST_EXTENT(eh) && + ex_ee_block + ex_ee_len > start) { ++ ++ if (ext4_ext_is_uninitialized(ex)) ++ uninitialized = 1; ++ else ++ uninitialized = 0; ++ + ext_debug("remove ext %lu:%u\n", ex_ee_block, ex_ee_len); + path[depth].p_ext = ex; + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext4-clear-unwritten-flag-after-extent-initialization b/src/patches/suse-2.6.27.31/patches.fixes/ext4-clear-unwritten-flag-after-extent-initialization similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext4-clear-unwritten-flag-after-extent-initialization rename to src/patches/suse-2.6.27.31/patches.fixes/ext4-clear-unwritten-flag-after-extent-initialization diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext4-fix-sub-block-zeroing-for-preallocated-writes b/src/patches/suse-2.6.27.31/patches.fixes/ext4-fix-sub-block-zeroing-for-preallocated-writes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext4-fix-sub-block-zeroing-for-preallocated-writes rename to src/patches/suse-2.6.27.31/patches.fixes/ext4-fix-sub-block-zeroing-for-preallocated-writes diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext4-fixes-2.6.28-rc8.patch b/src/patches/suse-2.6.27.31/patches.fixes/ext4-fixes-2.6.28-rc8.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext4-fixes-2.6.28-rc8.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ext4-fixes-2.6.28-rc8.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext4-mballoc-preallocate.patch b/src/patches/suse-2.6.27.31/patches.fixes/ext4-mballoc-preallocate.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext4-mballoc-preallocate.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ext4-mballoc-preallocate.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head b/src/patches/suse-2.6.27.31/patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head rename to src/patches/suse-2.6.27.31/patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head diff --git a/src/patches/suse-2.6.27.25/patches.fixes/fc_transport-devloss-callback-restore b/src/patches/suse-2.6.27.31/patches.fixes/fc_transport-devloss-callback-restore similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/fc_transport-devloss-callback-restore rename to src/patches/suse-2.6.27.31/patches.fixes/fc_transport-devloss-callback-restore diff --git a/src/patches/suse-2.6.27.25/patches.fixes/fix-device-number-in-blktrace.patch b/src/patches/suse-2.6.27.31/patches.fixes/fix-device-number-in-blktrace.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/fix-device-number-in-blktrace.patch rename to src/patches/suse-2.6.27.31/patches.fixes/fix-device-number-in-blktrace.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/fix-nf_conntrack_slp b/src/patches/suse-2.6.27.31/patches.fixes/fix-nf_conntrack_slp similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/fix-nf_conntrack_slp rename to src/patches/suse-2.6.27.31/patches.fixes/fix-nf_conntrack_slp diff --git a/src/patches/suse-2.6.27.31/patches.fixes/fix-nr_uninterruptible-accounting-of-frozen-tasks b/src/patches/suse-2.6.27.31/patches.fixes/fix-nr_uninterruptible-accounting-of-frozen-tasks new file mode 100644 index 000000000..a9a49da40 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/fix-nr_uninterruptible-accounting-of-frozen-tasks @@ -0,0 +1,73 @@ +From: Thomas Gleixner +To: LKML +Cc: Andrew Morton , Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Nathan Lynch , Nigel Cunningham , , containers@lists.linux-foundation.org, linux-pm@lists.linux-foundation.org, Matt Helsley +Subject: [patch 2/2] sched: fix nr_uninterruptible accounting of frozen tasks really +References: bnc#529660 + +commit e3c8ca8336 (sched: do not count frozen tasks toward load) broke +the nr_uninterruptible accounting on freeze/thaw. On freeze the task +is excluded from accounting with a check for (task->flags & +PF_FROZEN), but that flag is cleared before the task is thawed. So +while we prevent that the freezing task with state +TASK_UNINTERRUPTIBLE is accounted to nr_uninterruptible we decrement +nr_uninterruptible on thaw. + +Use a separate flag which is handled by the freezing task itself. Set +it before calling the scheduler with TASK_UNINTERRUPTIBLE state and +clear it after we return from frozen state. + +Signed-off-by: Thomas Gleixner +Cc: Nathan Lynch +Cc: Andrew Morton +Cc: Nigel Cunningham +Cc: +Cc: containers@lists.linux-foundation.org +Cc: linux-pm@lists.linux-foundation.org +Cc: Matt Helsley +Acked-by: Jeff Mahoney +--- + include/linux/sched.h | 3 ++- + kernel/freezer.c | 7 +++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -203,7 +203,7 @@ extern unsigned long long time_sync_thre + ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) + #define task_contributes_to_load(task) \ + ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ +- (task->flags & PF_FROZEN) == 0) ++ (task->flags & PF_FREEZING) == 0) + + #define __set_task_state(tsk, state_value) \ + do { (tsk)->state = (state_value); } while (0) +@@ -1507,6 +1507,7 @@ extern cputime_t task_gtime(struct task_ + #define PF_MEMALLOC 0x00000800 /* Allocating memory */ + #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ + #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ ++#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ + #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ + #define PF_FROZEN 0x00010000 /* frozen for system suspend */ + #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ +--- a/kernel/freezer.c ++++ b/kernel/freezer.c +@@ -44,12 +44,19 @@ void refrigerator(void) + recalc_sigpending(); /* We sent fake signal, clean it up */ + spin_unlock_irq(¤t->sighand->siglock); + ++ /* prevent accounting of that task to load */ ++ current->flags |= PF_FREEZING; ++ + for (;;) { + set_current_state(TASK_UNINTERRUPTIBLE); + if (!frozen(current)) + break; + schedule(); + } ++ ++ /* Remove the accounting blocker */ ++ current->flags &= ~PF_FREEZING; ++ + pr_debug("%s left refrigerator\n", current->comm); + __set_current_state(save); + } diff --git a/src/patches/suse-2.6.27.25/patches.fixes/fujisu_laptop_fix_section_mismatch.patch b/src/patches/suse-2.6.27.31/patches.fixes/fujisu_laptop_fix_section_mismatch.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/fujisu_laptop_fix_section_mismatch.patch rename to src/patches/suse-2.6.27.31/patches.fixes/fujisu_laptop_fix_section_mismatch.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/grab-swap-token-oops b/src/patches/suse-2.6.27.31/patches.fixes/grab-swap-token-oops similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/grab-swap-token-oops rename to src/patches/suse-2.6.27.31/patches.fixes/grab-swap-token-oops diff --git a/src/patches/suse-2.6.27.25/patches.fixes/hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch b/src/patches/suse-2.6.27.31/patches.fixes/hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch rename to src/patches/suse-2.6.27.31/patches.fixes/hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/hpet-fix-for-LS21-boot-hang b/src/patches/suse-2.6.27.31/patches.fixes/hpet-fix-for-LS21-boot-hang similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/hpet-fix-for-LS21-boot-hang rename to src/patches/suse-2.6.27.31/patches.fixes/hpet-fix-for-LS21-boot-hang diff --git a/src/patches/suse-2.6.27.25/patches.fixes/hpilo-open-close-fix b/src/patches/suse-2.6.27.31/patches.fixes/hpilo-open-close-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/hpilo-open-close-fix rename to src/patches/suse-2.6.27.31/patches.fixes/hpilo-open-close-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ia64-configure-HAVE_UNSTABLE_SCHED_CLOCK-for-SGI_SN.patch b/src/patches/suse-2.6.27.31/patches.fixes/ia64-configure-HAVE_UNSTABLE_SCHED_CLOCK-for-SGI_SN.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ia64-configure-HAVE_UNSTABLE_SCHED_CLOCK-for-SGI_SN.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ia64-configure-HAVE_UNSTABLE_SCHED_CLOCK-for-SGI_SN.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ia64-sparse-fixes.diff b/src/patches/suse-2.6.27.31/patches.fixes/ia64-sparse-fixes.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ia64-sparse-fixes.diff rename to src/patches/suse-2.6.27.31/patches.fixes/ia64-sparse-fixes.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ia64_uv_partition_id.diff b/src/patches/suse-2.6.27.31/patches.fixes/ia64_uv_partition_id.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ia64_uv_partition_id.diff rename to src/patches/suse-2.6.27.31/patches.fixes/ia64_uv_partition_id.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ia64_uv_watchlist.diff b/src/patches/suse-2.6.27.31/patches.fixes/ia64_uv_watchlist.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ia64_uv_watchlist.diff rename to src/patches/suse-2.6.27.31/patches.fixes/ia64_uv_watchlist.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ib-ipath-fix-hang-on-module-unload b/src/patches/suse-2.6.27.31/patches.fixes/ib-ipath-fix-hang-on-module-unload similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ib-ipath-fix-hang-on-module-unload rename to src/patches/suse-2.6.27.31/patches.fixes/ib-ipath-fix-hang-on-module-unload diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ieee1394-sbp2_long_sysfs_ieee1394_id.patch b/src/patches/suse-2.6.27.31/patches.fixes/ieee1394-sbp2_long_sysfs_ieee1394_id.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ieee1394-sbp2_long_sysfs_ieee1394_id.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ieee1394-sbp2_long_sysfs_ieee1394_id.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/initialize-dev-power-entry b/src/patches/suse-2.6.27.31/patches.fixes/initialize-dev-power-entry new file mode 100644 index 000000000..d0541baff --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/initialize-dev-power-entry @@ -0,0 +1,24 @@ +From: Jeff Mahoney +Subject: pm: initialize &dev->power.entry +References: bnc#514022 + + dev->power.entry is uninitialized, which can lead to Oopses if the device + is removed early. + +Signed-off-by: Jeff Mahoney +--- + drivers/base/power/power.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/base/power/power.h ++++ b/drivers/base/power/power.h +@@ -1,6 +1,9 @@ + static inline void device_pm_init(struct device *dev) + { + dev->power.status = DPM_ON; ++#ifdef CONFIG_PM_SLEEP ++ INIT_LIST_HEAD(&dev->power.entry); ++#endif + } + + #ifdef CONFIG_PM_SLEEP diff --git a/src/patches/suse-2.6.27.25/patches.fixes/input-add-acer-aspire-5710-to-nomux.patch b/src/patches/suse-2.6.27.31/patches.fixes/input-add-acer-aspire-5710-to-nomux.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/input-add-acer-aspire-5710-to-nomux.patch rename to src/patches/suse-2.6.27.31/patches.fixes/input-add-acer-aspire-5710-to-nomux.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/input-add-nomux-dell-vostro-1510.patch b/src/patches/suse-2.6.27.31/patches.fixes/input-add-nomux-dell-vostro-1510.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/input-add-nomux-dell-vostro-1510.patch rename to src/patches/suse-2.6.27.31/patches.fixes/input-add-nomux-dell-vostro-1510.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ipw2200-send-noassoc.patch b/src/patches/suse-2.6.27.31/patches.fixes/ipw2200-send-noassoc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ipw2200-send-noassoc.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ipw2200-send-noassoc.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwl3945-fix-crash-on-rmmod.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwl3945-fix-crash-on-rmmod.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwl3945-fix-crash-on-rmmod.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwl3945-fix-crash-on-rmmod.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwl3945-fix-rfkill.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwl3945-fix-rfkill.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwl3945-fix-rfkill.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwl3945-fix-rfkill.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlagn-fix-error-path.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwlagn-fix-error-path.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlagn-fix-error-path.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwlagn-fix-error-path.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlagn-fix-rfkill.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwlagn-fix-rfkill.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlagn-fix-rfkill.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwlagn-fix-rfkill.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff b/src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff rename to src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff b/src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff rename to src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-updating-key-flags.patch b/src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-updating-key-flags.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/iwlwifi-fix-updating-key-flags.patch rename to src/patches/suse-2.6.27.31/patches.fixes/iwlwifi-fix-updating-key-flags.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-Commited_AS-fix b/src/patches/suse-2.6.27.31/patches.fixes/kdb-Commited_AS-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-Commited_AS-fix rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-Commited_AS-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-bb_all-fixes b/src/patches/suse-2.6.27.31/patches.fixes/kdb-bb_all-fixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-bb_all-fixes rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-bb_all-fixes diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-fix-stack-overflow.patch b/src/patches/suse-2.6.27.31/patches.fixes/kdb-fix-stack-overflow.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-fix-stack-overflow.patch rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-fix-stack-overflow.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-kdump.diff b/src/patches/suse-2.6.27.31/patches.fixes/kdb-kdump.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-kdump.diff rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-kdump.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-oops-panic.diff b/src/patches/suse-2.6.27.31/patches.fixes/kdb-oops-panic.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-oops-panic.diff rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-oops-panic.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdb-read-CR.diff b/src/patches/suse-2.6.27.31/patches.fixes/kdb-read-CR.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdb-read-CR.diff rename to src/patches/suse-2.6.27.31/patches.fixes/kdb-read-CR.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kdump-x86-sparsemem.diff b/src/patches/suse-2.6.27.31/patches.fixes/kdump-x86-sparsemem.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kdump-x86-sparsemem.diff rename to src/patches/suse-2.6.27.31/patches.fixes/kdump-x86-sparsemem.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/kvm-vmx-dont-allow-uninhibited-access-to-EFER-on-i386 b/src/patches/suse-2.6.27.31/patches.fixes/kvm-vmx-dont-allow-uninhibited-access-to-EFER-on-i386 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/kvm-vmx-dont-allow-uninhibited-access-to-EFER-on-i386 rename to src/patches/suse-2.6.27.31/patches.fixes/kvm-vmx-dont-allow-uninhibited-access-to-EFER-on-i386 diff --git a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed similarity index 83% rename from src/patches/suse-2.6.27.25/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed rename to src/patches/suse-2.6.27.31/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed index 6cf96bd10..68a5026de 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed +++ b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-don-t-let-io-sit-in-queue-when-session-has-failed @@ -17,13 +17,11 @@ Signed-off-by: Hannes Reinecke --- drivers/scsi/libiscsi.c | 15 ++++++--------- - 1 files changed, 6 insertions(+), 9 deletions(-) + 1 file changed, 6 insertions(+), 9 deletions(-) -diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c -index a9d7e52..57eb3af 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c -@@ -1390,13 +1390,7 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +@@ -1242,13 +1242,7 @@ int iscsi_queuecommand(struct scsi_cmnd goto fault; } @@ -38,7 +36,7 @@ index a9d7e52..57eb3af 100644 /* * to handle the race between when we set the recovery state * and block the session we requeue here (commands could -@@ -1404,12 +1398,15 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +@@ -1256,12 +1250,15 @@ int iscsi_queuecommand(struct scsi_cmnd * up because the block code is not locked) */ switch (session->state) { @@ -56,6 +54,3 @@ index a9d7e52..57eb3af 100644 case ISCSI_STATE_RECOVERY_FAILED: reason = FAILURE_SESSION_RECOVERY_TIMEOUT; sc->result = DID_TRANSPORT_FAILFAST << 16; --- -1.5.3.2 - diff --git a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-locking-in-eh_device_reset b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-locking-in-eh_device_reset similarity index 83% rename from src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-locking-in-eh_device_reset rename to src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-locking-in-eh_device_reset index 551924f95..033b6e79a 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-locking-in-eh_device_reset +++ b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-locking-in-eh_device_reset @@ -16,11 +16,13 @@ Signed-off-by: Mike Christie Signed-off-by: James Bottomley Signed-off-by: Hannes Reinecke -diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c -index 5aa0db1..801c7cf 100644 +--- + drivers/scsi/libiscsi.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c -@@ -404,11 +404,6 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_task *task, +@@ -413,11 +413,6 @@ static void fail_command(struct iscsi_co conn->session->queued_cmdsn--; else conn->session->tt->cleanup_task(conn, task); @@ -32,7 +34,7 @@ index 5aa0db1..801c7cf 100644 sc->result = err; if (!scsi_bidi_cmnd(sc)) -@@ -1829,10 +1824,10 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc) +@@ -1839,10 +1834,10 @@ int iscsi_eh_device_reset(struct scsi_cm iscsi_suspend_tx(conn); diff --git a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-nop-response-reply-and-session-cleanup.patch b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-nop-response-reply-and-session-cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-nop-response-reply-and-session-cleanup.patch rename to src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-nop-response-reply-and-session-cleanup.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands similarity index 86% rename from src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands rename to src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands index efe5fd704..45d9990c9 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands +++ b/src/patches/suse-2.6.27.31/patches.fixes/libiscsi-fix-null-pointer-in-fail-all-commands @@ -16,11 +16,13 @@ Signed-off-by: Mike Christie Signed-off-by: James Bottomley Signed-off-by: Hannes Reinecke -diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c -index d070179..dfaa8ad 100644 +--- + drivers/scsi/libiscsi.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c -@@ -1603,8 +1603,11 @@ static void fail_all_commands(struct iscsi_conn *conn, unsigned lun, +@@ -1498,8 +1498,11 @@ static void fail_all_commands(struct isc { struct iscsi_task *task, *tmp; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/mac80211-add-direct-probe.patch b/src/patches/suse-2.6.27.31/patches.fixes/mac80211-add-direct-probe.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/mac80211-add-direct-probe.patch rename to src/patches/suse-2.6.27.31/patches.fixes/mac80211-add-direct-probe.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/make-note_interrupt-fast.diff b/src/patches/suse-2.6.27.31/patches.fixes/make-note_interrupt-fast.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/make-note_interrupt-fast.diff rename to src/patches/suse-2.6.27.31/patches.fixes/make-note_interrupt-fast.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/md-disable-recovery-on-faulty-degraded-array b/src/patches/suse-2.6.27.31/patches.fixes/md-disable-recovery-on-faulty-degraded-array similarity index 93% rename from src/patches/suse-2.6.27.25/patches.fixes/md-disable-recovery-on-faulty-degraded-array rename to src/patches/suse-2.6.27.31/patches.fixes/md-disable-recovery-on-faulty-degraded-array index 904fefbce..774472d6c 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/md-disable-recovery-on-faulty-degraded-array +++ b/src/patches/suse-2.6.27.31/patches.fixes/md-disable-recovery-on-faulty-degraded-array @@ -36,7 +36,7 @@ Signed-off-by: Neil Brown } } else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) -@@ -4528,7 +4528,7 @@ static int set_bitmap_file(mddev_t *mdde +@@ -4530,7 +4530,7 @@ static int set_bitmap_file(mddev_t *mdde if (mddev->pers) { if (!mddev->pers->quiesce) return -EBUSY; @@ -45,7 +45,7 @@ Signed-off-by: Neil Brown return -EBUSY; /* we should be able to change the bitmap.. */ } -@@ -4783,7 +4783,7 @@ static int update_array_info(mddev_t *md +@@ -4785,7 +4785,7 @@ static int update_array_info(mddev_t *md if ((state ^ info->state) & (1<pers->quiesce == NULL) return -EINVAL; @@ -54,7 +54,7 @@ Signed-off-by: Neil Brown return -EBUSY; if (info->state & (1< rdev_for_each(rdev, rtmp, mddev) { if (rdev->raid_disk >= 0 && !test_bit(In_sync, &rdev->flags) && -@@ -6200,7 +6201,7 @@ void md_check_recovery(mddev_t *mddev) +@@ -6202,7 +6203,7 @@ void md_check_recovery(mddev_t *mddev) rdev_for_each(rdev, rtmp, mddev) rdev->saved_raid_disk = -1; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/md-raid1-chunksize b/src/patches/suse-2.6.27.31/patches.fixes/md-raid1-chunksize similarity index 95% rename from src/patches/suse-2.6.27.25/patches.fixes/md-raid1-chunksize rename to src/patches/suse-2.6.27.31/patches.fixes/md-raid1-chunksize index 85c2e5265..7b8871003 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/md-raid1-chunksize +++ b/src/patches/suse-2.6.27.31/patches.fixes/md-raid1-chunksize @@ -23,7 +23,7 @@ Signed-off-by: Neil Brown --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -3585,13 +3585,13 @@ static int do_md_run(mddev_t * mddev) +@@ -3587,13 +3587,13 @@ static int do_md_run(mddev_t * mddev) return -EINVAL; } if (chunk_size < PAGE_SIZE) { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/md-raid1-handle-read-error.patch b/src/patches/suse-2.6.27.31/patches.fixes/md-raid1-handle-read-error.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/md-raid1-handle-read-error.patch rename to src/patches/suse-2.6.27.31/patches.fixes/md-raid1-handle-read-error.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/md-update-size b/src/patches/suse-2.6.27.31/patches.fixes/md-update-size similarity index 94% rename from src/patches/suse-2.6.27.25/patches.fixes/md-update-size rename to src/patches/suse-2.6.27.31/patches.fixes/md-update-size index 305bb8fce..8c682166f 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/md-update-size +++ b/src/patches/suse-2.6.27.31/patches.fixes/md-update-size @@ -18,7 +18,7 @@ Signed-off-by: NeilBrown --- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c +++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c -@@ -3809,6 +3809,7 @@ static int do_md_run(mddev_t * mddev) +@@ -3892,6 +3892,7 @@ static int do_md_run(mddev_t * mddev) md_wakeup_thread(mddev->thread); md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ diff --git a/src/patches/suse-2.6.27.25/patches.fixes/md-utime-fix b/src/patches/suse-2.6.27.31/patches.fixes/md-utime-fix similarity index 93% rename from src/patches/suse-2.6.27.25/patches.fixes/md-utime-fix rename to src/patches/suse-2.6.27.31/patches.fixes/md-utime-fix index 37437a700..35f63c8c0 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/md-utime-fix +++ b/src/patches/suse-2.6.27.31/patches.fixes/md-utime-fix @@ -23,7 +23,7 @@ Signed-off-by: NeilBrown --- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c +++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c -@@ -1757,6 +1757,7 @@ static void md_update_sb(mddev_t * mddev +@@ -1758,6 +1758,7 @@ static void md_update_sb(mddev_t * mddev int sync_req; int nospares = 0; @@ -31,7 +31,7 @@ Signed-off-by: NeilBrown if (mddev->external) return; repeat: -@@ -1786,7 +1787,6 @@ repeat: +@@ -1787,7 +1788,6 @@ repeat: nospares = 0; sync_req = mddev->in_sync; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS b/src/patches/suse-2.6.27.31/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS similarity index 98% rename from src/patches/suse-2.6.27.25/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS rename to src/patches/suse-2.6.27.31/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS index 3f39c1f29..55ea6084c 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS +++ b/src/patches/suse-2.6.27.31/patches.fixes/mm-fix-Commited_AS-underflow-on-large-NR_CPUS @@ -113,8 +113,8 @@ Signed-off-by: Jeff Mahoney +struct percpu_counter vm_committed_as; int heap_stack_gap __read_mostly = 1; - /* -@@ -178,11 +178,7 @@ int __vm_enough_memory(struct mm_struct + /* amount of vm to protect from userspace access */ +@@ -181,11 +181,7 @@ int __vm_enough_memory(struct mm_struct leave 3% of the size of this process for other processes */ allowed -= mm->total_vm / 32; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/mm-madvise-fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/mm-madvise-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/mm-madvise-fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/mm-madvise-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/mm-nr_pdflush-race-fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/mm-nr_pdflush-race-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/mm-nr_pdflush-race-fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/mm-nr_pdflush-race-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/multiq-requeue-should-rewind-current_band b/src/patches/suse-2.6.27.31/patches.fixes/multiq-requeue-should-rewind-current_band similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/multiq-requeue-should-rewind-current_band rename to src/patches/suse-2.6.27.31/patches.fixes/multiq-requeue-should-rewind-current_band diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-01-Uninline-the-function-put_mnt_ns b/src/patches/suse-2.6.27.31/patches.fixes/nfs-01-Uninline-the-function-put_mnt_ns new file mode 100644 index 000000000..17e3f66ba --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-01-Uninline-the-function-put_mnt_ns @@ -0,0 +1,52 @@ +From 616511d039af402670de8500d0e24495113a9cab Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 22 Jun 2009 15:09:13 -0400 +Subject: [PATCH 1/5] VFS: Uninline the function put_mnt_ns() + +In order to allow modules to use it without having to export vfsmount_lock. + +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Acked-by: NeilBrown +--- + fs/namespace.c | 8 ++++++-- + include/linux/mnt_namespace.h | 9 +-------- + 2 files changed, 7 insertions(+), 10 deletions(-) + +--- a/fs/namespace.c ++++ b/fs/namespace.c +@@ -2310,10 +2310,14 @@ void __init mnt_init(void) + init_mount_tree(); + } + +-void __put_mnt_ns(struct mnt_namespace *ns) ++void put_mnt_ns(struct mnt_namespace *ns) + { +- struct vfsmount *root = ns->root; ++ struct vfsmount *root; + LIST_HEAD(umount_list); ++ ++ if (!atomic_dec_and_lock(&ns->count, &vfsmount_lock)) ++ return; ++ root = ns->root; + ns->root = NULL; + spin_unlock(&vfsmount_lock); + down_write(&namespace_sem); +--- a/include/linux/mnt_namespace.h ++++ b/include/linux/mnt_namespace.h +@@ -24,14 +24,7 @@ struct proc_mounts { + + extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, + struct fs_struct *); +-extern void __put_mnt_ns(struct mnt_namespace *ns); +- +-static inline void put_mnt_ns(struct mnt_namespace *ns) +-{ +- if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) +- /* releases vfsmount_lock */ +- __put_mnt_ns(ns); +-} ++extern void put_mnt_ns(struct mnt_namespace *ns); + + static inline void exit_mnt_ns(struct task_struct *p) + { diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-02-Add-VFS-helper-functions-for-setting-up-private-namespaces b/src/patches/suse-2.6.27.31/patches.fixes/nfs-02-Add-VFS-helper-functions-for-setting-up-private-namespaces new file mode 100644 index 000000000..2aef92da7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-02-Add-VFS-helper-functions-for-setting-up-private-namespaces @@ -0,0 +1,116 @@ +From cf8d2c11cb77f129675478792122f50827e5b0ae Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 22 Jun 2009 15:09:13 -0400 +Subject: [PATCH 2/5] VFS: Add VFS helper functions for setting up private namespaces + +The purpose of this patch is to improve the remote mount path lookup +support for distributed filesystems such as the NFSv4 client. + +When given a mount command of the form "mount server:/foo/bar /mnt", the +NFSv4 client is required to look up the filehandle for "server:/", and +then look up each component of the remote mount path "foo/bar" in order +to find the directory that is actually going to be mounted on /mnt. +Following that remote mount path may involve following symlinks, +crossing server-side mount points and even following referrals to +filesystem volumes on other servers. + +Since the standard VFS path lookup code already supports walking paths +that contain all these features (using in-kernel automounts for +following referrals) we would like to be able to reuse that rather than +duplicate the full path traversal functionality in the NFSv4 client code. + +This patch therefore defines a VFS helper function create_mnt_ns(), that +sets up a temporary filesystem namespace and attaches a root filesystem to +it. It exports the create_mnt_ns() and put_mnt_ns() function for use by +filesystem modules. + +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Acked-by: NeilBrown +--- + fs/namespace.c | 45 ++++++++++++++++++++++++++++++++++-------- + include/linux/mnt_namespace.h | 1 + 2 files changed, 38 insertions(+), 8 deletions(-) + +--- a/fs/namespace.c ++++ b/fs/namespace.c +@@ -1939,6 +1939,21 @@ dput_out: + return retval; + } + ++static struct mnt_namespace *alloc_mnt_ns(void) ++{ ++ struct mnt_namespace *new_ns; ++ ++ new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); ++ if (!new_ns) ++ return ERR_PTR(-ENOMEM); ++ atomic_set(&new_ns->count, 1); ++ new_ns->root = NULL; ++ INIT_LIST_HEAD(&new_ns->list); ++ init_waitqueue_head(&new_ns->poll); ++ new_ns->event = 0; ++ return new_ns; ++} ++ + /* + * Allocate a new namespace structure and populate it with contents + * copied from the namespace of the passed in task structure. +@@ -1950,14 +1965,9 @@ static struct mnt_namespace *dup_mnt_ns( + struct vfsmount *rootmnt = NULL, *pwdmnt = NULL; + struct vfsmount *p, *q; + +- new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); +- if (!new_ns) +- return ERR_PTR(-ENOMEM); +- +- atomic_set(&new_ns->count, 1); +- INIT_LIST_HEAD(&new_ns->list); +- init_waitqueue_head(&new_ns->poll); +- new_ns->event = 0; ++ new_ns = alloc_mnt_ns(); ++ if (IS_ERR(new_ns)) ++ return new_ns; + + down_write(&namespace_sem); + /* First pass: copy the tree topology */ +@@ -2021,6 +2031,24 @@ struct mnt_namespace *copy_mnt_ns(unsign + return new_ns; + } + ++/** ++ * create_mnt_ns - creates a private namespace and adds a root filesystem ++ * @mnt: pointer to the new root filesystem mountpoint ++ */ ++struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt) ++{ ++ struct mnt_namespace *new_ns; ++ ++ new_ns = alloc_mnt_ns(); ++ if (!IS_ERR(new_ns)) { ++ mnt->mnt_ns = new_ns; ++ new_ns->root = mnt; ++ list_add(&new_ns->list, &new_ns->root->mnt_list); ++ } ++ return new_ns; ++} ++EXPORT_SYMBOL(create_mnt_ns); ++ + SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, + char __user *, type, unsigned long, flags, void __user *, data) + { +@@ -2328,3 +2356,4 @@ void put_mnt_ns(struct mnt_namespace *ns + release_mounts(&umount_list); + kfree(ns); + } ++EXPORT_SYMBOL(put_mnt_ns); +--- a/include/linux/mnt_namespace.h ++++ b/include/linux/mnt_namespace.h +@@ -22,6 +22,7 @@ struct proc_mounts { + int event; + }; + ++extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); + extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, + struct fs_struct *); + extern void put_mnt_ns(struct mnt_namespace *ns); diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-03-NFSv4-Replace-nfs4_path_walk-with-VFS-path-lookup-in-private-namespace b/src/patches/suse-2.6.27.31/patches.fixes/nfs-03-NFSv4-Replace-nfs4_path_walk-with-VFS-path-lookup-in-private-namespace new file mode 100644 index 000000000..14d6fbb85 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-03-NFSv4-Replace-nfs4_path_walk-with-VFS-path-lookup-in-private-namespace @@ -0,0 +1,291 @@ +From c02d7adf8c5429727a98bad1d039bccad4c61c50 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 22 Jun 2009 15:09:14 -0400 +Subject: [PATCH 3/5] NFSv4: Replace nfs4_path_walk() with VFS path lookup in a private namespace + +As noted in the previous patch, the NFSv4 client mount code currently +has several limitations. If the mount path contains symlinks, or +referrals, or even if it just contains a '..', then the client code in +nfs4_path_walk() will fail with an error. + +This patch replaces the nfs4_path_walk()-based lookup with a helper +function that sets up a private namespace to represent the namespace on the +server, then uses the ordinary VFS and NFS path lookup code to walk down the +mount path in that namespace. + +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Acked-by: NeilBrown +--- + fs/nfs/super.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 156 insertions(+), 20 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/super.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfs/super.c +@@ -42,6 +42,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -244,10 +246,14 @@ static const struct super_operations nfs + #ifdef CONFIG_NFS_V4 + static int nfs4_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); ++static int nfs4_remote_get_sb(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); + static int nfs4_xdev_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); + static int nfs4_referral_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); ++static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); + static void nfs4_kill_super(struct super_block *sb); + + static struct file_system_type nfs4_fs_type = { +@@ -258,6 +264,14 @@ static struct file_system_type nfs4_fs_t + .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, + }; + ++static struct file_system_type nfs4_remote_fs_type = { ++ .owner = THIS_MODULE, ++ .name = "nfs4", ++ .get_sb = nfs4_remote_get_sb, ++ .kill_sb = nfs4_kill_super, ++ .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, ++}; ++ + struct file_system_type nfs4_xdev_fs_type = { + .owner = THIS_MODULE, + .name = "nfs4", +@@ -266,6 +280,14 @@ struct file_system_type nfs4_xdev_fs_typ + .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, + }; + ++static struct file_system_type nfs4_remote_referral_fs_type = { ++ .owner = THIS_MODULE, ++ .name = "nfs4", ++ .get_sb = nfs4_remote_referral_get_sb, ++ .kill_sb = nfs4_kill_super, ++ .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, ++}; ++ + struct file_system_type nfs4_referral_fs_type = { + .owner = THIS_MODULE, + .name = "nfs4", +@@ -2294,12 +2316,12 @@ out_no_client_address: + } + + /* +- * Get the superblock for an NFS4 mountpoint ++ * Get the superblock for the NFS4 root partition + */ +-static int nfs4_get_sb(struct file_system_type *fs_type, ++static int nfs4_remote_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) + { +- struct nfs_parsed_mount_data *data; ++ struct nfs_parsed_mount_data *data = raw_data; + struct super_block *s; + struct nfs_server *server; + struct nfs_fh *mntfh; +@@ -2310,18 +2332,12 @@ static int nfs4_get_sb(struct file_syste + }; + int error = -ENOMEM; + +- data = kzalloc(sizeof(*data), GFP_KERNEL); + mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL); + if (data == NULL || mntfh == NULL) + goto out_free_fh; + + security_init_mnt_opts(&data->lsm_opts); + +- /* Validate the mount data */ +- error = nfs4_validate_mount_data(raw_data, data, dev_name); +- if (error < 0) +- goto out; +- + /* Get a volume representation */ + server = nfs4_create_server(data, mntfh); + if (IS_ERR(server)) { +@@ -2334,7 +2350,7 @@ static int nfs4_get_sb(struct file_syste + compare_super = NULL; + + /* Get a superblock - note that we may end up sharing one that already exists */ +- s = sget(fs_type, compare_super, nfs_set_super, &sb_mntdata); ++ s = sget(&nfs4_fs_type, compare_super, nfs_set_super, &sb_mntdata); + if (IS_ERR(s)) { + error = PTR_ERR(s); + goto out_free; +@@ -2370,13 +2386,9 @@ static int nfs4_get_sb(struct file_syste + error = 0; + + out: +- kfree(data->client_address); +- kfree(data->nfs_server.export_path); +- kfree(data->nfs_server.hostname); + security_free_mnt_opts(&data->lsm_opts); + out_free_fh: + kfree(mntfh); +- kfree(data); + return error; + + out_free: +@@ -2391,6 +2403,101 @@ error_splat_super: + goto out; + } + ++static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type, ++ int flags, void *data, const char *hostname) ++{ ++ struct vfsmount *root_mnt; ++ char *root_devname; ++ size_t len; ++ ++ len = strlen(hostname) + 3; ++ root_devname = kmalloc(len, GFP_KERNEL); ++ if (root_devname == NULL) ++ return ERR_PTR(-ENOMEM); ++ snprintf(root_devname, len, "%s:/", hostname); ++ root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data); ++ kfree(root_devname); ++ return root_mnt; ++} ++ ++static int nfs_follow_remote_path(struct vfsmount *root_mnt, ++ const char *export_path, struct vfsmount *mnt_target) ++{ ++ struct mnt_namespace *ns_private; ++ struct nameidata nd; ++ struct super_block *s; ++ int ret; ++ ++ ns_private = create_mnt_ns(root_mnt); ++ ret = PTR_ERR(ns_private); ++ if (IS_ERR(ns_private)) ++ goto out_mntput; ++ ++ ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt, ++ export_path, LOOKUP_FOLLOW, &nd); ++ ++ put_mnt_ns(ns_private); ++ ++ if (ret != 0) ++ goto out_err; ++ ++ s = nd.path.mnt->mnt_sb; ++ atomic_inc(&s->s_active); ++ mnt_target->mnt_sb = s; ++ mnt_target->mnt_root = dget(nd.path.dentry); ++ ++ path_put(&nd.path); ++ down_write(&s->s_umount); ++ return 0; ++out_mntput: ++ mntput(root_mnt); ++out_err: ++ return ret; ++} ++ ++/* ++ * Get the superblock for an NFS4 mountpoint ++ */ ++static int nfs4_get_sb(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) ++{ ++ struct nfs_parsed_mount_data *data; ++ char *export_path; ++ struct vfsmount *root_mnt; ++ int error = -ENOMEM; ++ ++ data = kzalloc(sizeof(*data), GFP_KERNEL); ++ if (data == NULL) ++ goto out_free_data; ++ ++ /* Validate the mount data */ ++ error = nfs4_validate_mount_data(raw_data, data, dev_name); ++ if (error < 0) ++ goto out; ++ ++ export_path = data->nfs_server.export_path; ++ data->nfs_server.export_path = "/"; ++ root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, data, ++ data->nfs_server.hostname); ++ data->nfs_server.export_path = export_path; ++ ++ error = PTR_ERR(root_mnt); ++ if (IS_ERR(root_mnt)) ++ goto out; ++ ++ error = nfs_follow_remote_path(root_mnt, export_path, mnt); ++ ++out: ++ kfree(data->client_address); ++ kfree(data->nfs_server.export_path); ++ kfree(data->nfs_server.hostname); ++out_free_data: ++ kfree(data); ++ dprintk("<-- nfs4_get_sb() = %d%s\n", error, ++ error != 0 ? " [error]" : ""); ++ return error; ++} ++ + static void nfs4_kill_super(struct super_block *sb) + { + struct nfs_server *server = NFS_SB(sb); +@@ -2486,12 +2593,9 @@ error_splat_super: + return error; + } + +-/* +- * Create an NFS4 server record on referral traversal +- */ +-static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags, +- const char *dev_name, void *raw_data, +- struct vfsmount *mnt) ++static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *raw_data, ++ struct vfsmount *mnt) + { + struct nfs_clone_mount *data = raw_data; + struct super_block *s; +@@ -2571,4 +2675,36 @@ error_splat_super: + return error; + } + ++/* ++ * Create an NFS4 server record on referral traversal ++ */ ++static int nfs4_referral_get_sb(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *raw_data, ++ struct vfsmount *mnt) ++{ ++ struct nfs_clone_mount *data = raw_data; ++ char *export_path; ++ struct vfsmount *root_mnt; ++ int error; ++ ++ dprintk("--> nfs4_referral_get_sb()\n"); ++ ++ export_path = data->mnt_path; ++ data->mnt_path = "/"; ++ ++ root_mnt = nfs_do_root_mount(&nfs4_remote_referral_fs_type, ++ flags, data, data->hostname); ++ data->mnt_path = export_path; ++ ++ error = PTR_ERR(root_mnt); ++ if (IS_ERR(root_mnt)) ++ goto out; ++ ++ error = nfs_follow_remote_path(root_mnt, export_path, mnt); ++out: ++ dprintk("<-- nfs4_referral_get_sb() = %d%s\n", error, ++ error != 0 ? " [error]" : ""); ++ return error; ++} ++ + #endif /* CONFIG_NFS_V4 */ diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path b/src/patches/suse-2.6.27.31/patches.fixes/nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path new file mode 100644 index 000000000..3fd25fe7d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path @@ -0,0 +1,26 @@ +From 0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 22 Jun 2009 15:09:14 -0400 +Subject: [PATCH 4/5] NFS: Fix nfs_path() to always return a '/' at the beginning of the path + +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Acked-by: NeilBrown +--- + fs/nfs/namespace.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/namespace.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfs/namespace.c +@@ -65,6 +65,11 @@ char *nfs_path(const char *base, + dentry = dentry->d_parent; + } + spin_unlock(&dcache_lock); ++ if (*end != '/') { ++ if (--buflen < 0) ++ goto Elong; ++ *--end = '/'; ++ } + namelen = strlen(base); + /* Strip off excess slashes in base string */ + while (namelen > 0 && base[namelen - 1] == '/') diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-05-Correct-the-NFS-mount-path-when-following-a-referral b/src/patches/suse-2.6.27.31/patches.fixes/nfs-05-Correct-the-NFS-mount-path-when-following-a-referral new file mode 100644 index 000000000..8a95f5d02 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-05-Correct-the-NFS-mount-path-when-following-a-referral @@ -0,0 +1,52 @@ +From b88f8a546f5dba213938fdfc11e66bc5c2421623 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 22 Jun 2009 15:09:14 -0400 +Subject: [PATCH 5/5] NFS: Correct the NFS mount path when following a referral + +Signed-off-by: Trond Myklebust +Signed-off-by: Linus Torvalds +Acked-by: NeilBrown +--- + fs/nfs/super.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/super.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfs/super.c +@@ -2420,6 +2420,27 @@ static struct vfsmount *nfs_do_root_moun + return root_mnt; + } + ++static void nfs_fix_devname(const struct path *path, struct vfsmount *mnt) ++{ ++ char *page = (char *) __get_free_page(GFP_KERNEL); ++ char *devname, *tmp; ++ ++ if (page == NULL) ++ return; ++ devname = nfs_path(path->mnt->mnt_devname, ++ path->mnt->mnt_root, path->dentry, ++ page, PAGE_SIZE); ++ if (devname == NULL) ++ goto out_freepage; ++ tmp = kstrdup(devname, GFP_KERNEL); ++ if (tmp == NULL) ++ goto out_freepage; ++ kfree(mnt->mnt_devname); ++ mnt->mnt_devname = tmp; ++out_freepage: ++ free_page((unsigned long)page); ++} ++ + static int nfs_follow_remote_path(struct vfsmount *root_mnt, + const char *export_path, struct vfsmount *mnt_target) + { +@@ -2446,6 +2467,9 @@ static int nfs_follow_remote_path(struct + mnt_target->mnt_sb = s; + mnt_target->mnt_root = dget(nd.path.dentry); + ++ /* Correct the device pathname */ ++ nfs_fix_devname(&nd.path, mnt_target); ++ + path_put(&nd.path); + down_write(&s->s_umount); + return 0; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfs-06-dont-bother-with-check_mnt-in-do_add_mount-on-shrinkable-ones b/src/patches/suse-2.6.27.31/patches.fixes/nfs-06-dont-bother-with-check_mnt-in-do_add_mount-on-shrinkable-ones new file mode 100644 index 000000000..579bc0161 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-06-dont-bother-with-check_mnt-in-do_add_mount-on-shrinkable-ones @@ -0,0 +1,29 @@ +Git: dd5cae6e9772ecc62fd374f7a8ec10eb51c96c4d +From: Al Viro +Subject: Don't bother with check_mnt() in do_add_mount() on shrinkable ones +Date: Tue Apr 7 12:21:18 2009 -0400 +Patch-mainline: 2.7.30 +References: bnc#490030, bnc#531633 + +These guys are what we add as submounts; checks for "is that attached in +our namespace" are simply irrelevant for those and counterproductive for +use of private vfsmount trees a-la what NFS folks want. + +Signed-off-by: Al Viro +Acked-by: NeilBrown + +--- + fs/namespace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/namespace.c ++++ linux-2.6.27-SLE11_BRANCH/fs/namespace.c +@@ -1658,7 +1658,7 @@ int do_add_mount(struct vfsmount *newmnt + follow_down(&path->mnt, &path->dentry)) + ; + err = -EINVAL; +- if (!check_mnt(path->mnt)) ++ if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(path->mnt)) + goto unlock; + + /* Refuse the same filesystem on the same mount point */ diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-acl-caching.diff b/src/patches/suse-2.6.27.31/patches.fixes/nfs-acl-caching.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-acl-caching.diff rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-acl-caching.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-file-cred-context-null b/src/patches/suse-2.6.27.31/patches.fixes/nfs-file-cred-context-null similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-file-cred-context-null rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-file-cred-context-null diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-fix-nfs3_xdr_setaclargs b/src/patches/suse-2.6.27.31/patches.fixes/nfs-fix-nfs3_xdr_setaclargs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-fix-nfs3_xdr_setaclargs rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-fix-nfs3_xdr_setaclargs diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-fix-posix-acl b/src/patches/suse-2.6.27.31/patches.fixes/nfs-fix-posix-acl similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-fix-posix-acl rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-fix-posix-acl diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-handle-ESTALE-on-ACCESS b/src/patches/suse-2.6.27.31/patches.fixes/nfs-handle-ESTALE-on-ACCESS similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-handle-ESTALE-on-ACCESS rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-handle-ESTALE-on-ACCESS diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-lock-release-lockargs b/src/patches/suse-2.6.27.31/patches.fixes/nfs-lock-release-lockargs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-lock-release-lockargs rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-lock-release-lockargs diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nfs-write.c-bug-removal.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfs-write.c-bug-removal.patch similarity index 85% rename from src/patches/suse-2.6.27.25/patches.fixes/nfs-write.c-bug-removal.patch rename to src/patches/suse-2.6.27.31/patches.fixes/nfs-write.c-bug-removal.patch index ebceada09..edebc1881 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/nfs-write.c-bug-removal.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfs-write.c-bug-removal.patch @@ -17,7 +17,7 @@ Signed-off-by: Neil Brown --- a/fs/nfs/write.c +++ b/fs/nfs/write.c -@@ -284,9 +284,12 @@ static int nfs_page_async_flush(struct n +@@ -282,9 +282,12 @@ static int nfs_page_async_flush(struct n return ret; spin_lock(&inode->i_lock); } @@ -32,7 +32,7 @@ Signed-off-by: Neil Brown } if (nfs_set_page_writeback(page) != 0) { spin_unlock(&inode->i_lock); -@@ -460,6 +463,19 @@ nfs_mark_request_dirty(struct nfs_page * +@@ -458,6 +461,19 @@ nfs_mark_request_dirty(struct nfs_page * __set_page_dirty_nobuffers(req->wb_page); } @@ -52,7 +52,7 @@ Signed-off-by: Neil Brown #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) /* * Add a request to the inode's commit list. -@@ -472,7 +488,7 @@ nfs_mark_request_commit(struct nfs_page +@@ -470,7 +486,7 @@ nfs_mark_request_commit(struct nfs_page spin_lock(&inode->i_lock); nfsi->ncommit++; @@ -61,7 +61,7 @@ Signed-off-by: Neil Brown radix_tree_tag_set(&nfsi->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_COMMIT); -@@ -483,19 +499,6 @@ nfs_mark_request_commit(struct nfs_page +@@ -481,19 +497,6 @@ nfs_mark_request_commit(struct nfs_page __mark_inode_dirty(inode, I_DIRTY_DATASYNC); } @@ -81,7 +81,7 @@ Signed-off-by: Neil Brown static inline int nfs_write_need_commit(struct nfs_write_data *data) { -@@ -505,7 +508,7 @@ int nfs_write_need_commit(struct nfs_wri +@@ -503,7 +506,7 @@ int nfs_write_need_commit(struct nfs_wri static inline int nfs_reschedule_unstable_write(struct nfs_page *req) { @@ -90,7 +90,7 @@ Signed-off-by: Neil Brown nfs_mark_request_commit(req); return 1; } -@@ -521,12 +524,6 @@ nfs_mark_request_commit(struct nfs_page +@@ -519,12 +522,6 @@ nfs_mark_request_commit(struct nfs_page { } @@ -103,7 +103,7 @@ Signed-off-by: Neil Brown static inline int nfs_write_need_commit(struct nfs_write_data *data) { -@@ -584,8 +581,11 @@ static void nfs_cancel_commit_list(struc +@@ -582,8 +579,11 @@ static void nfs_cancel_commit_list(struc while(!list_empty(head)) { req = nfs_list_entry(head->next); @@ -116,7 +116,7 @@ Signed-off-by: Neil Brown nfs_inode_remove_request(req); nfs_unlock_request(req); } -@@ -657,7 +657,8 @@ static struct nfs_page *nfs_try_to_updat +@@ -655,7 +655,8 @@ static struct nfs_page *nfs_try_to_updat * Note: nfs_flush_incompatible() will already * have flushed out requests having wrong owners. */ @@ -126,7 +126,7 @@ Signed-off-by: Neil Brown || end < req->wb_offset) goto out_flushme; -@@ -673,10 +674,6 @@ static struct nfs_page *nfs_try_to_updat +@@ -671,10 +672,6 @@ static struct nfs_page *nfs_try_to_updat spin_lock(&inode->i_lock); } @@ -137,7 +137,7 @@ Signed-off-by: Neil Brown /* Okay, the request matches. Update the region */ if (offset < req->wb_offset) { req->wb_offset = offset; -@@ -758,7 +755,8 @@ int nfs_flush_incompatible(struct file * +@@ -756,7 +753,8 @@ int nfs_flush_incompatible(struct file * req = nfs_page_find_request(page); if (req == NULL) return 0; @@ -147,7 +147,7 @@ Signed-off-by: Neil Brown nfs_release_request(req); if (!do_flush) return 0; -@@ -1363,7 +1361,10 @@ static void nfs_commit_release(void *cal +@@ -1361,7 +1359,10 @@ static void nfs_commit_release(void *cal while (!list_empty(&data->pages)) { req = nfs_list_entry(data->pages.next); nfs_list_remove_request(req); @@ -159,7 +159,7 @@ Signed-off-by: Neil Brown dprintk("NFS: commit (%s/%lld %d@%lld)", req->wb_context->path.dentry->d_inode->i_sb->s_id, -@@ -1539,7 +1540,7 @@ int nfs_wb_page_cancel(struct inode *ino +@@ -1537,7 +1538,7 @@ int nfs_wb_page_cancel(struct inode *ino req = nfs_page_find_request(page); if (req == NULL) goto out; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-01-sunrpc-cache-simplify-cache_fresh_locked-and-cache_f.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-01-sunrpc-cache-simplify-cache_fresh_locked-and-cache_f.patch new file mode 100644 index 000000000..8d93b3cb0 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-01-sunrpc-cache-simplify-cache_fresh_locked-and-cache_f.patch @@ -0,0 +1,94 @@ +Patch-mainline: submitted 4aug09 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:37 +1000 +Subject: [PATCH 03/12] sunrpc/cache: simplify cache_fresh_locked and cache_fresh_unlocked. + +The extra call to cache_revisit_request in cache_fresh_unlocked is not +needed, as should have been fairly clear at the time of + commit 4013edea9a0b6cdcb1fdf5d4011e47e068fd6efb + +If there are requests to be revisited, then we can be sure that +CACHE_PENDING is set, so the second call is sufficient. + +So remove the first call. +Then remove the 'new' parameter, +then remove the return value for cache_fresh_locked which is only used +to provide the value for 'new'. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/cache.c | 23 ++++++++++------------- + 1 file changed, 10 insertions(+), 13 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c +@@ -103,18 +103,16 @@ EXPORT_SYMBOL(sunrpc_cache_lookup); + + static void queue_loose(struct cache_detail *detail, struct cache_head *ch); + +-static int cache_fresh_locked(struct cache_head *head, time_t expiry) ++static void cache_fresh_locked(struct cache_head *head, time_t expiry) + { + head->expiry_time = expiry; + head->last_refresh = get_seconds(); +- return !test_and_set_bit(CACHE_VALID, &head->flags); ++ set_bit(CACHE_VALID, &head->flags); + } + + static void cache_fresh_unlocked(struct cache_head *head, +- struct cache_detail *detail, int new) ++ struct cache_detail *detail) + { +- if (new) +- cache_revisit_request(head); + if (test_and_clear_bit(CACHE_PENDING, &head->flags)) { + cache_revisit_request(head); + queue_loose(detail, head); +@@ -130,7 +128,6 @@ struct cache_head *sunrpc_cache_update(s + */ + struct cache_head **head; + struct cache_head *tmp; +- int is_new; + + if (!test_bit(CACHE_VALID, &old->flags)) { + write_lock(&detail->hash_lock); +@@ -139,9 +136,9 @@ struct cache_head *sunrpc_cache_update(s + set_bit(CACHE_NEGATIVE, &old->flags); + else + detail->update(old, new); +- is_new = cache_fresh_locked(old, new->expiry_time); ++ cache_fresh_locked(old, new->expiry_time); + write_unlock(&detail->hash_lock); +- cache_fresh_unlocked(old, detail, is_new); ++ cache_fresh_unlocked(old, detail); + return old; + } + write_unlock(&detail->hash_lock); +@@ -165,11 +162,11 @@ struct cache_head *sunrpc_cache_update(s + *head = tmp; + detail->entries++; + cache_get(tmp); +- is_new = cache_fresh_locked(tmp, new->expiry_time); ++ cache_fresh_locked(tmp, new->expiry_time); + cache_fresh_locked(old, 0); + write_unlock(&detail->hash_lock); +- cache_fresh_unlocked(tmp, detail, is_new); +- cache_fresh_unlocked(old, detail, 0); ++ cache_fresh_unlocked(tmp, detail); ++ cache_fresh_unlocked(old, detail); + cache_put(old, detail); + return tmp; + } +@@ -223,8 +220,8 @@ int cache_check(struct cache_detail *det + clear_bit(CACHE_PENDING, &h->flags); + if (rv == -EAGAIN) { + set_bit(CACHE_NEGATIVE, &h->flags); +- cache_fresh_unlocked(h, detail, +- cache_fresh_locked(h, get_seconds()+CACHE_NEW_EXPIRY)); ++ cache_fresh_locked(h, get_seconds()+CACHE_NEW_EXPIRY); ++ cache_fresh_unlocked(h, detail); + rv = -ENOENT; + } + break; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-02-sunrpc-cache-recheck-cache-validity-after-cache_defe.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-02-sunrpc-cache-recheck-cache-validity-after-cache_defe.patch new file mode 100644 index 000000000..a6fcb278a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-02-sunrpc-cache-recheck-cache-validity-after-cache_defe.patch @@ -0,0 +1,117 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:37 +1000 +Subject: [PATCH 04/12] sunrpc/cache: recheck cache validity after cache_defer_req + +If cache_defer_req did not leave the request on a queue, then it could +possibly have waited long enough that the cache became valid. So check the +status after the call. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/cache.c | 53 +++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 33 insertions(+), 20 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c +@@ -173,6 +173,22 @@ struct cache_head *sunrpc_cache_update(s + EXPORT_SYMBOL(sunrpc_cache_update); + + static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h); ++ ++static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h) ++{ ++ if (!test_bit(CACHE_VALID, &h->flags) || ++ h->expiry_time < get_seconds()) ++ return -EAGAIN; ++ else if (detail->flush_time > h->last_refresh) ++ return -EAGAIN; ++ else { ++ /* entry is valid */ ++ if (test_bit(CACHE_NEGATIVE, &h->flags)) ++ return -ENOENT; ++ else ++ return 0; ++ } ++} + /* + * This is the generic cache management routine for all + * the authentication caches. +@@ -181,8 +197,10 @@ static int cache_make_upcall(struct cach + * + * + * Returns 0 if the cache_head can be used, or cache_puts it and returns +- * -EAGAIN if upcall is pending, +- * -ETIMEDOUT if upcall failed and should be retried, ++ * -EAGAIN if upcall is pending and request has been queued ++ * -ETIMEDOUT if upcall failed or request could not be queue or ++ * upcall completed but item is still invalid (implying that ++ * the cache item has been replaced with a newer one). + * -ENOENT if cache entry was negative + */ + int cache_check(struct cache_detail *detail, +@@ -192,17 +210,7 @@ int cache_check(struct cache_detail *det + long refresh_age, age; + + /* First decide return status as best we can */ +- if (!test_bit(CACHE_VALID, &h->flags) || +- h->expiry_time < get_seconds()) +- rv = -EAGAIN; +- else if (detail->flush_time > h->last_refresh) +- rv = -EAGAIN; +- else { +- /* entry is valid */ +- if (test_bit(CACHE_NEGATIVE, &h->flags)) +- rv = -ENOENT; +- else rv = 0; +- } ++ rv = cache_is_valid(detail, h); + + /* now see if we want to start an upcall */ + refresh_age = (h->expiry_time - h->last_refresh); +@@ -234,10 +242,14 @@ int cache_check(struct cache_detail *det + } + } + +- if (rv == -EAGAIN) +- if (cache_defer_req(rqstp, h) != 0) +- rv = -ETIMEDOUT; +- ++ if (rv == -EAGAIN) { ++ if (cache_defer_req(rqstp, h) == 0) { ++ /* Request is not deferred */ ++ rv = cache_is_valid(detail, h); ++ if (rv == -EAGAIN) ++ rv = -ETIMEDOUT; ++ } ++ } + if (rv) + cache_put(h, detail); + return rv; +@@ -558,11 +570,11 @@ static int cache_defer_req(struct cache_ + * or continue and drop the oldest below + */ + if (net_random()&1) +- return -ETIMEDOUT; ++ return 0; + } + dreq = req->defer(req); + if (dreq == NULL) +- return -ETIMEDOUT; ++ return 0; + + dreq->item = item; + +@@ -592,8 +604,9 @@ static int cache_defer_req(struct cache_ + if (!test_bit(CACHE_PENDING, &item->flags)) { + /* must have just been validated... */ + cache_revisit_request(item); ++ return 0; + } +- return 0; ++ return 1; + } + + static void cache_revisit_request(struct cache_head *item) diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-03-sunrpc-cache-use-list_del_init-for-the-list_head-ent.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-03-sunrpc-cache-use-list_del_init-for-the-list_head-ent.patch new file mode 100644 index 000000000..ee0ad0f6d --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-03-sunrpc-cache-use-list_del_init-for-the-list_head-ent.patch @@ -0,0 +1,47 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:38 +1000 +Subject: [PATCH 05/12] sunrpc/cache: use list_del_init for the list_head entries in cache_deferred_req + +Using list_del_init is generally safer than list_del, and it will +allow us, in the next patch, to see if an entry has already been +processed or not. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/cache.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c +@@ -591,8 +591,8 @@ static int cache_defer_req(struct cache_ + if (++cache_defer_cnt > DFR_MAX) { + dreq = list_entry(cache_defer_list.prev, + struct cache_deferred_req, recent); +- list_del(&dreq->recent); +- list_del(&dreq->hash); ++ list_del_init(&dreq->recent); ++ list_del_init(&dreq->hash); + cache_defer_cnt--; + } + spin_unlock(&cache_defer_lock); +@@ -626,7 +626,7 @@ static void cache_revisit_request(struct + dreq = list_entry(lp, struct cache_deferred_req, hash); + lp = lp->next; + if (dreq->item == item) { +- list_del(&dreq->hash); ++ list_del_init(&dreq->hash); + list_move(&dreq->recent, &pending); + cache_defer_cnt--; + } +@@ -652,7 +652,7 @@ void cache_clean_deferred(void *owner) + + list_for_each_entry_safe(dreq, tmp, &cache_defer_list, recent) { + if (dreq->owner == owner) { +- list_del(&dreq->hash); ++ list_del_init(&dreq->hash); + list_move(&dreq->recent, &pending); + cache_defer_cnt--; + } diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-04-sunrpc-cache-avoid-variable-over-loading-in-cache_de.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-04-sunrpc-cache-avoid-variable-over-loading-in-cache_de.patch new file mode 100644 index 000000000..2c96296fd --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-04-sunrpc-cache-avoid-variable-over-loading-in-cache_de.patch @@ -0,0 +1,59 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:38 +1000 +Subject: [PATCH 06/12] sunrpc/cache: avoid variable over-loading in cache_defer_req + +In cache_defer_req, 'dreq' is used for two significantly different +values that happen to be of the same type. + +This is both confusing, and make it hard to extend the range of one of +the values as we will in the next patch. +So introduce 'discard' to take one of the values. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/cache.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c +@@ -562,7 +562,7 @@ static int cache_defer_cnt; + + static int cache_defer_req(struct cache_req *req, struct cache_head *item) + { +- struct cache_deferred_req *dreq; ++ struct cache_deferred_req *dreq, *discard; + int hash = DFR_HASH(item); + + if (cache_defer_cnt >= DFR_MAX) { +@@ -587,20 +587,20 @@ static int cache_defer_req(struct cache_ + list_add(&dreq->hash, &cache_defer_hash[hash]); + + /* it is in, now maybe clean up */ +- dreq = NULL; ++ discard = NULL; + if (++cache_defer_cnt > DFR_MAX) { +- dreq = list_entry(cache_defer_list.prev, +- struct cache_deferred_req, recent); ++ discard = list_entry(cache_defer_list.prev, ++ struct cache_deferred_req, recent); +- list_del_init(&dreq->recent); +- list_del_init(&dreq->hash); ++ list_del_init(&discard->recent); ++ list_del_init(&discard->hash); + cache_defer_cnt--; + } + spin_unlock(&cache_defer_lock); + +- if (dreq) { ++ if (discard) + /* there was one too many */ +- dreq->revisit(dreq, 1); +- } ++ discard->revisit(discard, 1); ++ + if (!test_bit(CACHE_PENDING, &item->flags)) { + /* must have just been validated... */ + cache_revisit_request(item); diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-05-sunrpc-cache-allow-thread-to-block-while-waiting-for.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-05-sunrpc-cache-allow-thread-to-block-while-waiting-for.patch new file mode 100644 index 000000000..5ace31d1a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-05-sunrpc-cache-allow-thread-to-block-while-waiting-for.patch @@ -0,0 +1,149 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:38 +1000 +Subject: [PATCH 07/12] sunrpc/cache: allow thread to block while waiting for cache update. + +The current practice of waiting for cache updates by queueing the +whole request to be retried has (at least) two problems. + +1/ We NFSv4, requests can be quite complex and re-trying a whole + request when a later part fails should only be a list-resort, not a + normal practice. + +2/ Large requests, and in particular any 'write' request, will not be + queued by the current code and doing so would be undesirable. + +In many cases only a very sort wait is needed before the cache gets +valid data. + +So, providing the underlying transport permits it by setting + ->thread_wait, +arrange to wait briefly for an upcall to be completed (as reflected in +the clearing of CACHE_PENDING). +If the short wait was not long enough and CACHE_PENDING is still set, +fall back on the old approach. + +The 'thread_wait' value is set to 5 seconds when there are spare +threads, and 1 second when there are no spare threads. + +These values are probably much higher than needed, but will ensure +some forward progress. + +Signed-off-by: NeilBrown + +--- + include/linux/sunrpc/cache.h | 3 ++ + net/sunrpc/cache.c | 44 ++++++++++++++++++++++++++++++++++++++++++- + net/sunrpc/svc_xprt.c | 11 ++++++++++ + 3 files changed, 57 insertions(+), 1 deletion(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/include/linux/sunrpc/cache.h ++++ linux-2.6.27-SLE11_BRANCH/include/linux/sunrpc/cache.h +@@ -112,6 +112,9 @@ struct cache_detail { + */ + struct cache_req { + struct cache_deferred_req *(*defer)(struct cache_req *req); ++ int thread_wait; /* How long (jiffies) we can block the ++ * current thread to wait for updates. ++ */ + }; + /* this must be embedded in a deferred_request that is being + * delayed awaiting cache-fill +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c +@@ -560,10 +560,22 @@ static LIST_HEAD(cache_defer_list); + static struct list_head cache_defer_hash[DFR_HASHSIZE]; + static int cache_defer_cnt; + ++struct thread_deferred_req { ++ struct cache_deferred_req handle; ++ wait_queue_head_t wait; ++}; ++static void cache_restart_thread(struct cache_deferred_req *dreq, int too_many) ++{ ++ struct thread_deferred_req *dr = ++ container_of(dreq, struct thread_deferred_req, handle); ++ wake_up(&dr->wait); ++} ++ + static int cache_defer_req(struct cache_req *req, struct cache_head *item) + { + struct cache_deferred_req *dreq, *discard; + int hash = DFR_HASH(item); ++ struct thread_deferred_req sleeper; + + if (cache_defer_cnt >= DFR_MAX) { + /* too much in the cache, randomly drop this one, +@@ -572,7 +584,14 @@ static int cache_defer_req(struct cache_ + if (net_random()&1) + return 0; + } +- dreq = req->defer(req); ++ if (req->thread_wait) { ++ dreq = &sleeper.handle; ++ init_waitqueue_head(&sleeper.wait); ++ dreq->revisit = cache_restart_thread; ++ } else ++ dreq = req->defer(req); ++ ++ retry: + if (dreq == NULL) + return 0; + +@@ -606,6 +625,29 @@ static int cache_defer_req(struct cache_ + cache_revisit_request(item); + return 0; + } ++ ++ if (dreq == &sleeper.handle) { ++ wait_event_interruptible_timeout( ++ sleeper.wait, ++ !test_bit(CACHE_PENDING, &item->flags) ++ || list_empty(&sleeper.handle.hash), ++ req->thread_wait); ++ spin_lock(&cache_defer_lock); ++ if (!list_empty(&sleeper.handle.hash)) { ++ list_del_init(&sleeper.handle.recent); ++ list_del_init(&sleeper.handle.hash); ++ cache_defer_cnt--; ++ } ++ spin_unlock(&cache_defer_lock); ++ if (test_bit(CACHE_PENDING, &item->flags)) { ++ /* item is still pending, try request ++ * deferral ++ */ ++ dreq = req->defer(req); ++ goto retry; ++ } ++ return 0; ++ } + return 1; + } + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/svc_xprt.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/svc_xprt.c +@@ -593,12 +593,23 @@ int svc_recv(struct svc_rqst *rqstp, lon + return -EINTR; + + spin_lock_bh(&pool->sp_lock); ++ ++ /* Normally we will wait up to 5 seconds for any required ++ * cache information to be provided. ++ */ ++ rqstp->rq_chandle.thread_wait = 5*HZ; + xprt = svc_xprt_dequeue(pool); + if (xprt) { + rqstp->rq_xprt = xprt; + svc_xprt_get(xprt); + rqstp->rq_reserved = serv->sv_max_mesg; + atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved); ++ ++ /* As there is a shortage of threads and this request ++ * had to be queue, don't allow the thread to wait so ++ * long for cache updates. ++ */ ++ rqstp->rq_chandle.thread_wait = 1*HZ; + } else { + /* No data pending. Go to sleep */ + svc_thread_enqueue(pool, rqstp); diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-06-sunrpc-cache-retry-cache-lookups-that-return-ETIMEDO.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-06-sunrpc-cache-retry-cache-lookups-that-return-ETIMEDO.patch new file mode 100644 index 000000000..078db781c --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-06-sunrpc-cache-retry-cache-lookups-that-return-ETIMEDO.patch @@ -0,0 +1,122 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:38 +1000 +Subject: [PATCH 08/12] sunrpc/cache: retry cache lookups that return -ETIMEDOUT + +If cache_check returns -ETIMEDOUT, then the cache item is not +up-to-date, but there is no pending upcall. +This could mean the data is not available, or it could mean that the +good data has been stored in a new cache item. + +So re-do the lookup and if that returns a new item, proceed using that +item. + +Signed-off-by: NeilBrown + +--- + fs/nfsd/export.c | 18 ++++++++++++++++++ + net/sunrpc/svcauth_unix.c | 22 ++++++++++++++++++++-- + 2 files changed, 38 insertions(+), 2 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfsd/export.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfsd/export.c +@@ -796,9 +796,18 @@ exp_find_key(svc_client *clp, int fsid_t + memcpy(key.ek_fsid, fsidv, key_len(fsid_type)); + + ek = svc_expkey_lookup(&key); ++ again: + if (ek == NULL) + return ERR_PTR(-ENOMEM); + err = cache_check(&svc_expkey_cache, &ek->h, reqp); ++ if (err == -ETIMEDOUT) { ++ struct svc_expkey *prev_ek = ek; ++ ek = svc_expkey_lookup(&key); ++ if (ek != prev_ek) ++ goto again; ++ if (ek) ++ cache_put(&ek->h, &svc_expkey_cache); ++ } + if (err) + return ERR_PTR(err); + return ek; +@@ -870,9 +879,18 @@ static svc_export *exp_get_by_name(svc_c + key.ex_path.dentry = dentry; + + exp = svc_export_lookup(&key); ++ retry: + if (exp == NULL) + return ERR_PTR(-ENOMEM); + err = cache_check(&svc_export_cache, &exp->h, reqp); ++ if (err == -ETIMEDOUT) { ++ struct svc_export *prev_exp = exp; ++ exp = svc_export_lookup(&key); ++ if (exp != prev_exp) ++ goto retry; ++ if (exp) ++ cache_put(&exp->h, &svc_export_cache); ++ } + if (err) + return ERR_PTR(err); + return exp; +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/svcauth_unix.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/svcauth_unix.c +@@ -659,8 +659,10 @@ static int unix_gid_find(uid_t uid, stru + struct svc_rqst *rqstp) + { + struct unix_gid *ug = unix_gid_lookup(uid); ++ struct unix_gid *prevug; + if (!ug) + return -EAGAIN; ++ retry: + switch (cache_check(&unix_gid_cache, &ug->h, &rqstp->rq_chandle)) { + case -ENOENT: + *gip = NULL; +@@ -669,6 +671,13 @@ static int unix_gid_find(uid_t uid, stru + *gip = ug->gi; + get_group_info(*gip); + return 0; ++ case -ETIMEDOUT: ++ prevug = ug; ++ ug = unix_gid_lookup(uid); ++ if (ug != prevug) ++ goto retry; ++ if (ug) ++ cache_put(&ug->h, &unix_gid_cache); + default: + return -EAGAIN; + } +@@ -679,7 +688,7 @@ svcauth_unix_set_client(struct svc_rqst + { + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6, sin6_storage; +- struct ip_map *ipm; ++ struct ip_map *ipm, *prev_ipm; + + switch (rqstp->rq_addr.ss_family) { + case AF_INET: +@@ -704,14 +713,23 @@ svcauth_unix_set_client(struct svc_rqst + ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, + &sin6->sin6_addr); + ++ retry: + if (ipm == NULL) + return SVC_DENIED; + + switch (cache_check(&ip_map_cache, &ipm->h, &rqstp->rq_chandle)) { + default: + BUG(); +- case -EAGAIN: + case -ETIMEDOUT: ++ prev_ipm = ipm; ++ ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, ++ &sin6->sin6_addr); ++ if (ipm != prev_ipm) ++ goto retry; ++ if (ipm) ++ cache_put(&ipm->h, &ip_map_cache); ++ ++ case -EAGAIN: + return SVC_DROP; + case -ENOENT: + return SVC_DENIED; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-07-nfsd-idmap-drop-special-request-deferal-in-favour-of.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-07-nfsd-idmap-drop-special-request-deferal-in-favour-of.patch new file mode 100644 index 000000000..266855945 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-07-nfsd-idmap-drop-special-request-deferal-in-favour-of.patch @@ -0,0 +1,141 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:39 +1000 +Subject: [PATCH 09/12] nfsd/idmap: drop special request deferal in favour of improved default. + +The idmap code manages request deferal by waiting for a reply from +userspace rather than putting the NFS request on a queue to be retried +from the start. +Now that the comment deferal code does this there is no need for the +special code in idmap. + +Signed-off-by: NeilBrown + +--- + fs/nfsd/nfs4idmap.c | 105 +++++----------------------------------------------- + 1 file changed, 11 insertions(+), 94 deletions(-) + +--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfsd/nfs4idmap.c ++++ linux-2.6.27-SLE11_BRANCH/fs/nfsd/nfs4idmap.c +@@ -485,109 +485,26 @@ nfsd_idmap_shutdown(void) + cache_unregister(&nametoid_cache); + } + +-/* +- * Deferred request handling +- */ +- +-struct idmap_defer_req { +- struct cache_req req; +- struct cache_deferred_req deferred_req; +- wait_queue_head_t waitq; +- atomic_t count; +-}; +- +-static inline void +-put_mdr(struct idmap_defer_req *mdr) +-{ +- if (atomic_dec_and_test(&mdr->count)) +- kfree(mdr); +-} +- +-static inline void +-get_mdr(struct idmap_defer_req *mdr) +-{ +- atomic_inc(&mdr->count); +-} +- +-static void +-idmap_revisit(struct cache_deferred_req *dreq, int toomany) +-{ +- struct idmap_defer_req *mdr = +- container_of(dreq, struct idmap_defer_req, deferred_req); +- +- wake_up(&mdr->waitq); +- put_mdr(mdr); +-} +- +-static struct cache_deferred_req * +-idmap_defer(struct cache_req *req) +-{ +- struct idmap_defer_req *mdr = +- container_of(req, struct idmap_defer_req, req); +- +- mdr->deferred_req.revisit = idmap_revisit; +- get_mdr(mdr); +- return (&mdr->deferred_req); +-} +- +-static inline int +-do_idmap_lookup(struct ent *(*lookup_fn)(struct ent *), struct ent *key, +- struct cache_detail *detail, struct ent **item, +- struct idmap_defer_req *mdr) +-{ +- *item = lookup_fn(key); +- if (!*item) +- return -ENOMEM; +- return cache_check(detail, &(*item)->h, &mdr->req); +-} +- +-static inline int +-do_idmap_lookup_nowait(struct ent *(*lookup_fn)(struct ent *), +- struct ent *key, struct cache_detail *detail, +- struct ent **item) +-{ +- int ret = -ENOMEM; +- +- *item = lookup_fn(key); +- if (!*item) +- goto out_err; +- ret = -ETIMEDOUT; +- if (!test_bit(CACHE_VALID, &(*item)->h.flags) +- || (*item)->h.expiry_time < get_seconds() +- || detail->flush_time > (*item)->h.last_refresh) +- goto out_put; +- ret = -ENOENT; +- if (test_bit(CACHE_NEGATIVE, &(*item)->h.flags)) +- goto out_put; +- return 0; +-out_put: +- cache_put(&(*item)->h, detail); +-out_err: +- *item = NULL; +- return ret; +-} +- + static int + idmap_lookup(struct svc_rqst *rqstp, + struct ent *(*lookup_fn)(struct ent *), struct ent *key, + struct cache_detail *detail, struct ent **item) + { +- struct idmap_defer_req *mdr; + int ret; + +- mdr = kzalloc(sizeof(*mdr), GFP_KERNEL); +- if (!mdr) ++ *item = lookup_fn(key); ++ if (!*item) + return -ENOMEM; +- atomic_set(&mdr->count, 1); +- init_waitqueue_head(&mdr->waitq); +- mdr->req.defer = idmap_defer; +- ret = do_idmap_lookup(lookup_fn, key, detail, item, mdr); +- if (ret == -EAGAIN) { +- wait_event_interruptible_timeout(mdr->waitq, +- test_bit(CACHE_VALID, &(*item)->h.flags), 1 * HZ); +- ret = do_idmap_lookup_nowait(lookup_fn, key, detail, item); ++ retry: ++ ret = cache_check(detail, &(*item)->h, &rqstp->rq_chandle); ++ ++ if (ret == -ETIMEDOUT) { ++ struct ent *prev_item = *item; ++ *item = lookup_fn(key); ++ if (*item != prev_item) ++ goto retry; ++ cache_put(&(*item)->h, detail); + } +- put_mdr(mdr); + return ret; + } + diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-08-sunrpc-fix-memory-leak-in-unix_gid-cache.patch b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-08-sunrpc-fix-memory-leak-in-unix_gid-cache.patch new file mode 100644 index 000000000..4d6ce858b --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-08-sunrpc-fix-memory-leak-in-unix_gid-cache.patch @@ -0,0 +1,26 @@ +Patch-mainline: submitted 04aug2009 +References: bnc#498708 +From: NeilBrown +Date: Tue, 4 Aug 2009 15:06:39 +1000 +Subject: [PATCH 10/12] sunrpc: fix memory leak in unix_gid cache. + +When we look up an entry in the uid->gidlist cache, we take +a reference to the content but don't drop the reference to the +cache entry. So it never gets freed. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/svcauth_unix.c | 1 + + 1 file changed, 1 insertion(+) + +--- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/svcauth_unix.c ++++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/svcauth_unix.c +@@ -670,6 +670,7 @@ static int unix_gid_find(uid_t uid, stru + case 0: + *gip = ug->gi; + get_group_info(*gip); ++ cache_put(&ug->h, &unix_gid_cache); + return 0; + case -ETIMEDOUT: + prevug = ug; diff --git a/src/patches/suse-2.6.27.31/patches.fixes/nfsd-09-fix-kabi b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-09-fix-kabi new file mode 100644 index 000000000..8eb6c6db7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/nfsd-09-fix-kabi @@ -0,0 +1,89 @@ +From: NeilBrown + +--- + include/linux/sunrpc/cache.h | 3 --- + net/sunrpc/cache.c | 12 +++++------- + net/sunrpc/svc_xprt.c | 9 --------- + 3 files changed, 5 insertions(+), 19 deletions(-) + +--- linux-2.6.27-working.orig/include/linux/sunrpc/cache.h ++++ linux-2.6.27-working/include/linux/sunrpc/cache.h +@@ -112,9 +112,6 @@ struct cache_detail { + */ + struct cache_req { + struct cache_deferred_req *(*defer)(struct cache_req *req); +- int thread_wait; /* How long (jiffies) we can block the +- * current thread to wait for updates. +- */ + }; + /* this must be embedded in a deferred_request that is being + * delayed awaiting cache-fill +--- linux-2.6.27-working.orig/net/sunrpc/cache.c ++++ linux-2.6.27-working/net/sunrpc/cache.c +@@ -584,12 +584,10 @@ static int cache_defer_req(struct cache_ + if (net_random()&1) + return 0; + } +- if (req->thread_wait) { +- dreq = &sleeper.handle; +- init_waitqueue_head(&sleeper.wait); +- dreq->revisit = cache_restart_thread; +- } else +- dreq = req->defer(req); ++ ++ dreq = &sleeper.handle; ++ init_waitqueue_head(&sleeper.wait); ++ dreq->revisit = cache_restart_thread; + + retry: + if (dreq == NULL) +@@ -631,7 +629,7 @@ static int cache_defer_req(struct cache_ + sleeper.wait, + !test_bit(CACHE_PENDING, &item->flags) + || list_empty(&sleeper.handle.hash), +- req->thread_wait); ++ 3*HZ); + spin_lock(&cache_defer_lock); + if (!list_empty(&sleeper.handle.hash)) { + list_del_init(&sleeper.handle.recent); +--- linux-2.6.27-working.orig/net/sunrpc/svc_xprt.c ++++ linux-2.6.27-working/net/sunrpc/svc_xprt.c +@@ -594,10 +594,6 @@ int svc_recv(struct svc_rqst *rqstp, lon + + spin_lock_bh(&pool->sp_lock); + +- /* Normally we will wait up to 5 seconds for any required +- * cache information to be provided. +- */ +- rqstp->rq_chandle.thread_wait = 5*HZ; + xprt = svc_xprt_dequeue(pool); + if (xprt) { + rqstp->rq_xprt = xprt; +@@ -605,11 +601,6 @@ int svc_recv(struct svc_rqst *rqstp, lon + rqstp->rq_reserved = serv->sv_max_mesg; + atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved); + +- /* As there is a shortage of threads and this request +- * had to be queue, don't allow the thread to wait so +- * long for cache updates. +- */ +- rqstp->rq_chandle.thread_wait = 1*HZ; + } else { + /* No data pending. Go to sleep */ + svc_thread_enqueue(pool, rqstp); diff --git a/src/patches/suse-2.6.27.25/patches.fixes/no-sys_uv-on-non-uv-systems b/src/patches/suse-2.6.27.31/patches.fixes/no-sys_uv-on-non-uv-systems similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/no-sys_uv-on-non-uv-systems rename to src/patches/suse-2.6.27.31/patches.fixes/no-sys_uv-on-non-uv-systems diff --git a/src/patches/suse-2.6.27.25/patches.fixes/nr-irqs-file b/src/patches/suse-2.6.27.31/patches.fixes/nr-irqs-file similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/nr-irqs-file rename to src/patches/suse-2.6.27.31/patches.fixes/nr-irqs-file diff --git a/src/patches/suse-2.6.27.25/patches.fixes/numa-enable-hashdist-default.patch b/src/patches/suse-2.6.27.31/patches.fixes/numa-enable-hashdist-default.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/numa-enable-hashdist-default.patch rename to src/patches/suse-2.6.27.31/patches.fixes/numa-enable-hashdist-default.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 similarity index 76% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 index 4b2b4736e..72ce017d2 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 +++ b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-4e8a301929bfa017e6ffe11e3cf78ccaf8492801 @@ -10,13 +10,11 @@ that get it for writing. Signed-off-by: Jan Kara --- fs/ocfs2/quota_global.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) + 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c -index 1ed0f7c..edfa60c 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c -@@ -421,6 +421,7 @@ int ocfs2_global_read_dquot(struct dquot *dquot) +@@ -354,6 +354,7 @@ int ocfs2_global_read_dquot(struct dquot OCFS2_DQUOT(dquot)->dq_originodes = dquot->dq_dqb.dqb_curinodes; if (!dquot->dq_off) { /* No real quota entry? */ /* Upgrade to exclusive lock for allocation */ @@ -24,7 +22,7 @@ index 1ed0f7c..edfa60c 100644 err = ocfs2_qinfo_lock(info, 1); if (err < 0) goto out_qlock; -@@ -435,7 +436,8 @@ int ocfs2_global_read_dquot(struct dquot *dquot) +@@ -368,7 +369,8 @@ int ocfs2_global_read_dquot(struct dquot out_qlock: if (ex) ocfs2_qinfo_unlock(info, 1); @@ -34,6 +32,3 @@ index 1ed0f7c..edfa60c 100644 out: if (err < 0) mlog_errno(err); --- -1.6.0.2 - diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 similarity index 90% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 index a632630d1..2a53d27f6 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 +++ b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-65bac575e35915801ea518b9d8d8824367d125c8 @@ -19,13 +19,11 @@ quota file lock anywhere inside vfs_dq_transfer(). Signed-off-by: Jan Kara --- fs/ocfs2/file.c | 53 ++++++++++++++++++++++++++++++----------------------- - 1 files changed, 30 insertions(+), 23 deletions(-) + 1 file changed, 30 insertions(+), 23 deletions(-) -diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c -index c2a87c8..1a96cac 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c -@@ -894,9 +894,9 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) +@@ -899,9 +899,9 @@ int ocfs2_setattr(struct dentry *dentry, struct ocfs2_super *osb = OCFS2_SB(sb); struct buffer_head *bh = NULL; handle_t *handle = NULL; @@ -38,7 +36,7 @@ index c2a87c8..1a96cac 100644 mlog_entry("(0x%p, '%.*s')\n", dentry, dentry->d_name.len, dentry->d_name.name); -@@ -969,30 +969,37 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) +@@ -974,30 +974,37 @@ int ocfs2_setattr(struct dentry *dentry, if ((attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { @@ -90,7 +88,7 @@ index c2a87c8..1a96cac 100644 if (IS_ERR(handle)) { status = PTR_ERR(handle); mlog_errno(status); -@@ -1030,12 +1037,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) +@@ -1035,12 +1042,6 @@ int ocfs2_setattr(struct dentry *dentry, bail_commit: ocfs2_commit_trans(osb, handle); bail_unlock: @@ -103,7 +101,7 @@ index c2a87c8..1a96cac 100644 ocfs2_inode_unlock(inode, 1); bail_unlock_rw: if (size_change) -@@ -1043,6 +1044,12 @@ bail_unlock_rw: +@@ -1048,6 +1049,12 @@ bail_unlock_rw: bail: brelse(bh); @@ -116,6 +114,3 @@ index c2a87c8..1a96cac 100644 if (!status && attr->ia_valid & ATTR_MODE) { status = ocfs2_acl_chmod(inode); if (status < 0) --- -1.6.0.2 - diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-80d73f15d12f087f3fe074f8a4d6e5c5624f2b47 b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-80d73f15d12f087f3fe074f8a4d6e5c5624f2b47 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-80d73f15d12f087f3fe074f8a4d6e5c5624f2b47 rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-80d73f15d12f087f3fe074f8a4d6e5c5624f2b47 diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 similarity index 77% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 index 6943e465d..b58feed1b 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 +++ b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-1.4-git-b4c30de39a2596503e888a7b47d19792f25913d6 @@ -13,13 +13,11 @@ it in the end since we don't need it - noone can race with us at this moment. Signed-off-by: Jan Kara --- fs/ocfs2/quota_local.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) + 1 file changed, 5 insertions(+) -diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c -index 07deec5..71cf410 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c -@@ -655,6 +655,9 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) +@@ -647,6 +647,9 @@ static int ocfs2_local_read_info(struct struct ocfs2_quota_recovery *rec; int locked = 0; @@ -29,7 +27,7 @@ index 07deec5..71cf410 100644 info->dqi_maxblimit = 0x7fffffffffffffffLL; info->dqi_maxilimit = 0x7fffffffffffffffLL; oinfo = kmalloc(sizeof(struct ocfs2_mem_dqinfo), GFP_NOFS); -@@ -733,6 +736,7 @@ static int ocfs2_local_read_info(struct super_block *sb, int type) +@@ -725,6 +728,7 @@ static int ocfs2_local_read_info(struct goto out_err; } @@ -37,7 +35,7 @@ index 07deec5..71cf410 100644 return 0; out_err: if (oinfo) { -@@ -746,6 +750,7 @@ out_err: +@@ -738,6 +742,7 @@ out_err: kfree(oinfo); } brelse(bh); @@ -45,6 +43,3 @@ index 07deec5..71cf410 100644 return -1; } --- -1.6.0.2 - diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Add-JBD2-compat-feature-bit.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Add-JBD2-compat-feature-bit.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Add-JBD2-compat-feature-bit.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Add-JBD2-compat-feature-bit.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Always-update-xattr-search-when-creating-buck.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Always-update-xattr-search-when-creating-buck.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Always-update-xattr-search-when-creating-buck.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Always-update-xattr-search-when-creating-buck.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-errors-from-ocfs2_xattr_update_xattr_se.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-errors-from-ocfs2_xattr_update_xattr_se.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-errors-from-ocfs2_xattr_update_xattr_se.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-errors-from-ocfs2_xattr_update_xattr_se.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-search-result-in-ocfs2_xattr_block_get.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-search-result-in-ocfs2_xattr_block_get.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-search-result-in-ocfs2_xattr_block_get.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-search-result-in-ocfs2_xattr_block_get.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-xattr-block-signatures-properly.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-xattr-block-signatures-properly.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Check-xattr-block-signatures-properly.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Check-xattr-block-signatures-properly.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Don-t-repeat-ocfs2_xattr_block_find.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Don-t-repeat-ocfs2_xattr_block_find.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Don-t-repeat-ocfs2_xattr_block_find.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Don-t-repeat-ocfs2_xattr_block_find.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Don-t-return-EFAULT-from-a-corrupt-xattr-ent.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Don-t-return-EFAULT-from-a-corrupt-xattr-ent.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Don-t-return-EFAULT-from-a-corrupt-xattr-ent.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Don-t-return-EFAULT-from-a-corrupt-xattr-ent.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-check-of-return-value-of-ocfs2_start_tran.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-checking-of-return-value-of-new_inode.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-checking-of-return-value-of-new_inode.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-checking-of-return-value-of-new_inode.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-checking-of-return-value-of-new_inode.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-some-typos-in-xattr-annotations.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-some-typos-in-xattr-annotations.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Fix-some-typos-in-xattr-annotations.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-some-typos-in-xattr-annotations.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Let-inode-be-really-deleted-when-ocfs2_mknod_.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Let-inode-be-really-deleted-when-ocfs2_mknod_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Let-inode-be-really-deleted-when-ocfs2_mknod_.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Let-inode-be-really-deleted-when-ocfs2_mknod_.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Remove-unused-ocfs2_restore_xattr_block.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Remove-unused-ocfs2_restore_xattr_block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Remove-unused-ocfs2_restore_xattr_block.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Remove-unused-ocfs2_restore_xattr_block.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Set-journal-descriptor-to-NULL-after-journal.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Set-journal-descriptor-to-NULL-after-journal.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Set-journal-descriptor-to-NULL-after-journal.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Set-journal-descriptor-to-NULL-after-journal.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Specify-appropriate-journal-access-for-new-xa.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Specify-appropriate-journal-access-for-new-xa.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-Specify-appropriate-journal-access-for-new-xa.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Specify-appropriate-journal-access-for-new-xa.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-access-and-dirty-the-buffer_head-in-mark_writ.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-access-and-dirty-the-buffer_head-in-mark_writ.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-access-and-dirty-the-buffer_head-in-mark_writ.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-access-and-dirty-the-buffer_head-in-mark_writ.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-handler_map-array-bounds-checking.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-handler_map-array-bounds-checking.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-handler_map-array-bounds-checking.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-handler_map-array-bounds-checking.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-io-error-check-in-ocfs2_get_sector.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-io-error-check-in-ocfs2_get_sector.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-io-error-check-in-ocfs2_get_sector.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-io-error-check-in-ocfs2_get_sector.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-quota-call-to-ocfs2_remove_btree_range.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-quota-call-to-ocfs2_remove_btree_range.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-add-quota-call-to-ocfs2_remove_btree_range.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-add-quota-call-to-ocfs2_remove_btree_range.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-comments-typo-fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-comments-typo-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-comments-typo-fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-comments-typo-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-Hold-off-sending-lockres-drop-ref-message.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-Hold-off-sending-lockres-drop-ref-message.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-Hold-off-sending-lockres-drop-ref-message.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-Hold-off-sending-lockres-drop-ref-message.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-activate-dlm-master_hash-for-master-list.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-activate-dlm-master_hash-for-master-list.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-activate-dlm-master_hash-for-master-list.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-activate-dlm-master_hash-for-master-list.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-clean-up-struct-dlm_lock_name.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-clean-up-struct-dlm_lock_name.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-clean-up-struct-dlm_lock_name.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-clean-up-struct-dlm_lock_name.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-create-and-destroy-the-dlm-master_hash.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-create-and-destroy-the-dlm-master_hash.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-create-and-destroy-the-dlm-master_hash.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-create-and-destroy-the-dlm-master_hash.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-dlm_set_lockres_owner-and-dlm_change_lo.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-dlm_set_lockres_owner-and-dlm_change_lo.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-dlm_set_lockres_owner-and-dlm_change_lo.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-dlm_set_lockres_owner-and-dlm_change_lo.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-do-not-purge-lockres-that-is-being-migrat.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-do-not-purge-lockres-that-is-being-migrat.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-do-not-purge-lockres-that-is-being-migrat.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-do-not-purge-lockres-that-is-being-migrat.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-encapsulate-adding-and-removing-of-mle-fr.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-encapsulate-adding-and-removing-of-mle-fr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-encapsulate-adding-and-removing-of-mle-fr.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-encapsulate-adding-and-removing-of-mle-fr.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-fix-race-in-adding-removing-lockres-to-f.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-fix-race-in-adding-removing-lockres-to-f.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-fix-race-in-adding-removing-lockres-to-f.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-fix-race-in-adding-removing-lockres-to-f.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-improve-lockres-counts.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-improve-lockres-counts.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-improve-lockres-counts.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-improve-lockres-counts.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-indent-dlm_cleanup_master_list.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-indent-dlm_cleanup_master_list.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-indent-dlm_cleanup_master_list.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-indent-dlm_cleanup_master_list.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-make-dlm_assert_master_handler-kill-its.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-make-dlm_assert_master_handler-kill-its.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-make-dlm_assert_master_handler-kill-its.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-make-dlm_assert_master_handler-kill-its.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-refactor-dlm_clean_master_list.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-refactor-dlm_clean_master_list.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-refactor-dlm_clean_master_list.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-refactor-dlm_clean_master_list.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-remove-struct-dlm_lock_name-in-struct-dlm.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-remove-struct-dlm_lock_name-in-struct-dlm.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-remove-struct-dlm_lock_name-in-struct-dlm.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-remove-struct-dlm_lock_name-in-struct-dlm.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-show-the-number-of-lockres-mles-in-dlm_st.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-show-the-number-of-lockres-mles-in-dlm_st.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-show-the-number-of-lockres-mles-in-dlm_st.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-show-the-number-of-lockres-mles-in-dlm_st.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-track-number-of-mles.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-track-number-of-mles.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-track-number-of-mles.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-track-number-of-mles.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-tweak-mle_state-output.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-tweak-mle_state-output.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-tweak-mle_state-output.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-tweak-mle_state-output.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-use-ast_lock-to-protect-ast_list.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-use-ast_lock-to-protect-ast_list.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-dlm-use-ast_lock-to-protect-ast_list.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-dlm-use-ast_lock-to-protect-ast_list.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-a-bug-found-by-sparse-check.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-a-bug-found-by-sparse-check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-a-bug-found-by-sparse-check.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-a-bug-found-by-sparse-check.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-function-declaration-and-definition-in-xa.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-function-declaration-and-definition-in-xa.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-function-declaration-and-definition-in-xa.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-function-declaration-and-definition-in-xa.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-license-in-xattr.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-license-in-xattr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-license-in-xattr.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-license-in-xattr.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-printk-related-build-warnings-in-xattr.c.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-printk-related-build-warnings-in-xattr.c.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-printk-related-build-warnings-in-xattr.c.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-printk-related-build-warnings-in-xattr.c.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-return-value-set-in-init_dlmfs_fs.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-return-value-set-in-init_dlmfs_fs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-return-value-set-in-init_dlmfs_fs.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-return-value-set-in-init_dlmfs_fs.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-wake_up-in-unlock_ast.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-wake_up-in-unlock_ast.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-wake_up-in-unlock_ast.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-fix-wake_up-in-unlock_ast.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-initialize-count-before-generic_write_checks b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-count-before-generic_write_checks similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-initialize-count-before-generic_write_checks rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-count-before-generic_write_checks diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-initialize-stack_user-lvbptr.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-stack_user-lvbptr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-initialize-stack_user-lvbptr.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-stack_user-lvbptr.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-the-cluster-we-re-writing-to.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-the-cluster-we-re-writing-to.patch new file mode 100644 index 000000000..4046ce62a --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-initialize-the-cluster-we-re-writing-to.patch @@ -0,0 +1,193 @@ +From e7432675f8ca868a4af365759a8d4c3779a3d922 Mon Sep 17 00:00:00 2001 +From: Sunil Mushran +Date: Thu, 6 Aug 2009 16:12:58 -0700 +Subject: ocfs2: Initialize the cluster we're writing to in a non-sparse extend +References: bnc#501563 + +In a non-sparse extend, we correctly allocate (and zero) the clusters between +the old_i_size and pos, but we don't zero the portions of the cluster we're +writing to outside of pos<->len. + +It handles clustersize > pagesize and blocksize < pagesize. + +[Cleaned up by Joel Becker.] + +Signed-off-by: Sunil Mushran +Signed-off-by: Joel Becker +Signed-off-by: Mark Fasheh +--- + fs/ocfs2/aops.c | 66 +++++++++++++++++++++++++++++++++++++++--------------- + 1 files changed, 47 insertions(+), 19 deletions(-) + +Index: linux-2.6.27-ocfs2-update-sle11/fs/ocfs2/aops.c +=================================================================== +--- linux-2.6.27-ocfs2-update-sle11.orig/fs/ocfs2/aops.c ++++ linux-2.6.27-ocfs2-update-sle11/fs/ocfs2/aops.c +@@ -909,18 +909,17 @@ struct ocfs2_write_cluster_desc { + */ + unsigned c_new; + unsigned c_unwritten; ++ unsigned c_needs_zero; + }; + +-static inline int ocfs2_should_zero_cluster(struct ocfs2_write_cluster_desc *d) +-{ +- return d->c_new || d->c_unwritten; +-} +- + struct ocfs2_write_ctxt { + /* Logical cluster position / len of write */ + u32 w_cpos; + u32 w_clen; + ++ /* First cluster allocated in a nonsparse extend */ ++ u32 w_first_new_cpos; ++ + struct ocfs2_write_cluster_desc w_desc[OCFS2_MAX_CLUSTERS_PER_PAGE]; + + /* +@@ -998,6 +997,7 @@ static int ocfs2_alloc_write_ctxt(struct + return -ENOMEM; + + wc->w_cpos = pos >> osb->s_clustersize_bits; ++ wc->w_first_new_cpos = UINT_MAX; + cend = (pos + len - 1) >> osb->s_clustersize_bits; + wc->w_clen = cend - wc->w_cpos + 1; + get_bh(di_bh); +@@ -1239,20 +1239,18 @@ out: + */ + static int ocfs2_write_cluster(struct address_space *mapping, + u32 phys, unsigned int unwritten, ++ unsigned int should_zero, + struct ocfs2_alloc_context *data_ac, + struct ocfs2_alloc_context *meta_ac, + struct ocfs2_write_ctxt *wc, u32 cpos, + loff_t user_pos, unsigned user_len) + { +- int ret, i, new, should_zero = 0; ++ int ret, i, new; + u64 v_blkno, p_blkno; + struct inode *inode = mapping->host; + struct ocfs2_extent_tree et; + + new = phys == 0 ? 1 : 0; +- if (new || unwritten) +- should_zero = 1; +- + if (new) { + u32 tmp_pos; + +@@ -1363,7 +1361,9 @@ static int ocfs2_write_cluster_by_desc(s + local_len = osb->s_clustersize - cluster_off; + + ret = ocfs2_write_cluster(mapping, desc->c_phys, +- desc->c_unwritten, data_ac, meta_ac, ++ desc->c_unwritten, ++ desc->c_needs_zero, ++ data_ac, meta_ac, + wc, desc->c_cpos, pos, local_len); + if (ret) { + mlog_errno(ret); +@@ -1413,14 +1413,14 @@ static void ocfs2_set_target_boundaries( + * newly allocated cluster. + */ + desc = &wc->w_desc[0]; +- if (ocfs2_should_zero_cluster(desc)) ++ if (desc->c_needs_zero) + ocfs2_figure_cluster_boundaries(osb, + desc->c_cpos, + &wc->w_target_from, + NULL); + + desc = &wc->w_desc[wc->w_clen - 1]; +- if (ocfs2_should_zero_cluster(desc)) ++ if (desc->c_needs_zero) + ocfs2_figure_cluster_boundaries(osb, + desc->c_cpos, + NULL, +@@ -1488,13 +1488,28 @@ static int ocfs2_populate_write_desc(str + phys++; + } + ++ /* ++ * If w_first_new_cpos is < UINT_MAX, we have a non-sparse ++ * file that got extended. w_first_new_cpos tells us ++ * where the newly allocated clusters are so we can ++ * zero them. ++ */ ++ if (desc->c_cpos >= wc->w_first_new_cpos) { ++ BUG_ON(phys == 0); ++ desc->c_needs_zero = 1; ++ } ++ + desc->c_phys = phys; + if (phys == 0) { + desc->c_new = 1; ++ desc->c_needs_zero = 1; + *clusters_to_alloc = *clusters_to_alloc + 1; + } +- if (ext_flags & OCFS2_EXT_UNWRITTEN) ++ ++ if (ext_flags & OCFS2_EXT_UNWRITTEN) { + desc->c_unwritten = 1; ++ desc->c_needs_zero = 1; ++ } + + num_clusters--; + } +@@ -1654,10 +1669,13 @@ static int ocfs2_expand_nonsparse_inode( + if (newsize <= i_size_read(inode)) + return 0; + +- ret = ocfs2_extend_no_holes(inode, newsize, newsize - len); ++ ret = ocfs2_extend_no_holes(inode, newsize, pos); + if (ret) + mlog_errno(ret); + ++ wc->w_first_new_cpos = ++ ocfs2_clusters_for_bytes(inode->i_sb, i_size_read(inode)); ++ + return ret; + } + +@@ -1666,7 +1684,7 @@ int ocfs2_write_begin_nolock(struct addr + struct page **pagep, void **fsdata, + struct buffer_head *di_bh, struct page *mmap_page) + { +- int ret, credits = OCFS2_INODE_UPDATE_CREDITS; ++ int ret, cluster_of_pages, credits = OCFS2_INODE_UPDATE_CREDITS; + unsigned int clusters_to_alloc, extents_to_split; + struct ocfs2_write_ctxt *wc; + struct inode *inode = mapping->host; +@@ -1744,8 +1762,19 @@ int ocfs2_write_begin_nolock(struct addr + + } + +- ocfs2_set_target_boundaries(osb, wc, pos, len, +- clusters_to_alloc + extents_to_split); ++ /* ++ * We have to zero sparse allocated clusters, unwritten extent clusters, ++ * and non-sparse clusters we just extended. For non-sparse writes, ++ * we know zeros will only be needed in the first and/or last cluster. ++ */ ++ if (clusters_to_alloc || extents_to_split || ++ wc->w_desc[0].c_needs_zero || ++ wc->w_desc[wc->w_clen - 1].c_needs_zero) ++ cluster_of_pages = 1; ++ else ++ cluster_of_pages = 0; ++ ++ ocfs2_set_target_boundaries(osb, wc, pos, len, cluster_of_pages); + + handle = ocfs2_start_trans(osb, credits); + if (IS_ERR(handle)) { +@@ -1778,8 +1807,7 @@ int ocfs2_write_begin_nolock(struct addr + * extent. + */ + ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos, +- clusters_to_alloc + extents_to_split, +- mmap_page); ++ cluster_of_pages, mmap_page); + if (ret) { + mlog_errno(ret); + goto out_quota; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-more_start_tran_fixes.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-more_start_tran_fixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-more_start_tran_fixes.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-more_start_tran_fixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-push-out-dropping-of-dentry-lock-to-ocfs2_wq.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-push-out-dropping-of-dentry-lock-to-ocfs2_wq.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-push-out-dropping-of-dentry-lock-to-ocfs2_wq.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-push-out-dropping-of-dentry-lock-to-ocfs2_wq.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Initialize-blocks-allocated-to-local-quota-fi.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Initialize-blocks-allocated-to-local-quota-fi.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Initialize-blocks-allocated-to-local-quota-fi.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Initialize-blocks-allocated-to-local-quota-fi.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Make-global-quota-files-blocksize-aligned.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Make-global-quota-files-blocksize-aligned.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Make-global-quota-files-blocksize-aligned.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Make-global-quota-files-blocksize-aligned.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch similarity index 79% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch index dd980302b..e39726e30 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Mark-buffer-uptodate-before-calling-ocfs2_jou.patch @@ -11,10 +11,8 @@ marking buffer uptodate. Signed-off-by: Jan Kara --- fs/ocfs2/quota_local.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) + 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c -index 5a460fa..b624f9b 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -20,6 +20,7 @@ @@ -25,7 +23,7 @@ index 5a460fa..b624f9b 100644 /* Number of local quota structures per block */ static inline unsigned int ol_quota_entries_per_block(struct super_block *sb) -@@ -979,6 +980,8 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( +@@ -968,6 +969,8 @@ static struct ocfs2_quota_chunk *ocfs2_l mlog_errno(status); goto out; } @@ -34,7 +32,7 @@ index 5a460fa..b624f9b 100644 dchunk = (struct ocfs2_local_disk_chunk *)bh->b_data; handle = ocfs2_start_trans(OCFS2_SB(sb), 2); -@@ -999,7 +1002,6 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( +@@ -988,7 +991,6 @@ static struct ocfs2_quota_chunk *ocfs2_l memset(dchunk->dqc_bitmap, 0, sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) - OCFS2_QBLK_RESERVED_SPACE); @@ -42,6 +40,3 @@ index 5a460fa..b624f9b 100644 unlock_buffer(bh); status = ocfs2_journal_dirty(handle, bh); if (status < 0) { --- -1.6.0.2 - diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Remove-syncjiff-field-from-quota-info.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Remove-syncjiff-field-from-quota-info.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-quota-Remove-syncjiff-field-from-quota-info.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-quota-Remove-syncjiff-field-from-quota-info.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-really-add-ACL-Kconfig.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-really-add-ACL-Kconfig.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-really-add-ACL-Kconfig.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-really-add-ACL-Kconfig.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-duplicate-definition-in-xattr.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-duplicate-definition-in-xattr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-duplicate-definition-in-xattr.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-duplicate-definition-in-xattr.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-prepare_write-commit_write.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-prepare_write-commit_write.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-prepare_write-commit_write.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-prepare_write-commit_write.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-undefined-xattr-handlers.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-undefined-xattr-handlers.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-remove-undefined-xattr-handlers.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-remove-undefined-xattr-handlers.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-reserve-xattr-block-for-new-directory-with-in.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-reserve-xattr-block-for-new-directory-with-in.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-reserve-xattr-block-for-new-directory-with-in.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-reserve-xattr-block-for-new-directory-with-in.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-set-gap-to-seperate-entry-and-value-when-xatt.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-set-gap-to-seperate-entry-and-value-when-xatt.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-set-gap-to-seperate-entry-and-value-when-xatt.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-set-gap-to-seperate-entry-and-value-when-xatt.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-truncate-outstanding-block-after-direct-io-fa.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-truncate-outstanding-block-after-direct-io-fa.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-truncate-outstanding-block-after-direct-io-fa.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-truncate-outstanding-block-after-direct-io-fa.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-tweak-to-get-the-maximum-inline-data-size-wit.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-tweak-to-get-the-maximum-inline-data-size-wit.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-tweak-to-get-the-maximum-inline-data-size-wit.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-tweak-to-get-the-maximum-inline-data-size-wit.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-use-xs-bucket-to-set-xattr-value-outside.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-use-xs-bucket-to-set-xattr-value-outside.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-use-xs-bucket-to-set-xattr-value-outside.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-use-xs-bucket-to-set-xattr-value-outside.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-wakeup-the-downconvert-thread-after-a-success.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-wakeup-the-downconvert-thread-after-a-success.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-wakeup-the-downconvert-thread-after-a-success.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-wakeup-the-downconvert-thread-after-a-success.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ocfs2-xattr-Proper-hash-collision-handle-in-bucket.patch b/src/patches/suse-2.6.27.31/patches.fixes/ocfs2-xattr-Proper-hash-collision-handle-in-bucket.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ocfs2-xattr-Proper-hash-collision-handle-in-bucket.patch rename to src/patches/suse-2.6.27.31/patches.fixes/ocfs2-xattr-Proper-hash-collision-handle-in-bucket.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/oom-warning b/src/patches/suse-2.6.27.31/patches.fixes/oom-warning similarity index 96% rename from src/patches/suse-2.6.27.25/patches.fixes/oom-warning rename to src/patches/suse-2.6.27.31/patches.fixes/oom-warning index 4900e2b24..cd9a3a788 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/oom-warning +++ b/src/patches/suse-2.6.27.31/patches.fixes/oom-warning @@ -13,7 +13,7 @@ Signed-off-by: Andrea Arcangeli --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1645,7 +1645,13 @@ nofail_alloc: +@@ -1650,7 +1650,13 @@ nofail_alloc: nopage: if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit()) { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/open-iscsi-git-update b/src/patches/suse-2.6.27.31/patches.fixes/open-iscsi-git-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/open-iscsi-git-update rename to src/patches/suse-2.6.27.31/patches.fixes/open-iscsi-git-update diff --git a/src/patches/suse-2.6.27.25/patches.fixes/open-iscsi-mv-transport-eh-setting b/src/patches/suse-2.6.27.31/patches.fixes/open-iscsi-mv-transport-eh-setting similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/open-iscsi-mv-transport-eh-setting rename to src/patches/suse-2.6.27.31/patches.fixes/open-iscsi-mv-transport-eh-setting diff --git a/src/patches/suse-2.6.27.25/patches.fixes/parport-mutex b/src/patches/suse-2.6.27.31/patches.fixes/parport-mutex similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/parport-mutex rename to src/patches/suse-2.6.27.31/patches.fixes/parport-mutex diff --git a/src/patches/suse-2.6.27.25/patches.fixes/pci-amd-813x-b2-devices-do-not-need-quirk.patch b/src/patches/suse-2.6.27.31/patches.fixes/pci-amd-813x-b2-devices-do-not-need-quirk.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/pci-amd-813x-b2-devices-do-not-need-quirk.patch rename to src/patches/suse-2.6.27.31/patches.fixes/pci-amd-813x-b2-devices-do-not-need-quirk.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/percpu_counter_sum_cleanup.patch b/src/patches/suse-2.6.27.31/patches.fixes/percpu_counter_sum_cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/percpu_counter_sum_cleanup.patch rename to src/patches/suse-2.6.27.31/patches.fixes/percpu_counter_sum_cleanup.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/pkt_action-skbedit b/src/patches/suse-2.6.27.31/patches.fixes/pkt_action-skbedit similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/pkt_action-skbedit rename to src/patches/suse-2.6.27.31/patches.fixes/pkt_action-skbedit diff --git a/src/patches/suse-2.6.27.25/patches.fixes/pkt_sched_multiq_support b/src/patches/suse-2.6.27.31/patches.fixes/pkt_sched_multiq_support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/pkt_sched_multiq_support rename to src/patches/suse-2.6.27.31/patches.fixes/pkt_sched_multiq_support diff --git a/src/patches/suse-2.6.27.25/patches.fixes/proc-scsi-scsi-fix.diff b/src/patches/suse-2.6.27.31/patches.fixes/proc-scsi-scsi-fix.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/proc-scsi-scsi-fix.diff rename to src/patches/suse-2.6.27.31/patches.fixes/proc-scsi-scsi-fix.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/ptrace-getsiginfo b/src/patches/suse-2.6.27.31/patches.fixes/ptrace-getsiginfo similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/ptrace-getsiginfo rename to src/patches/suse-2.6.27.31/patches.fixes/ptrace-getsiginfo diff --git a/src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-check-fc-rport-validity b/src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-check-fc-rport-validity similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-check-fc-rport-validity rename to src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-check-fc-rport-validity diff --git a/src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-devtbl-fix b/src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-devtbl-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-devtbl-fix rename to src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-devtbl-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-disable-automatic-queue-tracking b/src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-disable-automatic-queue-tracking similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/qla2xxx-disable-automatic-queue-tracking rename to src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-disable-automatic-queue-tracking diff --git a/src/patches/suse-2.6.27.25/patches.fixes/reiserfs-commit-ids-unsigned-ints b/src/patches/suse-2.6.27.31/patches.fixes/reiserfs-commit-ids-unsigned-ints similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/reiserfs-commit-ids-unsigned-ints rename to src/patches/suse-2.6.27.31/patches.fixes/reiserfs-commit-ids-unsigned-ints diff --git a/src/patches/suse-2.6.27.25/patches.fixes/reiserfs-debug-1036 b/src/patches/suse-2.6.27.31/patches.fixes/reiserfs-debug-1036 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/reiserfs-debug-1036 rename to src/patches/suse-2.6.27.31/patches.fixes/reiserfs-debug-1036 diff --git a/src/patches/suse-2.6.27.25/patches.fixes/reiserfs-error-buffer-locking b/src/patches/suse-2.6.27.31/patches.fixes/reiserfs-error-buffer-locking similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/reiserfs-error-buffer-locking rename to src/patches/suse-2.6.27.31/patches.fixes/reiserfs-error-buffer-locking diff --git a/src/patches/suse-2.6.27.25/patches.fixes/reiserfs-prealloc-fix b/src/patches/suse-2.6.27.31/patches.fixes/reiserfs-prealloc-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/reiserfs-prealloc-fix rename to src/patches/suse-2.6.27.31/patches.fixes/reiserfs-prealloc-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/reiserfs-varargs-fix b/src/patches/suse-2.6.27.31/patches.fixes/reiserfs-varargs-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/reiserfs-varargs-fix rename to src/patches/suse-2.6.27.31/patches.fixes/reiserfs-varargs-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/remount-no-shrink-dcache b/src/patches/suse-2.6.27.31/patches.fixes/remount-no-shrink-dcache similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/remount-no-shrink-dcache rename to src/patches/suse-2.6.27.31/patches.fixes/remount-no-shrink-dcache diff --git a/src/patches/suse-2.6.27.25/patches.fixes/remove_kernel_physical_mapping_init_from_init b/src/patches/suse-2.6.27.31/patches.fixes/remove_kernel_physical_mapping_init_from_init similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/remove_kernel_physical_mapping_init_from_init rename to src/patches/suse-2.6.27.31/patches.fixes/remove_kernel_physical_mapping_init_from_init diff --git a/src/patches/suse-2.6.27.25/patches.fixes/round-jiffies-up b/src/patches/suse-2.6.27.31/patches.fixes/round-jiffies-up similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/round-jiffies-up rename to src/patches/suse-2.6.27.31/patches.fixes/round-jiffies-up diff --git a/src/patches/suse-2.6.27.25/patches.fixes/rt2x00-fix-led_device_naming.diff b/src/patches/suse-2.6.27.31/patches.fixes/rt2x00-fix-led_device_naming.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/rt2x00-fix-led_device_naming.diff rename to src/patches/suse-2.6.27.31/patches.fixes/rt2x00-fix-led_device_naming.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/rt2x00-fix-race-conditions.patch b/src/patches/suse-2.6.27.31/patches.fixes/rt2x00-fix-race-conditions.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/rt2x00-fix-race-conditions.patch rename to src/patches/suse-2.6.27.31/patches.fixes/rt2x00-fix-race-conditions.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/saa7134-fix-resource-map-sanity-check-conflict.patch b/src/patches/suse-2.6.27.31/patches.fixes/saa7134-fix-resource-map-sanity-check-conflict.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/saa7134-fix-resource-map-sanity-check-conflict.patch rename to src/patches/suse-2.6.27.31/patches.fixes/saa7134-fix-resource-map-sanity-check-conflict.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sched-fix-__load_balance_iterator-for-cfs-with-on.patch b/src/patches/suse-2.6.27.31/patches.fixes/sched-fix-__load_balance_iterator-for-cfs-with-on.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sched-fix-__load_balance_iterator-for-cfs-with-on.patch rename to src/patches/suse-2.6.27.31/patches.fixes/sched-fix-__load_balance_iterator-for-cfs-with-on.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-add-tgps-setting b/src/patches/suse-2.6.27.31/patches.fixes/scsi-add-tgps-setting similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-add-tgps-setting rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-add-tgps-setting diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-call-unprep_request-under-lock b/src/patches/suse-2.6.27.31/patches.fixes/scsi-call-unprep_request-under-lock similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-call-unprep_request-under-lock rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-call-unprep_request-under-lock diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-check-host-lookup-failure b/src/patches/suse-2.6.27.31/patches.fixes/scsi-check-host-lookup-failure similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-check-host-lookup-failure rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-check-host-lookup-failure diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-group-id-mask b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-group-id-mask similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-group-id-mask rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-group-id-mask diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-retry-UA b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-retry-UA similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-retry-UA rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-retry-UA diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-send-stpg b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-send-stpg similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-alua-send-stpg rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-send-stpg diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-emc-mode-select-10-size b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-emc-mode-select-10-size similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-emc-mode-select-10-size rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-emc-mode-select-10-size diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-emc-rw-mismatch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-emc-rw-mismatch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-emc-rw-mismatch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-emc-rw-mismatch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-queuedata-accessors b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-queuedata-accessors similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-queuedata-accessors rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-queuedata-accessors diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-add-stk b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-add-stk similarity index 59% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-add-stk rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-add-stk index 38e51dbca..cc392dccb 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-add-stk +++ b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-add-stk @@ -11,11 +11,9 @@ Signed-off-by: Hannes Reinecke drivers/scsi/device_handler/scsi_dh_rdac.c | 2 ++ 1 file changed, 2 insertions(+) -Index: linux-2.6.27/drivers/scsi/device_handler/scsi_dh_rdac.c -=================================================================== ---- linux-2.6.27.orig/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-06-19 16:20:29.000000000 +0200 -+++ linux-2.6.27/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-06-19 16:24:51.000000000 +0200 -@@ -602,6 +602,8 @@ static const struct scsi_dh_devlist rdac +--- a/drivers/scsi/device_handler/scsi_dh_rdac.c ++++ b/drivers/scsi/device_handler/scsi_dh_rdac.c +@@ -607,6 +607,8 @@ static const struct scsi_dh_devlist rdac {"SGI", "TP9500", 0}, {"SGI", "IS", 0}, {"STK", "OPENstorage D280", 0}, diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-initialize-passive-path b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-initialize-passive-path similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-initialize-passive-path rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-initialize-passive-path diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-UA b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-UA similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-UA rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-UA diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-for-not-ready b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-for-not-ready similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-for-not-ready rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-for-not-ready diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-mode-select b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-mode-select similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-retry-mode-select rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-retry-mode-select diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-set-default-ownership b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-set-default-ownership similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-dh-rdac-set-default-ownership rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-rdac-set-default-ownership diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-eh-timed-out-missing-braces b/src/patches/suse-2.6.27.31/patches.fixes/scsi-eh-timed-out-missing-braces similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-eh-timed-out-missing-braces rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-eh-timed-out-missing-braces diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-enhance-error-codes b/src/patches/suse-2.6.27.31/patches.fixes/scsi-enhance-error-codes similarity index 99% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-enhance-error-codes rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-enhance-error-codes index 1c50f0bc0..73f8986ed 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/scsi-enhance-error-codes +++ b/src/patches/suse-2.6.27.31/patches.fixes/scsi-enhance-error-codes @@ -78,7 +78,7 @@ Signed-off-by: Hannes Reinecke * REQ_BARRIER implies no merging, but lets make it explicit --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c -@@ -846,7 +846,7 @@ static int multipath_map(struct dm_targe +@@ -857,7 +857,7 @@ static int multipath_map(struct dm_targe dm_bio_record(&mpio->details, bio); map_context->ptr = mpio; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-fix-hang-in-starved-list-processing b/src/patches/suse-2.6.27.31/patches.fixes/scsi-fix-hang-in-starved-list-processing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-fix-hang-in-starved-list-processing rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-fix-hang-in-starved-list-processing diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-fixup-failfast-definitions b/src/patches/suse-2.6.27.31/patches.fixes/scsi-fixup-failfast-definitions similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-fixup-failfast-definitions rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-fixup-failfast-definitions diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-fixup-scsi_host_lookup-return-value b/src/patches/suse-2.6.27.31/patches.fixes/scsi-fixup-scsi_host_lookup-return-value similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-fixup-scsi_host_lookup-return-value rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-fixup-scsi_host_lookup-return-value diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-can_queue_fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-can_queue_fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-can_queue_fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-can_queue_fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-module_alias.patch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-module_alias.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-module_alias.patch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-module_alias.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-show-config.patch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-show-config.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-show-config.patch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-show-config.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-vio_leak.patch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-vio_leak.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-ibmvscsi-vio_leak.patch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-ibmvscsi-vio_leak.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/scsi-initialize-max_targets_blocked b/src/patches/suse-2.6.27.31/patches.fixes/scsi-initialize-max_targets_blocked new file mode 100644 index 000000000..4da5ae4c7 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/scsi-initialize-max_targets_blocked @@ -0,0 +1,30 @@ +From: Edward Goggin +Date: Thu Apr 9 10:02:22 2009 -0700 +Subject: initialize max_target_blocked in scsi_alloc_target +Patch-Mainline: Yes +References: bnc#524347 + +This patch initializes the max_target_blocked field of a scsi target +structure so that a queuecommand return value of +SCSI_MLQUEUE_TARGET_BUSY will actually result in having the +scsi_queue_insert blocking the device queue before requeuing the +command and running the queue. Otherwise, can and does cause livelock +on single CPU configurations if/when open-iSCSI software initiator's +command PDU window fills. + +Signed-off-by: Ed Goggin +Signed-off-by: James Bottomley +Acked-by: Hannes Reinecke + +diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c +index 6f51ca4..e2b50d8 100644 +--- a/drivers/scsi/scsi_scan.c ++++ b/drivers/scsi/scsi_scan.c +@@ -425,6 +425,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, + INIT_LIST_HEAD(&starget->devices); + starget->state = STARGET_CREATED; + starget->scsi_level = SCSI_2; ++ starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED; + retry: + spin_lock_irqsave(shost->host_lock, flags); + diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-inquiry-too-short-ratelimit b/src/patches/suse-2.6.27.31/patches.fixes/scsi-inquiry-too-short-ratelimit similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-inquiry-too-short-ratelimit rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-inquiry-too-short-ratelimit diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-ipr-fix-PCI-permanent-error-handler b/src/patches/suse-2.6.27.31/patches.fixes/scsi-ipr-fix-PCI-permanent-error-handler similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-ipr-fix-PCI-permanent-error-handler rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-ipr-fix-PCI-permanent-error-handler diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-lib-string_get_size-don-t-hang-on-zero-no-decimals-on-exact.patch b/src/patches/suse-2.6.27.31/patches.fixes/scsi-lib-string_get_size-don-t-hang-on-zero-no-decimals-on-exact.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-lib-string_get_size-don-t-hang-on-zero-no-decimals-on-exact.patch rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-lib-string_get_size-don-t-hang-on-zero-no-decimals-on-exact.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-misc-git-update b/src/patches/suse-2.6.27.31/patches.fixes/scsi-misc-git-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-misc-git-update rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-misc-git-update diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-refactor-busy-processing b/src/patches/suse-2.6.27.31/patches.fixes/scsi-refactor-busy-processing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-refactor-busy-processing rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-refactor-busy-processing diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-remove-scmd-timeout b/src/patches/suse-2.6.27.31/patches.fixes/scsi-remove-scmd-timeout similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-remove-scmd-timeout rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-remove-scmd-timeout diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-restart-lookup-by-target b/src/patches/suse-2.6.27.31/patches.fixes/scsi-restart-lookup-by-target similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-restart-lookup-by-target rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-restart-lookup-by-target diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-TASK_ABORTED b/src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-TASK_ABORTED similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-TASK_ABORTED rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-TASK_ABORTED diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-alua-transition-in-progress b/src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-alua-transition-in-progress similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-alua-transition-in-progress rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-alua-transition-in-progress diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-transport-error b/src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-transport-error similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-retry-transport-error rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-retry-transport-error diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-scan-blist-update b/src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-blist-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-scan-blist-update rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-blist-update diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy b/src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-skip-nonscsi-device-for-dma b/src/patches/suse-2.6.27.31/patches.fixes/scsi-skip-nonscsi-device-for-dma similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-skip-nonscsi-device-for-dma rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-skip-nonscsi-device-for-dma diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi-terminate-target-reset b/src/patches/suse-2.6.27.31/patches.fixes/scsi-terminate-target-reset similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi-terminate-target-reset rename to src/patches/suse-2.6.27.31/patches.fixes/scsi-terminate-target-reset diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi_dh-add-lsi-ids-to-rdac b/src/patches/suse-2.6.27.31/patches.fixes/scsi_dh-add-lsi-ids-to-rdac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi_dh-add-lsi-ids-to-rdac rename to src/patches/suse-2.6.27.31/patches.fixes/scsi_dh-add-lsi-ids-to-rdac diff --git a/src/patches/suse-2.6.27.25/patches.fixes/scsi_dh-retry-on-UNIT_ATTENTION b/src/patches/suse-2.6.27.31/patches.fixes/scsi_dh-retry-on-UNIT_ATTENTION similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/scsi_dh-retry-on-UNIT_ATTENTION rename to src/patches/suse-2.6.27.31/patches.fixes/scsi_dh-retry-on-UNIT_ATTENTION diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sd-needs-updating b/src/patches/suse-2.6.27.31/patches.fixes/sd-needs-updating similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sd-needs-updating rename to src/patches/suse-2.6.27.31/patches.fixes/sd-needs-updating diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sd-no-spinup-on-standby-ports b/src/patches/suse-2.6.27.31/patches.fixes/sd-no-spinup-on-standby-ports similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sd-no-spinup-on-standby-ports rename to src/patches/suse-2.6.27.31/patches.fixes/sd-no-spinup-on-standby-ports diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sd_liberal_28_sense_invalid.diff b/src/patches/suse-2.6.27.31/patches.fixes/sd_liberal_28_sense_invalid.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sd_liberal_28_sense_invalid.diff rename to src/patches/suse-2.6.27.31/patches.fixes/sd_liberal_28_sense_invalid.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/seccomp-disable-tsc-option b/src/patches/suse-2.6.27.31/patches.fixes/seccomp-disable-tsc-option similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/seccomp-disable-tsc-option rename to src/patches/suse-2.6.27.31/patches.fixes/seccomp-disable-tsc-option diff --git a/src/patches/suse-2.6.27.25/patches.fixes/slab-alloc_slabmgmt-fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/slab-alloc_slabmgmt-fix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/slab-alloc_slabmgmt-fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/slab-alloc_slabmgmt-fix.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sn-irq-affinity b/src/patches/suse-2.6.27.31/patches.fixes/sn-irq-affinity similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sn-irq-affinity rename to src/patches/suse-2.6.27.31/patches.fixes/sn-irq-affinity diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sparsemem-maxmem-fix b/src/patches/suse-2.6.27.31/patches.fixes/sparsemem-maxmem-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sparsemem-maxmem-fix rename to src/patches/suse-2.6.27.31/patches.fixes/sparsemem-maxmem-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/sunrpc-fix-oops-not-setup-socket b/src/patches/suse-2.6.27.31/patches.fixes/sunrpc-fix-oops-not-setup-socket similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/sunrpc-fix-oops-not-setup-socket rename to src/patches/suse-2.6.27.31/patches.fixes/sunrpc-fix-oops-not-setup-socket diff --git a/src/patches/suse-2.6.27.31/patches.fixes/sunrpc-tcp-reconnect b/src/patches/suse-2.6.27.31/patches.fixes/sunrpc-tcp-reconnect new file mode 100644 index 000000000..49074f4cf --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/sunrpc-tcp-reconnect @@ -0,0 +1,50 @@ +From: NeilBrown +Subject: reset TCP connect timeout on successful connection. +Patch-mainline: no - see below +References: bnc#498708 + +Currently, every time an NFS server closes a TCP connection, the +client will double its time out (up to 300 seconds) before attempting +to reconnect. +The timeout should only double while it fails. On success it should +reset the timeout. + +This patch resets the timeout on a successful connection. +It also ensures that we the timeout it doubled, it does not remain at +0. This should fix a behaviour which has been observed where the +client hammers on the server until it accepts a connection. + +Note: this has not been accepted upstream. +The stated reason is that some (Netapp?) servers are prone to accept +a connection and then drop it immediately. This would defeat the backoff. +While this should be fixed there are complexities in getting it right, +and the current patch is at least an improvement. +(there where already cases where the client would retry at a high + rate and the new case is, I think, quite remote). +When things are sorted out with upstream, we can get a better fix. + +Signed-off-by: NeilBrown + +--- + net/sunrpc/xprtsock.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/sunrpc/xprtsock.c ++++ b/net/sunrpc/xprtsock.c +@@ -1143,6 +1143,7 @@ static void xs_tcp_state_change(struct s + TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID; + + xprt_wake_pending_tasks(xprt, 0); ++ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; + } + spin_unlock_bh(&xprt->transport_lock); + break; +@@ -1785,6 +1786,8 @@ static void xs_connect(struct rpc_task * + &transport->connect_worker, + xprt->reestablish_timeout); + xprt->reestablish_timeout <<= 1; ++ if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO) ++ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; + if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO) + xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; + } else { diff --git a/src/patches/suse-2.6.27.25/patches.fixes/taskstats-alignment b/src/patches/suse-2.6.27.31/patches.fixes/taskstats-alignment similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/taskstats-alignment rename to src/patches/suse-2.6.27.31/patches.fixes/taskstats-alignment diff --git a/src/patches/suse-2.6.27.25/patches.fixes/tg3-fix-default-wol.patch b/src/patches/suse-2.6.27.31/patches.fixes/tg3-fix-default-wol.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/tg3-fix-default-wol.patch rename to src/patches/suse-2.6.27.31/patches.fixes/tg3-fix-default-wol.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/tiocgdev b/src/patches/suse-2.6.27.31/patches.fixes/tiocgdev similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/tiocgdev rename to src/patches/suse-2.6.27.31/patches.fixes/tiocgdev diff --git a/src/patches/suse-2.6.27.25/patches.fixes/tulip-quad-NIC-ifdown b/src/patches/suse-2.6.27.31/patches.fixes/tulip-quad-NIC-ifdown similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/tulip-quad-NIC-ifdown rename to src/patches/suse-2.6.27.31/patches.fixes/tulip-quad-NIC-ifdown diff --git a/src/patches/suse-2.6.27.25/patches.fixes/udf-faster_anchor_detection.patch b/src/patches/suse-2.6.27.31/patches.fixes/udf-faster_anchor_detection.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/udf-faster_anchor_detection.patch rename to src/patches/suse-2.6.27.31/patches.fixes/udf-faster_anchor_detection.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/udf-last_block_fix.patch b/src/patches/suse-2.6.27.31/patches.fixes/udf-last_block_fix.patch similarity index 89% rename from src/patches/suse-2.6.27.25/patches.fixes/udf-last_block_fix.patch rename to src/patches/suse-2.6.27.31/patches.fixes/udf-last_block_fix.patch index e929601d0..995933582 100644 --- a/src/patches/suse-2.6.27.25/patches.fixes/udf-last_block_fix.patch +++ b/src/patches/suse-2.6.27.31/patches.fixes/udf-last_block_fix.patch @@ -9,9 +9,9 @@ media. Signed-off-by: Jan Kara -diff -rupX /home/jack/.kerndiffexclude linux-2.6.27-SLE11_BRANCH/fs/udf/lowlevel.c linux-2.6.27-SLE11_BRANCH-1-udf_last_block_fix//fs/udf/lowlevel.c +diff -rupX /home/jack/.kerndiffexclude linux-2.6.27-SLE11_BRANCH/fs/udf/lowlevel.c linux-2.6.27-SLE11_BRANCH-1-udf_last_block_fix/fs/udf/lowlevel.c --- linux-2.6.27-SLE11_BRANCH/fs/udf/lowlevel.c 2008-10-10 00:13:53.000000000 +0200 -+++ linux-2.6.27-SLE11_BRANCH-1-udf_last_block_fix//fs/udf/lowlevel.c 2009-06-18 12:08:11.000000000 +0200 ++++ linux-2.6.27-SLE11_BRANCH-1-udf_last_block_fix/fs/udf/lowlevel.c 2009-06-18 12:08:11.000000000 +0200 @@ -56,7 +56,12 @@ unsigned long udf_get_last_block(struct struct block_device *bdev = sb->s_bdev; unsigned long lblock = 0; diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_memprotect.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_memprotect.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_memprotect.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_memprotect.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_partition.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_partition.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_partition.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_partition.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_reserve_page.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_reserve_page.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_reserve_page.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_reserve_page.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_watchlist.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_watchlist.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-bios_call_watchlist.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-bios_call_watchlist.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-bios_common.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-bios_common.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-bios_common.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-bios_common.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-efi_bios.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-efi_bios.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-efi_bios.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-efi_bios.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-redundant-creation-of-proc-dir b/src/patches/suse-2.6.27.31/patches.fixes/uv-redundant-creation-of-proc-dir similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-redundant-creation-of-proc-dir rename to src/patches/suse-2.6.27.31/patches.fixes/uv-redundant-creation-of-proc-dir diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-sn_region_size.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-sn_region_size.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-sn_region_size.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-sn_region_size.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-sysfs.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-sysfs.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-sysfs.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-sysfs.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-xp-change_memprotect.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-xp-change_memprotect.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-xp-change_memprotect.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-xp-change_memprotect.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-xpc-get_sn_info.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-xpc-get_sn_info.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-xpc-get_sn_info.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-xpc-get_sn_info.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-xpc_create_gru_mq_uv.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-xpc_create_gru_mq_uv.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-xpc_create_gru_mq_uv.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-xpc_create_gru_mq_uv.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv-xpc_get_part_rsvd_page.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv-xpc_get_part_rsvd_page.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv-xpc_get_part_rsvd_page.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv-xpc_get_part_rsvd_page.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv_setup_irq.diff b/src/patches/suse-2.6.27.31/patches.fixes/uv_setup_irq.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv_setup_irq.diff rename to src/patches/suse-2.6.27.31/patches.fixes/uv_setup_irq.diff diff --git a/src/patches/suse-2.6.27.25/patches.fixes/uv_zalias_support b/src/patches/suse-2.6.27.31/patches.fixes/uv_zalias_support similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/uv_zalias_support rename to src/patches/suse-2.6.27.31/patches.fixes/uv_zalias_support diff --git a/src/patches/suse-2.6.27.25/patches.fixes/video-vesa-bad-mode b/src/patches/suse-2.6.27.31/patches.fixes/video-vesa-bad-mode similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/video-vesa-bad-mode rename to src/patches/suse-2.6.27.31/patches.fixes/video-vesa-bad-mode diff --git a/src/patches/suse-2.6.27.25/patches.fixes/vlan-gso-size-fix b/src/patches/suse-2.6.27.31/patches.fixes/vlan-gso-size-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/vlan-gso-size-fix rename to src/patches/suse-2.6.27.31/patches.fixes/vlan-gso-size-fix diff --git a/src/patches/suse-2.6.27.25/patches.fixes/x86_cpufreq_powernow-k8_acpi_latency_values.patch b/src/patches/suse-2.6.27.31/patches.fixes/x86_cpufreq_powernow-k8_acpi_latency_values.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/x86_cpufreq_powernow-k8_acpi_latency_values.patch rename to src/patches/suse-2.6.27.31/patches.fixes/x86_cpufreq_powernow-k8_acpi_latency_values.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xfs-dmapi-fixes b/src/patches/suse-2.6.27.31/patches.fixes/xfs-dmapi-fixes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xfs-dmapi-fixes rename to src/patches/suse-2.6.27.31/patches.fixes/xfs-dmapi-fixes diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xfs-fix-overflow-in-xfs_growfs_data_private b/src/patches/suse-2.6.27.31/patches.fixes/xfs-fix-overflow-in-xfs_growfs_data_private similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xfs-fix-overflow-in-xfs_growfs_data_private rename to src/patches/suse-2.6.27.31/patches.fixes/xfs-fix-overflow-in-xfs_growfs_data_private diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xfs-kern_32215a_Clean-up-dquot-pincount-code.patch b/src/patches/suse-2.6.27.31/patches.fixes/xfs-kern_32215a_Clean-up-dquot-pincount-code.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xfs-kern_32215a_Clean-up-dquot-pincount-code.patch rename to src/patches/suse-2.6.27.31/patches.fixes/xfs-kern_32215a_Clean-up-dquot-pincount-code.patch diff --git a/src/patches/suse-2.6.27.31/patches.fixes/xfs-more-sb-checks b/src/patches/suse-2.6.27.31/patches.fixes/xfs-more-sb-checks new file mode 100644 index 000000000..495a91cb1 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/xfs-more-sb-checks @@ -0,0 +1,47 @@ +Date: Thu, May 7 2009 11:15:56 -0500 +From: Felix Blyakher +References: SGI:PV995062 bnc#471396 +Subject: add more checks to superblock validation +Patch-mainline: 2.6.30.5 + +commit 2ac00af7a6d2e65013e6f28bd1f37c0cd98ba134 +Author: Olaf Weber +Date: Fri Apr 17 16:12:45 2009 -0500 + + xfs: add more checks to superblock validation + + There had been reports where xfs filesystem was randomly + corrupted with fsfuzzer, and xfs failed to handle it + gracefully. This patch fixes couple of reported problem + by providing additional checks in the superblock + validation routine. + +Signed-off-by: Olaf Weber +Reviewed-by: Josef 'Jeff' Sipek +Reviewed-by: Christoph Hellwig +Signed-off-by: Felix Blyakher +Acked-by: + +Index: xfs_mount.c +=========================================================================== + +--- a/fs/xfs/xfs_mount.c 2009-05-07 11:16:02.000000000 -0500 ++++ b/fs/xfs/xfs_mount.c 2009-05-07 11:16:02.000000000 -0500 +@@ -215,14 +215,17 @@ xfs_mount_validate_sb( + sbp->sb_sectsize > XFS_MAX_SECTORSIZE || + sbp->sb_sectlog < XFS_MIN_SECTORSIZE_LOG || + sbp->sb_sectlog > XFS_MAX_SECTORSIZE_LOG || ++ sbp->sb_sectsize != (1 << sbp->sb_sectlog) || + sbp->sb_blocksize < XFS_MIN_BLOCKSIZE || + sbp->sb_blocksize > XFS_MAX_BLOCKSIZE || + sbp->sb_blocklog < XFS_MIN_BLOCKSIZE_LOG || + sbp->sb_blocklog > XFS_MAX_BLOCKSIZE_LOG || ++ sbp->sb_blocksize != (1 << sbp->sb_blocklog) || + sbp->sb_inodesize < XFS_DINODE_MIN_SIZE || + sbp->sb_inodesize > XFS_DINODE_MAX_SIZE || + sbp->sb_inodelog < XFS_DINODE_MIN_LOG || + sbp->sb_inodelog > XFS_DINODE_MAX_LOG || ++ sbp->sb_inodesize != (1 << sbp->sb_inodelog) || + (sbp->sb_blocklog - sbp->sb_inodelog != sbp->sb_inopblog) || + (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) || + (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) || diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xfs-redirty-ENOSPC.patch b/src/patches/suse-2.6.27.31/patches.fixes/xfs-redirty-ENOSPC.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xfs-redirty-ENOSPC.patch rename to src/patches/suse-2.6.27.31/patches.fixes/xfs-redirty-ENOSPC.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xfs_file_last_byte-needs-to-acquire-ilock.patch b/src/patches/suse-2.6.27.31/patches.fixes/xfs_file_last_byte-needs-to-acquire-ilock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xfs_file_last_byte-needs-to-acquire-ilock.patch rename to src/patches/suse-2.6.27.31/patches.fixes/xfs_file_last_byte-needs-to-acquire-ilock.patch diff --git a/src/patches/suse-2.6.27.25/patches.fixes/xpc-pass-physical b/src/patches/suse-2.6.27.31/patches.fixes/xpc-pass-physical similarity index 100% rename from src/patches/suse-2.6.27.25/patches.fixes/xpc-pass-physical rename to src/patches/suse-2.6.27.31/patches.fixes/xpc-pass-physical diff --git a/src/patches/suse-2.6.27.31/patches.fixes/zfcp-make-queue_depth-adjustable b/src/patches/suse-2.6.27.31/patches.fixes/zfcp-make-queue_depth-adjustable new file mode 100644 index 000000000..aa3293f0f --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.fixes/zfcp-make-queue_depth-adjustable @@ -0,0 +1,64 @@ +From: Christof Schmitt +Subject: [SCSI] zfcp: Make queue_depth adjustable +Patch-mainline: 2.6.31-rc1 +Git-commit: a40a1bafe7da0afe61b1c20fc50e18c07ce724f9 +References: bnc#513954 + +[SCSI] zfcp: Make queue_depth adjustable + +zfcp did always set the queue_depth for SCSI devices to 32, not +allowing to change this. Introduce a kernel parameter zfcp.queue_depth +and the change_queue_depth callback to allow changing the queue_depth +when it is required. + +Reviewed-by: Swen Schillig +Signed-off-by: Christof Schmitt +Signed-off-by: James Bottomley +Acked-by: Jeff Mahoney +--- + drivers/s390/scsi/zfcp_scsi.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/s390/scsi/zfcp_scsi.c ++++ b/drivers/s390/scsi/zfcp_scsi.c +@@ -11,6 +11,10 @@ + #include "zfcp_ext.h" + #include + ++static unsigned int default_depth = 32; ++module_param_named(queue_depth, default_depth, uint, 0600); ++MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices"); ++ + /* Find start of Sense Information in FCP response unit*/ + char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) + { +@@ -23,6 +27,12 @@ char *zfcp_get_fcp_sns_info_ptr(struct f + return fcp_sns_info_ptr; + } + ++static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth) ++{ ++ scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); ++ return sdev->queue_depth; ++} ++ + static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) + { + struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; +@@ -34,7 +44,7 @@ static void zfcp_scsi_slave_destroy(stru + static int zfcp_scsi_slave_configure(struct scsi_device *sdp) + { + if (sdp->tagged_supported) +- scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, 32); ++ scsi_adjust_queue_depth(sdp, MSG_SIMPLE_TAG, default_depth); + else + scsi_adjust_queue_depth(sdp, 0, 1); + return 0; +@@ -653,6 +663,7 @@ struct zfcp_data zfcp_data = { + .name = "zfcp", + .module = THIS_MODULE, + .proc_name = "zfcp", ++ .change_queue_depth = zfcp_scsi_change_queue_depth, + .slave_alloc = zfcp_scsi_slave_alloc, + .slave_configure = zfcp_scsi_slave_configure, + .slave_destroy = zfcp_scsi_slave_destroy, diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-add-back-skb_truesize_bug-and-skb_truesize_check.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-add-back-skb_truesize_bug-and-skb_truesize_check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-add-back-skb_truesize_bug-and-skb_truesize_check.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-add-back-skb_truesize_bug-and-skb_truesize_check.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-epoll_devs-back-to-struct-user_struct.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-epoll_devs-back-to-struct-user_struct.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-epoll_devs-back-to-struct-user_struct.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-epoll_devs-back-to-struct-user_struct.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-s_syncing-back-to-struct-super_block.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-s_syncing-back-to-struct-super_block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-s_syncing-back-to-struct-super_block.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-s_syncing-back-to-struct-super_block.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-vc_scrl_erase_char-back-to-struct-vc_data.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-vc_scrl_erase_char-back-to-struct-vc_data.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-vc_scrl_erase_char-back-to-struct-vc_data.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-vc_scrl_erase_char-back-to-struct-vc_data.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-wb_sync_hold-enum-writeback_sync_modes.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-wb_sync_hold-enum-writeback_sync_modes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-fix-add-wb_sync_hold-enum-writeback_sync_modes.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-fix-add-wb_sync_hold-enum-writeback_sync_modes.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/abi-fix-for-struct-seq_file-change.patch b/src/patches/suse-2.6.27.31/patches.kabi/abi-fix-for-struct-seq_file-change.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/abi-fix-for-struct-seq_file-change.patch rename to src/patches/suse-2.6.27.31/patches.kabi/abi-fix-for-struct-seq_file-change.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/export-iwl_rx_allocate b/src/patches/suse-2.6.27.31/patches.kabi/export-iwl_rx_allocate similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/export-iwl_rx_allocate rename to src/patches/suse-2.6.27.31/patches.kabi/export-iwl_rx_allocate diff --git a/src/patches/suse-2.6.27.25/patches.kabi/ftrace-dummy-export b/src/patches/suse-2.6.27.31/patches.kabi/ftrace-dummy-export similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/ftrace-dummy-export rename to src/patches/suse-2.6.27.31/patches.kabi/ftrace-dummy-export diff --git a/src/patches/suse-2.6.27.31/patches.kabi/ia64-sn-specific-version-of-dma_get_required_mask-kabi-fix b/src/patches/suse-2.6.27.31/patches.kabi/ia64-sn-specific-version-of-dma_get_required_mask-kabi-fix new file mode 100644 index 000000000..888ebac16 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.kabi/ia64-sn-specific-version-of-dma_get_required_mask-kabi-fix @@ -0,0 +1,111 @@ +From: Michal Marek +Subject: preserve the kabi checksum of dma_get_required_mask on ia64 + +Signed-off-by: Michal Marek +Signed-off-by: Jeff Mahoney + +--- + arch/ia64/include/asm/machvec.h | 8 +++++--- + arch/ia64/pci/pci.c | 22 +++++++++++----------- + drivers/base/platform.c | 9 +++++++++ + 3 files changed, 25 insertions(+), 14 deletions(-) + +--- a/arch/ia64/include/asm/machvec.h ++++ b/arch/ia64/include/asm/machvec.h +@@ -210,7 +210,6 @@ struct ia64_machine_vector { + ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device; + ia64_mv_dma_mapping_error *dma_mapping_error; + ia64_mv_dma_supported *dma_supported; +- ia64_mv_dma_get_required_mask *dma_get_required_mask; + ia64_mv_irq_to_vector *irq_to_vector; + ia64_mv_local_vector_to_irq *local_vector_to_irq; + ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; +@@ -236,6 +235,9 @@ struct ia64_machine_vector { + ia64_mv_teardown_msi_irq_t *teardown_msi_irq; + ia64_mv_pci_fixup_bus_t *pci_fixup_bus; + ia64_mv_kernel_launch_event_t *kernel_launch_event; ++#ifndef __GENKSYMS__ ++ ia64_mv_dma_get_required_mask *dma_get_required_mask; ++#endif + } __attribute__((__aligned__(16))); /* align attrib? see above comment */ + + #define MACHVEC_INIT(name) \ +@@ -261,7 +263,6 @@ struct ia64_machine_vector { + platform_dma_sync_sg_for_device, \ + platform_dma_mapping_error, \ + platform_dma_supported, \ +- platform_dma_get_required_mask, \ + platform_irq_to_vector, \ + platform_local_vector_to_irq, \ + platform_pci_get_legacy_mem, \ +@@ -286,7 +287,8 @@ struct ia64_machine_vector { + platform_setup_msi_irq, \ + platform_teardown_msi_irq, \ + platform_pci_fixup_bus, \ +- platform_kernel_launch_event \ ++ platform_kernel_launch_event, \ ++ platform_dma_get_required_mask \ + } + + extern struct ia64_machine_vector ia64_mv; +--- a/arch/ia64/pci/pci.c ++++ b/arch/ia64/pci/pci.c +@@ -19,7 +19,6 @@ + #include + #include + #include +-#include + + #include + #include +@@ -744,6 +743,16 @@ static void __init set_pci_cacheline_siz + pci_cache_line_size = (1 << cci.pcci_line_size) / 4; + } + ++static int __init pcibios_init(void) ++{ ++ set_pci_cacheline_size(); ++ return 0; ++} ++ ++subsys_initcall(pcibios_init); ++ ++#include ++ + u64 ia64_dma_get_required_mask(struct device *dev) + { + u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT); +@@ -764,16 +773,7 @@ u64 ia64_dma_get_required_mask(struct de + } + EXPORT_SYMBOL_GPL(ia64_dma_get_required_mask); + +-u64 dma_get_required_mask(struct device *dev) ++u64 ia64_dma_get_required_mask_wrapper(struct device *dev) + { + return platform_dma_get_required_mask(dev); + } +-EXPORT_SYMBOL_GPL(dma_get_required_mask); +- +-static int __init pcibios_init(void) +-{ +- set_pci_cacheline_size(); +- return 0; +-} +- +-subsys_initcall(pcibios_init); +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -931,4 +931,13 @@ u64 dma_get_required_mask(struct device + return mask; + } + EXPORT_SYMBOL_GPL(dma_get_required_mask); ++#else ++#ifdef __ia64__ ++u64 ia64_dma_get_required_mask_wrapper(struct device *dev); ++u64 dma_get_required_mask(struct device *dev) ++{ ++ return ia64_dma_get_required_mask_wrapper(dev); ++} ++EXPORT_SYMBOL_GPL(dma_get_required_mask); ++#endif + #endif diff --git a/src/patches/suse-2.6.27.25/patches.kabi/mm-page_mkwrite-compat.patch b/src/patches/suse-2.6.27.31/patches.kabi/mm-page_mkwrite-compat.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/mm-page_mkwrite-compat.patch rename to src/patches/suse-2.6.27.31/patches.kabi/mm-page_mkwrite-compat.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/mm-page_mkwrite-rename.patch b/src/patches/suse-2.6.27.31/patches.kabi/mm-page_mkwrite-rename.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.kabi/mm-page_mkwrite-rename.patch rename to src/patches/suse-2.6.27.31/patches.kabi/mm-page_mkwrite-rename.patch index 4ecdeba47..fabdfeed7 100644 --- a/src/patches/suse-2.6.27.25/patches.kabi/mm-page_mkwrite-rename.patch +++ b/src/patches/suse-2.6.27.31/patches.kabi/mm-page_mkwrite-rename.patch @@ -38,6 +38,67 @@ Signed-off-by: Nick Piggin }; static int fb_deferred_io_set_page_dirty(struct page *page) +--- a/fs/buffer.c ++++ b/fs/buffer.c +@@ -2402,7 +2402,7 @@ int block_commit_write(struct page *page + * unlock the page. + */ + int +-block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ++block_page_mkwrite2(struct vm_area_struct *vma, struct vm_fault *vmf, + get_block_t get_block) + { + struct page *page = vmf->page; +@@ -2444,6 +2444,41 @@ out: + } + + /* ++ * XXX: ABI hack ++ */ ++int ++block_page_mkwrite(struct vm_area_struct *vma, struct page *page, ++ get_block_t get_block) ++{ ++ struct inode *inode = vma->vm_file->f_path.dentry->d_inode; ++ unsigned long end; ++ loff_t size; ++ int ret = -EINVAL; ++ ++ lock_page(page); ++ size = i_size_read(inode); ++ if ((page->mapping != inode->i_mapping) || ++ (page_offset(page) > size)) { ++ /* page got truncated out from underneath us */ ++ goto out_unlock; ++ } ++ ++ /* page is wholly or partially inside EOF */ ++ if (((page->index + 1) << PAGE_CACHE_SHIFT) > size) ++ end = size & ~PAGE_CACHE_MASK; ++ else ++ end = PAGE_CACHE_SIZE; ++ ++ ret = block_prepare_write(page, 0, end, get_block); ++ if (!ret) ++ ret = block_commit_write(page, 0, end); ++ ++out_unlock: ++ unlock_page(page); ++ return ret; ++} ++ ++/* + * nobh_write_begin()'s prereads are special: the buffer_heads are freed + * immediately, while under the page lock. So it needs a special end_io + * handler which does not touch the bh after unlocking it. +@@ -3362,6 +3397,7 @@ EXPORT_SYMBOL(__wait_on_buffer); + EXPORT_SYMBOL(block_commit_write); + EXPORT_SYMBOL(block_prepare_write); + EXPORT_SYMBOL(block_page_mkwrite); ++EXPORT_SYMBOL(block_page_mkwrite2); + EXPORT_SYMBOL(block_read_full_page); + EXPORT_SYMBOL(block_sync_page); + EXPORT_SYMBOL(block_truncate_page); --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -125,7 +125,7 @@ force_commit: @@ -122,6 +183,19 @@ Signed-off-by: Nick Piggin - .page_mkwrite = xfs_vm_page_mkwrite, + ._pmkw.page_mkwrite2 = xfs_vm_page_mkwrite, }; +--- a/include/linux/buffer_head.h ++++ b/include/linux/buffer_head.h +@@ -222,7 +222,9 @@ int cont_write_begin(struct file *, stru + get_block_t *, loff_t *); + int generic_cont_expand_simple(struct inode *inode, loff_t size); + int block_commit_write(struct page *page, unsigned from, unsigned to); +-int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ++int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, ++ get_block_t get_block); ++int block_page_mkwrite2(struct vm_area_struct *vma, struct vm_fault *vmf, + get_block_t get_block); + void block_sync_page(struct page *); + sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -172,9 +172,22 @@ struct vm_operations_struct { @@ -150,80 +224,6 @@ Signed-off-by: Nick Piggin /* called by access_process_vm when get_user_pages() fails, typically * for use by special VMAs that can switch between memory and hardware ---- a/fs/buffer.c -+++ b/fs/buffer.c -@@ -2402,7 +2402,7 @@ int block_commit_write(struct page *page - * unlock the page. - */ - int --block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, -+block_page_mkwrite2(struct vm_area_struct *vma, struct vm_fault *vmf, - get_block_t get_block) - { - struct page *page = vmf->page; -@@ -2444,6 +2444,41 @@ out: - } - - /* -+ * XXX: ABI hack -+ */ -+int -+block_page_mkwrite(struct vm_area_struct *vma, struct page *page, -+ get_block_t get_block) -+{ -+ struct inode *inode = vma->vm_file->f_path.dentry->d_inode; -+ unsigned long end; -+ loff_t size; -+ int ret = -EINVAL; -+ -+ lock_page(page); -+ size = i_size_read(inode); -+ if ((page->mapping != inode->i_mapping) || -+ (page_offset(page) > size)) { -+ /* page got truncated out from underneath us */ -+ goto out_unlock; -+ } -+ -+ /* page is wholly or partially inside EOF */ -+ if (((page->index + 1) << PAGE_CACHE_SHIFT) > size) -+ end = size & ~PAGE_CACHE_MASK; -+ else -+ end = PAGE_CACHE_SIZE; -+ -+ ret = block_prepare_write(page, 0, end, get_block); -+ if (!ret) -+ ret = block_commit_write(page, 0, end); -+ -+out_unlock: -+ unlock_page(page); -+ return ret; -+} -+ -+/* - * nobh_write_begin()'s prereads are special: the buffer_heads are freed - * immediately, while under the page lock. So it needs a special end_io - * handler which does not touch the bh after unlocking it. -@@ -3362,6 +3397,7 @@ EXPORT_SYMBOL(__wait_on_buffer); - EXPORT_SYMBOL(block_commit_write); - EXPORT_SYMBOL(block_prepare_write); - EXPORT_SYMBOL(block_page_mkwrite); -+EXPORT_SYMBOL(block_page_mkwrite2); - EXPORT_SYMBOL(block_read_full_page); - EXPORT_SYMBOL(block_sync_page); - EXPORT_SYMBOL(block_truncate_page); ---- a/include/linux/buffer_head.h -+++ b/include/linux/buffer_head.h -@@ -222,7 +222,9 @@ int cont_write_begin(struct file *, stru - get_block_t *, loff_t *); - int generic_cont_expand_simple(struct inode *inode, loff_t size); - int block_commit_write(struct page *page, unsigned from, unsigned to); --int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, -+int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, -+ get_block_t get_block); -+int block_page_mkwrite2(struct vm_area_struct *vma, struct vm_fault *vmf, - get_block_t get_block); - void block_sync_page(struct page *); - sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); --- a/mm/memory.c +++ b/mm/memory.c @@ -1800,7 +1800,7 @@ static int do_wp_page(struct mm_struct * @@ -261,7 +261,7 @@ Signed-off-by: Nick Piggin ret = tmp; --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -1071,7 +1071,7 @@ int vma_wants_writenotify(struct vm_area +@@ -1074,7 +1074,7 @@ int vma_wants_writenotify(struct vm_area return 0; /* The backer wishes to know when pages are first written to? */ diff --git a/src/patches/suse-2.6.27.25/patches.kabi/sched-kabi-compat-hack.patch b/src/patches/suse-2.6.27.31/patches.kabi/sched-kabi-compat-hack.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/sched-kabi-compat-hack.patch rename to src/patches/suse-2.6.27.31/patches.kabi/sched-kabi-compat-hack.patch diff --git a/src/patches/suse-2.6.27.25/patches.kabi/splice-kabi-fix.patch b/src/patches/suse-2.6.27.31/patches.kabi/splice-kabi-fix.patch similarity index 80% rename from src/patches/suse-2.6.27.25/patches.kabi/splice-kabi-fix.patch rename to src/patches/suse-2.6.27.31/patches.kabi/splice-kabi-fix.patch index 9ebe8aa8d..8f146923b 100644 --- a/src/patches/suse-2.6.27.25/patches.kabi/splice-kabi-fix.patch +++ b/src/patches/suse-2.6.27.31/patches.kabi/splice-kabi-fix.patch @@ -13,11 +13,9 @@ Signed-off-by: Miklos Szeredi include/linux/splice.h | 12 +++++++---- 3 files changed, 46 insertions(+), 35 deletions(-) -Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c -=================================================================== ---- linux-2.6.25-SL110_BRANCH.orig/fs/ocfs2/file.c 2009-05-26 17:23:28.000000000 +0200 -+++ linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c 2009-05-27 10:10:28.000000000 +0200 -@@ -2073,9 +2073,10 @@ out_sems: +--- a/fs/ocfs2/file.c ++++ b/fs/ocfs2/file.c +@@ -2077,9 +2077,10 @@ out_sems: static int ocfs2_splice_to_file(struct pipe_inode_info *pipe, struct file *out, @@ -29,7 +27,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, &sd->pos, sd->total_len, 0, NULL); -@@ -2084,7 +2085,7 @@ static int ocfs2_splice_to_file(struct p +@@ -2088,7 +2089,7 @@ static int ocfs2_splice_to_file(struct p return ret; } @@ -38,7 +36,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c } static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, -@@ -2102,6 +2103,7 @@ static ssize_t ocfs2_file_splice_write(s +@@ -2106,6 +2107,7 @@ static ssize_t ocfs2_file_splice_write(s .pos = *ppos, .u.file = out, }; @@ -46,7 +44,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", out, pipe, (unsigned int)len, -@@ -2111,9 +2113,9 @@ static ssize_t ocfs2_file_splice_write(s +@@ -2115,9 +2117,9 @@ static ssize_t ocfs2_file_splice_write(s if (pipe->inode) mutex_lock_nested(&pipe->inode->i_mutex, I_MUTEX_PARENT); @@ -58,7 +56,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c if (ret <= 0) break; -@@ -2122,18 +2124,18 @@ static ssize_t ocfs2_file_splice_write(s +@@ -2126,18 +2128,18 @@ static ssize_t ocfs2_file_splice_write(s if (ret < 0) mlog_errno(ret); else { @@ -81,11 +79,9 @@ Index: linux-2.6.25-SL110_BRANCH/fs/ocfs2/file.c if (ret > 0) { unsigned long nr_pages; -Index: linux-2.6.25-SL110_BRANCH/fs/splice.c -=================================================================== ---- linux-2.6.25-SL110_BRANCH.orig/fs/splice.c 2009-05-26 17:23:29.000000000 +0200 -+++ linux-2.6.25-SL110_BRANCH/fs/splice.c 2009-05-27 10:09:01.000000000 +0200 -@@ -619,10 +619,11 @@ static void wakeup_pipe_writers(struct p +--- a/fs/splice.c ++++ b/fs/splice.c +@@ -629,10 +629,11 @@ static void wakeup_pipe_writers(struct p * locking is required around copying the pipe buffers to the * destination. */ @@ -98,7 +94,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c while (pipe->nrbufs) { struct pipe_buffer *buf = pipe->bufs + pipe->curbuf; -@@ -641,7 +642,7 @@ int splice_from_pipe_feed(struct pipe_in +@@ -651,7 +652,7 @@ int splice_from_pipe_feed(struct pipe_in buf->offset += ret; buf->len -= ret; @@ -107,7 +103,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c sd->len -= ret; sd->pos += ret; sd->total_len -= ret; -@@ -652,7 +653,7 @@ int splice_from_pipe_feed(struct pipe_in +@@ -662,7 +663,7 @@ int splice_from_pipe_feed(struct pipe_in pipe->curbuf = (pipe->curbuf + 1) & (PIPE_BUFFERS - 1); pipe->nrbufs--; if (pipe->inode) @@ -116,7 +112,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c } if (!sd->total_len) -@@ -673,13 +674,15 @@ EXPORT_SYMBOL(splice_from_pipe_feed); +@@ -683,13 +684,15 @@ EXPORT_SYMBOL(splice_from_pipe_feed); * value (one) if pipe buffers are available. It will return zero * or -errno if no more data needs to be spliced. */ @@ -134,7 +130,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c return 0; if (sd->flags & SPLICE_F_NONBLOCK) -@@ -688,9 +691,9 @@ int splice_from_pipe_next(struct pipe_in +@@ -698,9 +701,9 @@ int splice_from_pipe_next(struct pipe_in if (signal_pending(current)) return -ERESTARTSYS; @@ -146,7 +142,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c } pipe_wait(pipe); -@@ -709,10 +712,10 @@ EXPORT_SYMBOL(splice_from_pipe_next); +@@ -719,10 +722,10 @@ EXPORT_SYMBOL(splice_from_pipe_next); * splice_from_pipe_next() and splice_from_pipe_feed() to * initialize the necessary fields of @sd. */ @@ -160,7 +156,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c } EXPORT_SYMBOL(splice_from_pipe_begin); -@@ -726,9 +729,9 @@ EXPORT_SYMBOL(splice_from_pipe_begin); +@@ -736,9 +739,9 @@ EXPORT_SYMBOL(splice_from_pipe_begin); * be called after a loop containing splice_from_pipe_next() and * splice_from_pipe_feed(). */ @@ -172,7 +168,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c wakeup_pipe_writers(pipe); } EXPORT_SYMBOL(splice_from_pipe_end); -@@ -750,16 +753,17 @@ ssize_t __splice_from_pipe(struct pipe_i +@@ -760,16 +763,17 @@ ssize_t __splice_from_pipe(struct pipe_i splice_actor *actor) { int ret; @@ -195,7 +191,7 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c } EXPORT_SYMBOL(__splice_from_pipe); -@@ -882,30 +886,31 @@ generic_file_splice_write(struct pipe_in +@@ -892,30 +896,31 @@ generic_file_splice_write(struct pipe_in .pos = *ppos, .u.file = out, }; @@ -233,10 +229,8 @@ Index: linux-2.6.25-SL110_BRANCH/fs/splice.c if (ret > 0) { unsigned long nr_pages; -Index: linux-2.6.25-SL110_BRANCH/include/linux/splice.h -=================================================================== ---- linux-2.6.25-SL110_BRANCH.orig/include/linux/splice.h 2009-05-26 17:23:28.000000000 +0200 -+++ linux-2.6.25-SL110_BRANCH/include/linux/splice.h 2009-05-27 09:59:51.000000000 +0200 +--- a/include/linux/splice.h ++++ b/include/linux/splice.h @@ -36,6 +36,10 @@ struct splice_desc { void *data; /* cookie */ } u; diff --git a/src/patches/suse-2.6.27.25/patches.kabi/xen-x86_64-note-init-p2m b/src/patches/suse-2.6.27.31/patches.kabi/xen-x86_64-note-init-p2m similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/xen-x86_64-note-init-p2m rename to src/patches/suse-2.6.27.31/patches.kabi/xen-x86_64-note-init-p2m diff --git a/src/patches/suse-2.6.27.25/patches.kabi/xen3-e1000e_Export_set_memory_ro-rw b/src/patches/suse-2.6.27.31/patches.kabi/xen3-e1000e_Export_set_memory_ro-rw similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/xen3-e1000e_Export_set_memory_ro-rw rename to src/patches/suse-2.6.27.31/patches.kabi/xen3-e1000e_Export_set_memory_ro-rw diff --git a/src/patches/suse-2.6.27.25/patches.kabi/xen3-patch-2.6.27.18-19 b/src/patches/suse-2.6.27.31/patches.kabi/xen3-patch-2.6.27.18-19 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/xen3-patch-2.6.27.18-19 rename to src/patches/suse-2.6.27.31/patches.kabi/xen3-patch-2.6.27.18-19 diff --git a/src/patches/suse-2.6.27.25/patches.kabi/xpc-pass-physical b/src/patches/suse-2.6.27.31/patches.kabi/xpc-pass-physical similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kabi/xpc-pass-physical rename to src/patches/suse-2.6.27.31/patches.kabi/xpc-pass-physical diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/arch-include-asm-fixes b/src/patches/suse-2.6.27.31/patches.kernel.org/arch-include-asm-fixes similarity index 95% rename from src/patches/suse-2.6.27.25/patches.kernel.org/arch-include-asm-fixes rename to src/patches/suse-2.6.27.31/patches.kernel.org/arch-include-asm-fixes index d1a3af16e..f9dce943a 100644 --- a/src/patches/suse-2.6.27.25/patches.kernel.org/arch-include-asm-fixes +++ b/src/patches/suse-2.6.27.31/patches.kernel.org/arch-include-asm-fixes @@ -10,12 +10,60 @@ References: bnc#427473 Signed-off-by: Jeff Mahoney --- - Makefile | 23 +++++++++++++++-------- + Makefile | 24 ++++++++++++++++-------- arch/ia64/Makefile | 2 +- arch/ia64/include/asm/irq.h | 2 +- arch/ia64/kernel/Makefile | 6 +++--- - 4 files changed, 20 insertions(+), 13 deletions(-) + 4 files changed, 21 insertions(+), 13 deletions(-) +--- a/Makefile ++++ b/Makefile +@@ -969,8 +969,10 @@ define check-symlink + set -e; \ + if [ -L include/asm ]; then \ + asmlink=`readlink include/asm | cut -d '-' -f 2`; \ +- if [ "$$asmlink" != "$(SRCARCH)" ]; then \ +- echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ ++ archlink=`readlink include/asm | cut -d '/' -f 3`; \ ++ if [ "$$asmlink" != "$(SRCARCH)" -a \ ++ "$$archlink" != "$(SRCARCH)" ]; then \ ++ echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) or ../arch/$(SRCARCH)/include/asm was expected"; \ + echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ + exit 1; \ + fi; \ +@@ -981,12 +983,18 @@ endef + # not exist so the test in chack-symlink works and we have a + # directory for generated filesas used by some architectures. + define create-symlink +- if [ ! -L include/asm ]; then \ +- echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ +- if [ ! -d include/asm-$(SRCARCH) ]; then \ +- mkdir -p include/asm-$(SRCARCH); \ +- fi; \ +- ln -fsn asm-$(SRCARCH) $@; \ ++ if [ ! -L include/asm ]; then \ ++ if [ -d $(srctree)/arch/$(SRCARCH)/include/asm ]; then \ ++ echo ' SYMLINK $@ -> arch/$(SRCARCH)/include/asm'; \ ++ mkdir -p arch/$(SRCARCH)/include/asm; \ ++ ln -fsn ../arch/$(SRCARCH)/include/asm $@; \ ++ else \ ++ echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ ++ if [ ! -d include/asm-$(SRCARCH) ]; then \ ++ mkdir -p include/asm-$(SRCARCH); \ ++ fi; \ ++ ln -fsn asm-$(SRCARCH) $@; \ ++ fi; \ + fi + endef + +--- a/arch/ia64/Makefile ++++ b/arch/ia64/Makefile +@@ -105,4 +105,4 @@ archprepare: make_nr_irqs_h FORCE + PHONY += make_nr_irqs_h FORCE + + make_nr_irqs_h: FORCE +- $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h ++ $(Q)$(MAKE) $(build)=arch/ia64/kernel arch/ia64/include/asm/nr-irqs.h --- a/arch/ia64/include/asm/irq.h +++ b/arch/ia64/include/asm/irq.h @@ -13,7 +13,7 @@ @@ -48,51 +96,3 @@ Signed-off-by: Jeff Mahoney # # native ivt.S and entry.S ---- a/arch/ia64/Makefile -+++ b/arch/ia64/Makefile -@@ -105,4 +105,4 @@ archprepare: make_nr_irqs_h FORCE - PHONY += make_nr_irqs_h FORCE - - make_nr_irqs_h: FORCE -- $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h -+ $(Q)$(MAKE) $(build)=arch/ia64/kernel arch/ia64/include/asm/nr-irqs.h ---- a/Makefile -+++ b/Makefile -@@ -968,8 +968,10 @@ define check-symlink - set -e; \ - if [ -L include/asm ]; then \ - asmlink=`readlink include/asm | cut -d '-' -f 2`; \ -- if [ "$$asmlink" != "$(SRCARCH)" ]; then \ -- echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ -+ archlink=`readlink include/asm | cut -d '/' -f 3`; \ -+ if [ "$$asmlink" != "$(SRCARCH)" -a \ -+ "$$archlink" != "$(SRCARCH)" ]; then \ -+ echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) or ../arch/$(SRCARCH)/include/asm was expected"; \ - echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ - exit 1; \ - fi; \ -@@ -980,12 +982,18 @@ endef - # not exist so the test in chack-symlink works and we have a - # directory for generated filesas used by some architectures. - define create-symlink -- if [ ! -L include/asm ]; then \ -- echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ -- if [ ! -d include/asm-$(SRCARCH) ]; then \ -- mkdir -p include/asm-$(SRCARCH); \ -- fi; \ -- ln -fsn asm-$(SRCARCH) $@; \ -+ if [ ! -L include/asm ]; then \ -+ if [ -d $(srctree)/arch/$(SRCARCH)/include/asm ]; then \ -+ echo ' SYMLINK $@ -> arch/$(SRCARCH)/include/asm'; \ -+ mkdir -p arch/$(SRCARCH)/include/asm; \ -+ ln -fsn ../arch/$(SRCARCH)/include/asm $@; \ -+ else \ -+ echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ -+ if [ ! -d include/asm-$(SRCARCH) ]; then \ -+ mkdir -p include/asm-$(SRCARCH); \ -+ fi; \ -+ ln -fsn asm-$(SRCARCH) $@; \ -+ fi; \ - fi - endef - diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/carmine-section-mismatch b/src/patches/suse-2.6.27.31/patches.kernel.org/carmine-section-mismatch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/carmine-section-mismatch rename to src/patches/suse-2.6.27.31/patches.kernel.org/carmine-section-mismatch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/gdth-section-conflict b/src/patches/suse-2.6.27.31/patches.kernel.org/gdth-section-conflict similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/gdth-section-conflict rename to src/patches/suse-2.6.27.31/patches.kernel.org/gdth-section-conflict diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/ipmi-section-conflict.diff b/src/patches/suse-2.6.27.31/patches.kernel.org/ipmi-section-conflict.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/ipmi-section-conflict.diff rename to src/patches/suse-2.6.27.31/patches.kernel.org/ipmi-section-conflict.diff diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/md-section-conflict b/src/patches/suse-2.6.27.31/patches.kernel.org/md-section-conflict similarity index 93% rename from src/patches/suse-2.6.27.25/patches.kernel.org/md-section-conflict rename to src/patches/suse-2.6.27.31/patches.kernel.org/md-section-conflict index b380a1fa9..1888568cd 100644 --- a/src/patches/suse-2.6.27.25/patches.kernel.org/md-section-conflict +++ b/src/patches/suse-2.6.27.31/patches.kernel.org/md-section-conflict @@ -14,7 +14,7 @@ Signed-off-by: Jeff Mahoney --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -6412,11 +6412,11 @@ static __exit void md_exit(void) +@@ -6414,11 +6414,11 @@ static __exit void md_exit(void) subsys_initcall(md_init); module_exit(md_exit) diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/psmouse-section-conflict.diff b/src/patches/suse-2.6.27.31/patches.kernel.org/psmouse-section-conflict.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/psmouse-section-conflict.diff rename to src/patches/suse-2.6.27.31/patches.kernel.org/psmouse-section-conflict.diff diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/revert-ext4-changes-in-2.6.27.19-and-2.6.27.20-and-2.6.27.25.patch b/src/patches/suse-2.6.27.31/patches.kernel.org/revert-ext4-changes-in-2.6.27.19-and-2.6.27.20-and-2.6.27.25.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/revert-ext4-changes-in-2.6.27.19-and-2.6.27.20-and-2.6.27.25.patch rename to src/patches/suse-2.6.27.31/patches.kernel.org/revert-ext4-changes-in-2.6.27.19-and-2.6.27.20-and-2.6.27.25.patch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-correct-atmel-flash-part-handling.patch b/src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-correct-atmel-flash-part-handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-correct-atmel-flash-part-handling.patch rename to src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-correct-atmel-flash-part-handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch b/src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch rename to src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-return-a-failed-status-when-abort-mailbox-command-fails.patch b/src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-return-a-failed-status-when-abort-mailbox-command-fails.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/revert-scsi-qla2xxx-return-a-failed-status-when-abort-mailbox-command-fails.patch rename to src/patches/suse-2.6.27.31/patches.kernel.org/revert-scsi-qla2xxx-return-a-failed-status-when-abort-mailbox-command-fails.patch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/setup_APIC_timer-section-mismatch b/src/patches/suse-2.6.27.31/patches.kernel.org/setup_APIC_timer-section-mismatch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/setup_APIC_timer-section-mismatch rename to src/patches/suse-2.6.27.31/patches.kernel.org/setup_APIC_timer-section-mismatch diff --git a/src/patches/suse-2.6.27.25/patches.kernel.org/spu_profiler-include b/src/patches/suse-2.6.27.31/patches.kernel.org/spu_profiler-include similarity index 100% rename from src/patches/suse-2.6.27.25/patches.kernel.org/spu_profiler-include rename to src/patches/suse-2.6.27.31/patches.kernel.org/spu_profiler-include diff --git a/src/patches/suse-2.6.27.25/patches.rpmify/buildhost b/src/patches/suse-2.6.27.31/patches.rpmify/buildhost similarity index 100% rename from src/patches/suse-2.6.27.25/patches.rpmify/buildhost rename to src/patches/suse-2.6.27.31/patches.rpmify/buildhost diff --git a/src/patches/suse-2.6.27.25/patches.rpmify/cloneconfig.diff b/src/patches/suse-2.6.27.31/patches.rpmify/cloneconfig.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.rpmify/cloneconfig.diff rename to src/patches/suse-2.6.27.31/patches.rpmify/cloneconfig.diff diff --git a/src/patches/suse-2.6.27.25/patches.rpmify/firmware-path b/src/patches/suse-2.6.27.31/patches.rpmify/firmware-path similarity index 95% rename from src/patches/suse-2.6.27.25/patches.rpmify/firmware-path rename to src/patches/suse-2.6.27.31/patches.rpmify/firmware-path index 3ced83c1c..3cdfbbb2d 100644 --- a/src/patches/suse-2.6.27.25/patches.rpmify/firmware-path +++ b/src/patches/suse-2.6.27.31/patches.rpmify/firmware-path @@ -14,7 +14,7 @@ Signed-off-by: Jeff Mahoney --- a/Makefile +++ b/Makefile -@@ -1035,7 +1035,7 @@ depend dep: +@@ -1037,7 +1037,7 @@ depend dep: # --------------------------------------------------------------------------- # Firmware install diff --git a/src/patches/suse-2.6.27.25/patches.rpmify/no-include-asm b/src/patches/suse-2.6.27.31/patches.rpmify/no-include-asm similarity index 95% rename from src/patches/suse-2.6.27.25/patches.rpmify/no-include-asm rename to src/patches/suse-2.6.27.31/patches.rpmify/no-include-asm index 9ad2644b3..5fc1aa0cd 100644 --- a/src/patches/suse-2.6.27.25/patches.rpmify/no-include-asm +++ b/src/patches/suse-2.6.27.31/patches.rpmify/no-include-asm @@ -18,7 +18,7 @@ Signed-off-by: Takashi Iwai --- a/Makefile +++ b/Makefile -@@ -937,7 +937,11 @@ ifneq ($(KBUILD_SRC),) +@@ -938,7 +938,11 @@ ifneq ($(KBUILD_SRC),) fi; $(Q)if [ ! -d include2 ]; then \ mkdir -p include2; \ diff --git a/src/patches/suse-2.6.27.25/patches.rpmify/rpm-kernel-config b/src/patches/suse-2.6.27.31/patches.rpmify/rpm-kernel-config similarity index 100% rename from src/patches/suse-2.6.27.25/patches.rpmify/rpm-kernel-config rename to src/patches/suse-2.6.27.31/patches.rpmify/rpm-kernel-config diff --git a/src/patches/suse-2.6.27.25/patches.suse/8250-sysrq-ctrl_o.patch b/src/patches/suse-2.6.27.31/patches.suse/8250-sysrq-ctrl_o.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/8250-sysrq-ctrl_o.patch rename to src/patches/suse-2.6.27.31/patches.suse/8250-sysrq-ctrl_o.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch index 2632b07af..606ed3075 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-01-mm-gfp-to-alloc_flags.patch @@ -28,7 +28,7 @@ Acked-by: Suresh Jayaraman --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1455,6 +1455,44 @@ try_next_zone: +@@ -1460,6 +1460,44 @@ try_next_zone: } /* @@ -73,7 +73,7 @@ Acked-by: Suresh Jayaraman * This is the 'heart' of the zoned buddy allocator. */ struct page * -@@ -1512,49 +1550,28 @@ restart: +@@ -1517,49 +1555,28 @@ restart: * OK, we're below the kswapd watermark and have kicked background * reclaim. Now things get more complex, so set up alloc_flags according * to how we want to proceed. @@ -135,7 +135,7 @@ Acked-by: Suresh Jayaraman } goto nopage; } -@@ -1563,6 +1580,10 @@ nofail_alloc: +@@ -1568,6 +1585,10 @@ nofail_alloc: if (!wait) goto nopage; diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch similarity index 90% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch index 7aa2ca5c8..615b4afcc 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-02-mm-setup_per_zone_pages_min.patch @@ -26,7 +26,7 @@ Acked-by: Suresh Jayaraman int min_free_kbytes = 1024; unsigned long __meminitdata nr_kernel_pages; -@@ -4260,12 +4261,12 @@ static void setup_per_zone_lowmem_reserv +@@ -4265,12 +4266,12 @@ static void setup_per_zone_lowmem_reserv } /** @@ -41,7 +41,7 @@ Acked-by: Suresh Jayaraman { unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10); unsigned long lowmem_pages = 0; -@@ -4320,6 +4321,15 @@ void setup_per_zone_pages_min(void) +@@ -4325,6 +4326,15 @@ void setup_per_zone_pages_min(void) calculate_totalreserve_pages(); } @@ -57,7 +57,7 @@ Acked-by: Suresh Jayaraman /* * Initialise min_free_kbytes. * -@@ -4355,7 +4365,7 @@ static int __init init_per_zone_pages_mi +@@ -4360,7 +4370,7 @@ static int __init init_per_zone_pages_mi min_free_kbytes = 128; if (min_free_kbytes > 65536) min_free_kbytes = 65536; diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-03-net-ipv6-route-cleanup.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-03-net-ipv6-route-cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-03-net-ipv6-route-cleanup.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-03-net-ipv6-route-cleanup.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-04-net-ipv6-route-cleanup-sysctl.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-04-net-ipv6-route-cleanup-sysctl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-04-net-ipv6-route-cleanup-sysctl.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-04-net-ipv6-route-cleanup-sysctl.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-05-doc.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-05-doc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-05-doc.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-05-doc.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch index 4a749c050..72d5678da 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-06-mm-gfp-to-alloc_flags-expose.patch @@ -36,7 +36,7 @@ Acked-by: Suresh Jayaraman MMINIT_WARNING, --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1124,14 +1124,6 @@ failed: +@@ -1129,14 +1129,6 @@ failed: return NULL; } @@ -51,7 +51,7 @@ Acked-by: Suresh Jayaraman #ifdef CONFIG_FAIL_PAGE_ALLOC static struct fail_page_alloc_attr { -@@ -1458,7 +1450,7 @@ try_next_zone: +@@ -1463,7 +1455,7 @@ try_next_zone: /* * get the deepest reaching allocation flags for the given gfp_mask */ diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-07-page_alloc-reserve.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-07-page_alloc-reserve.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-07-page_alloc-reserve.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-07-page_alloc-reserve.patch index 959bccfac..6b1915a78 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-07-page_alloc-reserve.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-07-page_alloc-reserve.patch @@ -32,7 +32,7 @@ Acked-by: Suresh Jayaraman * protected by zone->lru_lock ! --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1425,8 +1425,10 @@ zonelist_scan: +@@ -1430,8 +1430,10 @@ zonelist_scan: } page = buffered_rmqueue(preferred_zone, zone, order, gfp_mask); diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-08-reserve-slub.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-08-reserve-slub.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-08-reserve-slub.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-08-reserve-slub.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-09-mm-kmem_estimate_pages.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-09-mm-kmem_estimate_pages.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-09-mm-kmem_estimate_pages.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-09-mm-kmem_estimate_pages.patch index 987581f3a..0cb47c48a 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-09-mm-kmem_estimate_pages.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-09-mm-kmem_estimate_pages.patch @@ -127,7 +127,7 @@ Acked-by: Suresh Jayaraman static int alloc_kmemlist(struct kmem_cache *cachep) --- a/mm/slob.c +++ b/mm/slob.c -@@ -659,3 +659,70 @@ void __init kmem_cache_init(void) +@@ -661,3 +661,70 @@ void __init kmem_cache_init(void) { slob_ready = 1; } @@ -243,7 +243,7 @@ Acked-by: Suresh Jayaraman static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { -@@ -2776,6 +2812,57 @@ void kfree(const void *x) +@@ -2778,6 +2814,57 @@ void kfree(const void *x) EXPORT_SYMBOL(kfree); /* diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch similarity index 95% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch index a34dcb82c..b0e5b7f2b 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-10-mm-PF_MEMALLOC-softirq.patch @@ -35,7 +35,7 @@ Acked-by: Suresh Jayaraman --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1554,6 +1554,13 @@ extern cputime_t task_gtime(struct task_ +@@ -1555,6 +1555,13 @@ extern cputime_t task_gtime(struct task_ #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) #define used_math() tsk_used_math(current) @@ -70,7 +70,7 @@ Acked-by: Suresh Jayaraman #ifndef __ARCH_HAS_DO_SOFTIRQ --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1478,9 +1478,10 @@ int gfp_to_alloc_flags(gfp_t gfp_mask) +@@ -1483,9 +1483,10 @@ int gfp_to_alloc_flags(gfp_t gfp_mask) alloc_flags |= ALLOC_HARDER; if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) { diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-11-mm-page_alloc-emerg.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-11-mm-page_alloc-emerg.patch similarity index 92% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-11-mm-page_alloc-emerg.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-11-mm-page_alloc-emerg.patch index c223c0291..12ace2ea0 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-11-mm-page_alloc-emerg.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-11-mm-page_alloc-emerg.patch @@ -52,7 +52,7 @@ Acked-by: Suresh Jayaraman unsigned long __meminitdata nr_kernel_pages; unsigned long __meminitdata nr_all_pages; -@@ -1236,7 +1238,7 @@ int zone_watermark_ok(struct zone *z, in +@@ -1241,7 +1243,7 @@ int zone_watermark_ok(struct zone *z, in if (alloc_flags & ALLOC_HARDER) min -= min / 4; @@ -61,7 +61,7 @@ Acked-by: Suresh Jayaraman return 0; for (o = 0; o < order; o++) { /* At the next order, this order's pages become unavailable */ -@@ -1503,7 +1505,7 @@ __alloc_pages_internal(gfp_t gfp_mask, u +@@ -1508,7 +1510,7 @@ __alloc_pages_internal(gfp_t gfp_mask, u struct reclaim_state reclaim_state; struct task_struct *p = current; int do_retry; @@ -70,7 +70,7 @@ Acked-by: Suresh Jayaraman unsigned long did_some_progress; unsigned long pages_reclaimed = 0; -@@ -1674,9 +1676,9 @@ nopage: +@@ -1679,9 +1681,9 @@ nopage: printk(KERN_INFO "everything is working fine. Allocations from irqs cannot be\n"); printk(KERN_INFO "perfectly reliable and the kernel is designed to handle that.\n"); } @@ -83,7 +83,7 @@ Acked-by: Suresh Jayaraman dump_stack(); show_mem(); } -@@ -1940,9 +1942,9 @@ void show_free_areas(void) +@@ -1945,9 +1947,9 @@ void show_free_areas(void) "\n", zone->name, K(zone_page_state(zone, NR_FREE_PAGES)), @@ -96,7 +96,7 @@ Acked-by: Suresh Jayaraman K(zone_page_state(zone, NR_ACTIVE)), K(zone_page_state(zone, NR_INACTIVE)), K(zone->present_pages), -@@ -4206,7 +4208,7 @@ static void calculate_totalreserve_pages +@@ -4211,7 +4213,7 @@ static void calculate_totalreserve_pages } /* we treat pages_high as reserved pages. */ @@ -105,7 +105,7 @@ Acked-by: Suresh Jayaraman if (max > zone->present_pages) max = zone->present_pages; -@@ -4263,7 +4265,8 @@ static void setup_per_zone_lowmem_reserv +@@ -4268,7 +4270,8 @@ static void setup_per_zone_lowmem_reserv */ static void __setup_per_zone_pages_min(void) { @@ -115,7 +115,7 @@ Acked-by: Suresh Jayaraman unsigned long lowmem_pages = 0; struct zone *zone; unsigned long flags; -@@ -4275,11 +4278,13 @@ static void __setup_per_zone_pages_min(v +@@ -4280,11 +4283,13 @@ static void __setup_per_zone_pages_min(v } for_each_zone(zone) { @@ -130,7 +130,7 @@ Acked-by: Suresh Jayaraman if (is_highmem(zone)) { /* * __GFP_HIGH and PF_MEMALLOC allocations usually don't -@@ -4298,12 +4303,14 @@ static void __setup_per_zone_pages_min(v +@@ -4303,12 +4308,14 @@ static void __setup_per_zone_pages_min(v if (min_pages > 128) min_pages = 128; zone->pages_min = min_pages; @@ -145,7 +145,7 @@ Acked-by: Suresh Jayaraman } zone->pages_low = zone->pages_min + (tmp >> 2); -@@ -4325,6 +4332,63 @@ void setup_per_zone_pages_min(void) +@@ -4330,6 +4337,63 @@ void setup_per_zone_pages_min(void) spin_unlock_irqrestore(&min_free_lock, flags); } diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch index b3011010e..ec5badbe0 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-12-global-ALLOC_NO_WATERMARKS.patch @@ -25,7 +25,7 @@ Acked-by: Suresh Jayaraman --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1561,6 +1561,11 @@ restart: +@@ -1566,6 +1566,11 @@ restart: rebalance: if (alloc_flags & ALLOC_NO_WATERMARKS) { nofail_alloc: diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch index 725c4b9b1..a979f6013 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch @@ -39,7 +39,7 @@ Acked-by: Suresh Jayaraman #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1480,7 +1480,9 @@ int gfp_to_alloc_flags(gfp_t gfp_mask) +@@ -1485,7 +1485,9 @@ int gfp_to_alloc_flags(gfp_t gfp_mask) alloc_flags |= ALLOC_HARDER; if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) { diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-14-mm-reserve.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-14-mm-reserve.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-14-mm-reserve.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-14-mm-reserve.patch index b1c5a597d..2134c9065 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-14-mm-reserve.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-14-mm-reserve.patch @@ -23,10 +23,8 @@ Acked-by: Suresh Jayaraman mm/slub.c | 2 5 files changed, 848 insertions(+), 11 deletions(-) -Index: linux-2.6.27/include/linux/reserve.h -=================================================================== --- /dev/null -+++ linux-2.6.27/include/linux/reserve.h ++++ b/include/linux/reserve.h @@ -0,0 +1,198 @@ +/* + * Memory reserve management. @@ -226,10 +224,57 @@ Index: linux-2.6.27/include/linux/reserve.h +} + +#endif /* _LINUX_RESERVE_H */ -Index: linux-2.6.27/mm/Makefile -=================================================================== ---- linux-2.6.27.orig/mm/Makefile -+++ linux-2.6.27/mm/Makefile +--- a/include/linux/slab.h ++++ b/include/linux/slab.h +@@ -230,13 +230,14 @@ static inline void *kmem_cache_alloc_nod + */ + #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) + extern void *__kmalloc_track_caller(size_t, gfp_t, void*); +-#define kmalloc_track_caller(size, flags) \ +- __kmalloc_track_caller(size, flags, __builtin_return_address(0)) + #else +-#define kmalloc_track_caller(size, flags) \ ++#define __kmalloc_track_caller(size, flags, ip) \ + __kmalloc(size, flags) + #endif /* DEBUG_SLAB */ + ++#define kmalloc_track_caller(size, flags) \ ++ __kmalloc_track_caller(size, flags, __builtin_return_address(0)) ++ + #ifdef CONFIG_NUMA + /* + * kmalloc_node_track_caller is a special version of kmalloc_node that +@@ -248,21 +249,22 @@ extern void *__kmalloc_track_caller(size + */ + #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) + extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); +-#define kmalloc_node_track_caller(size, flags, node) \ +- __kmalloc_node_track_caller(size, flags, node, \ +- __builtin_return_address(0)) + #else +-#define kmalloc_node_track_caller(size, flags, node) \ ++#define __kmalloc_node_track_caller(size, flags, node, ip) \ + __kmalloc_node(size, flags, node) + #endif + + #else /* CONFIG_NUMA */ + +-#define kmalloc_node_track_caller(size, flags, node) \ +- kmalloc_track_caller(size, flags) ++#define __kmalloc_node_track_caller(size, flags, node, ip) \ ++ __kmalloc_track_caller(size, flags, ip) + + #endif /* DEBUG_SLAB */ + ++#define kmalloc_node_track_caller(size, flags, node) \ ++ __kmalloc_node_track_caller(size, flags, node, \ ++ __builtin_return_address(0)) ++ + /* + * Shortcuts + */ +--- a/mm/Makefile ++++ b/mm/Makefile @@ -11,7 +11,7 @@ obj-y := bootmem.o filemap.o mempool.o maccess.o page_alloc.o page-writeback.o pdflush.o \ readahead.o swap.o truncate.o vmscan.o \ @@ -239,10 +284,8 @@ Index: linux-2.6.27/mm/Makefile obj-$(CONFIG_PROC_PAGE_MONITOR) += pagewalk.o obj-$(CONFIG_BOUNCE) += bounce.o -Index: linux-2.6.27/mm/reserve.c -=================================================================== --- /dev/null -+++ linux-2.6.27/mm/reserve.c ++++ b/mm/reserve.c @@ -0,0 +1,637 @@ +/* + * Memory reserve management. @@ -881,62 +924,9 @@ Index: linux-2.6.27/mm/reserve.c + __free_pages(page, order); + mem_reserve_pages_charge(res, -(1 << order)); +} -Index: linux-2.6.27/include/linux/slab.h -=================================================================== ---- linux-2.6.27.orig/include/linux/slab.h -+++ linux-2.6.27/include/linux/slab.h -@@ -230,13 +230,14 @@ static inline void *kmem_cache_alloc_nod - */ - #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) - extern void *__kmalloc_track_caller(size_t, gfp_t, void*); --#define kmalloc_track_caller(size, flags) \ -- __kmalloc_track_caller(size, flags, __builtin_return_address(0)) - #else --#define kmalloc_track_caller(size, flags) \ -+#define __kmalloc_track_caller(size, flags, ip) \ - __kmalloc(size, flags) - #endif /* DEBUG_SLAB */ - -+#define kmalloc_track_caller(size, flags) \ -+ __kmalloc_track_caller(size, flags, __builtin_return_address(0)) -+ - #ifdef CONFIG_NUMA - /* - * kmalloc_node_track_caller is a special version of kmalloc_node that -@@ -248,21 +249,22 @@ extern void *__kmalloc_track_caller(size - */ - #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) - extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); --#define kmalloc_node_track_caller(size, flags, node) \ -- __kmalloc_node_track_caller(size, flags, node, \ -- __builtin_return_address(0)) - #else --#define kmalloc_node_track_caller(size, flags, node) \ -+#define __kmalloc_node_track_caller(size, flags, node, ip) \ - __kmalloc_node(size, flags, node) - #endif - - #else /* CONFIG_NUMA */ - --#define kmalloc_node_track_caller(size, flags, node) \ -- kmalloc_track_caller(size, flags) -+#define __kmalloc_node_track_caller(size, flags, node, ip) \ -+ __kmalloc_track_caller(size, flags, ip) - - #endif /* DEBUG_SLAB */ - -+#define kmalloc_node_track_caller(size, flags, node) \ -+ __kmalloc_node_track_caller(size, flags, node, \ -+ __builtin_return_address(0)) -+ - /* - * Shortcuts - */ -Index: linux-2.6.27/mm/slub.c -=================================================================== ---- linux-2.6.27.orig/mm/slub.c -+++ linux-2.6.27/mm/slub.c -@@ -2726,6 +2726,7 @@ void *__kmalloc(size_t size, gfp_t flags +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -2728,6 +2728,7 @@ void *__kmalloc(size_t size, gfp_t flags } EXPORT_SYMBOL(__kmalloc); @@ -944,7 +934,7 @@ Index: linux-2.6.27/mm/slub.c static void *kmalloc_large_node(size_t size, gfp_t flags, int node) { struct page *page = alloc_pages_node(node, flags | __GFP_COMP, -@@ -2737,7 +2738,6 @@ static void *kmalloc_large_node(size_t s +@@ -2739,7 +2740,6 @@ static void *kmalloc_large_node(size_t s return NULL; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-15-mm-selinux-emergency.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-15-mm-selinux-emergency.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-15-mm-selinux-emergency.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-15-mm-selinux-emergency.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-16-net-backlog.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-16-net-backlog.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-16-net-backlog.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-16-net-backlog.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-17-net-ps_rx.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-17-net-ps_rx.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-17-net-ps_rx.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-17-net-ps_rx.patch index 583fbe6b7..05ca9534c 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-17-net-ps_rx.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-17-net-ps_rx.patch @@ -17,7 +17,7 @@ bnx2.c part fixed by Jiri Bohac (bnc#484306) --- - drivers/net/bnx2.c | 8 +++----- + drivers/net/bnx2.c | 9 +++------ drivers/net/e1000/e1000_main.c | 8 ++------ drivers/net/e1000e/netdev.c | 7 ++----- drivers/net/igb/igb_main.c | 9 ++------- @@ -25,7 +25,7 @@ bnx2.c part fixed by Jiri Bohac (bnc#484306) drivers/net/sky2.c | 16 ++++++---------- include/linux/skbuff.h | 23 +++++++++++++++++++++++ net/core/skbuff.c | 20 ++++++++++++++++++++ - 8 files changed, 64 insertions(+), 41 deletions(-) + 8 files changed, 64 insertions(+), 42 deletions(-) --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -47,22 +47,16 @@ bnx2.c part fixed by Jiri Bohac (bnc#484306) rx_pg->page = NULL; } -@@ -2833,23 +2833,20 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2 +@@ -2819,7 +2819,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2 if (i == pages - 1) frag_len -= 4; - + - skb_fill_page_desc(skb, i, rx_pg->page, 0, frag_len); + skb_add_rx_frag(skb, i, rx_pg->page, 0, frag_len); rx_pg->page = NULL; - + err = bnx2_alloc_rx_page(bp, rxr, - RX_PG_RING_IDX(pg_prod)); - if (unlikely(err)) { - rxr->rx_pg_cons = pg_cons; - rxr->rx_pg_prod = pg_prod; - bnx2_reuse_rx_skb_pages(bp, rxr, skb, - pages - i); - return err; +@@ -2833,9 +2833,6 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2 } frag_size -= frag_len; diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-18-net-sk_allocation.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-18-net-sk_allocation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-18-net-sk_allocation.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-18-net-sk_allocation.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-19-netvm-reserve.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-19-netvm-reserve.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-19-netvm-reserve.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-19-netvm-reserve.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-20-netvm-reserve-inet.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-20-netvm-reserve-inet.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-20-netvm-reserve-inet.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-20-netvm-reserve-inet.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-20-netvm-reserve-inet.patch-fix b/src/patches/suse-2.6.27.31/patches.suse/SoN-20-netvm-reserve-inet.patch-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-20-netvm-reserve-inet.patch-fix rename to src/patches/suse-2.6.27.31/patches.suse/SoN-20-netvm-reserve-inet.patch-fix diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-21-netvm-skbuff-reserve.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-21-netvm-skbuff-reserve.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-21-netvm-skbuff-reserve.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-21-netvm-skbuff-reserve.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-22-netvm-sk_filter.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-22-netvm-sk_filter.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-22-netvm-sk_filter.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-22-netvm-sk_filter.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-23-netvm-tcp-deadlock.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-23-netvm-tcp-deadlock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-23-netvm-tcp-deadlock.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-23-netvm-tcp-deadlock.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-24-emergency-nf_queue.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-24-emergency-nf_queue.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-24-emergency-nf_queue.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-24-emergency-nf_queue.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-25-netvm.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-25-netvm.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-25-netvm.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-25-netvm.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-26-mm-swapfile.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-26-mm-swapfile.patch similarity index 97% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-26-mm-swapfile.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-26-mm-swapfile.patch index 94e1f363f..7949fb8a7 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-26-mm-swapfile.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-26-mm-swapfile.patch @@ -73,7 +73,7 @@ Acked-by: Suresh Jayaraman ->prepare_write(), ->commit_write(), ->sync_page() and ->readpage() may be called from the request handler (/dev/loop). -@@ -289,6 +297,20 @@ cleaned, or an error value if not. Note +@@ -289,6 +297,20 @@ cleaned, or an error value if not. Note getting mapped back in and redirtied, it needs to be kept locked across the entire operation. @@ -130,7 +130,7 @@ Acked-by: Suresh Jayaraman --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h -@@ -345,7 +345,7 @@ static inline void invalidate_inode_buff +@@ -347,7 +347,7 @@ static inline void invalidate_inode_buff static inline int remove_inode_buffers(struct inode *inode) { return 1; } static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } static inline void invalidate_bdev(struct block_device *bdev) {} @@ -271,9 +271,22 @@ Acked-by: Suresh Jayaraman bio = get_swap_bio(GFP_KERNEL, page_private(page), page, end_swap_bio_read); if (bio == NULL) { +--- a/mm/swap_state.c ++++ b/mm/swap_state.c +@@ -27,8 +27,8 @@ + */ + static const struct address_space_operations swap_aops = { + .writepage = swap_writepage, +- .sync_page = block_sync_page, +- .set_page_dirty = __set_page_dirty_nobuffers, ++ .sync_page = swap_sync_page, ++ .set_page_dirty = swap_set_page_dirty, + .migratepage = migrate_page, + }; + --- a/mm/swapfile.c +++ b/mm/swapfile.c -@@ -1018,6 +1018,14 @@ static void destroy_swap_extents(struct +@@ -1018,6 +1018,14 @@ static void destroy_swap_extents(struct list_del(&se->list); kfree(se); } @@ -288,7 +301,7 @@ Acked-by: Suresh Jayaraman } /* -@@ -1092,7 +1100,9 @@ add_swap_extent(struct swap_info_struct +@@ -1092,7 +1100,9 @@ add_swap_extent(struct swap_info_struct */ static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span) { @@ -346,16 +359,3 @@ Acked-by: Suresh Jayaraman /* * swap_lock prevents swap_map being freed. Don't grab an extra * reference on the swaphandle, it doesn't matter if it becomes unused. ---- a/mm/swap_state.c -+++ b/mm/swap_state.c -@@ -27,8 +27,8 @@ - */ - static const struct address_space_operations swap_aops = { - .writepage = swap_writepage, -- .sync_page = block_sync_page, -- .set_page_dirty = __set_page_dirty_nobuffers, -+ .sync_page = swap_sync_page, -+ .set_page_dirty = swap_set_page_dirty, - .migratepage = migrate_page, - }; - diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-27-mm-page_file_methods.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-27-mm-page_file_methods.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-27-mm-page_file_methods.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-27-mm-page_file_methods.patch index a5696c5d4..73670761b 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-27-mm-page_file_methods.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-27-mm-page_file_methods.patch @@ -32,7 +32,7 @@ Acked-by: Suresh Jayaraman --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -646,6 +646,17 @@ static inline struct address_space *page +@@ -658,6 +658,17 @@ static inline struct address_space *page return mapping; } @@ -50,7 +50,7 @@ Acked-by: Suresh Jayaraman static inline int PageAnon(struct page *page) { return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0; -@@ -662,6 +673,20 @@ static inline pgoff_t page_index(struct +@@ -674,6 +685,20 @@ static inline pgoff_t page_index(struct return page->index; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-28-nfs-swapcache.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-28-nfs-swapcache.patch similarity index 89% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-28-nfs-swapcache.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-28-nfs-swapcache.patch index 20375c359..78a363119 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-28-nfs-swapcache.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-28-nfs-swapcache.patch @@ -94,7 +94,7 @@ Acked-by: Suresh Jayaraman * --- a/fs/nfs/read.c +++ b/fs/nfs/read.c -@@ -477,11 +477,11 @@ static const struct rpc_call_ops nfs_rea +@@ -475,11 +475,11 @@ static const struct rpc_call_ops nfs_rea int nfs_readpage(struct file *file, struct page *page) { struct nfs_open_context *ctx; @@ -108,7 +108,7 @@ Acked-by: Suresh Jayaraman nfs_inc_stats(inode, NFSIOS_VFSREADPAGE); nfs_add_stats(inode, NFSIOS_READPAGES, 1); -@@ -528,7 +528,7 @@ static int +@@ -526,7 +526,7 @@ static int readpage_async_filler(void *data, struct page *page) { struct nfs_readdesc *desc = (struct nfs_readdesc *)data; @@ -119,7 +119,7 @@ Acked-by: Suresh Jayaraman int error; --- a/fs/nfs/write.c +++ b/fs/nfs/write.c -@@ -120,7 +120,7 @@ static struct nfs_page *nfs_page_find_re +@@ -118,7 +118,7 @@ static struct nfs_page *nfs_page_find_re static struct nfs_page *nfs_page_find_request(struct page *page) { @@ -128,7 +128,7 @@ Acked-by: Suresh Jayaraman struct nfs_page *req = NULL; spin_lock(&inode->i_lock); -@@ -132,16 +132,16 @@ static struct nfs_page *nfs_page_find_re +@@ -130,16 +130,16 @@ static struct nfs_page *nfs_page_find_re /* Adjust the file length if we're writing beyond the end */ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int count) { @@ -148,7 +148,7 @@ Acked-by: Suresh Jayaraman if (i_size >= end) goto out; i_size_write(inode, end); -@@ -154,7 +154,7 @@ out: +@@ -152,7 +152,7 @@ out: static void nfs_set_pageerror(struct page *page) { SetPageError(page); @@ -157,7 +157,7 @@ Acked-by: Suresh Jayaraman } /* We can set the PG_uptodate flag if we see that a write request -@@ -195,7 +195,7 @@ static int nfs_set_page_writeback(struct +@@ -193,7 +193,7 @@ static int nfs_set_page_writeback(struct int ret = test_set_page_writeback(page); if (!ret) { @@ -166,7 +166,7 @@ Acked-by: Suresh Jayaraman struct nfs_server *nfss = NFS_SERVER(inode); if (atomic_long_inc_return(&nfss->writeback) > -@@ -207,7 +207,7 @@ static int nfs_set_page_writeback(struct +@@ -205,7 +205,7 @@ static int nfs_set_page_writeback(struct static void nfs_end_page_writeback(struct page *page) { @@ -175,7 +175,7 @@ Acked-by: Suresh Jayaraman struct nfs_server *nfss = NFS_SERVER(inode); end_page_writeback(page); -@@ -222,7 +222,7 @@ static void nfs_end_page_writeback(struc +@@ -220,7 +220,7 @@ static void nfs_end_page_writeback(struc static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, struct page *page) { @@ -184,7 +184,7 @@ Acked-by: Suresh Jayaraman struct nfs_page *req; int ret; -@@ -265,12 +265,12 @@ static int nfs_page_async_flush(struct n +@@ -263,12 +263,12 @@ static int nfs_page_async_flush(struct n static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) { @@ -199,7 +199,7 @@ Acked-by: Suresh Jayaraman return nfs_page_async_flush(pgio, page); } -@@ -282,7 +282,7 @@ static int nfs_writepage_locked(struct p +@@ -280,7 +280,7 @@ static int nfs_writepage_locked(struct p struct nfs_pageio_descriptor pgio; int err; @@ -208,7 +208,7 @@ Acked-by: Suresh Jayaraman err = nfs_do_writepage(page, wbc, &pgio); nfs_pageio_complete(&pgio); if (err < 0) -@@ -411,7 +411,8 @@ nfs_mark_request_commit(struct nfs_page +@@ -409,7 +409,8 @@ nfs_mark_request_commit(struct nfs_page NFS_PAGE_TAG_COMMIT); spin_unlock(&inode->i_lock); inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); @@ -218,7 +218,7 @@ Acked-by: Suresh Jayaraman __mark_inode_dirty(inode, I_DIRTY_DATASYNC); } -@@ -422,7 +423,7 @@ nfs_clear_request_commit(struct nfs_page +@@ -420,7 +421,7 @@ nfs_clear_request_commit(struct nfs_page if (test_and_clear_bit(PG_CLEAN, &(req)->wb_flags)) { dec_zone_page_state(page, NR_UNSTABLE_NFS); @@ -227,7 +227,7 @@ Acked-by: Suresh Jayaraman return 1; } return 0; -@@ -528,7 +529,7 @@ static void nfs_cancel_commit_list(struc +@@ -526,7 +527,7 @@ static void nfs_cancel_commit_list(struc * nfs_scan_commit - Scan an inode for commit requests * @inode: NFS inode to scan * @dst: destination list @@ -236,7 +236,7 @@ Acked-by: Suresh Jayaraman * @npages: idx_start + npages sets the upper bound to scan. * * Moves requests from the inode's 'commit' request list. -@@ -639,7 +640,7 @@ out_err: +@@ -637,7 +638,7 @@ out_err: static struct nfs_page * nfs_setup_write_request(struct nfs_open_context* ctx, struct page *page, unsigned int offset, unsigned int bytes) { @@ -245,7 +245,7 @@ Acked-by: Suresh Jayaraman struct nfs_page *req; int error; -@@ -694,7 +695,7 @@ int nfs_flush_incompatible(struct file * +@@ -692,7 +693,7 @@ int nfs_flush_incompatible(struct file * nfs_release_request(req); if (!do_flush) return 0; @@ -254,7 +254,7 @@ Acked-by: Suresh Jayaraman } while (status == 0); return status; } -@@ -720,7 +721,7 @@ int nfs_updatepage(struct file *file, st +@@ -718,7 +719,7 @@ int nfs_updatepage(struct file *file, st unsigned int offset, unsigned int count) { struct nfs_open_context *ctx = nfs_file_open_context(file); @@ -263,7 +263,7 @@ Acked-by: Suresh Jayaraman int status = 0; nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE); -@@ -728,7 +729,7 @@ int nfs_updatepage(struct file *file, st +@@ -726,7 +727,7 @@ int nfs_updatepage(struct file *file, st dprintk("NFS: nfs_updatepage(%s/%s %d@%lld)\n", file->f_path.dentry->d_parent->d_name.name, file->f_path.dentry->d_name.name, count, @@ -272,7 +272,7 @@ Acked-by: Suresh Jayaraman /* If we're not using byte range locks, and we know the page * is up to date, it may be more efficient to extend the write -@@ -1003,7 +1004,7 @@ static void nfs_writeback_release_partia +@@ -1001,7 +1002,7 @@ static void nfs_writeback_release_partia } if (nfs_write_need_commit(data)) { @@ -281,7 +281,7 @@ Acked-by: Suresh Jayaraman spin_lock(&inode->i_lock); if (test_bit(PG_NEED_RESCHED, &req->wb_flags)) { -@@ -1264,7 +1265,7 @@ nfs_commit_list(struct inode *inode, str +@@ -1262,7 +1263,7 @@ nfs_commit_list(struct inode *inode, str nfs_list_remove_request(req); nfs_mark_request_commit(req); dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); @@ -290,7 +290,7 @@ Acked-by: Suresh Jayaraman BDI_RECLAIMABLE); nfs_clear_page_tag_locked(req); } -@@ -1455,10 +1456,10 @@ int nfs_wb_nocommit(struct inode *inode) +@@ -1453,10 +1454,10 @@ int nfs_wb_nocommit(struct inode *inode) int nfs_wb_page_cancel(struct inode *inode, struct page *page) { struct nfs_page *req; @@ -303,7 +303,7 @@ Acked-by: Suresh Jayaraman .sync_mode = WB_SYNC_ALL, .nr_to_write = LONG_MAX, .range_start = range_start, -@@ -1491,7 +1492,7 @@ int nfs_wb_page_cancel(struct inode *ino +@@ -1489,7 +1490,7 @@ int nfs_wb_page_cancel(struct inode *ino } if (!PagePrivate(page)) return 0; @@ -312,7 +312,7 @@ Acked-by: Suresh Jayaraman out: return ret; } -@@ -1499,10 +1500,10 @@ out: +@@ -1497,10 +1498,10 @@ out: static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how) { @@ -325,7 +325,7 @@ Acked-by: Suresh Jayaraman .sync_mode = WB_SYNC_ALL, .nr_to_write = LONG_MAX, .range_start = range_start, -@@ -1517,7 +1518,7 @@ static int nfs_wb_page_priority(struct i +@@ -1515,7 +1516,7 @@ static int nfs_wb_page_priority(struct i goto out_error; } else if (!PagePrivate(page)) break; diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-29-nfs-swapper.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-29-nfs-swapper.patch similarity index 86% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-29-nfs-swapper.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-29-nfs-swapper.patch index e13822770..fe029991c 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-29-nfs-swapper.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-29-nfs-swapper.patch @@ -25,10 +25,8 @@ Acked-by: Suresh Jayaraman fs/nfs/write.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 13 deletions(-) -Index: linux-2.6.26/fs/nfs/inode.c -=================================================================== ---- linux-2.6.26.orig/fs/nfs/inode.c -+++ linux-2.6.26/fs/nfs/inode.c +--- a/fs/nfs/inode.c ++++ b/fs/nfs/inode.c @@ -824,6 +824,12 @@ int nfs_revalidate_mapping_nolock(struct struct nfs_inode *nfsi = NFS_I(inode); int ret = 0; @@ -42,11 +40,9 @@ Index: linux-2.6.26/fs/nfs/inode.c if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode) || NFS_STALE(inode)) { ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); -Index: linux-2.6.26/fs/nfs/write.c -=================================================================== ---- linux-2.6.26.orig/fs/nfs/write.c -+++ linux-2.6.26/fs/nfs/write.c -@@ -106,25 +106,62 @@ static void nfs_context_set_write_error( +--- a/fs/nfs/write.c ++++ b/fs/nfs/write.c +@@ -104,25 +104,62 @@ static void nfs_context_set_write_error( set_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags); } @@ -115,7 +111,7 @@ Index: linux-2.6.26/fs/nfs/write.c spin_unlock(&inode->i_lock); return req; } -@@ -228,7 +265,7 @@ static int nfs_page_async_flush(struct n +@@ -226,7 +263,7 @@ static int nfs_page_async_flush(struct n spin_lock(&inode->i_lock); for(;;) { @@ -124,7 +120,7 @@ Index: linux-2.6.26/fs/nfs/write.c if (req == NULL) { spin_unlock(&inode->i_lock); return 0; -@@ -351,8 +388,14 @@ static int nfs_inode_add_request(struct +@@ -349,8 +386,14 @@ static int nfs_inode_add_request(struct if (nfs_have_delegation(inode, FMODE_WRITE)) nfsi->change_attr++; } @@ -141,7 +137,7 @@ Index: linux-2.6.26/fs/nfs/write.c nfsi->npages++; kref_get(&req->wb_kref); radix_tree_tag_set(&nfsi->nfs_page_tree, req->wb_index, -@@ -374,8 +417,10 @@ static void nfs_inode_remove_request(str +@@ -372,8 +415,10 @@ static void nfs_inode_remove_request(str BUG_ON (!NFS_WBACK_BUSY(req)); spin_lock(&inode->i_lock); @@ -154,7 +150,7 @@ Index: linux-2.6.26/fs/nfs/write.c radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); nfsi->npages--; if (!nfsi->npages) { -@@ -579,7 +624,7 @@ static struct nfs_page *nfs_try_to_updat +@@ -577,7 +622,7 @@ static struct nfs_page *nfs_try_to_updat spin_lock(&inode->i_lock); for (;;) { @@ -163,7 +159,7 @@ Index: linux-2.6.26/fs/nfs/write.c if (req == NULL) goto out_unlock; -@@ -1490,7 +1535,7 @@ int nfs_wb_page_cancel(struct inode *ino +@@ -1488,7 +1533,7 @@ int nfs_wb_page_cancel(struct inode *ino if (ret < 0) goto out; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-30-nfs-swap_ops.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-30-nfs-swap_ops.patch similarity index 91% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-30-nfs-swap_ops.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-30-nfs-swap_ops.patch index 012c0ca5f..049b78fbf 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/SoN-30-nfs-swap_ops.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/SoN-30-nfs-swap_ops.patch @@ -62,7 +62,7 @@ Acked-by: Suresh Jayaraman depends on SUNRPC && EXPERIMENTAL --- a/fs/nfs/file.c +++ b/fs/nfs/file.c -@@ -434,6 +434,18 @@ static int nfs_launder_page(struct page +@@ -434,6 +434,18 @@ static int nfs_launder_page(struct page return nfs_wb_page(inode, page); } @@ -96,7 +96,7 @@ Acked-by: Suresh Jayaraman static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) --- a/fs/nfs/write.c +++ b/fs/nfs/write.c -@@ -338,6 +338,28 @@ int nfs_writepage(struct page *page, str +@@ -336,6 +336,28 @@ int nfs_writepage(struct page *page, str return ret; } @@ -127,10 +127,10 @@ Acked-by: Suresh Jayaraman int ret; --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h -@@ -465,6 +465,8 @@ extern int nfs_flush_incompatible(struc +@@ -464,6 +464,8 @@ extern int nfs_writepages(struct addres + extern int nfs_flush_incompatible(struct file *file, struct page *page); extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); - extern void nfs_writedata_release(void *); +extern int nfs_swap_out(struct file *file, struct page *page, + struct writeback_control *wbc); @@ -191,7 +191,7 @@ Acked-by: Suresh Jayaraman /* --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c -@@ -1453,6 +1453,55 @@ static inline void xs_reclassify_socket6 +@@ -1454,6 +1454,55 @@ static inline void xs_reclassify_socket6 } #endif @@ -247,7 +247,7 @@ Acked-by: Suresh Jayaraman static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) { struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); -@@ -1477,6 +1526,8 @@ static void xs_udp_finish_connecting(str +@@ -1478,6 +1527,8 @@ static void xs_udp_finish_connecting(str transport->sock = sock; transport->inet = sk; @@ -256,7 +256,7 @@ Acked-by: Suresh Jayaraman write_unlock_bh(&sk->sk_callback_lock); } xs_udp_do_set_buffer_size(xprt); -@@ -1494,11 +1545,15 @@ static void xs_udp_connect_worker4(struc +@@ -1495,11 +1546,15 @@ static void xs_udp_connect_worker4(struc container_of(work, struct sock_xprt, connect_worker.work); struct rpc_xprt *xprt = &transport->xprt; struct socket *sock = transport->sock; @@ -272,7 +272,7 @@ Acked-by: Suresh Jayaraman /* Start by resetting any existing state */ xs_close(xprt); -@@ -1521,6 +1576,7 @@ static void xs_udp_connect_worker4(struc +@@ -1522,6 +1577,7 @@ static void xs_udp_connect_worker4(struc out: xprt_wake_pending_tasks(xprt, status); xprt_clear_connecting(xprt); @@ -280,7 +280,7 @@ Acked-by: Suresh Jayaraman } /** -@@ -1535,11 +1591,15 @@ static void xs_udp_connect_worker6(struc +@@ -1536,11 +1592,15 @@ static void xs_udp_connect_worker6(struc container_of(work, struct sock_xprt, connect_worker.work); struct rpc_xprt *xprt = &transport->xprt; struct socket *sock = transport->sock; @@ -296,7 +296,7 @@ Acked-by: Suresh Jayaraman /* Start by resetting any existing state */ xs_close(xprt); -@@ -1562,6 +1622,7 @@ static void xs_udp_connect_worker6(struc +@@ -1563,6 +1623,7 @@ static void xs_udp_connect_worker6(struc out: xprt_wake_pending_tasks(xprt, status); xprt_clear_connecting(xprt); @@ -304,7 +304,7 @@ Acked-by: Suresh Jayaraman } /* -@@ -1621,6 +1682,8 @@ static int xs_tcp_finish_connecting(stru +@@ -1632,6 +1693,8 @@ static int xs_tcp_finish_connecting(stru write_unlock_bh(&sk->sk_callback_lock); } @@ -313,7 +313,7 @@ Acked-by: Suresh Jayaraman /* Tell the socket layer to start connecting... */ xprt->stat.connect_count++; xprt->stat.connect_start = jiffies; -@@ -1639,11 +1702,15 @@ static void xs_tcp_connect_worker4(struc +@@ -1650,11 +1713,15 @@ static void xs_tcp_connect_worker4(struc container_of(work, struct sock_xprt, connect_worker.work); struct rpc_xprt *xprt = &transport->xprt; struct socket *sock = transport->sock; @@ -329,7 +329,7 @@ Acked-by: Suresh Jayaraman if (!sock) { /* start from scratch */ if ((err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) { -@@ -1685,6 +1752,7 @@ out: +@@ -1696,6 +1763,7 @@ out: xprt_wake_pending_tasks(xprt, status); out_clear: xprt_clear_connecting(xprt); @@ -337,7 +337,7 @@ Acked-by: Suresh Jayaraman } /** -@@ -1699,11 +1767,15 @@ static void xs_tcp_connect_worker6(struc +@@ -1710,11 +1778,15 @@ static void xs_tcp_connect_worker6(struc container_of(work, struct sock_xprt, connect_worker.work); struct rpc_xprt *xprt = &transport->xprt; struct socket *sock = transport->sock; @@ -353,7 +353,7 @@ Acked-by: Suresh Jayaraman if (!sock) { /* start from scratch */ if ((err = sock_create_kern(PF_INET6, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) { -@@ -1744,6 +1816,7 @@ out: +@@ -1755,6 +1827,7 @@ out: xprt_wake_pending_tasks(xprt, status); out_clear: xprt_clear_connecting(xprt); diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-31-nfs-alloc-recursions.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-31-nfs-alloc-recursions.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-31-nfs-alloc-recursions.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-31-nfs-alloc-recursions.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-fix-sync b/src/patches/suse-2.6.27.31/patches.suse/SoN-fix-sync similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-fix-sync rename to src/patches/suse-2.6.27.31/patches.suse/SoN-fix-sync diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-fix-uninitialized-variable.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-fix-uninitialized-variable.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/SoN-fix-uninitialized-variable.patch rename to src/patches/suse-2.6.27.31/patches.suse/SoN-fix-uninitialized-variable.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/acpi-dsdt-initrd-v0.9a-2.6.25.patch b/src/patches/suse-2.6.27.31/patches.suse/acpi-dsdt-initrd-v0.9a-2.6.25.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/acpi-dsdt-initrd-v0.9a-2.6.25.patch rename to src/patches/suse-2.6.27.31/patches.suse/acpi-dsdt-initrd-v0.9a-2.6.25.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/acpi_osi_sle11_ident.patch b/src/patches/suse-2.6.27.31/patches.suse/acpi_osi_sle11_ident.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/acpi_osi_sle11_ident.patch rename to src/patches/suse-2.6.27.31/patches.suse/acpi_osi_sle11_ident.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/apm_setup_UP.diff b/src/patches/suse-2.6.27.31/patches.suse/apm_setup_UP.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/apm_setup_UP.diff rename to src/patches/suse-2.6.27.31/patches.suse/apm_setup_UP.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/bootsplash b/src/patches/suse-2.6.27.31/patches.suse/bootsplash similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/bootsplash rename to src/patches/suse-2.6.27.31/patches.suse/bootsplash diff --git a/src/patches/suse-2.6.27.25/patches.suse/cfq-ioc-race b/src/patches/suse-2.6.27.31/patches.suse/cfq-ioc-race similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/cfq-ioc-race rename to src/patches/suse-2.6.27.31/patches.suse/cfq-ioc-race diff --git a/src/patches/suse-2.6.27.25/patches.suse/cgroup-disable-memory.patch b/src/patches/suse-2.6.27.31/patches.suse/cgroup-disable-memory.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/cgroup-disable-memory.patch rename to src/patches/suse-2.6.27.31/patches.suse/cgroup-disable-memory.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/cgroup-freezer.patch b/src/patches/suse-2.6.27.31/patches.suse/cgroup-freezer.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/cgroup-freezer.patch rename to src/patches/suse-2.6.27.31/patches.suse/cgroup-freezer.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/connector-read-mostly b/src/patches/suse-2.6.27.31/patches.suse/connector-read-mostly similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/connector-read-mostly rename to src/patches/suse-2.6.27.31/patches.suse/connector-read-mostly diff --git a/src/patches/suse-2.6.27.25/patches.suse/convert-novfs-to-open-soure-coding-standards.patch b/src/patches/suse-2.6.27.31/patches.suse/convert-novfs-to-open-soure-coding-standards.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/convert-novfs-to-open-soure-coding-standards.patch rename to src/patches/suse-2.6.27.31/patches.suse/convert-novfs-to-open-soure-coding-standards.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/coredump_filter-add-elfhdr-default.patch b/src/patches/suse-2.6.27.31/patches.suse/coredump_filter-add-elfhdr-default.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/coredump_filter-add-elfhdr-default.patch rename to src/patches/suse-2.6.27.31/patches.suse/coredump_filter-add-elfhdr-default.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/crasher-26.diff b/src/patches/suse-2.6.27.31/patches.suse/crasher-26.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/crasher-26.diff rename to src/patches/suse-2.6.27.31/patches.suse/crasher-26.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-Change-rwlock-which-is-only-used-in-write-mode-to-a-spinlock.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-Change-rwlock-which-is-only-used-in-write-mode-to-a-spinlock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-Change-rwlock-which-is-only-used-in-write-mode-to-a-spinlock.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-Change-rwlock-which-is-only-used-in-write-mode-to-a-spinlock.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-add-new-debugfs-entry.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-add-new-debugfs-entry.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-add-new-debugfs-entry.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-add-new-debugfs-entry.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-add-time-stamp-of-blocking-callback.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-add-time-stamp-of-blocking-callback.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-add-time-stamp-of-blocking-callback.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-add-time-stamp-of-blocking-callback.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-change-lock-time-stamping.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-change-lock-time-stamping.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-change-lock-time-stamping.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-change-lock-time-stamping.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-change-rsbtbl-rwlock-to-spinlock.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-change-rsbtbl-rwlock-to-spinlock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-change-rsbtbl-rwlock-to-spinlock.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-change-rsbtbl-rwlock-to-spinlock.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-choose-better-identifiers.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-choose-better-identifiers.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-choose-better-identifiers.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-choose-better-identifiers.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-clear-defunct-cancel-state.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-clear-defunct-cancel-state.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-clear-defunct-cancel-state.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-clear-defunct-cancel-state.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-comment-typo-fixes.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-comment-typo-fixes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-comment-typo-fixes.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-comment-typo-fixes.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-detect-available-userspace-daemon.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-detect-available-userspace-daemon.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-detect-available-userspace-daemon.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-detect-available-userspace-daemon.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-address-compare.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-address-compare.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-address-compare.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-address-compare.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-length-calculation-in-compat-code.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-length-calculation-in-compat-code.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-length-calculation-in-compat-code.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-length-calculation-in-compat-code.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-locking-of-lockspace-list-in-dlm_scand.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-locking-of-lockspace-list-in-dlm_scand.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-locking-of-lockspace-list-in-dlm_scand.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-locking-of-lockspace-list-in-dlm_scand.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-plock-notify-callback-to-lockd.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-plock-notify-callback-to-lockd.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-plock-notify-callback-to-lockd.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-plock-notify-callback-to-lockd.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-seq_file-usage-in-debugfs-lock-dump.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-seq_file-usage-in-debugfs-lock-dump.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-seq_file-usage-in-debugfs-lock-dump.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-seq_file-usage-in-debugfs-lock-dump.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fix-up-memory-allocation-flags.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fix-up-memory-allocation-flags.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fix-up-memory-allocation-flags.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fix-up-memory-allocation-flags.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-fsdlm-ast.c-fix-warning.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-fsdlm-ast.c-fix-warning.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-fsdlm-ast.c-fix-warning.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-fsdlm-ast.c-fix-warning.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-ignore-cancel-on-granted-lock.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-ignore-cancel-on-granted-lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-ignore-cancel-on-granted-lock.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-ignore-cancel-on-granted-lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-improve-how-bast-mode-handling.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-improve-how-bast-mode-handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-improve-how-bast-mode-handling.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-improve-how-bast-mode-handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-remove-bkl.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-remove-bkl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-remove-bkl.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-remove-bkl.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-remove-extra-blocking-callback-check.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-remove-extra-blocking-callback-check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-remove-extra-blocking-callback-check.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-remove-extra-blocking-callback-check.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-remove-kmap-and-kunmap.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-remove-kmap-and-kunmap.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-remove-kmap-and-kunmap.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-remove-kmap-and-kunmap.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-replace-idr-with-hash-table-for-connections.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-replace-idr-with-hash-table-for-connections.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-replace-idr-with-hash-table-for-connections.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-replace-idr-with-hash-table-for-connections.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-replace-schedule-with-cond_resched.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-replace-schedule-with-cond_resched.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-replace-schedule-with-cond_resched.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-replace-schedule-with-cond_resched.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-trivial-annotation-of-be16-value.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-trivial-annotation-of-be16-value.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-trivial-annotation-of-be16-value.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-trivial-annotation-of-be16-value.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm-use-ipv6_addr_copy.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm-use-ipv6_addr_copy.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm-use-ipv6_addr_copy.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm-use-ipv6_addr_copy.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dlm_lock_data-make-most-exported-headers-use-strict-integer-types.patch b/src/patches/suse-2.6.27.31/patches.suse/dlm_lock_data-make-most-exported-headers-use-strict-integer-types.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dlm_lock_data-make-most-exported-headers-use-strict-integer-types.patch rename to src/patches/suse-2.6.27.31/patches.suse/dlm_lock_data-make-most-exported-headers-use-strict-integer-types.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-barrier-single-device b/src/patches/suse-2.6.27.31/patches.suse/dm-barrier-single-device similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-barrier-single-device rename to src/patches/suse-2.6.27.31/patches.suse/dm-barrier-single-device diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-block-integrity b/src/patches/suse-2.6.27.31/patches.suse/dm-block-integrity similarity index 99% rename from src/patches/suse-2.6.27.25/patches.suse/dm-block-integrity rename to src/patches/suse-2.6.27.31/patches.suse/dm-block-integrity index 44f672724..1fa112172 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-block-integrity +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-block-integrity @@ -184,7 +184,7 @@ Signed-off-by: Hannes Reinecke return 0; fail: -@@ -3965,6 +3998,7 @@ static int do_md_stop(mddev_t * mddev, i +@@ -3967,6 +4000,7 @@ static int do_md_stop(mddev_t * mddev, i printk(KERN_INFO "md: %s switched to read-only mode.\n", mdname(mddev)); err = 0; diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-emulate-blkrrpart-ioctl b/src/patches/suse-2.6.27.31/patches.suse/dm-emulate-blkrrpart-ioctl similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-emulate-blkrrpart-ioctl rename to src/patches/suse-2.6.27.31/patches.suse/dm-emulate-blkrrpart-ioctl diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-accept-failed-paths b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-accept-failed-paths similarity index 77% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-accept-failed-paths rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-accept-failed-paths index 96873576d..e1b3a4cb9 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-accept-failed-paths +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-accept-failed-paths @@ -11,11 +11,16 @@ paths as down. Signed-off-by: Hannes Reinecke -diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c -index 510fd26..95feacd 100644 +--- + drivers/md/dm-mpath.c | 66 ++++++++++++++++++++++++++++++++++++++++---------- + drivers/md/dm-mpath.h | 1 + drivers/md/dm-table.c | 3 ++ + drivers/md/dm.c | 4 +++ + 4 files changed, 61 insertions(+), 13 deletions(-) + --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c -@@ -141,7 +141,8 @@ static void deactivate_path(struct work_struct *work) +@@ -141,7 +141,8 @@ static void deactivate_path(struct work_ struct pgpath *pgpath = container_of(work, struct pgpath, deactivate_path); @@ -25,7 +30,7 @@ index 510fd26..95feacd 100644 } static struct priority_group *alloc_priority_group(void) -@@ -253,6 +254,11 @@ static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg, +@@ -253,6 +254,11 @@ static int __choose_path_in_pg(struct mu m->current_pgpath = path_to_pgpath(path); @@ -37,7 +42,7 @@ index 510fd26..95feacd 100644 if (m->current_pg != pg) __switch_pg(m, m->current_pgpath); -@@ -570,6 +576,7 @@ static struct pgpath *parse_path(struct arg_set *as, struct path_selector *ps, +@@ -576,6 +582,7 @@ static struct pgpath *parse_path(struct { int r; struct pgpath *p; @@ -45,7 +50,7 @@ index 510fd26..95feacd 100644 struct multipath *m = ti->private; /* we need at least a path arg */ -@@ -582,14 +589,37 @@ static struct pgpath *parse_path(struct arg_set *as, struct path_selector *ps, +@@ -588,14 +595,37 @@ static struct pgpath *parse_path(struct if (!p) return NULL; @@ -87,7 +92,7 @@ index 510fd26..95feacd 100644 struct request_queue *q = bdev_get_queue(p->path.dev->bdev); r = scsi_dh_attach(q, m->hw_handler_name); -@@ -880,7 +910,7 @@ static int fail_path(struct pgpath *pgpath) +@@ -891,7 +921,7 @@ static int fail_path(struct pgpath *pgpa if (!pgpath->is_active) goto out; @@ -96,7 +101,7 @@ index 510fd26..95feacd 100644 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); pgpath->is_active = 0; -@@ -892,7 +922,7 @@ static int fail_path(struct pgpath *pgpath) +@@ -903,7 +933,7 @@ static int fail_path(struct pgpath *pgpa m->current_pgpath = NULL; dm_path_uevent(DM_UEVENT_PATH_FAILED, m->ti, @@ -105,7 +110,7 @@ index 510fd26..95feacd 100644 queue_work(kmultipathd, &m->trigger_event); queue_work(kmultipathd, &pgpath->deactivate_path); -@@ -917,6 +947,12 @@ static int reinstate_path(struct pgpath *pgpath) +@@ -928,6 +958,12 @@ static int reinstate_path(struct pgpath if (pgpath->is_active) goto out; @@ -118,7 +123,7 @@ index 510fd26..95feacd 100644 if (!pgpath->pg->ps.type->reinstate_path) { DMWARN("Reinstate path not supported by path selector %s", pgpath->pg->ps.type->name); -@@ -935,7 +971,7 @@ static int reinstate_path(struct pgpath *pgpath) +@@ -946,7 +982,7 @@ static int reinstate_path(struct pgpath queue_work(kmultipathd, &m->process_queued_ios); dm_path_uevent(DM_UEVENT_PATH_REINSTATED, m->ti, @@ -127,7 +132,7 @@ index 510fd26..95feacd 100644 queue_work(kmultipathd, &m->trigger_event); -@@ -955,6 +991,9 @@ static int action_dev(struct multipath *m, struct dm_dev *dev, +@@ -966,6 +1002,9 @@ static int action_dev(struct multipath * struct pgpath *pgpath; struct priority_group *pg; @@ -137,7 +142,7 @@ index 510fd26..95feacd 100644 list_for_each_entry(pg, &m->priority_groups, list) { list_for_each_entry(pgpath, &pg->pgpaths, list) { if (pgpath->path.dev == dev) -@@ -1124,11 +1163,12 @@ static void pg_init_done(struct dm_path *path, int errors) +@@ -1135,11 +1174,12 @@ static void pg_init_done(struct dm_path static void activate_path(struct work_struct *work) { @@ -152,7 +157,7 @@ index 510fd26..95feacd 100644 pg_init_done(&pgpath->path, ret); } -@@ -1295,7 +1335,7 @@ static int multipath_status(struct dm_target *ti, status_type_t type, +@@ -1306,7 +1346,7 @@ static int multipath_status(struct dm_ta pg->ps.type->info_args); list_for_each_entry(p, &pg->pgpaths, list) { @@ -161,7 +166,7 @@ index 510fd26..95feacd 100644 p->is_active ? "A" : "F", p->fail_count); if (pg->ps.type->status) -@@ -1321,7 +1361,7 @@ static int multipath_status(struct dm_target *ti, status_type_t type, +@@ -1332,7 +1372,7 @@ static int multipath_status(struct dm_ta pg->ps.type->table_args); list_for_each_entry(p, &pg->pgpaths, list) { @@ -170,7 +175,7 @@ index 510fd26..95feacd 100644 if (pg->ps.type->status) sz += pg->ps.type->status(&pg->ps, &p->path, type, result + sz, -@@ -1403,7 +1443,7 @@ static int multipath_ioctl(struct dm_target *ti, struct inode *inode, +@@ -1414,7 +1454,7 @@ static int multipath_ioctl(struct dm_tar if (!m->current_pgpath) __choose_pgpath(m, 1 << 19); /* Assume 512KB */ @@ -179,8 +184,6 @@ index 510fd26..95feacd 100644 bdev = m->current_pgpath->path.dev->bdev; fake_dentry.d_inode = bdev->bd_inode; fake_file.f_mode = m->current_pgpath->path.dev->mode; -diff --git a/drivers/md/dm-mpath.h b/drivers/md/dm-mpath.h -index e230f71..f97388d 100644 --- a/drivers/md/dm-mpath.h +++ b/drivers/md/dm-mpath.h @@ -12,6 +12,7 @@ @@ -191,11 +194,9 @@ index e230f71..f97388d 100644 struct dm_dev *dev; /* Read-only */ void *pscontext; /* For path-selector use */ }; -diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c -index 1514e84..ee61b82 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c -@@ -566,6 +566,9 @@ int dm_get_device(struct dm_target *ti, const char *path, sector_t start, +@@ -566,6 +566,9 @@ int dm_get_device(struct dm_target *ti, */ void dm_put_device(struct dm_target *ti, struct dm_dev *dd) { @@ -205,11 +206,9 @@ index 1514e84..ee61b82 100644 if (atomic_dec_and_test(&dd->count)) { close_dev(dd, ti->table->md); list_del(&dd->list); -diff --git a/drivers/md/dm.c b/drivers/md/dm.c -index 6783f91..134995e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c -@@ -1503,6 +1503,9 @@ static void map_request(struct dm_target *ti, struct request *rq, +@@ -1503,6 +1503,9 @@ static void map_request(struct dm_target tio->ti = ti; atomic_inc(&md->pending); @@ -219,7 +218,7 @@ index 6783f91..134995e 100644 /* * Although submitted requests to the md->queue are checked against * the table/queue limitations at the submission time, the limitations -@@ -1525,6 +1528,7 @@ static void map_request(struct dm_target *ti, struct request *rq, +@@ -1525,6 +1528,7 @@ static void map_request(struct dm_target dm_kill_request(clone, r); return; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-add-start-io b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-add-start-io similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-add-start-io rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-add-start-io diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-check-info-before-access b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-check-info-before-access similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-check-info-before-access rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-check-info-before-access diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-leastpending-path-update b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-leastpending-path-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-leastpending-path-update rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-leastpending-path-update diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-lockdep-irqsave b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-lockdep-irqsave similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-lockdep-irqsave rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-lockdep-irqsave diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-no-activate-for-offlined-paths b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-activate-for-offlined-paths similarity index 87% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-no-activate-for-offlined-paths rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-activate-for-offlined-paths index c320ddbfe..55c77ce36 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-no-activate-for-offlined-paths +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-activate-for-offlined-paths @@ -25,7 +25,7 @@ Signed-off-by: Hannes Reinecke queue_work(kmpath_handlerd, &tmp->activate_path); m->pg_init_in_progress++; } -@@ -1109,9 +1112,8 @@ static int pg_init_limit_reached(struct +@@ -1120,9 +1123,8 @@ static int pg_init_limit_reached(struct return limit_reached; } @@ -36,7 +36,7 @@ Signed-off-by: Hannes Reinecke struct priority_group *pg = pgpath->pg; struct multipath *m = pg->m; unsigned long flags; -@@ -1125,8 +1127,8 @@ static void pg_init_done(struct dm_path +@@ -1136,8 +1138,8 @@ static void pg_init_done(struct dm_path errors = 0; break; } @@ -47,7 +47,7 @@ Signed-off-by: Hannes Reinecke /* * Fail path for now, so we do not ping pong */ -@@ -1139,6 +1141,10 @@ static void pg_init_done(struct dm_path +@@ -1150,6 +1152,10 @@ static void pg_init_done(struct dm_path */ bypass_pg(m, pg, 1); break; @@ -58,7 +58,7 @@ Signed-off-by: Hannes Reinecke /* TODO: For SCSI_DH_RETRY we should wait a couple seconds */ case SCSI_DH_RETRY: case SCSI_DH_IMM_RETRY: -@@ -1158,7 +1164,8 @@ static void pg_init_done(struct dm_path +@@ -1169,7 +1175,8 @@ static void pg_init_done(struct dm_path spin_lock_irqsave(&m->lock, flags); if (errors) { @@ -68,7 +68,7 @@ Signed-off-by: Hannes Reinecke m->current_pgpath = NULL; m->current_pg = NULL; } else if (!m->pg_init_required) { -@@ -1180,7 +1187,10 @@ static void activate_path(struct work_st +@@ -1191,7 +1198,10 @@ static void activate_path(struct work_st if (pgpath->path.dev) ret = scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev)); diff --git a/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-partitions-feature b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-partitions-feature new file mode 100644 index 000000000..0e9efcebc --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-no-partitions-feature @@ -0,0 +1,66 @@ +From: Hannes Reinecke +Subject: Disable partitions scan for multipathed devices +References: bnc#402922,bnc#514767 + +When multipath devices are being used as disks for VM Guests +any partition scanning / setup should be done within the VM Guest, +not from host. So we need to switch off partitions scanning via +kpartx there. +For this I've implemented a new feature 'no_partitions' which +just serves as a notifier to kpartx to _not_ create partitions +on these devices. + +Patch ported to SLES11. + +Signed-off-by: Hannes Reinecke + +--- + drivers/md/dm-mpath.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/drivers/md/dm-mpath.c ++++ b/drivers/md/dm-mpath.c +@@ -55,6 +55,8 @@ struct priority_group { + struct list_head pgpaths; + }; + ++#define FEATURE_NO_PARTITIONS 1 ++ + /* Multipath context */ + struct multipath { + struct list_head list; +@@ -79,6 +81,7 @@ struct multipath { + unsigned saved_queue_if_no_path;/* Saved state during suspension */ + unsigned pg_init_retries; /* Number of times to retry pg_init */ + unsigned pg_init_count; /* Number of times pg_init called */ ++ unsigned features; /* Additional selected features */ + + struct work_struct process_queued_ios; + struct list_head queued_ios; +@@ -802,6 +805,10 @@ static int parse_features(struct arg_set + continue; + } + ++ if (!strnicmp(param_name, MESG_STR("no_partitions"))) { ++ m->features |= FEATURE_NO_PARTITIONS; ++ continue; ++ } + if (!strnicmp(param_name, MESG_STR("pg_init_retries")) && + (argc >= 1)) { + r = read_param(_params + 1, shift(as), +@@ -1321,11 +1328,14 @@ static int multipath_status(struct dm_ta + DMEMIT("2 %u %u ", m->queue_size, m->pg_init_count); + else { + DMEMIT("%u ", m->queue_if_no_path + +- (m->pg_init_retries > 0) * 2); ++ (m->pg_init_retries > 0) * 2 + ++ (m->features & FEATURE_NO_PARTITIONS)); + if (m->queue_if_no_path) + DMEMIT("queue_if_no_path "); + if (m->pg_init_retries) + DMEMIT("pg_init_retries %u ", m->pg_init_retries); ++ if (m->features & FEATURE_NO_PARTITIONS) ++ DMEMIT("no_partitions "); + } + + if (!m->hw_handler_name || type == STATUSTYPE_INFO) diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-null-pgs b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-null-pgs similarity index 92% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-null-pgs rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-null-pgs index d5dc72c15..3cece77e7 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-null-pgs +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-null-pgs @@ -13,7 +13,7 @@ Signed-off-by: Hannes Reinecke --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c -@@ -768,8 +768,8 @@ static int multipath_ctr(struct dm_targe +@@ -779,8 +779,8 @@ static int multipath_ctr(struct dm_targe { /* target parameters */ static struct param _params[] = { diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-queue-length-load-balancing b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-queue-length-load-balancing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-queue-length-load-balancing rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-queue-length-load-balancing diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-requeue-for-stopped-queue b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-requeue-for-stopped-queue similarity index 86% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-requeue-for-stopped-queue rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-requeue-for-stopped-queue index 8f6c9f2dc..7a4c33425 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-requeue-for-stopped-queue +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-requeue-for-stopped-queue @@ -15,10 +15,13 @@ if the multipath table doesn't specify one. Signed-off-by: Hannes Reinecke -Index: linux-2.6.27/drivers/md/dm-mpath.c -=================================================================== ---- linux-2.6.27.orig/drivers/md/dm-mpath.c -+++ linux-2.6.27/drivers/md/dm-mpath.c +--- + drivers/md/dm-mpath.c | 45 ++++++++++++++++++++++++++++----------------- + drivers/md/dm.c | 6 +++++- + 2 files changed, 33 insertions(+), 18 deletions(-) + +--- a/drivers/md/dm-mpath.c ++++ b/drivers/md/dm-mpath.c @@ -159,9 +159,7 @@ static struct priority_group *alloc_prio static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti) @@ -53,7 +56,7 @@ Index: linux-2.6.27/drivers/md/dm-mpath.c if ((pgpath && !m->queue_io) || (!pgpath && !m->queue_if_no_path)) must_queue = 0; -@@ -619,22 +623,24 @@ static struct pgpath *parse_path(struct +@@ -625,22 +629,24 @@ static struct pgpath *parse_path(struct memcpy(p->path.pdev, p->path.dev->name, 16); } @@ -91,7 +94,7 @@ Index: linux-2.6.27/drivers/md/dm-mpath.c } } -@@ -644,6 +653,11 @@ static struct pgpath *parse_path(struct +@@ -650,6 +656,11 @@ static struct pgpath *parse_path(struct goto bad; } @@ -103,10 +106,8 @@ Index: linux-2.6.27/drivers/md/dm-mpath.c return p; bad: -Index: linux-2.6.27/drivers/md/dm.c -=================================================================== ---- linux-2.6.27.orig/drivers/md/dm.c -+++ linux-2.6.27/drivers/md/dm.c +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c @@ -1304,7 +1304,11 @@ static int dm_make_request(struct reques return 0; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-service-time-load-balancing b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-service-time-load-balancing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-service-time-load-balancing rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-service-time-load-balancing diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-tracking-nr-bytes b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-tracking-nr-bytes similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/dm-mpath-tracking-nr-bytes rename to src/patches/suse-2.6.27.31/patches.suse/dm-mpath-tracking-nr-bytes index 2dd81a1ec..23cf19470 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/dm-mpath-tracking-nr-bytes +++ b/src/patches/suse-2.6.27.31/patches.suse/dm-mpath-tracking-nr-bytes @@ -139,7 +139,7 @@ Signed-off-by: Hannes Reinecke pgpath = m->current_pgpath; -@@ -1193,7 +1198,7 @@ static int multipath_end_io(struct dm_ta +@@ -1204,7 +1209,7 @@ static int multipath_end_io(struct dm_ta if (pgpath) { ps = &pgpath->pg->ps; if (ps->type->end_io) @@ -148,7 +148,7 @@ Signed-off-by: Hannes Reinecke } mempool_free(mpio, m->mpio_pool); -@@ -1412,7 +1417,7 @@ static int multipath_ioctl(struct dm_tar +@@ -1423,7 +1428,7 @@ static int multipath_ioctl(struct dm_tar spin_lock_irqsave(&m->lock, flags); if (!m->current_pgpath) diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-raid45_2.6.27_20081027.patch b/src/patches/suse-2.6.27.31/patches.suse/dm-raid45_2.6.27_20081027.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-raid45_2.6.27_20081027.patch rename to src/patches/suse-2.6.27.31/patches.suse/dm-raid45_2.6.27_20081027.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-table-change-mode-to-ro b/src/patches/suse-2.6.27.31/patches.suse/dm-table-change-mode-to-ro similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-table-change-mode-to-ro rename to src/patches/suse-2.6.27.31/patches.suse/dm-table-change-mode-to-ro diff --git a/src/patches/suse-2.6.27.25/patches.suse/dm-use-md-for-free_bio_clone b/src/patches/suse-2.6.27.31/patches.suse/dm-use-md-for-free_bio_clone similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/dm-use-md-for-free_bio_clone rename to src/patches/suse-2.6.27.31/patches.suse/dm-use-md-for-free_bio_clone diff --git a/src/patches/suse-2.6.27.25/patches.suse/e1000e_Export_set_memory_ro-rw b/src/patches/suse-2.6.27.31/patches.suse/e1000e_Export_set_memory_ro-rw similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/e1000e_Export_set_memory_ro-rw rename to src/patches/suse-2.6.27.31/patches.suse/e1000e_Export_set_memory_ro-rw diff --git a/src/patches/suse-2.6.27.25/patches.suse/export-release_open_intent b/src/patches/suse-2.6.27.31/patches.suse/export-release_open_intent similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/export-release_open_intent rename to src/patches/suse-2.6.27.31/patches.suse/export-release_open_intent diff --git a/src/patches/suse-2.6.27.25/patches.suse/ext2-fsync-err b/src/patches/suse-2.6.27.31/patches.suse/ext2-fsync-err similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ext2-fsync-err rename to src/patches/suse-2.6.27.31/patches.suse/ext2-fsync-err diff --git a/src/patches/suse-2.6.27.25/patches.suse/ext3-Use-sb_any_quota_loaded-instead-of-sb_any_qu.patch b/src/patches/suse-2.6.27.31/patches.suse/ext3-Use-sb_any_quota_loaded-instead-of-sb_any_qu.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ext3-Use-sb_any_quota_loaded-instead-of-sb_any_qu.patch rename to src/patches/suse-2.6.27.31/patches.suse/ext3-Use-sb_any_quota_loaded-instead-of-sb_any_qu.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ext3-barrier-default b/src/patches/suse-2.6.27.31/patches.suse/ext3-barrier-default similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ext3-barrier-default rename to src/patches/suse-2.6.27.31/patches.suse/ext3-barrier-default diff --git a/src/patches/suse-2.6.27.25/patches.suse/file-capabilities-add-file_caps-switch.diff b/src/patches/suse-2.6.27.31/patches.suse/file-capabilities-add-file_caps-switch.diff similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/file-capabilities-add-file_caps-switch.diff rename to src/patches/suse-2.6.27.31/patches.suse/file-capabilities-add-file_caps-switch.diff index e12aba6ff..1ac93ed6e 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/file-capabilities-add-file_caps-switch.diff +++ b/src/patches/suse-2.6.27.31/patches.suse/file-capabilities-add-file_caps-switch.diff @@ -44,7 +44,7 @@ Signed-off-by: Andreas Gruenbacher --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1396,6 +1396,15 @@ and is between 256 and 4096 characters. +@@ -1403,6 +1403,15 @@ and is between 256 and 4096 characters. instruction doesn't work correctly and not to use it. diff --git a/src/patches/suse-2.6.27.25/patches.suse/file-capabilities-disable-by-default.diff b/src/patches/suse-2.6.27.31/patches.suse/file-capabilities-disable-by-default.diff similarity index 94% rename from src/patches/suse-2.6.27.25/patches.suse/file-capabilities-disable-by-default.diff rename to src/patches/suse-2.6.27.31/patches.suse/file-capabilities-disable-by-default.diff index e31560682..dab5faf40 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/file-capabilities-disable-by-default.diff +++ b/src/patches/suse-2.6.27.31/patches.suse/file-capabilities-disable-by-default.diff @@ -13,7 +13,7 @@ Signed-off-by: Andreas Gruenbacher --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1403,7 +1403,7 @@ and is between 256 and 4096 characters. +@@ -1410,7 +1410,7 @@ and is between 256 and 4096 characters. Format: {"0" | "1"} 0 -- ignore file capabilities. 1 -- honor file capabilities. diff --git a/src/patches/suse-2.6.27.25/patches.suse/fix-warning-in-fsdlm-netlink.c.patch b/src/patches/suse-2.6.27.31/patches.suse/fix-warning-in-fsdlm-netlink.c.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/fix-warning-in-fsdlm-netlink.c.patch rename to src/patches/suse-2.6.27.31/patches.suse/fix-warning-in-fsdlm-netlink.c.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/fs-knows-MAY_APPEND.diff b/src/patches/suse-2.6.27.31/patches.suse/fs-knows-MAY_APPEND.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/fs-knows-MAY_APPEND.diff rename to src/patches/suse-2.6.27.31/patches.suse/fs-knows-MAY_APPEND.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/fs-may_iops.diff b/src/patches/suse-2.6.27.31/patches.suse/fs-may_iops.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/fs-may_iops.diff rename to src/patches/suse-2.6.27.31/patches.suse/fs-may_iops.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/genhd-disk-ro-uevents b/src/patches/suse-2.6.27.31/patches.suse/genhd-disk-ro-uevents similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/genhd-disk-ro-uevents rename to src/patches/suse-2.6.27.31/patches.suse/genhd-disk-ro-uevents diff --git a/src/patches/suse-2.6.27.25/patches.suse/genksyms-add-override-flag.diff b/src/patches/suse-2.6.27.31/patches.suse/genksyms-add-override-flag.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/genksyms-add-override-flag.diff rename to src/patches/suse-2.6.27.31/patches.suse/genksyms-add-override-flag.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/genksyms-override.diff b/src/patches/suse-2.6.27.31/patches.suse/genksyms-override.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/genksyms-override.diff rename to src/patches/suse-2.6.27.31/patches.suse/genksyms-override.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/genksyms-reference.diff b/src/patches/suse-2.6.27.31/patches.suse/genksyms-reference.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/genksyms-reference.diff rename to src/patches/suse-2.6.27.31/patches.suse/genksyms-reference.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/headers_check-fix-linux-dlm_plock.h.patch b/src/patches/suse-2.6.27.31/patches.suse/headers_check-fix-linux-dlm_plock.h.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/headers_check-fix-linux-dlm_plock.h.patch rename to src/patches/suse-2.6.27.31/patches.suse/headers_check-fix-linux-dlm_plock.h.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/hp_backlight_blacklist_6530b.patch b/src/patches/suse-2.6.27.31/patches.suse/hp_backlight_blacklist_6530b.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/hp_backlight_blacklist_6530b.patch rename to src/patches/suse-2.6.27.31/patches.suse/hp_backlight_blacklist_6530b.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/kbd-ignore-gfx.patch b/src/patches/suse-2.6.27.31/patches.suse/kbd-ignore-gfx.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kbd-ignore-gfx.patch rename to src/patches/suse-2.6.27.31/patches.suse/kbd-ignore-gfx.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdb-common b/src/patches/suse-2.6.27.31/patches.suse/kdb-common similarity index 99% rename from src/patches/suse-2.6.27.25/patches.suse/kdb-common rename to src/patches/suse-2.6.27.31/patches.suse/kdb-common index 962034180..8857e10d4 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/kdb-common +++ b/src/patches/suse-2.6.27.31/patches.suse/kdb-common @@ -31782,7 +31782,7 @@ Acked-by: Bernhard Walle +#endif /* CONFIG_KDB */ --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -2595,3 +2595,52 @@ void __init signals_init(void) +@@ -2596,3 +2596,52 @@ void __init signals_init(void) { sigqueue_cachep = KMEM_CACHE(sigqueue, SLAB_PANIC); } diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdb-ia64 b/src/patches/suse-2.6.27.31/patches.suse/kdb-ia64 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kdb-ia64 rename to src/patches/suse-2.6.27.31/patches.suse/kdb-ia64 diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdb-resolve-uv-conflict.diff b/src/patches/suse-2.6.27.31/patches.suse/kdb-resolve-uv-conflict.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kdb-resolve-uv-conflict.diff rename to src/patches/suse-2.6.27.31/patches.suse/kdb-resolve-uv-conflict.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdb-serial-8250 b/src/patches/suse-2.6.27.31/patches.suse/kdb-serial-8250 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kdb-serial-8250 rename to src/patches/suse-2.6.27.31/patches.suse/kdb-serial-8250 diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdb-x86 b/src/patches/suse-2.6.27.31/patches.suse/kdb-x86 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kdb-x86 rename to src/patches/suse-2.6.27.31/patches.suse/kdb-x86 diff --git a/src/patches/suse-2.6.27.25/patches.suse/kdump-dump_after_notifier.patch b/src/patches/suse-2.6.27.31/patches.suse/kdump-dump_after_notifier.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kdump-dump_after_notifier.patch rename to src/patches/suse-2.6.27.31/patches.suse/kdump-dump_after_notifier.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/kvm-as-kmp b/src/patches/suse-2.6.27.31/patches.suse/kvm-as-kmp similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/kvm-as-kmp rename to src/patches/suse-2.6.27.31/patches.suse/kvm-as-kmp diff --git a/src/patches/suse-2.6.27.25/patches.suse/led_classdev.sysfs-name.patch b/src/patches/suse-2.6.27.31/patches.suse/led_classdev.sysfs-name.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/led_classdev.sysfs-name.patch rename to src/patches/suse-2.6.27.31/patches.suse/led_classdev.sysfs-name.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/md-bitmap-sub-page-chunks b/src/patches/suse-2.6.27.31/patches.suse/md-bitmap-sub-page-chunks similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/md-bitmap-sub-page-chunks rename to src/patches/suse-2.6.27.31/patches.suse/md-bitmap-sub-page-chunks diff --git a/src/patches/suse-2.6.27.25/patches.suse/md-notify-when-stopped b/src/patches/suse-2.6.27.31/patches.suse/md-notify-when-stopped similarity index 90% rename from src/patches/suse-2.6.27.25/patches.suse/md-notify-when-stopped rename to src/patches/suse-2.6.27.31/patches.suse/md-notify-when-stopped index c3d7b568a..3bd7719bb 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/md-notify-when-stopped +++ b/src/patches/suse-2.6.27.31/patches.suse/md-notify-when-stopped @@ -14,7 +14,7 @@ Signed-off-by: Neil Brown --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -3994,6 +3994,8 @@ static int do_md_stop(mddev_t * mddev, i +@@ -3996,6 +3996,8 @@ static int do_md_stop(mddev_t * mddev, i mddev->barriers_work = 0; mddev->safemode = 0; diff --git a/src/patches/suse-2.6.27.25/patches.suse/md-raid-metadata-PAGE_SIZE.patch b/src/patches/suse-2.6.27.31/patches.suse/md-raid-metadata-PAGE_SIZE.patch similarity index 96% rename from src/patches/suse-2.6.27.25/patches.suse/md-raid-metadata-PAGE_SIZE.patch rename to src/patches/suse-2.6.27.31/patches.suse/md-raid-metadata-PAGE_SIZE.patch index d8d026f4b..d9790f474 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/md-raid-metadata-PAGE_SIZE.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/md-raid-metadata-PAGE_SIZE.patch @@ -30,7 +30,7 @@ Signed-off-by: Olaf Hering --- a/drivers/md/md.c +++ b/drivers/md/md.c -@@ -3585,9 +3585,14 @@ static int do_md_run(mddev_t * mddev) +@@ -3587,9 +3587,14 @@ static int do_md_run(mddev_t * mddev) return -EINVAL; } if (chunk_size < PAGE_SIZE) { diff --git a/src/patches/suse-2.6.27.25/patches.suse/mem_cgroup_stat-dynamic-alloc b/src/patches/suse-2.6.27.31/patches.suse/mem_cgroup_stat-dynamic-alloc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/mem_cgroup_stat-dynamic-alloc rename to src/patches/suse-2.6.27.31/patches.suse/mem_cgroup_stat-dynamic-alloc diff --git a/src/patches/suse-2.6.27.25/patches.suse/mm-devzero-optimisation.patch b/src/patches/suse-2.6.27.31/patches.suse/mm-devzero-optimisation.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/mm-devzero-optimisation.patch rename to src/patches/suse-2.6.27.31/patches.suse/mm-devzero-optimisation.patch index 345b19156..bd499e7d2 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/mm-devzero-optimisation.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/mm-devzero-optimisation.patch @@ -153,7 +153,7 @@ Signed-off-by: Nick Piggin static ssize_t write_full(struct file * file, const char __user * buf, --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -779,6 +779,8 @@ void free_pgd_range(struct mmu_gather *t +@@ -791,6 +791,8 @@ void free_pgd_range(struct mmu_gather *t unsigned long end, unsigned long floor, unsigned long ceiling); int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma); @@ -260,7 +260,7 @@ Signed-off-by: Nick Piggin pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl) { -@@ -1878,7 +1967,6 @@ gotten: +@@ -1899,7 +1988,6 @@ gotten: if (unlikely(anon_vma_prepare(vma))) goto oom; diff --git a/src/patches/suse-2.6.27.25/patches.suse/mm-do-not-disable-memory-hotplug-when-hibernation-is-enabled.patch b/src/patches/suse-2.6.27.31/patches.suse/mm-do-not-disable-memory-hotplug-when-hibernation-is-enabled.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/mm-do-not-disable-memory-hotplug-when-hibernation-is-enabled.patch rename to src/patches/suse-2.6.27.31/patches.suse/mm-do-not-disable-memory-hotplug-when-hibernation-is-enabled.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/mm-increase-dirty-limits.patch b/src/patches/suse-2.6.27.31/patches.suse/mm-increase-dirty-limits.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/mm-increase-dirty-limits.patch rename to src/patches/suse-2.6.27.31/patches.suse/mm-increase-dirty-limits.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/mm-vmalloc-fail-dump-stack.patch b/src/patches/suse-2.6.27.31/patches.suse/mm-vmalloc-fail-dump-stack.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/mm-vmalloc-fail-dump-stack.patch rename to src/patches/suse-2.6.27.31/patches.suse/mm-vmalloc-fail-dump-stack.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/mnt-want-write-speedup.patch b/src/patches/suse-2.6.27.31/patches.suse/mnt-want-write-speedup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/mnt-want-write-speedup.patch rename to src/patches/suse-2.6.27.31/patches.suse/mnt-want-write-speedup.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/mnt_clone_write.patch b/src/patches/suse-2.6.27.31/patches.suse/mnt_clone_write.patch similarity index 59% rename from src/patches/suse-2.6.27.25/patches.suse/mnt_clone_write.patch rename to src/patches/suse-2.6.27.31/patches.suse/mnt_clone_write.patch index 767f6264d..e51b8875e 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/mnt_clone_write.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/mnt_clone_write.patch @@ -25,28 +25,31 @@ After these two patches, mnt_want_write and mnt_drop_write go from 7% on the profile down to 1.3% (including mnt_clone_write). --- - fs/file_table.c | 3 +-- - fs/inode.c | 2 +- - fs/namespace.c | 38 ++++++++++++++++++++++++++++++++++++++ - fs/open.c | 4 ++-- - fs/xattr.c | 4 ++-- - include/linux/mount.h | 2 ++ - 6 files changed, 46 insertions(+), 7 deletions(-) + fs/file_table.c | 2 - + fs/inode.c | 2 - + fs/namespace.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ + fs/open.c | 4 +-- + fs/xattr.c | 4 +-- + include/linux/mount.h | 5 +++ + 6 files changed, 74 insertions(+), 6 deletions(-) ---- a/fs/file_table.c -+++ b/fs/file_table.c -@@ -210,8 +210,7 @@ int init_file(struct file *file, struct +Index: linux-2.6.27/fs/file_table.c +=================================================================== +--- linux-2.6.27.orig/fs/file_table.c ++++ linux-2.6.27/fs/file_table.c +@@ -210,7 +210,7 @@ int init_file(struct file *file, struct */ if ((mode & FMODE_WRITE) && !special_file(dentry->d_inode->i_mode)) { file_take_write(file); - error = mnt_want_write(mnt); -- WARN_ON(error); -+ mnt_clone_write(mnt); ++ error = mnt_clone_write_2(mnt); + WARN_ON(error); } return error; - } ---- a/fs/inode.c -+++ b/fs/inode.c +Index: linux-2.6.27/fs/inode.c +=================================================================== +--- linux-2.6.27.orig/fs/inode.c ++++ linux-2.6.27/fs/inode.c @@ -1256,7 +1256,7 @@ void file_update_time(struct file *file) if (IS_NOCMTIME(inode)) return; @@ -56,9 +59,11 @@ the profile down to 1.3% (including mnt_clone_write). if (err) return; ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -264,6 +264,44 @@ out: +Index: linux-2.6.27/fs/namespace.c +=================================================================== +--- linux-2.6.27.orig/fs/namespace.c ++++ linux-2.6.27/fs/namespace.c +@@ -264,6 +264,69 @@ out: EXPORT_SYMBOL_GPL(mnt_want_write); /** @@ -70,6 +75,9 @@ the profile down to 1.3% (including mnt_clone_write). + * on a mountpoint that we already know has a write reference + * on it. This allows some optimisation. + * ++ * The caller should really check __mnt_is_readonly before callint ++ * mnt_clone_write. See mnt_clone_write_2. ++ * + * After finished, mnt_drop_write must be called as usual to + * drop the reference. + */ @@ -82,6 +90,29 @@ the profile down to 1.3% (including mnt_clone_write). +EXPORT_SYMBOL_GPL(mnt_clone_write); + +/** ++ * mnt_clone_write_2 - get write access to a mount ++ * @mnt: the mount on which to take a write ++ * ++ * Same as mnt_clone_write, but it performs the __mnt_is_readonly ++ * check itself, and returns -error on failure. This is the preferred ++ * function. This is here to preserve kABI compatibility. ++ * ++ * After finished, mnt_drop_write must be called as usual to ++ * drop the reference. ++ */ ++int mnt_clone_write_2(struct vfsmount *mnt) ++{ ++ /* superblock may be r/o */ ++ if (__mnt_is_readonly(mnt)) ++ return -EROFS; ++ preempt_disable(); ++ inc_mnt_writers(mnt); ++ preempt_enable(); ++ return 0; ++} ++EXPORT_SYMBOL_GPL(mnt_clone_write_2); ++ ++/** + * mnt_want_write_file - get write access to a file's mount + * @file: the file who's mount on which to take a write + * @@ -90,12 +121,11 @@ the profile down to 1.3% (including mnt_clone_write). + */ +int mnt_want_write_file(struct vfsmount *mnt, struct file *file) +{ -+ if (!(file->f_mode & FMODE_WRITE)) ++ struct inode *inode = file->f_dentry->d_inode; ++ if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode)) + return mnt_want_write(mnt); -+ else { -+ mnt_clone_write(mnt); -+ return 0; -+ } ++ else ++ return mnt_clone_write_2(mnt); +} +EXPORT_SYMBOL_GPL(mnt_want_write_file); + @@ -103,8 +133,10 @@ the profile down to 1.3% (including mnt_clone_write). * mnt_drop_write - give up write access to a mount * @mnt: the mount on which to give up write access * ---- a/fs/open.c -+++ b/fs/open.c +Index: linux-2.6.27/fs/open.c +=================================================================== +--- linux-2.6.27.orig/fs/open.c ++++ linux-2.6.27/fs/open.c @@ -616,7 +616,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd audit_inode(NULL, dentry); @@ -123,8 +155,10 @@ the profile down to 1.3% (including mnt_clone_write). if (error) goto out_fput; dentry = file->f_path.dentry; ---- a/fs/xattr.c -+++ b/fs/xattr.c +Index: linux-2.6.27/fs/xattr.c +=================================================================== +--- linux-2.6.27.orig/fs/xattr.c ++++ linux-2.6.27/fs/xattr.c @@ -301,7 +301,7 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, cons return error; dentry = f->f_path.dentry; @@ -143,14 +177,20 @@ the profile down to 1.3% (including mnt_clone_write). if (!error) { error = removexattr(dentry, name); mnt_drop_write(f->f_path.mnt); ---- a/include/linux/mount.h -+++ b/include/linux/mount.h -@@ -99,6 +99,8 @@ static inline struct vfsmount *mntget(st +Index: linux-2.6.27/include/linux/mount.h +=================================================================== +--- linux-2.6.27.orig/include/linux/mount.h ++++ linux-2.6.27/include/linux/mount.h +@@ -98,7 +98,12 @@ static inline struct vfsmount *mntget(st + return mnt; } ++struct file; ++ extern int mnt_want_write(struct vfsmount *mnt); +extern int mnt_want_write_file(struct vfsmount *mnt, struct file *file); +extern void mnt_clone_write(struct vfsmount *mnt); ++extern int mnt_clone_write_2(struct vfsmount *mnt); extern void mnt_drop_write(struct vfsmount *mnt); extern void mntput_no_expire(struct vfsmount *mnt); extern void mnt_pin(struct vfsmount *mnt); diff --git a/src/patches/suse-2.6.27.25/patches.suse/modpost-filter-out-built-in-depends b/src/patches/suse-2.6.27.31/patches.suse/modpost-filter-out-built-in-depends similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/modpost-filter-out-built-in-depends rename to src/patches/suse-2.6.27.31/patches.suse/modpost-filter-out-built-in-depends diff --git a/src/patches/suse-2.6.27.25/patches.suse/module-ref-dynamic-alloc b/src/patches/suse-2.6.27.31/patches.suse/module-ref-dynamic-alloc similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/module-ref-dynamic-alloc rename to src/patches/suse-2.6.27.31/patches.suse/module-ref-dynamic-alloc diff --git a/src/patches/suse-2.6.27.25/patches.suse/nameif-track-rename.patch b/src/patches/suse-2.6.27.31/patches.suse/nameif-track-rename.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/nameif-track-rename.patch rename to src/patches/suse-2.6.27.31/patches.suse/nameif-track-rename.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/netfilter-ip_conntrack_slp.patch b/src/patches/suse-2.6.27.31/patches.suse/netfilter-ip_conntrack_slp.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/netfilter-ip_conntrack_slp.patch rename to src/patches/suse-2.6.27.31/patches.suse/netfilter-ip_conntrack_slp.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/netfilter-ipt_LOG-mac b/src/patches/suse-2.6.27.31/patches.suse/netfilter-ipt_LOG-mac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/netfilter-ipt_LOG-mac rename to src/patches/suse-2.6.27.31/patches.suse/netfilter-ipt_LOG-mac diff --git a/src/patches/suse-2.6.27.25/patches.suse/netfilter-ipv4options b/src/patches/suse-2.6.27.31/patches.suse/netfilter-ipv4options similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/netfilter-ipv4options rename to src/patches/suse-2.6.27.31/patches.suse/netfilter-ipv4options diff --git a/src/patches/suse-2.6.27.25/patches.suse/nfs4acl-ai.diff b/src/patches/suse-2.6.27.31/patches.suse/nfs4acl-ai.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/nfs4acl-ai.diff rename to src/patches/suse-2.6.27.31/patches.suse/nfs4acl-ai.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/nfs4acl-common.diff b/src/patches/suse-2.6.27.31/patches.suse/nfs4acl-common.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/nfs4acl-common.diff rename to src/patches/suse-2.6.27.31/patches.suse/nfs4acl-common.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/nfs4acl-ext3.diff b/src/patches/suse-2.6.27.31/patches.suse/nfs4acl-ext3.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/nfs4acl-ext3.diff rename to src/patches/suse-2.6.27.31/patches.suse/nfs4acl-ext3.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/nfsacl-client-cache-CHECK.diff b/src/patches/suse-2.6.27.31/patches.suse/nfsacl-client-cache-CHECK.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/nfsacl-client-cache-CHECK.diff rename to src/patches/suse-2.6.27.31/patches.suse/nfsacl-client-cache-CHECK.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/no-frame-pointer-select b/src/patches/suse-2.6.27.31/patches.suse/no-frame-pointer-select similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/no-frame-pointer-select rename to src/patches/suse-2.6.27.31/patches.suse/no-frame-pointer-select diff --git a/src/patches/suse-2.6.27.25/patches.suse/no-partition-scan b/src/patches/suse-2.6.27.31/patches.suse/no-partition-scan similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/no-partition-scan rename to src/patches/suse-2.6.27.31/patches.suse/no-partition-scan diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-add-the-novell-filesystem-client-kernel-module.patch b/src/patches/suse-2.6.27.31/patches.suse/novfs-add-the-novell-filesystem-client-kernel-module.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-add-the-novell-filesystem-client-kernel-module.patch rename to src/patches/suse-2.6.27.31/patches.suse/novfs-add-the-novell-filesystem-client-kernel-module.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-clear-mappeddrives.patch b/src/patches/suse-2.6.27.31/patches.suse/novfs-clear-mappeddrives.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-clear-mappeddrives.patch rename to src/patches/suse-2.6.27.31/patches.suse/novfs-clear-mappeddrives.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-gregorian-day-fix b/src/patches/suse-2.6.27.31/patches.suse/novfs-gregorian-day-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-gregorian-day-fix rename to src/patches/suse-2.6.27.31/patches.suse/novfs-gregorian-day-fix diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-map-drives-correctly.diff b/src/patches/suse-2.6.27.31/patches.suse/novfs-map-drives-correctly.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-map-drives-correctly.diff rename to src/patches/suse-2.6.27.31/patches.suse/novfs-map-drives-correctly.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-merge-changes.diff b/src/patches/suse-2.6.27.31/patches.suse/novfs-merge-changes.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-merge-changes.diff rename to src/patches/suse-2.6.27.31/patches.suse/novfs-merge-changes.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/novfs-patch-2.6.27 b/src/patches/suse-2.6.27.31/patches.suse/novfs-patch-2.6.27 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/novfs-patch-2.6.27 rename to src/patches/suse-2.6.27.31/patches.suse/novfs-patch-2.6.27 diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Abstract-ocfs2_extent_tree-in-b.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Abstract-ocfs2_extent_tree-in-b.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Abstract-ocfs2_extent_tree-in-b.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Abstract-ocfs2_extent_tree-in-b.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-an-insertion-check-to-ocfs2_extent_tree_o.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-an-insertion-check-to-ocfs2_extent_tree_o.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-an-insertion-check-to-ocfs2_extent_tree_o.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-an-insertion-check-to-ocfs2_extent_tree_o.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-clusters-free-in-dealloc_ctxt.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-clusters-free-in-dealloc_ctxt.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-clusters-free-in-dealloc_ctxt.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-clusters-free-in-dealloc_ctxt.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-empty-bucket-support-in-xattr.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-empty-bucket-support-in-xattr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-empty-bucket-support-in-xattr.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-empty-bucket-support-in-xattr.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-extended-attribute-support.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-extended-attribute-support.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-extended-attribute-support.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-extended-attribute-support.patch index 40ae4e752..133ea4d4e 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-extended-attribute-support.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-extended-attribute-support.patch @@ -53,7 +53,7 @@ Signed-off-by: Mark Fasheh #include "buffer_head_io.h" -@@ -2128,6 +2129,10 @@ const struct inode_operations ocfs2_file +@@ -2130,6 +2131,10 @@ const struct inode_operations ocfs2_file .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, .permission = ocfs2_permission, diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-extent-tree-operation-for-x.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-extent-tree-operation-for-x.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-extent-tree-operation-for-x.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-extent-tree-operation-for-x.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-helper-function-in-uptodate.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-helper-function-in-uptodate.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-helper-function-in-uptodate.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-helper-function-in-uptodate.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-incompatible-flag-for-exten.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-incompatible-flag-for-exten.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-incompatible-flag-for-exten.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-incompatible-flag-for-exten.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-quota-calls-for-allocation-and-freeing-of.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-quota-calls-for-allocation-and-freeing-of.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-quota-calls-for-allocation-and-freeing-of.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-quota-calls-for-allocation-and-freeing-of.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-the-basic-xattr-disk-layout-in-ocf.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-the-basic-xattr-disk-layout-in-ocf.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-the-basic-xattr-disk-layout-in-ocf.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-the-basic-xattr-disk-layout-in-ocf.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-the-inode64-mount-option.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-the-inode64-mount-option.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-the-inode64-mount-option.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-the-inode64-mount-option.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-bucket-iteration-for.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-bucket-iteration-for.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-bucket-iteration-for.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-bucket-iteration-for.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-index-tree-operations.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-index-tree-operations.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-index-tree-operations.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-index-tree-operations.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-lookup-code-xattr-btr.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-lookup-code-xattr-btr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-lookup-code-xattr-btr.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-lookup-code-xattr-btr.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-mount-option-in-ocfs2_show_options.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-mount-option-in-ocfs2_show_options.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-xattr-mount-option-in-ocfs2_show_options.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Add-xattr-mount-option-in-ocfs2_show_options.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Assign-feature-bits-and-system-inodes-to-quot.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Assign-feature-bits-and-system-inodes-to-quot.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Assign-feature-bits-and-system-inodes-to-quot.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Assign-feature-bits-and-system-inodes-to-quot.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Calculate-EA-hash-only-by-its-suffix.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Calculate-EA-hash-only-by-its-suffix.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Calculate-EA-hash-only-by-its-suffix.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Calculate-EA-hash-only-by-its-suffix.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Change-ocfs2_get_-_extent_tree-to-ocfs2_ini.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Change-ocfs2_get_-_extent_tree-to-ocfs2_ini.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Change-ocfs2_get_-_extent_tree-to-ocfs2_ini.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Change-ocfs2_get_-_extent_tree-to-ocfs2_ini.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Change-quotafile-names.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Change-quotafile-names.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Change-quotafile-names.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Change-quotafile-names.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Comment-struct-ocfs2_extent_tree_operations.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Comment-struct-ocfs2_extent_tree_operations.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Comment-struct-ocfs2_extent_tree_operations.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Comment-struct-ocfs2_extent_tree_operations.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-block.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-block.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-block.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-header.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-header.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-header.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-an-xattr-bucket-s-header.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-xattr-bucket-data-blocks.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-xattr-bucket-data-blocks.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Convenient-access-to-xattr-bucket-data-blocks.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Convenient-access-to-xattr-bucket-data-blocks.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Copy-xattr-buckets-with-a-dedicated-function.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Copy-xattr-buckets-with-a-dedicated-function.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Copy-xattr-buckets-with-a-dedicated-function.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Copy-xattr-buckets-with-a-dedicated-function.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Create-specific-get_extent_tree-functions.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Create-specific-get_extent_tree-functions.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Create-specific-get_extent_tree-functions.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Create-specific-get_extent_tree-functions.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Delete-all-xattr-buckets-during.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Delete-all-xattr-buckets-during.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Delete-all-xattr-buckets-during.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Delete-all-xattr-buckets-during.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Determine-an-extent-tree-s-max_leaf_clusters.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Determine-an-extent-tree-s-max_leaf_clusters.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Determine-an-extent-tree-s-max_leaf_clusters.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Determine-an-extent-tree-s-max_leaf_clusters.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Documentation-update-for-user_xattr-nouser_.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Documentation-update-for-user_xattr-nouser_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Documentation-update-for-user_xattr-nouser_.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Documentation-update-for-user_xattr-nouser_.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Don-t-check-for-NULL-before-brelse.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Don-t-check-for-NULL-before-brelse.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Don-t-check-for-NULL-before-brelse.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Don-t-check-for-NULL-before-brelse.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Enable-quota-accounting-on-mount-disable-on.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Enable-quota-accounting-on-mount-disable-on.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Enable-quota-accounting-on-mount-disable-on.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Enable-quota-accounting-on-mount-disable-on.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Enable-xattr-set-in-index-btree.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Enable-xattr-set-in-index-btree.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Enable-xattr-set-in-index-btree.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Enable-xattr-set-in-index-btree.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Field-prefixes-for-the-xattr_bucket-structure.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Field-prefixes-for-the-xattr_bucket-structure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Field-prefixes-for-the-xattr_bucket-structure.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Field-prefixes-for-the-xattr_bucket-structure.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-grace-time-syncing.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-grace-time-syncing.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-grace-time-syncing.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-grace-time-syncing.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-hang-in-quota-recovery-code.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-hang-in-quota-recovery-code.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-hang-in-quota-recovery-code.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-hang-in-quota-recovery-code.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-mount-cleanup-after-quota-failure.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-mount-cleanup-after-quota-failure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-mount-cleanup-after-quota-failure.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-mount-cleanup-after-quota-failure.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-oop-in-recovery-without-quotas b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-oop-in-recovery-without-quotas similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-oop-in-recovery-without-quotas rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-oop-in-recovery-without-quotas diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-oops-when-one-quotatype-enabled b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-oops-when-one-quotatype-enabled similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-oops-when-one-quotatype-enabled rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Fix-oops-when-one-quotatype-enabled diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implement-quota-recovery.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implement-quota-recovery.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implement-quota-recovery.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implement-quota-recovery.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implement-quota-syncing-thread.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implement-quota-syncing-thread.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implement-quota-syncing-thread.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implement-quota-syncing-thread.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implementation-of-local-and-global-quota-file.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implementation-of-local-and-global-quota-file.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Implementation-of-local-and-global-quota-file.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Implementation-of-local-and-global-quota-file.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Improve-ocfs2_read_xattr_bucket.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Improve-ocfs2_read_xattr_bucket.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Improve-ocfs2_read_xattr_bucket.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Improve-ocfs2_read_xattr_bucket.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Kill-the-last-naked-wait_on_buffer-for-cach.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Limit-inode-allocation-to-32bits.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Limit-inode-allocation-to-32bits.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Limit-inode-allocation-to-32bits.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Limit-inode-allocation-to-32bits.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-cached-block-reads-the-common-case.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-cached-block-reads-the-common-case.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-cached-block-reads-the-common-case.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-cached-block-reads-the-common-case.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-high-level-btree-extend-co.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-high-level-btree-extend-co.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-high-level-btree-extend-co.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-high-level-btree-extend-co.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-ocfs2_extent_tree-get-put-instead-of-all.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-ocfs2_extent_tree-get-put-instead-of-all.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-ocfs2_extent_tree-get-put-instead-of-all.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-ocfs2_extent_tree-get-put-instead-of-all.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-ocfs2_extent_tree-the-first-class-repres.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-ocfs2_extent_tree-the-first-class-repres.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-ocfs2_extent_tree-the-first-class-repres.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-ocfs2_extent_tree-the-first-class-repres.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-private-into-object-on-ocfs2_extent_.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-private-into-object-on-ocfs2_extent_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Make-private-into-object-on-ocfs2_extent_.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Make-private-into-object-on-ocfs2_extent_.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Mark-system-files-as-not-subject-to-quota-acc.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Mark-system-files-as-not-subject-to-quota-acc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Mark-system-files-as-not-subject-to-quota-acc.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Mark-system-files-as-not-subject-to-quota-acc.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Modify-ocfs2_num_free_extents-f.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Modify-ocfs2_num_free_extents-f.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Modify-ocfs2_num_free_extents-f.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Modify-ocfs2_num_free_extents-f.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Move-ocfs2_bread-into-dir.c.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Move-ocfs2_bread-into-dir.c.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Move-ocfs2_bread-into-dir.c.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Move-ocfs2_bread-into-dir.c.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Move-trusted-and-user-attribute-support-into.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Move-trusted-and-user-attribute-support-into.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Move-trusted-and-user-attribute-support-into.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Move-trusted-and-user-attribute-support-into.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Optionally-limit-extent-size-in.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Optionally-limit-extent-size-in.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Optionally-limit-extent-size-in.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Optionally-limit-extent-size-in.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-POSIX-file-locks-support.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-POSIX-file-locks-support.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-POSIX-file-locks-support.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-POSIX-file-locks-support.patch index c2158c321..dc52231ad 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-POSIX-file-locks-support.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-POSIX-file-locks-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Mark Fasheh --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c -@@ -2152,6 +2152,10 @@ const struct inode_operations ocfs2_spec +@@ -2154,6 +2154,10 @@ const struct inode_operations ocfs2_spec .permission = ocfs2_permission, }; @@ -38,7 +38,7 @@ Signed-off-by: Mark Fasheh const struct file_operations ocfs2_fops = { .llseek = generic_file_llseek, .read = do_sync_read, -@@ -2166,6 +2170,7 @@ const struct file_operations ocfs2_fops +@@ -2168,6 +2172,7 @@ const struct file_operations ocfs2_fops #ifdef CONFIG_COMPAT .compat_ioctl = ocfs2_compat_ioctl, #endif @@ -46,7 +46,7 @@ Signed-off-by: Mark Fasheh .flock = ocfs2_flock, .splice_read = ocfs2_file_splice_read, .splice_write = ocfs2_file_splice_write, -@@ -2175,6 +2180,52 @@ const struct file_operations ocfs2_dops +@@ -2177,6 +2182,52 @@ const struct file_operations ocfs2_dops .llseek = generic_file_llseek, .read = generic_read_dir, .readdir = ocfs2_readdir, diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Prefix-the-extent-tree-operations-structure.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Prefix-the-extent-tree-operations-structure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Prefix-the-extent-tree-operations-structure.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Prefix-the-extent-tree-operations-structure.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Prefix-the-ocfs2_extent_tree-structure.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Prefix-the-ocfs2_extent_tree-structure.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Prefix-the-ocfs2_extent_tree-structure.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Prefix-the-ocfs2_extent_tree-structure.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Provide-a-wrapper-to-brelse-xattr-bucket-bu.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Provide-a-wrapper-to-brelse-xattr-bucket-bu.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Provide-a-wrapper-to-brelse-xattr-bucket-bu.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Provide-a-wrapper-to-brelse-xattr-bucket-bu.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Refactor-xattr-list-and-remove-ocfs2_xattr_ha.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Refactor-xattr-list-and-remove-ocfs2_xattr_ha.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Refactor-xattr-list-and-remove-ocfs2_xattr_ha.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Refactor-xattr-list-and-remove-ocfs2_xattr_ha.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Remove-pointless.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Remove-pointless.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Remove-pointless.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Remove-pointless.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Require-an-inode-for-ocfs2_read_block-s.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Resolve-deadlock-in-ocfs2_xattr_free_.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Resolve-deadlock-in-ocfs2_xattr_free_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Resolve-deadlock-in-ocfs2_xattr_free_.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Resolve-deadlock-in-ocfs2_xattr_free_.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Separate-out-sync-reads-from-ocfs2_read_block.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Separate-out-sync-reads-from-ocfs2_read_block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Separate-out-sync-reads-from-ocfs2_read_block.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Separate-out-sync-reads-from-ocfs2_read_block.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Simplify-ocfs2_read_block.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Simplify-ocfs2_read_block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Simplify-ocfs2_read_block.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Simplify-ocfs2_read_block.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Support-nested-transactions.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Support-nested-transactions.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Support-nested-transactions.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Support-nested-transactions.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Switch-over-to-JBD2.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Switch-over-to-JBD2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Switch-over-to-JBD2.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Switch-over-to-JBD2.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Take-ocfs2_xattr_bucket-structures-off-of-the.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Take-ocfs2_xattr_bucket-structures-off-of-the.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Take-ocfs2_xattr_bucket-structures-off-of-the.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Take-ocfs2_xattr_bucket-structures-off-of-the.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Track-local-alloc-bits-internally.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Track-local-alloc-bits-internally.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Track-local-alloc-bits-internally.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Track-local-alloc-bits-internally.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Uninline-ocfs2_xattr_name_hash.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Uninline-ocfs2_xattr_name_hash.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Uninline-ocfs2_xattr_name_hash.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Uninline-ocfs2_xattr_name_hash.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_defrag_xattr_bucket.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_defrag_xattr_bucket.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_defrag_xattr_bucket.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_defrag_xattr_bucket.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_bucket_find.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_bucket_find.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_bucket_find.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_bucket_find.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_create_index_block.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_create_index_block.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_create_index_block.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_create_index_block.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_set_entry_in_bucke.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_set_entry_in_bucke.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_set_entry_in_bucke.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-buckets-in-ocfs2_xattr_set_entry_in_bucke.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-ocfs2_extent_list-instead-o.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-ocfs2_extent_list-instead-o.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-ocfs2_extent_list-instead-o.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-ocfs2_extent_list-instead-o.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-struct-ocfs2_extent_tree-in-ocfs2_num_fre.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-struct-ocfs2_extent_tree-in-ocfs2_num_fre.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Use-struct-ocfs2_extent_tree-in-ocfs2_num_fre.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Use-struct-ocfs2_extent_tree-in-ocfs2_num_fre.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-Wrap-journal_access-journal_dirty-for-xattr-b.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-Wrap-journal_access-journal_dirty-for-xattr-b.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-Wrap-journal_access-journal_dirty-for-xattr-b.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-Wrap-journal_access-journal_dirty-for-xattr-b.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-POSIX-ACL-API.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-POSIX-ACL-API.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-POSIX-ACL-API.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-POSIX-ACL-API.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-mount-option-and-Kconfig-option-for-acl.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-mount-option-and-Kconfig-option-for-acl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-mount-option-and-Kconfig-option-for-acl.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-mount-option-and-Kconfig-option-for-acl.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_acl_chmod.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_acl_chmod.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_acl_chmod.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_acl_chmod.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_check_acl.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_check_acl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_check_acl.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_check_acl.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_init_acl-in-mknod.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_init_acl-in-mknod.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_init_acl-in-mknod.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_init_acl-in-mknod.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_init_security-in-during-file-create.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_init_security-in-during-file-create.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_init_security-in-during-file-create.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_init_security-in-during-file-create.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_xattr_get_nolock.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_xattr_get_nolock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_xattr_get_nolock.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_xattr_get_nolock.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_xattr_set_handle.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_xattr_set_handle.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-ocfs2_xattr_set_handle.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-ocfs2_xattr_set_handle.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-security-xattr-API.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-security-xattr-API.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-add-security-xattr-API.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-add-security-xattr-API.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-bug-fix-for-journal-extend-in-xattr.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-bug-fix-for-journal-extend-in-xattr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-bug-fix-for-journal-extend-in-xattr.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-bug-fix-for-journal-extend-in-xattr.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-fix-build-error.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-fix-build-error.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-fix-build-error.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-fix-build-error.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-fix-printk-format-warnings.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-fix-printk-format-warnings.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-fix-printk-format-warnings.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-fix-printk-format-warnings.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-make-la_debug_mutex-static.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-make-la_debug_mutex-static.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-make-la_debug_mutex-static.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-make-la_debug_mutex-static.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-move-new-inode-allocation-out-of-the-transact.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-move-new-inode-allocation-out-of-the-transact.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-move-new-inode-allocation-out-of-the-transact.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-move-new-inode-allocation-out-of-the-transact.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-reserve-inline-space-for-extend.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-reserve-inline-space-for-extend.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-reserve-inline-space-for-extend.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-reserve-inline-space-for-extend.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-throttle-back-local-alloc-when-low-on-disk-sp.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-throttle-back-local-alloc-when-low-on-disk-sp.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-throttle-back-local-alloc-when-low-on-disk-sp.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-throttle-back-local-alloc-when-low-on-disk-sp.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-track-local-alloc-state-via-debugfs.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-track-local-alloc-state-via-debugfs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-track-local-alloc-state-via-debugfs.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-track-local-alloc-state-via-debugfs.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-turn-__ocfs2_remove_inode_range-into-ocfs2_.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-turn-__ocfs2_remove_inode_range-into-ocfs2_.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-turn-__ocfs2_remove_inode_range-into-ocfs2_.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-turn-__ocfs2_remove_inode_range-into-ocfs2_.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-use-smaller-counters-in-ocfs2_remove_xattr_cl.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-use-smaller-counters-in-ocfs2_remove_xattr_cl.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-use-smaller-counters-in-ocfs2_remove_xattr_cl.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-use-smaller-counters-in-ocfs2_remove_xattr_cl.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Merge-xattr-set-transaction.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Merge-xattr-set-transaction.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Merge-xattr-set-transaction.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Merge-xattr-set-transaction.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Only-extend-xattr-bucket-in-need.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Only-extend-xattr-bucket-in-need.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Only-extend-xattr-bucket-in-need.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Only-extend-xattr-bucket-in-need.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Only-set-buffer-update-if-it-doesn-t-ex.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Only-set-buffer-update-if-it-doesn-t-ex.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Only-set-buffer-update-if-it-doesn-t-ex.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Only-set-buffer-update-if-it-doesn-t-ex.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Remove-additional-bucket-allocation-in.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Remove-additional-bucket-allocation-in.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Remove-additional-bucket-allocation-in.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Remove-additional-bucket-allocation-in.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Reserve-meta-data-at-the-beginning-of-o.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Reserve-meta-data-at-the-beginning-of-o.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr-Reserve-meta-data-at-the-beginning-of-o.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Reserve-meta-data-at-the-beginning-of-o.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr.c-Fix-a-bug-when-inserting-xattr.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr.c-Fix-a-bug-when-inserting-xattr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ocfs2-xattr.c-Fix-a-bug-when-inserting-xattr.patch rename to src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr.c-Fix-a-bug-when-inserting-xattr.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/of_platform_driver.module-owner.patch b/src/patches/suse-2.6.27.31/patches.suse/of_platform_driver.module-owner.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/of_platform_driver.module-owner.patch rename to src/patches/suse-2.6.27.31/patches.suse/of_platform_driver.module-owner.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/osync-error b/src/patches/suse-2.6.27.31/patches.suse/osync-error similarity index 91% rename from src/patches/suse-2.6.27.25/patches.suse/osync-error rename to src/patches/suse-2.6.27.31/patches.suse/osync-error index 1341b81f8..35036490c 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/osync-error +++ b/src/patches/suse-2.6.27.31/patches.suse/osync-error @@ -13,7 +13,7 @@ Acked-by: Jeff Mahoney --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -2497,7 +2497,7 @@ generic_file_buffered_write(struct kiocb +@@ -2498,7 +2498,7 @@ generic_file_buffered_write(struct kiocb if (likely(status >= 0)) { written += status; @@ -22,7 +22,7 @@ Acked-by: Jeff Mahoney /* * For now, when the user asks for O_SYNC, we'll actually give -@@ -2515,10 +2515,23 @@ generic_file_buffered_write(struct kiocb +@@ -2516,10 +2516,23 @@ generic_file_buffered_write(struct kiocb * to buffered writes (block instantiation inside i_size). So we sync * the file data here, to try to honour O_DIRECT expectations. */ diff --git a/src/patches/suse-2.6.27.25/patches.suse/panic-on-io-nmi.diff b/src/patches/suse-2.6.27.31/patches.suse/panic-on-io-nmi.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/panic-on-io-nmi.diff rename to src/patches/suse-2.6.27.31/patches.suse/panic-on-io-nmi.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/parser-match_string.diff b/src/patches/suse-2.6.27.31/patches.suse/parser-match_string.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/parser-match_string.diff rename to src/patches/suse-2.6.27.31/patches.suse/parser-match_string.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/perfmon2-add_ioctl_interface.patch b/src/patches/suse-2.6.27.31/patches.suse/perfmon2-add_ioctl_interface.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/perfmon2-add_ioctl_interface.patch rename to src/patches/suse-2.6.27.31/patches.suse/perfmon2-add_ioctl_interface.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/perfmon2-fix_disabled.patch b/src/patches/suse-2.6.27.31/patches.suse/perfmon2-fix_disabled.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/perfmon2-fix_disabled.patch rename to src/patches/suse-2.6.27.31/patches.suse/perfmon2-fix_disabled.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/perfmon2-remove_get_base_syscall_attr.patch b/src/patches/suse-2.6.27.31/patches.suse/perfmon2-remove_get_base_syscall_attr.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/perfmon2-remove_get_base_syscall_attr.patch rename to src/patches/suse-2.6.27.31/patches.suse/perfmon2-remove_get_base_syscall_attr.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/perfmon2-remove_syscalls.patch b/src/patches/suse-2.6.27.31/patches.suse/perfmon2-remove_syscalls.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/perfmon2-remove_syscalls.patch rename to src/patches/suse-2.6.27.31/patches.suse/perfmon2-remove_syscalls.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/perfmon2.patch b/src/patches/suse-2.6.27.31/patches.suse/perfmon2.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.suse/perfmon2.patch rename to src/patches/suse-2.6.27.31/patches.suse/perfmon2.patch index f332f4f5d..c96e24ee1 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/perfmon2.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/perfmon2.patch @@ -366,7 +366,7 @@ Signed-off-by: Greg Kroah-Hartman + registers. --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -1698,6 +1698,9 @@ and is between 256 and 4096 characters. +@@ -1705,6 +1705,9 @@ and is between 256 and 4096 characters. Format: { 0 | 1 } See arch/parisc/kernel/pdc_chassis.c diff --git a/src/patches/suse-2.6.27.25/patches.suse/ppc-no-LDFLAGS_MODULE.patch b/src/patches/suse-2.6.27.31/patches.suse/ppc-no-LDFLAGS_MODULE.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ppc-no-LDFLAGS_MODULE.patch rename to src/patches/suse-2.6.27.31/patches.suse/ppc-no-LDFLAGS_MODULE.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/ppc-powerbook-usb-fn-key-default.patch b/src/patches/suse-2.6.27.31/patches.suse/ppc-powerbook-usb-fn-key-default.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/ppc-powerbook-usb-fn-key-default.patch rename to src/patches/suse-2.6.27.31/patches.suse/ppc-powerbook-usb-fn-key-default.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Add-callbacks-for-allocating-and-destroying-d.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Add-callbacks-for-allocating-and-destroying-d.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Add-callbacks-for-allocating-and-destroying-d.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Add-callbacks-for-allocating-and-destroying-d.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Add-helpers-to-allow-ocfs2-specific-quota-ini.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Add-helpers-to-allow-ocfs2-specific-quota-ini.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Add-helpers-to-allow-ocfs2-specific-quota-ini.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Add-helpers-to-allow-ocfs2-specific-quota-ini.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Allow-negative-usage-of-space-and-inodes.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Allow-negative-usage-of-space-and-inodes.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Allow-negative-usage-of-space-and-inodes.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Allow-negative-usage-of-space-and-inodes.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Allow-to-separately-enable-quota-accounting-a.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Allow-to-separately-enable-quota-accounting-a.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Allow-to-separately-enable-quota-accounting-a.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Allow-to-separately-enable-quota-accounting-a.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Convert-union-in-mem_dqinfo-to-a-pointer.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Convert-union-in-mem_dqinfo-to-a-pointer.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Convert-union-in-mem_dqinfo-to-a-pointer.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Convert-union-in-mem_dqinfo-to-a-pointer.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Implement-function-for-scanning-active-dquots.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Implement-function-for-scanning-active-dquots.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Implement-function-for-scanning-active-dquots.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Implement-function-for-scanning-active-dquots.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Increase-size-of-variables-for-limits-and-ino.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Increase-size-of-variables-for-limits-and-ino.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Increase-size-of-variables-for-limits-and-ino.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Increase-size-of-variables-for-limits-and-ino.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Introduce-DQUOT_QUOTA_SYS_FILE-flag.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Introduce-DQUOT_QUOTA_SYS_FILE-flag.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Introduce-DQUOT_QUOTA_SYS_FILE-flag.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Introduce-DQUOT_QUOTA_SYS_FILE-flag.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Keep-which-entries-were-set-by-SETQUOTA-quota.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Keep-which-entries-were-set-by-SETQUOTA-quota.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Keep-which-entries-were-set-by-SETQUOTA-quota.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Keep-which-entries-were-set-by-SETQUOTA-quota.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Move-quotaio_v-12-.h-from-include-linux-to-f.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Move-quotaio_v-12-.h-from-include-linux-to-f.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Move-quotaio_v-12-.h-from-include-linux-to-f.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Move-quotaio_v-12-.h-from-include-linux-to-f.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Remove-bogus-optimization-in-check_idq-an.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Remove-bogus-optimization-in-check_idq-an.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Remove-bogus-optimization-in-check_idq-an.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Remove-bogus-optimization-in-check_idq-an.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Remove-compatibility-function-sb_any_quota_en.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Remove-compatibility-function-sb_any_quota_en.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Remove-compatibility-function-sb_any_quota_en.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Remove-compatibility-function-sb_any_quota_en.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/quota-Split-off-quota-tree-handling-into-a-separate.patch b/src/patches/suse-2.6.27.31/patches.suse/quota-Split-off-quota-tree-handling-into-a-separate.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/quota-Split-off-quota-tree-handling-into-a-separate.patch rename to src/patches/suse-2.6.27.31/patches.suse/quota-Split-off-quota-tree-handling-into-a-separate.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/radeon-monitor-jsxx-quirk.patch b/src/patches/suse-2.6.27.31/patches.suse/radeon-monitor-jsxx-quirk.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/radeon-monitor-jsxx-quirk.patch rename to src/patches/suse-2.6.27.31/patches.suse/radeon-monitor-jsxx-quirk.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/raw_device_max_minors_param.diff b/src/patches/suse-2.6.27.31/patches.suse/raw_device_max_minors_param.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/raw_device_max_minors_param.diff rename to src/patches/suse-2.6.27.31/patches.suse/raw_device_max_minors_param.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiser4-exports b/src/patches/suse-2.6.27.31/patches.suse/reiser4-exports similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiser4-exports rename to src/patches/suse-2.6.27.31/patches.suse/reiser4-exports diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiser4-sync_inodes b/src/patches/suse-2.6.27.31/patches.suse/reiser4-sync_inodes similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiser4-sync_inodes rename to src/patches/suse-2.6.27.31/patches.suse/reiser4-sync_inodes diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-Use-sb_any_quota_loaded-instead-of-sb_an.patch b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-Use-sb_any_quota_loaded-instead-of-sb_an.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-Use-sb_any_quota_loaded-instead-of-sb_an.patch rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-Use-sb_any_quota_loaded-instead-of-sb_an.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-add-reiserfs_error.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-add-reiserfs_error.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-add-reiserfs_error.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-add-reiserfs_error.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-barrier-default b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-barrier-default similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-barrier-default rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-barrier-default diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-buffer-info-for-balance.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-buffer-info-for-balance.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-buffer-info-for-balance.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-buffer-info-for-balance.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-clean-up-xattrs b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-clean-up-xattrs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-clean-up-xattrs rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-clean-up-xattrs diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-cleanup-path-funcs.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-cleanup-path-funcs.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-cleanup-path-funcs.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-cleanup-path-funcs.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-consistent-messages.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-consistent-messages.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-consistent-messages.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-consistent-messages.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-eliminate-per-super-xattr-lock.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-eliminate-per-super-xattr-lock.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-eliminate-per-super-xattr-lock.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-eliminate-per-super-xattr-lock.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-inode-init b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-inode-init similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-inode-init rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-inode-init diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-journaled-xattrs.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-journaled-xattrs.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-journaled-xattrs.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-journaled-xattrs.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-kill-xattr-readdir.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-kill-xattr-readdir.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-kill-xattr-readdir.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-kill-xattr-readdir.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-make-per-inode-xattr-locking-more-fine-grained.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-make-per-inode-xattr-locking-more-fine-grained.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-make-per-inode-xattr-locking-more-fine-grained.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-make-per-inode-xattr-locking-more-fine-grained.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-mount-count b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-mount-count similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-mount-count rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-mount-count diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rearrange-journal-abort.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rearrange-journal-abort.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rearrange-journal-abort.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rearrange-journal-abort.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs-warning.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs-warning.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs-warning.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs-warning.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs_info.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs_info.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs_info.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs_info.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs_panic.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs_panic.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-reiserfs_panic.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-reiserfs_panic.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-i_has_xattr_dir.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-i_has_xattr_dir.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-i_has_xattr_dir.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-i_has_xattr_dir.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-link-detection.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-link-detection.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-link-detection.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-link-detection.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-xinode b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-xinode similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-remove-xinode rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-remove-xinode diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-._.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-._.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-._.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-._.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_._.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_._.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_._.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_._.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_bh.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_bh.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_bh.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_bh.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_inode.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_inode.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_inode.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_inode.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_sb.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_sb.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_sb.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_sb.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_tb.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_tb.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-p_s_tb.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-rename-p_s_tb.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-selinux.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-selinux.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-selinux.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-selinux.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-simplify-buffer-info.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-simplify-buffer-info.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-simplify-buffer-info.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-simplify-buffer-info.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-simplify-xattr-internal-file-lookups-opens.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-simplify-xattr-internal-file-lookups-opens.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-simplify-xattr-internal-file-lookups-opens.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-simplify-xattr-internal-file-lookups-opens.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-strip-whitespace.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-strip-whitespace.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-strip-whitespace.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-strip-whitespace.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-use-generic-xattr-handlers.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-use-generic-xattr-handlers.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-use-generic-xattr-handlers.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-use-generic-xattr-handlers.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-use-reiserfs_error.diff b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-use-reiserfs_error.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-use-reiserfs_error.diff rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-use-reiserfs_error.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-xattr-S_PRIVATE b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-xattr-S_PRIVATE similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-xattr-S_PRIVATE rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-xattr-S_PRIVATE diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs-xattr-get-page b/src/patches/suse-2.6.27.31/patches.suse/reiserfs-xattr-get-page similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs-xattr-get-page rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs-xattr-get-page diff --git a/src/patches/suse-2.6.27.25/patches.suse/reiserfs_warning-reentrant b/src/patches/suse-2.6.27.31/patches.suse/reiserfs_warning-reentrant similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/reiserfs_warning-reentrant rename to src/patches/suse-2.6.27.31/patches.suse/reiserfs_warning-reentrant diff --git a/src/patches/suse-2.6.27.25/patches.suse/rlimit-memlock-64k.patch b/src/patches/suse-2.6.27.31/patches.suse/rlimit-memlock-64k.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/rlimit-memlock-64k.patch rename to src/patches/suse-2.6.27.31/patches.suse/rlimit-memlock-64k.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/rq-based-multipath b/src/patches/suse-2.6.27.31/patches.suse/rq-based-multipath similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/rq-based-multipath rename to src/patches/suse-2.6.27.31/patches.suse/rq-based-multipath index 7959eb23a..2a9594b34 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/rq-based-multipath +++ b/src/patches/suse-2.6.27.31/patches.suse/rq-based-multipath @@ -16,6 +16,488 @@ Signed-off-by: Hannes Reinecke include/linux/device-mapper.h | 24 + 6 files changed, 1158 insertions(+), 122 deletions(-) +--- a/drivers/md/dm-ioctl.c ++++ b/drivers/md/dm-ioctl.c +@@ -1046,6 +1046,12 @@ static int populate_table(struct dm_tabl + next = spec->next; + } + ++ r = dm_table_set_type(table); ++ if (r) { ++ DMWARN("unable to set table type"); ++ return r; ++ } ++ + return dm_table_complete(table); + } + +@@ -1069,6 +1075,13 @@ static int table_load(struct dm_ioctl *p + dm_table_put(t); + goto out; + } ++ ++ r = dm_init_md_mempool(md, dm_table_get_type(t)); ++ if (r) { ++ DMWARN("unable to initialize the md mempools for this table"); ++ dm_table_put(t); ++ goto out; ++ } + + down_write(&_hash_lock); + hc = dm_get_mdptr(md); +--- a/drivers/md/dm-mpath.c ++++ b/drivers/md/dm-mpath.c +@@ -7,8 +7,6 @@ + + #include "dm.h" + #include "dm-path-selector.h" +-#include "dm-bio-list.h" +-#include "dm-bio-record.h" + #include "dm-uevent.h" + + #include +@@ -83,7 +81,7 @@ struct multipath { + unsigned pg_init_count; /* Number of times pg_init called */ + + struct work_struct process_queued_ios; +- struct bio_list queued_ios; ++ struct list_head queued_ios; + unsigned queue_size; + + struct work_struct trigger_event; +@@ -100,7 +98,6 @@ struct multipath { + */ + struct dm_mpath_io { + struct pgpath *pgpath; +- struct dm_bio_details details; + }; + + typedef int (*action_fn) (struct pgpath *pgpath); +@@ -197,6 +194,7 @@ static struct multipath *alloc_multipath + m = kzalloc(sizeof(*m), GFP_KERNEL); + if (m) { + INIT_LIST_HEAD(&m->priority_groups); ++ INIT_LIST_HEAD(&m->queued_ios); + spin_lock_init(&m->lock); + m->queue_io = 1; + INIT_WORK(&m->process_queued_ios, process_queued_ios); +@@ -321,12 +319,13 @@ static int __must_push_back(struct multi + dm_noflush_suspending(m->ti)); + } + +-static int map_io(struct multipath *m, struct bio *bio, ++static int map_io(struct multipath *m, struct request *clone, + struct dm_mpath_io *mpio, unsigned was_queued) + { + int r = DM_MAPIO_REMAPPED; + unsigned long flags; + struct pgpath *pgpath; ++ struct block_device *bdev; + + spin_lock_irqsave(&m->lock, flags); + +@@ -343,16 +342,18 @@ static int map_io(struct multipath *m, s + if ((pgpath && m->queue_io) || + (!pgpath && m->queue_if_no_path)) { + /* Queue for the daemon to resubmit */ +- bio_list_add(&m->queued_ios, bio); ++ list_add_tail(&clone->queuelist, &m->queued_ios); + m->queue_size++; + if ((m->pg_init_required && !m->pg_init_in_progress) || + !m->queue_io) + queue_work(kmultipathd, &m->process_queued_ios); + pgpath = NULL; + r = DM_MAPIO_SUBMITTED; +- } else if (pgpath) +- bio->bi_bdev = pgpath->path.dev->bdev; +- else if (__must_push_back(m)) ++ } else if (pgpath) { ++ bdev = pgpath->path.dev->bdev; ++ clone->q = bdev_get_queue(bdev); ++ clone->rq_disk = bdev->bd_disk; ++ } else if (__must_push_back(m)) + r = DM_MAPIO_REQUEUE; + else + r = -EIO; /* Failed */ +@@ -395,30 +396,31 @@ static void dispatch_queued_ios(struct m + { + int r; + unsigned long flags; +- struct bio *bio = NULL, *next; + struct dm_mpath_io *mpio; + union map_info *info; ++ struct request *clone, *n; ++ LIST_HEAD(cl); + + spin_lock_irqsave(&m->lock, flags); +- bio = bio_list_get(&m->queued_ios); ++ list_splice_init(&m->queued_ios, &cl); + spin_unlock_irqrestore(&m->lock, flags); + +- while (bio) { +- next = bio->bi_next; +- bio->bi_next = NULL; ++ list_for_each_entry_safe(clone, n, &cl, queuelist) { ++ list_del_init(&clone->queuelist); + +- info = dm_get_mapinfo(bio); ++ info = dm_get_rq_mapinfo(clone); + mpio = info->ptr; + +- r = map_io(m, bio, mpio, 1); +- if (r < 0) +- bio_endio(bio, r); +- else if (r == DM_MAPIO_REMAPPED) +- generic_make_request(bio); +- else if (r == DM_MAPIO_REQUEUE) +- bio_endio(bio, -EIO); +- +- bio = next; ++ r = map_io(m, clone, mpio, 1); ++ if (r < 0) { ++ mempool_free(mpio, m->mpio_pool); ++ dm_kill_request(clone, r); ++ } else if (r == DM_MAPIO_REMAPPED) ++ dm_dispatch_request(clone); ++ else if (r == DM_MAPIO_REQUEUE) { ++ mempool_free(mpio, m->mpio_pool); ++ dm_requeue_request(clone); ++ } + } + } + +@@ -844,21 +846,24 @@ static void multipath_dtr(struct dm_targ + } + + /* +- * Map bios, recording original fields for later in case we have to resubmit ++ * Map cloned requests + */ +-static int multipath_map(struct dm_target *ti, struct bio *bio, ++static int multipath_map(struct dm_target *ti, struct request *clone, + union map_info *map_context) + { + int r; + struct dm_mpath_io *mpio; + struct multipath *m = (struct multipath *) ti->private; + +- mpio = mempool_alloc(m->mpio_pool, GFP_NOIO); +- dm_bio_record(&mpio->details, bio); ++ mpio = mempool_alloc(m->mpio_pool, GFP_ATOMIC); ++ if (!mpio) ++ /* ENOMEM, requeue */ ++ return DM_MAPIO_REQUEUE; ++ memset(mpio, 0, sizeof(*mpio)); + + map_context->ptr = mpio; +- bio->bi_rw |= (1 << BIO_RW_FAILFAST_TRANSPORT); +- r = map_io(m, bio, mpio, 0); ++ clone->cmd_flags |= REQ_FAILFAST_TRANSPORT; ++ r = map_io(m, clone, mpio, 0); + if (r < 0 || r == DM_MAPIO_REQUEUE) + mempool_free(mpio, m->mpio_pool); + +@@ -1140,53 +1145,41 @@ static void activate_path(struct work_st + /* + * end_io handling + */ +-static int do_end_io(struct multipath *m, struct bio *bio, ++static int do_end_io(struct multipath *m, struct request *clone, + int error, struct dm_mpath_io *mpio) + { ++ /* ++ * We don't queue any clone request inside the multipath target ++ * during end I/O handling, since those clone requests don't have ++ * bio clones. If we queue them inside the multipath target, ++ * we need to make bio clones, that requires memory allocation. ++ * (See drivers/md/dm.c:end_clone_bio() about why the clone requests ++ * don't have bio clones.) ++ * Instead of queueing the clone request here, we queue the original ++ * request into dm core, which will remake a clone request and ++ * clone bios for it and resubmit it later. ++ */ ++ int r = DM_ENDIO_REQUEUE; + unsigned long flags; + +- if (!error) ++ if (!error && !clone->errors) + return 0; /* I/O complete */ + +- if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio)) +- return error; +- + if (error == -EOPNOTSUPP) + return error; + +- spin_lock_irqsave(&m->lock, flags); +- if (!m->nr_valid_paths) { +- if (__must_push_back(m)) { +- spin_unlock_irqrestore(&m->lock, flags); +- return DM_ENDIO_REQUEUE; +- } else if (!m->queue_if_no_path) { +- spin_unlock_irqrestore(&m->lock, flags); +- return -EIO; +- } else { +- spin_unlock_irqrestore(&m->lock, flags); +- goto requeue; +- } +- } +- spin_unlock_irqrestore(&m->lock, flags); +- + if (mpio->pgpath) + fail_path(mpio->pgpath); + +- requeue: +- dm_bio_restore(&mpio->details, bio); +- +- /* queue for the daemon to resubmit or fail */ + spin_lock_irqsave(&m->lock, flags); +- bio_list_add(&m->queued_ios, bio); +- m->queue_size++; +- if (!m->queue_io) +- queue_work(kmultipathd, &m->process_queued_ios); ++ if (!m->nr_valid_paths && !m->queue_if_no_path && !__must_push_back(m)) ++ r = -EIO; + spin_unlock_irqrestore(&m->lock, flags); + +- return DM_ENDIO_INCOMPLETE; /* io not complete */ ++ return r; + } + +-static int multipath_end_io(struct dm_target *ti, struct bio *bio, ++static int multipath_end_io(struct dm_target *ti, struct request *clone, + int error, union map_info *map_context) + { + struct multipath *m = ti->private; +@@ -1195,14 +1188,13 @@ static int multipath_end_io(struct dm_ta + struct path_selector *ps; + int r; + +- r = do_end_io(m, bio, error, mpio); ++ r = do_end_io(m, clone, error, mpio); + if (pgpath) { + ps = &pgpath->pg->ps; + if (ps->type->end_io) + ps->type->end_io(ps, &pgpath->path); + } +- if (r != DM_ENDIO_INCOMPLETE) +- mempool_free(mpio, m->mpio_pool); ++ mempool_free(mpio, m->mpio_pool); + + return r; + } +@@ -1438,6 +1430,75 @@ static int multipath_ioctl(struct dm_tar + bdev->bd_disk, cmd, arg); + } + ++static int __pgpath_busy(struct pgpath *pgpath) ++{ ++ struct request_queue *q = bdev_get_queue(pgpath->path.dev->bdev); ++ ++ return dm_underlying_device_busy(q); ++} ++ ++/* ++ * We return "busy", only when we can map I/Os but underlying devices ++ * are busy (so even if we map I/Os now, the I/Os will wait on ++ * the underlying queue). ++ * In other words, if we want to kill I/Os or queue them inside us ++ * due to map unavailability, we don't return "busy". Otherwise, ++ * dm core won't give us the I/Os and we can't do what we want. ++ */ ++static int multipath_busy(struct dm_target *ti) ++{ ++ int busy = 0, has_active = 0; ++ struct multipath *m = (struct multipath *) ti->private; ++ struct priority_group *pg; ++ struct pgpath *pgpath; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&m->lock, flags); ++ ++ /* Guess which priority_group will be used at next mapping time */ ++ if (unlikely(!m->current_pgpath && m->next_pg)) ++ pg = m->next_pg; ++ else if (likely(m->current_pg)) ++ pg = m->current_pg; ++ else ++ /* ++ * We don't know which pg will be used at next mapping time. ++ * We don't call __choose_pgpath() here to avoid to trigger ++ * pg_init just by busy checking. ++ * So we don't know whether underlying devices we will be using ++ * at next mapping time are busy or not. Just try mapping. ++ */ ++ goto out; ++ ++ /* ++ * If there is one non-busy active path at least, the path selector ++ * will be able to select it. So we consider such a pg as not busy. ++ */ ++ busy = 1; ++ list_for_each_entry(pgpath, &pg->pgpaths, list) ++ if (pgpath->is_active) { ++ has_active = 1; ++ ++ if (!__pgpath_busy(pgpath)) { ++ busy = 0; ++ break; ++ } ++ } ++ ++ if (!has_active) ++ /* ++ * No active path in this pg, so this pg won't be used and ++ * the current_pg will be changed at next mapping time. ++ * We need to try mapping to determine it. ++ */ ++ busy = 0; ++ ++out: ++ spin_unlock_irqrestore(&m->lock, flags); ++ ++ return busy; ++} ++ + /*----------------------------------------------------------------- + * Module setup + *---------------------------------------------------------------*/ +@@ -1447,13 +1508,14 @@ static struct target_type multipath_targ + .module = THIS_MODULE, + .ctr = multipath_ctr, + .dtr = multipath_dtr, +- .map = multipath_map, +- .end_io = multipath_end_io, ++ .map_rq = multipath_map, ++ .rq_end_io = multipath_end_io, + .presuspend = multipath_presuspend, + .resume = multipath_resume, + .status = multipath_status, + .message = multipath_message, + .ioctl = multipath_ioctl, ++ .busy = multipath_busy, + }; + + static int __init dm_multipath_init(void) +--- a/drivers/md/dm-table.c ++++ b/drivers/md/dm-table.c +@@ -108,6 +108,8 @@ static void combine_restrictions_low(str + lhs->bounce_pfn = min_not_zero(lhs->bounce_pfn, rhs->bounce_pfn); + + lhs->no_cluster |= rhs->no_cluster; ++ ++ lhs->no_request_stacking |= rhs->no_request_stacking; + } + + /* +@@ -522,6 +524,8 @@ void dm_set_device_limits(struct dm_targ + rs->bounce_pfn = min_not_zero(rs->bounce_pfn, q->bounce_pfn); + + rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); ++ ++ rs->no_request_stacking |= !blk_queue_stackable(q); + } + EXPORT_SYMBOL_GPL(dm_set_device_limits); + +@@ -731,6 +735,66 @@ int dm_table_add_target(struct dm_table + return r; + } + ++int dm_table_set_type(struct dm_table *t) ++{ ++ int i; ++ int bio_based = 0, request_based = 0; ++ struct dm_target *tgt; ++ ++ for (i = 0; i < t->num_targets; i++) { ++ tgt = t->targets + i; ++ if (tgt->type->map_rq) ++ request_based = 1; ++ else ++ bio_based = 1; ++ ++ if (bio_based && request_based) { ++ DMWARN("Inconsistent table: different target types" ++ " can't be mixed up"); ++ return -EINVAL; ++ } ++ } ++ ++ if (bio_based) { ++ /* We must use this table as bio-based */ ++ t->limits.no_request_stacking = 1; ++ return 0; ++ } ++ ++ BUG_ON(!request_based); /* No targets in this table */ ++ ++ /* Non-request-stackable devices can't be used for request-based dm */ ++ if (t->limits.no_request_stacking) { ++ DMWARN("table load rejected: including non-request-stackable" ++ " devices"); ++ return -EINVAL; ++ } ++ ++ /* ++ * Request-based dm supports only tables that have a single target now. ++ * To support multiple targets, request splitting support is needed, ++ * and that needs lots of changes in the block-layer. ++ * (e.g. request completion process for partial completion.) ++ */ ++ if (t->num_targets > 1) { ++ DMWARN("Request-based dm doesn't support multiple targets yet"); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++int dm_table_get_type(struct dm_table *t) ++{ ++ return t->limits.no_request_stacking ? ++ DM_TYPE_BIO_BASED : DM_TYPE_REQUEST_BASED; ++} ++ ++int dm_table_request_based(struct dm_table *t) ++{ ++ return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED; ++} ++ + static int setup_indexes(struct dm_table *t) + { + int i; +@@ -861,6 +925,10 @@ void dm_table_set_restrictions(struct dm + else + queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q); + ++ if (t->limits.no_request_stacking) ++ queue_flag_clear_unlocked(QUEUE_FLAG_STACKABLE, q); ++ else ++ queue_flag_set_unlocked(QUEUE_FLAG_STACKABLE, q); + } + + unsigned int dm_table_get_num_targets(struct dm_table *t) +@@ -949,6 +1017,20 @@ int dm_table_any_congested(struct dm_tab + return r; + } + ++int dm_table_any_busy_target(struct dm_table *t) ++{ ++ int i; ++ struct dm_target *ti; ++ ++ for (i = 0; i < t->num_targets; i++) { ++ ti = t->targets + i; ++ if (ti->type->busy && ti->type->busy(ti)) ++ return 1; ++ } ++ ++ return 0; ++} ++ + void dm_table_unplug_all(struct dm_table *t) + { + struct dm_dev *dd; --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -32,6 +32,7 @@ static unsigned int _major = 0; @@ -1219,7 +1701,7 @@ Signed-off-by: Hannes Reinecke * List of devices that a metadevice uses and should open/close. */ struct dm_dev { -@@ -49,6 +56,10 @@ void dm_table_presuspend_targets(struct +@@ -49,6 +56,10 @@ void dm_table_presuspend_targets(struct void dm_table_postsuspend_targets(struct dm_table *t); int dm_table_resume_targets(struct dm_table *t); int dm_table_any_congested(struct dm_table *t, int bdi_bits); @@ -1247,488 +1729,6 @@ Signed-off-by: Hannes Reinecke +int dm_init_md_mempool(struct mapped_device *md, int type); + #endif ---- a/drivers/md/dm-ioctl.c -+++ b/drivers/md/dm-ioctl.c -@@ -1046,6 +1046,12 @@ static int populate_table(struct dm_tabl - next = spec->next; - } - -+ r = dm_table_set_type(table); -+ if (r) { -+ DMWARN("unable to set table type"); -+ return r; -+ } -+ - return dm_table_complete(table); - } - -@@ -1070,6 +1076,13 @@ static int table_load(struct dm_ioctl *p - goto out; - } - -+ r = dm_init_md_mempool(md, dm_table_get_type(t)); -+ if (r) { -+ DMWARN("unable to initialize the md mempools for this table"); -+ dm_table_put(t); -+ goto out; -+ } -+ - down_write(&_hash_lock); - hc = dm_get_mdptr(md); - if (!hc || hc->md != md) { ---- a/drivers/md/dm-mpath.c -+++ b/drivers/md/dm-mpath.c -@@ -7,8 +7,6 @@ - - #include "dm.h" - #include "dm-path-selector.h" --#include "dm-bio-list.h" --#include "dm-bio-record.h" - #include "dm-uevent.h" - - #include -@@ -83,7 +81,7 @@ struct multipath { - unsigned pg_init_count; /* Number of times pg_init called */ - - struct work_struct process_queued_ios; -- struct bio_list queued_ios; -+ struct list_head queued_ios; - unsigned queue_size; - - struct work_struct trigger_event; -@@ -100,7 +98,6 @@ struct multipath { - */ - struct dm_mpath_io { - struct pgpath *pgpath; -- struct dm_bio_details details; - }; - - typedef int (*action_fn) (struct pgpath *pgpath); -@@ -197,6 +194,7 @@ static struct multipath *alloc_multipath - m = kzalloc(sizeof(*m), GFP_KERNEL); - if (m) { - INIT_LIST_HEAD(&m->priority_groups); -+ INIT_LIST_HEAD(&m->queued_ios); - spin_lock_init(&m->lock); - m->queue_io = 1; - INIT_WORK(&m->process_queued_ios, process_queued_ios); -@@ -321,12 +319,13 @@ static int __must_push_back(struct multi - dm_noflush_suspending(m->ti)); - } - --static int map_io(struct multipath *m, struct bio *bio, -+static int map_io(struct multipath *m, struct request *clone, - struct dm_mpath_io *mpio, unsigned was_queued) - { - int r = DM_MAPIO_REMAPPED; - unsigned long flags; - struct pgpath *pgpath; -+ struct block_device *bdev; - - spin_lock_irqsave(&m->lock, flags); - -@@ -343,16 +342,18 @@ static int map_io(struct multipath *m, s - if ((pgpath && m->queue_io) || - (!pgpath && m->queue_if_no_path)) { - /* Queue for the daemon to resubmit */ -- bio_list_add(&m->queued_ios, bio); -+ list_add_tail(&clone->queuelist, &m->queued_ios); - m->queue_size++; - if ((m->pg_init_required && !m->pg_init_in_progress) || - !m->queue_io) - queue_work(kmultipathd, &m->process_queued_ios); - pgpath = NULL; - r = DM_MAPIO_SUBMITTED; -- } else if (pgpath) -- bio->bi_bdev = pgpath->path.dev->bdev; -- else if (__must_push_back(m)) -+ } else if (pgpath) { -+ bdev = pgpath->path.dev->bdev; -+ clone->q = bdev_get_queue(bdev); -+ clone->rq_disk = bdev->bd_disk; -+ } else if (__must_push_back(m)) - r = DM_MAPIO_REQUEUE; - else - r = -EIO; /* Failed */ -@@ -395,30 +396,31 @@ static void dispatch_queued_ios(struct m - { - int r; - unsigned long flags; -- struct bio *bio = NULL, *next; - struct dm_mpath_io *mpio; - union map_info *info; -+ struct request *clone, *n; -+ LIST_HEAD(cl); - - spin_lock_irqsave(&m->lock, flags); -- bio = bio_list_get(&m->queued_ios); -+ list_splice_init(&m->queued_ios, &cl); - spin_unlock_irqrestore(&m->lock, flags); - -- while (bio) { -- next = bio->bi_next; -- bio->bi_next = NULL; -+ list_for_each_entry_safe(clone, n, &cl, queuelist) { -+ list_del_init(&clone->queuelist); - -- info = dm_get_mapinfo(bio); -+ info = dm_get_rq_mapinfo(clone); - mpio = info->ptr; - -- r = map_io(m, bio, mpio, 1); -- if (r < 0) -- bio_endio(bio, r); -- else if (r == DM_MAPIO_REMAPPED) -- generic_make_request(bio); -- else if (r == DM_MAPIO_REQUEUE) -- bio_endio(bio, -EIO); -- -- bio = next; -+ r = map_io(m, clone, mpio, 1); -+ if (r < 0) { -+ mempool_free(mpio, m->mpio_pool); -+ dm_kill_request(clone, r); -+ } else if (r == DM_MAPIO_REMAPPED) -+ dm_dispatch_request(clone); -+ else if (r == DM_MAPIO_REQUEUE) { -+ mempool_free(mpio, m->mpio_pool); -+ dm_requeue_request(clone); -+ } - } - } - -@@ -833,21 +835,24 @@ static void multipath_dtr(struct dm_targ - } - - /* -- * Map bios, recording original fields for later in case we have to resubmit -+ * Map cloned requests - */ --static int multipath_map(struct dm_target *ti, struct bio *bio, -+static int multipath_map(struct dm_target *ti, struct request *clone, - union map_info *map_context) - { - int r; - struct dm_mpath_io *mpio; - struct multipath *m = (struct multipath *) ti->private; - -- mpio = mempool_alloc(m->mpio_pool, GFP_NOIO); -- dm_bio_record(&mpio->details, bio); -+ mpio = mempool_alloc(m->mpio_pool, GFP_ATOMIC); -+ if (!mpio) -+ /* ENOMEM, requeue */ -+ return DM_MAPIO_REQUEUE; -+ memset(mpio, 0, sizeof(*mpio)); - - map_context->ptr = mpio; -- bio->bi_rw |= (1 << BIO_RW_FAILFAST_TRANSPORT); -- r = map_io(m, bio, mpio, 0); -+ clone->cmd_flags |= REQ_FAILFAST_TRANSPORT; -+ r = map_io(m, clone, mpio, 0); - if (r < 0 || r == DM_MAPIO_REQUEUE) - mempool_free(mpio, m->mpio_pool); - -@@ -1129,53 +1134,41 @@ static void activate_path(struct work_st - /* - * end_io handling - */ --static int do_end_io(struct multipath *m, struct bio *bio, -+static int do_end_io(struct multipath *m, struct request *clone, - int error, struct dm_mpath_io *mpio) - { -+ /* -+ * We don't queue any clone request inside the multipath target -+ * during end I/O handling, since those clone requests don't have -+ * bio clones. If we queue them inside the multipath target, -+ * we need to make bio clones, that requires memory allocation. -+ * (See drivers/md/dm.c:end_clone_bio() about why the clone requests -+ * don't have bio clones.) -+ * Instead of queueing the clone request here, we queue the original -+ * request into dm core, which will remake a clone request and -+ * clone bios for it and resubmit it later. -+ */ -+ int r = DM_ENDIO_REQUEUE; - unsigned long flags; - -- if (!error) -+ if (!error && !clone->errors) - return 0; /* I/O complete */ - -- if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio)) -- return error; -- - if (error == -EOPNOTSUPP) - return error; - -- spin_lock_irqsave(&m->lock, flags); -- if (!m->nr_valid_paths) { -- if (__must_push_back(m)) { -- spin_unlock_irqrestore(&m->lock, flags); -- return DM_ENDIO_REQUEUE; -- } else if (!m->queue_if_no_path) { -- spin_unlock_irqrestore(&m->lock, flags); -- return -EIO; -- } else { -- spin_unlock_irqrestore(&m->lock, flags); -- goto requeue; -- } -- } -- spin_unlock_irqrestore(&m->lock, flags); -- - if (mpio->pgpath) - fail_path(mpio->pgpath); - -- requeue: -- dm_bio_restore(&mpio->details, bio); -- -- /* queue for the daemon to resubmit or fail */ - spin_lock_irqsave(&m->lock, flags); -- bio_list_add(&m->queued_ios, bio); -- m->queue_size++; -- if (!m->queue_io) -- queue_work(kmultipathd, &m->process_queued_ios); -+ if (!m->nr_valid_paths && !m->queue_if_no_path && !__must_push_back(m)) -+ r = -EIO; - spin_unlock_irqrestore(&m->lock, flags); - -- return DM_ENDIO_INCOMPLETE; /* io not complete */ -+ return r; - } - --static int multipath_end_io(struct dm_target *ti, struct bio *bio, -+static int multipath_end_io(struct dm_target *ti, struct request *clone, - int error, union map_info *map_context) - { - struct multipath *m = ti->private; -@@ -1184,14 +1177,13 @@ static int multipath_end_io(struct dm_ta - struct path_selector *ps; - int r; - -- r = do_end_io(m, bio, error, mpio); -+ r = do_end_io(m, clone, error, mpio); - if (pgpath) { - ps = &pgpath->pg->ps; - if (ps->type->end_io) - ps->type->end_io(ps, &pgpath->path); - } -- if (r != DM_ENDIO_INCOMPLETE) -- mempool_free(mpio, m->mpio_pool); -+ mempool_free(mpio, m->mpio_pool); - - return r; - } -@@ -1427,6 +1419,75 @@ static int multipath_ioctl(struct dm_tar - bdev->bd_disk, cmd, arg); - } - -+static int __pgpath_busy(struct pgpath *pgpath) -+{ -+ struct request_queue *q = bdev_get_queue(pgpath->path.dev->bdev); -+ -+ return dm_underlying_device_busy(q); -+} -+ -+/* -+ * We return "busy", only when we can map I/Os but underlying devices -+ * are busy (so even if we map I/Os now, the I/Os will wait on -+ * the underlying queue). -+ * In other words, if we want to kill I/Os or queue them inside us -+ * due to map unavailability, we don't return "busy". Otherwise, -+ * dm core won't give us the I/Os and we can't do what we want. -+ */ -+static int multipath_busy(struct dm_target *ti) -+{ -+ int busy = 0, has_active = 0; -+ struct multipath *m = (struct multipath *) ti->private; -+ struct priority_group *pg; -+ struct pgpath *pgpath; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&m->lock, flags); -+ -+ /* Guess which priority_group will be used at next mapping time */ -+ if (unlikely(!m->current_pgpath && m->next_pg)) -+ pg = m->next_pg; -+ else if (likely(m->current_pg)) -+ pg = m->current_pg; -+ else -+ /* -+ * We don't know which pg will be used at next mapping time. -+ * We don't call __choose_pgpath() here to avoid to trigger -+ * pg_init just by busy checking. -+ * So we don't know whether underlying devices we will be using -+ * at next mapping time are busy or not. Just try mapping. -+ */ -+ goto out; -+ -+ /* -+ * If there is one non-busy active path at least, the path selector -+ * will be able to select it. So we consider such a pg as not busy. -+ */ -+ busy = 1; -+ list_for_each_entry(pgpath, &pg->pgpaths, list) -+ if (pgpath->is_active) { -+ has_active = 1; -+ -+ if (!__pgpath_busy(pgpath)) { -+ busy = 0; -+ break; -+ } -+ } -+ -+ if (!has_active) -+ /* -+ * No active path in this pg, so this pg won't be used and -+ * the current_pg will be changed at next mapping time. -+ * We need to try mapping to determine it. -+ */ -+ busy = 0; -+ -+out: -+ spin_unlock_irqrestore(&m->lock, flags); -+ -+ return busy; -+} -+ - /*----------------------------------------------------------------- - * Module setup - *---------------------------------------------------------------*/ -@@ -1436,13 +1497,14 @@ static struct target_type multipath_targ - .module = THIS_MODULE, - .ctr = multipath_ctr, - .dtr = multipath_dtr, -- .map = multipath_map, -- .end_io = multipath_end_io, -+ .map_rq = multipath_map, -+ .rq_end_io = multipath_end_io, - .presuspend = multipath_presuspend, - .resume = multipath_resume, - .status = multipath_status, - .message = multipath_message, - .ioctl = multipath_ioctl, -+ .busy = multipath_busy, - }; - - static int __init dm_multipath_init(void) ---- a/drivers/md/dm-table.c -+++ b/drivers/md/dm-table.c -@@ -108,6 +108,8 @@ static void combine_restrictions_low(str - lhs->bounce_pfn = min_not_zero(lhs->bounce_pfn, rhs->bounce_pfn); - - lhs->no_cluster |= rhs->no_cluster; -+ -+ lhs->no_request_stacking |= rhs->no_request_stacking; - } - - /* -@@ -522,6 +524,8 @@ void dm_set_device_limits(struct dm_targ - rs->bounce_pfn = min_not_zero(rs->bounce_pfn, q->bounce_pfn); - - rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); -+ -+ rs->no_request_stacking |= !blk_queue_stackable(q); - } - EXPORT_SYMBOL_GPL(dm_set_device_limits); - -@@ -731,6 +735,66 @@ int dm_table_add_target(struct dm_table - return r; - } - -+int dm_table_set_type(struct dm_table *t) -+{ -+ int i; -+ int bio_based = 0, request_based = 0; -+ struct dm_target *tgt; -+ -+ for (i = 0; i < t->num_targets; i++) { -+ tgt = t->targets + i; -+ if (tgt->type->map_rq) -+ request_based = 1; -+ else -+ bio_based = 1; -+ -+ if (bio_based && request_based) { -+ DMWARN("Inconsistent table: different target types" -+ " can't be mixed up"); -+ return -EINVAL; -+ } -+ } -+ -+ if (bio_based) { -+ /* We must use this table as bio-based */ -+ t->limits.no_request_stacking = 1; -+ return 0; -+ } -+ -+ BUG_ON(!request_based); /* No targets in this table */ -+ -+ /* Non-request-stackable devices can't be used for request-based dm */ -+ if (t->limits.no_request_stacking) { -+ DMWARN("table load rejected: including non-request-stackable" -+ " devices"); -+ return -EINVAL; -+ } -+ -+ /* -+ * Request-based dm supports only tables that have a single target now. -+ * To support multiple targets, request splitting support is needed, -+ * and that needs lots of changes in the block-layer. -+ * (e.g. request completion process for partial completion.) -+ */ -+ if (t->num_targets > 1) { -+ DMWARN("Request-based dm doesn't support multiple targets yet"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+int dm_table_get_type(struct dm_table *t) -+{ -+ return t->limits.no_request_stacking ? -+ DM_TYPE_BIO_BASED : DM_TYPE_REQUEST_BASED; -+} -+ -+int dm_table_request_based(struct dm_table *t) -+{ -+ return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED; -+} -+ - static int setup_indexes(struct dm_table *t) - { - int i; -@@ -861,6 +925,10 @@ void dm_table_set_restrictions(struct dm - else - queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q); - -+ if (t->limits.no_request_stacking) -+ queue_flag_clear_unlocked(QUEUE_FLAG_STACKABLE, q); -+ else -+ queue_flag_set_unlocked(QUEUE_FLAG_STACKABLE, q); - } - - unsigned int dm_table_get_num_targets(struct dm_table *t) -@@ -949,6 +1017,20 @@ int dm_table_any_congested(struct dm_tab - return r; - } - -+int dm_table_any_busy_target(struct dm_table *t) -+{ -+ int i; -+ struct dm_target *ti; -+ -+ for (i = 0; i < t->num_targets; i++) { -+ ti = t->targets + i; -+ if (ti->type->busy && ti->type->busy(ti)) -+ return 1; -+ } -+ -+ return 0; -+} -+ - void dm_table_unplug_all(struct dm_table *t) - { - struct dm_dev *dd; --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -46,6 +46,8 @@ typedef void (*dm_dtr_fn) (struct dm_tar diff --git a/src/patches/suse-2.6.27.25/patches.suse/rwlocks-enable-interrupts b/src/patches/suse-2.6.27.31/patches.suse/rwlocks-enable-interrupts similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/rwlocks-enable-interrupts rename to src/patches/suse-2.6.27.31/patches.suse/rwlocks-enable-interrupts diff --git a/src/patches/suse-2.6.27.25/patches.suse/s390-Kerntypes.diff b/src/patches/suse-2.6.27.31/patches.suse/s390-Kerntypes.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/s390-Kerntypes.diff rename to src/patches/suse-2.6.27.31/patches.suse/s390-Kerntypes.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/s390-System.map.diff b/src/patches/suse-2.6.27.31/patches.suse/s390-System.map.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/s390-System.map.diff rename to src/patches/suse-2.6.27.31/patches.suse/s390-System.map.diff diff --git a/src/patches/suse-2.6.27.25/patches.suse/scsi-check-removed-device-for-offline b/src/patches/suse-2.6.27.31/patches.suse/scsi-check-removed-device-for-offline similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/scsi-check-removed-device-for-offline rename to src/patches/suse-2.6.27.31/patches.suse/scsi-check-removed-device-for-offline diff --git a/src/patches/suse-2.6.27.25/patches.suse/scsi-error-test-unit-ready-timeout b/src/patches/suse-2.6.27.31/patches.suse/scsi-error-test-unit-ready-timeout similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/scsi-error-test-unit-ready-timeout rename to src/patches/suse-2.6.27.31/patches.suse/scsi-error-test-unit-ready-timeout diff --git a/src/patches/suse-2.6.27.25/patches.suse/scsi-netlink-ml b/src/patches/suse-2.6.27.31/patches.suse/scsi-netlink-ml similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/scsi-netlink-ml rename to src/patches/suse-2.6.27.31/patches.suse/scsi-netlink-ml diff --git a/src/patches/suse-2.6.27.25/patches.suse/self-ptrace.patch b/src/patches/suse-2.6.27.31/patches.suse/self-ptrace.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/self-ptrace.patch rename to src/patches/suse-2.6.27.31/patches.suse/self-ptrace.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/setuid-dumpable-wrongdir b/src/patches/suse-2.6.27.31/patches.suse/setuid-dumpable-wrongdir similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/setuid-dumpable-wrongdir rename to src/patches/suse-2.6.27.31/patches.suse/setuid-dumpable-wrongdir diff --git a/src/patches/suse-2.6.27.25/patches.suse/shmall-bigger b/src/patches/suse-2.6.27.31/patches.suse/shmall-bigger similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/shmall-bigger rename to src/patches/suse-2.6.27.31/patches.suse/shmall-bigger diff --git a/src/patches/suse-2.6.27.25/patches.suse/silent-stack-overflow b/src/patches/suse-2.6.27.31/patches.suse/silent-stack-overflow similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/silent-stack-overflow rename to src/patches/suse-2.6.27.31/patches.suse/silent-stack-overflow diff --git a/src/patches/suse-2.6.27.25/patches.suse/silent-stack-overflow-2.patch b/src/patches/suse-2.6.27.31/patches.suse/silent-stack-overflow-2.patch similarity index 95% rename from src/patches/suse-2.6.27.25/patches.suse/silent-stack-overflow-2.patch rename to src/patches/suse-2.6.27.31/patches.suse/silent-stack-overflow-2.patch index 6bb970971..768373755 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/silent-stack-overflow-2.patch +++ b/src/patches/suse-2.6.27.31/patches.suse/silent-stack-overflow-2.patch @@ -300,7 +300,7 @@ Signed-off-by: Nick Piggin bottomup: --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1182,6 +1182,7 @@ void page_cache_async_readahead(struct a +@@ -1194,6 +1194,7 @@ void page_cache_async_readahead(struct a unsigned long max_sane_readahead(unsigned long nr); /* Do stack extension */ @@ -310,7 +310,7 @@ Signed-off-by: Nick Piggin extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -1209,6 +1209,14 @@ static struct ctl_table vm_table[] = { +@@ -1207,6 +1207,14 @@ static struct ctl_table vm_table[] = { .extra2 = &one, }, #endif @@ -333,9 +333,9 @@ Signed-off-by: Nick Piggin atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0); +int heap_stack_gap __read_mostly = 1; - /* - * Check that a process has enough memory to allocate a new virtual -@@ -1290,6 +1291,8 @@ arch_get_unmapped_area(struct file *filp + /* amount of vm to protect from userspace access */ + unsigned long mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; +@@ -1293,6 +1294,8 @@ arch_get_unmapped_area(struct file *filp full_search: for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { @@ -344,7 +344,7 @@ Signed-off-by: Nick Piggin /* At this point: (!vma || addr < vma->vm_end). */ if (TASK_SIZE - len < addr) { /* -@@ -1304,15 +1307,23 @@ full_search: +@@ -1307,15 +1310,23 @@ full_search: } return -ENOMEM; } @@ -371,7 +371,7 @@ Signed-off-by: Nick Piggin addr = vma->vm_end; } } -@@ -1370,34 +1381,51 @@ arch_get_unmapped_area_topdown(struct fi +@@ -1373,34 +1384,51 @@ arch_get_unmapped_area_topdown(struct fi /* make sure it can fit in the remaining address space */ if (addr > len) { @@ -433,7 +433,7 @@ Signed-off-by: Nick Piggin } while (len < vma->vm_start); bottomup: -@@ -1620,6 +1648,19 @@ int expand_upwards(struct vm_area_struct +@@ -1623,6 +1651,19 @@ int expand_upwards(struct vm_area_struct /* Somebody else might have raced and expanded it already */ if (address > vma->vm_end) { unsigned long size, grow; @@ -453,7 +453,7 @@ Signed-off-by: Nick Piggin size = address - vma->vm_start; grow = (address - vma->vm_end) >> PAGE_SHIFT; -@@ -1628,6 +1669,7 @@ int expand_upwards(struct vm_area_struct +@@ -1631,6 +1672,7 @@ int expand_upwards(struct vm_area_struct if (!error) vma->vm_end = address; } @@ -461,7 +461,7 @@ Signed-off-by: Nick Piggin anon_vma_unlock(vma); return error; } -@@ -1664,7 +1706,21 @@ static inline int expand_downwards(struc +@@ -1667,7 +1709,21 @@ static inline int expand_downwards(struc /* Somebody else might have raced and expanded it already */ if (address < vma->vm_start) { unsigned long size, grow; @@ -483,7 +483,7 @@ Signed-off-by: Nick Piggin size = vma->vm_end - address; grow = (vma->vm_start - address) >> PAGE_SHIFT; -@@ -1674,6 +1730,7 @@ static inline int expand_downwards(struc +@@ -1677,6 +1733,7 @@ static inline int expand_downwards(struc vma->vm_pgoff -= grow; } } diff --git a/src/patches/suse-2.6.27.25/patches.suse/squashfs-3.4.patch b/src/patches/suse-2.6.27.31/patches.suse/squashfs-3.4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/squashfs-3.4.patch rename to src/patches/suse-2.6.27.31/patches.suse/squashfs-3.4.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/stack-unwind b/src/patches/suse-2.6.27.31/patches.suse/stack-unwind similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/stack-unwind rename to src/patches/suse-2.6.27.31/patches.suse/stack-unwind diff --git a/src/patches/suse-2.6.27.25/patches.suse/supported-flag b/src/patches/suse-2.6.27.31/patches.suse/supported-flag similarity index 98% rename from src/patches/suse-2.6.27.25/patches.suse/supported-flag rename to src/patches/suse-2.6.27.31/patches.suse/supported-flag index 042906d7b..6cc9f04fb 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/supported-flag +++ b/src/patches/suse-2.6.27.31/patches.suse/supported-flag @@ -60,8 +60,8 @@ Signed-off-by: Andreas Gruenbacher --- a/Makefile +++ b/Makefile -@@ -343,6 +343,11 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstric - -Werror-implicit-function-declaration +@@ -344,6 +344,11 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstric + -fno-delete-null-pointer-checks KBUILD_AFLAGS := -D__ASSEMBLY__ +# Warn about unsupported modules in kernels built inside Autobuild diff --git a/src/patches/suse-2.6.27.25/patches.suse/supported-flag-sysfs b/src/patches/suse-2.6.27.31/patches.suse/supported-flag-sysfs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/supported-flag-sysfs rename to src/patches/suse-2.6.27.31/patches.suse/supported-flag-sysfs diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-BIT b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-BIT similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-BIT rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-BIT diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-get-property b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-get-property similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-get-property rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-get-property diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-handle-mm-fault b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-handle-mm-fault similarity index 90% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-handle-mm-fault rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-handle-mm-fault index 3164d0aa1..bd42e9365 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-handle-mm-fault +++ b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-handle-mm-fault @@ -15,7 +15,7 @@ Signed-off-by: Jeff Mahoney --- a/mm/memory.c +++ b/mm/memory.c -@@ -2766,6 +2766,7 @@ int handle_mm_fault(struct mm_struct *mm +@@ -2803,6 +2803,7 @@ int handle_mm_fault(struct mm_struct *mm return handle_pte_fault(mm, vma, address, pte, pmd, write_access); } diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-ioctl b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-ioctl similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-ioctl rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-ioctl diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-kbuild.patch b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-kbuild.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-kbuild.patch rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-kbuild.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-semaphore b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-semaphore similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-semaphore rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-semaphore diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-sheep b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-sheep similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol-sheep rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol-sheep diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol.patch b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc32-mol.patch rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc32-mol.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/suse-ppc64-branding b/src/patches/suse-2.6.27.31/patches.suse/suse-ppc64-branding similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/suse-ppc64-branding rename to src/patches/suse-2.6.27.31/patches.suse/suse-ppc64-branding diff --git a/src/patches/suse-2.6.27.25/patches.suse/sysctl-add-affinity_load_balancing b/src/patches/suse-2.6.27.31/patches.suse/sysctl-add-affinity_load_balancing similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/sysctl-add-affinity_load_balancing rename to src/patches/suse-2.6.27.31/patches.suse/sysctl-add-affinity_load_balancing diff --git a/src/patches/suse-2.6.27.25/patches.suse/twofish-2.6 b/src/patches/suse-2.6.27.31/patches.suse/twofish-2.6 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/twofish-2.6 rename to src/patches/suse-2.6.27.31/patches.suse/twofish-2.6 diff --git a/src/patches/suse-2.6.27.25/patches.suse/unlock_page-speedup.patch b/src/patches/suse-2.6.27.31/patches.suse/unlock_page-speedup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/unlock_page-speedup.patch rename to src/patches/suse-2.6.27.31/patches.suse/unlock_page-speedup.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/unmap_vmas-lat b/src/patches/suse-2.6.27.31/patches.suse/unmap_vmas-lat similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/unmap_vmas-lat rename to src/patches/suse-2.6.27.31/patches.suse/unmap_vmas-lat diff --git a/src/patches/suse-2.6.27.25/patches.suse/usb-move-ehci-reg-def.patch b/src/patches/suse-2.6.27.31/patches.suse/usb-move-ehci-reg-def.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/usb-move-ehci-reg-def.patch rename to src/patches/suse-2.6.27.31/patches.suse/usb-move-ehci-reg-def.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/usb-storage-disable-delay.patch b/src/patches/suse-2.6.27.31/patches.suse/usb-storage-disable-delay.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/usb-storage-disable-delay.patch rename to src/patches/suse-2.6.27.31/patches.suse/usb-storage-disable-delay.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/usb_correct_config_ti_04b3_4543.diff b/src/patches/suse-2.6.27.31/patches.suse/usb_correct_config_ti_04b3_4543.diff similarity index 93% rename from src/patches/suse-2.6.27.25/patches.suse/usb_correct_config_ti_04b3_4543.diff rename to src/patches/suse-2.6.27.31/patches.suse/usb_correct_config_ti_04b3_4543.diff index c6c603876..911a48f0c 100644 --- a/src/patches/suse-2.6.27.25/patches.suse/usb_correct_config_ti_04b3_4543.diff +++ b/src/patches/suse-2.6.27.31/patches.suse/usb_correct_config_ti_04b3_4543.diff @@ -10,7 +10,7 @@ Signed-off-by: Oliver Neukum --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c -@@ -464,9 +464,11 @@ static int ti_startup(struct usb_serial +@@ -463,9 +463,11 @@ static int ti_startup(struct usb_serial goto free_tdev; } diff --git a/src/patches/suse-2.6.27.25/patches.suse/wireless-no-aes-select b/src/patches/suse-2.6.27.31/patches.suse/wireless-no-aes-select similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/wireless-no-aes-select rename to src/patches/suse-2.6.27.31/patches.suse/wireless-no-aes-select diff --git a/src/patches/suse-2.6.27.25/patches.suse/x86-gb-linear-map.patch b/src/patches/suse-2.6.27.31/patches.suse/x86-gb-linear-map.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/x86-gb-linear-map.patch rename to src/patches/suse-2.6.27.31/patches.suse/x86-gb-linear-map.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/x86-mark_rodata_rw-2.patch b/src/patches/suse-2.6.27.31/patches.suse/x86-mark_rodata_rw-2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/x86-mark_rodata_rw-2.patch rename to src/patches/suse-2.6.27.31/patches.suse/x86-mark_rodata_rw-2.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/x86-mark_rodata_rw.patch b/src/patches/suse-2.6.27.31/patches.suse/x86-mark_rodata_rw.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/x86-mark_rodata_rw.patch rename to src/patches/suse-2.6.27.31/patches.suse/x86-mark_rodata_rw.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/x86-usb-debug-port-early-console-v4.patch b/src/patches/suse-2.6.27.31/patches.suse/x86-usb-debug-port-early-console-v4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/x86-usb-debug-port-early-console-v4.patch rename to src/patches/suse-2.6.27.31/patches.suse/x86-usb-debug-port-early-console-v4.patch diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-account-for-allocated-blocks-when-expanding-directories b/src/patches/suse-2.6.27.31/patches.suse/xfs-account-for-allocated-blocks-when-expanding-directories similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-account-for-allocated-blocks-when-expanding-directories rename to src/patches/suse-2.6.27.31/patches.suse/xfs-account-for-allocated-blocks-when-expanding-directories diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-check-for-valid-transaction-headers-in-recovery b/src/patches/suse-2.6.27.31/patches.suse/xfs-check-for-valid-transaction-headers-in-recovery similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-check-for-valid-transaction-headers-in-recovery rename to src/patches/suse-2.6.27.31/patches.suse/xfs-check-for-valid-transaction-headers-in-recovery diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-enable b/src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-enable similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-enable rename to src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-enable diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-src b/src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-src similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-src rename to src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-src diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-xfs-enable b/src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-xfs-enable similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-dmapi-xfs-enable rename to src/patches/suse-2.6.27.31/patches.suse/xfs-dmapi-xfs-enable diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-handle-memory-allocation-failures-during-log-initialisation b/src/patches/suse-2.6.27.31/patches.suse/xfs-handle-memory-allocation-failures-during-log-initialisation similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-handle-memory-allocation-failures-during-log-initialisation rename to src/patches/suse-2.6.27.31/patches.suse/xfs-handle-memory-allocation-failures-during-log-initialisation diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-nfsd-dmapi-aware b/src/patches/suse-2.6.27.31/patches.suse/xfs-nfsd-dmapi-aware similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-nfsd-dmapi-aware rename to src/patches/suse-2.6.27.31/patches.suse/xfs-nfsd-dmapi-aware diff --git a/src/patches/suse-2.6.27.25/patches.suse/xfs-wait-for-all-IO-on-truncate-to-zero b/src/patches/suse-2.6.27.31/patches.suse/xfs-wait-for-all-IO-on-truncate-to-zero similarity index 100% rename from src/patches/suse-2.6.27.25/patches.suse/xfs-wait-for-all-IO-on-truncate-to-zero rename to src/patches/suse-2.6.27.31/patches.suse/xfs-wait-for-all-IO-on-truncate-to-zero diff --git a/src/patches/suse-2.6.27.25/patches.trace/ftrace-framepointer.diff b/src/patches/suse-2.6.27.31/patches.trace/ftrace-framepointer.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/ftrace-framepointer.diff rename to src/patches/suse-2.6.27.31/patches.trace/ftrace-framepointer.diff diff --git a/src/patches/suse-2.6.27.25/patches.trace/ftrace-port-to-tracepoints.patch b/src/patches/suse-2.6.27.31/patches.trace/ftrace-port-to-tracepoints.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/ftrace-port-to-tracepoints.patch rename to src/patches/suse-2.6.27.31/patches.trace/ftrace-port-to-tracepoints.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-filemap.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-filemap.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-filemap.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-filemap.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-fs.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-fs.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-fs.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-fs.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-hugetlb.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-hugetlb.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-hugetlb.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-hugetlb.patch index 662e1cd7c..4d4b582f9 100644 --- a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-hugetlb.patch +++ b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-hugetlb.patch @@ -218,4 +218,4 @@ Acked-by: Jan Blunck + chg = region_truncate(&inode->i_mapping->private_list, offset); spin_lock(&inode->i_lock); - inode->i_blocks -= blocks_per_huge_page(h); + inode->i_blocks -= (blocks_per_huge_page(h) * freed); diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipc.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipc.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipc.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipv4.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipv4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipv4.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipv4.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipv6.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipv6.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipv6.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-ipv6.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-irq.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-irq.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-irq.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-irq.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-kernel.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-kernel.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-kernel.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-kernel.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-memory.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-memory.patch similarity index 99% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-memory.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-memory.patch index e8ef1706a..bafaf7288 100644 --- a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-memory.patch +++ b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-memory.patch @@ -62,7 +62,7 @@ Acked-by: Jan Blunck #include "internal.h" -@@ -2832,30 +2833,44 @@ unlock: +@@ -2869,30 +2870,44 @@ unlock: int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) { diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-net.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-net.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-net.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-net.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-page_alloc.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-page_alloc.patch similarity index 94% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-page_alloc.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-page_alloc.patch index b90d678e5..86fe4f0bd 100644 --- a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-page_alloc.patch +++ b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-page_alloc.patch @@ -64,7 +64,7 @@ Acked-by: Jan Blunck /* * Array of node states. */ -@@ -528,6 +530,8 @@ static void __free_pages_ok(struct page +@@ -528,6 +530,8 @@ static void __free_pages_ok(struct page int i; int reserved = 0; @@ -73,7 +73,7 @@ Acked-by: Jan Blunck for (i = 0 ; i < (1 << order) ; ++i) reserved += free_pages_check(page + i); if (reserved) -@@ -988,6 +992,8 @@ static void free_hot_cold_page(struct pa +@@ -991,6 +995,8 @@ static void free_hot_cold_page(struct pa struct per_cpu_pages *pcp; unsigned long flags; @@ -82,7 +82,7 @@ Acked-by: Jan Blunck if (PageAnon(page)) page->mapping = NULL; if (free_pages_check(page)) -@@ -1658,6 +1664,7 @@ nopage: +@@ -1663,6 +1669,7 @@ nopage: show_mem(); } got_pg: diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-scheduler.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-scheduler.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-scheduler.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-scheduler.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-socket.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-socket.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-socket.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-socket.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-swap.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-swap.patch similarity index 98% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-swap.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-swap.patch index 5ed410064..d57cb1043 100644 --- a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-swap.patch +++ b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-swap.patch @@ -70,7 +70,7 @@ Acked-by: Jan Blunck #ifndef CONFIG_NEED_MULTIPLE_NODES /* use the per-pgdat data instead for discontigmem - mbligh */ unsigned long max_mapnr; -@@ -2420,6 +2422,7 @@ static int do_swap_page(struct mm_struct +@@ -2441,6 +2443,7 @@ static int do_swap_page(struct mm_struct /* Had to read the page from swap area: Major fault */ ret = VM_FAULT_MAJOR; count_vm_event(PGMAJFAULT); diff --git a/src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-timer.patch b/src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-timer.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-timer.patch rename to src/patches/suse-2.6.27.31/patches.trace/lttng-instrumentation-timer.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/markers-use-rcu-read-lock-sched.patch b/src/patches/suse-2.6.27.31/patches.trace/markers-use-rcu-read-lock-sched.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/markers-use-rcu-read-lock-sched.patch rename to src/patches/suse-2.6.27.31/patches.trace/markers-use-rcu-read-lock-sched.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/rcu-read-sched.patch b/src/patches/suse-2.6.27.31/patches.trace/rcu-read-sched.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/rcu-read-sched.patch rename to src/patches/suse-2.6.27.31/patches.trace/rcu-read-sched.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/s390-syscall-get-nr.diff b/src/patches/suse-2.6.27.31/patches.trace/s390-syscall-get-nr.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/s390-syscall-get-nr.diff rename to src/patches/suse-2.6.27.31/patches.trace/s390-syscall-get-nr.diff diff --git a/src/patches/suse-2.6.27.25/patches.trace/s390-utrace-enablement.patch b/src/patches/suse-2.6.27.31/patches.trace/s390-utrace-enablement.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/s390-utrace-enablement.patch rename to src/patches/suse-2.6.27.31/patches.trace/s390-utrace-enablement.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-documentation-fix-teardown.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-documentation-fix-teardown.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-documentation-fix-teardown.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-documentation-fix-teardown.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-documentation.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-documentation.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-documentation.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-documentation.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-samples-fix-teardown.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-samples-fix-teardown.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-samples-fix-teardown.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-samples-fix-teardown.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-samples.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-samples.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-samples.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-samples.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-tracepoint-synchronize-unregister.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-tracepoint-synchronize-unregister.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-tracepoint-synchronize-unregister.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-tracepoint-synchronize-unregister.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints-use-table-size-macro.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints-use-table-size-macro.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints-use-table-size-macro.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints-use-table-size-macro.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/tracepoints.patch b/src/patches/suse-2.6.27.31/patches.trace/tracepoints.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/tracepoints.patch rename to src/patches/suse-2.6.27.31/patches.trace/tracepoints.patch diff --git a/src/patches/suse-2.6.27.25/patches.trace/utrace-core b/src/patches/suse-2.6.27.31/patches.trace/utrace-core similarity index 100% rename from src/patches/suse-2.6.27.25/patches.trace/utrace-core rename to src/patches/suse-2.6.27.31/patches.trace/utrace-core diff --git a/src/patches/suse-2.6.27.25/patches.xen/735-balloon-exit.patch b/src/patches/suse-2.6.27.31/patches.xen/735-balloon-exit.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/735-balloon-exit.patch rename to src/patches/suse-2.6.27.31/patches.xen/735-balloon-exit.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/737-kexec-free.patch b/src/patches/suse-2.6.27.31/patches.xen/737-kexec-free.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/737-kexec-free.patch rename to src/patches/suse-2.6.27.31/patches.xen/737-kexec-free.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/740-blkback-resource-leak.patch b/src/patches/suse-2.6.27.31/patches.xen/740-blkback-resource-leak.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/740-blkback-resource-leak.patch rename to src/patches/suse-2.6.27.31/patches.xen/740-blkback-resource-leak.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/746-pirq-status-page.patch b/src/patches/suse-2.6.27.31/patches.xen/746-pirq-status-page.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/746-pirq-status-page.patch rename to src/patches/suse-2.6.27.31/patches.xen/746-pirq-status-page.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/747-x86-undo-mfn-limit.patch b/src/patches/suse-2.6.27.31/patches.xen/747-x86-undo-mfn-limit.patch similarity index 81% rename from src/patches/suse-2.6.27.25/patches.xen/747-x86-undo-mfn-limit.patch rename to src/patches/suse-2.6.27.31/patches.xen/747-x86-undo-mfn-limit.patch index 363d98cf4..16d2b015c 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/747-x86-undo-mfn-limit.patch +++ b/src/patches/suse-2.6.27.31/patches.xen/747-x86-undo-mfn-limit.patch @@ -9,8 +9,8 @@ Patch-mainline: obsolete Signed-off-by: Jan Beulich ---- head-2009-01-16.orig/arch/x86/mm/hypervisor.c 2009-01-16 10:17:45.000000000 +0100 -+++ head-2009-01-16/arch/x86/mm/hypervisor.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/hypervisor.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/hypervisor.c 2008-12-01 11:25:57.000000000 +0100 @@ -374,6 +374,15 @@ void xen_destroy_contiguous_region(unsig } EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region); @@ -81,8 +81,8 @@ Signed-off-by: Jan Beulich } EXPORT_SYMBOL_GPL(xen_limit_pages_to_max_mfn); ---- head-2009-01-16.orig/arch/x86/mm/pgtable_32-xen.c 2009-01-16 10:17:45.000000000 +0100 -+++ head-2009-01-16/arch/x86/mm/pgtable_32-xen.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/pgtable_32-xen.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/pgtable_32-xen.c 2008-12-01 11:25:57.000000000 +0100 @@ -152,6 +152,12 @@ pte_t *pte_alloc_one_kernel(struct mm_st return pte; } @@ -105,8 +105,8 @@ Signed-off-by: Jan Beulich init_page_count(pte); } return pte; ---- head-2009-01-16.orig/arch/x86/mm/pageattr_64-xen.c 2009-01-16 10:17:45.000000000 +0100 -+++ head-2009-01-16/arch/x86/mm/pageattr_64-xen.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/pageattr_64-xen.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/pageattr_64-xen.c 2008-12-01 11:25:57.000000000 +0100 @@ -248,13 +248,19 @@ void _arch_exit_mmap(struct mm_struct *m mm_unpin(mm); } @@ -128,8 +128,8 @@ Signed-off-by: Jan Beulich init_page_count(pte); } return pte; ---- head-2009-01-16.orig/drivers/xen/core/gnttab.c 2009-01-16 10:17:45.000000000 +0100 -+++ head-2009-01-16/drivers/xen/core/gnttab.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/drivers/xen/core/gnttab.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/xen/core/gnttab.c 2008-12-01 11:25:57.000000000 +0100 @@ -505,8 +505,9 @@ static int gnttab_map(unsigned int start return 0; } @@ -141,8 +141,8 @@ Signed-off-by: Jan Beulich ClearPageForeign(page); gnttab_reset_grant_page(page); put_page(page); ---- head-2009-01-16.orig/drivers/xen/netback/netback.c 2009-01-16 10:17:45.000000000 +0100 -+++ head-2009-01-16/drivers/xen/netback/netback.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/drivers/xen/netback/netback.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/xen/netback/netback.c 2008-12-01 11:25:57.000000000 +0100 @@ -55,7 +55,6 @@ struct netbk_tx_pending_inuse { }; @@ -162,8 +162,8 @@ Signed-off-by: Jan Beulich netif_idx_release(netif_page_index(page)); } ---- head-2009-01-16.orig/include/linux/page-flags.h 2009-01-16 10:01:00.000000000 +0100 -+++ head-2009-01-16/include/linux/page-flags.h 2009-01-16 10:20:18.000000000 +0100 +--- sle11-2009-07-31.orig/include/linux/page-flags.h 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-07-31/include/linux/page-flags.h 2009-01-16 10:20:18.000000000 +0100 @@ -277,15 +277,15 @@ CLEARPAGEFLAG(Uptodate, uptodate) #define PageForeign(page) test_bit(PG_foreign, &(page)->flags) #define SetPageForeign(_page, dtor) do { \ @@ -183,8 +183,8 @@ Signed-off-by: Jan Beulich extern void cancel_dirty_page(struct page *page, unsigned int account_size); ---- head-2009-01-16.orig/mm/page_alloc.c 2008-12-08 13:17:58.000000000 +0100 -+++ head-2009-01-16/mm/page_alloc.c 2008-12-01 11:25:57.000000000 +0100 +--- sle11-2009-07-31.orig/mm/page_alloc.c 2009-07-31 14:50:10.000000000 +0200 ++++ sle11-2009-07-31/mm/page_alloc.c 2009-07-31 14:50:39.000000000 +0200 @@ -535,7 +535,7 @@ static void __free_pages_ok(struct page #ifdef CONFIG_XEN @@ -194,7 +194,7 @@ Signed-off-by: Jan Beulich return; } #endif -@@ -1003,7 +1003,7 @@ static void free_hot_cold_page(struct pa +@@ -1006,7 +1006,7 @@ static void free_hot_cold_page(struct pa #ifdef CONFIG_XEN if (PageForeign(page)) { diff --git a/src/patches/suse-2.6.27.25/patches.xen/748-x86-ioapic-cleanup.patch b/src/patches/suse-2.6.27.31/patches.xen/748-x86-ioapic-cleanup.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/748-x86-ioapic-cleanup.patch rename to src/patches/suse-2.6.27.31/patches.xen/748-x86-ioapic-cleanup.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/761-highpte.patch b/src/patches/suse-2.6.27.31/patches.xen/761-highpte.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/761-highpte.patch rename to src/patches/suse-2.6.27.31/patches.xen/761-highpte.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/762-xencons-hvc.patch b/src/patches/suse-2.6.27.31/patches.xen/762-xencons-hvc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/762-xencons-hvc.patch rename to src/patches/suse-2.6.27.31/patches.xen/762-xencons-hvc.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/764-netback-foreign-pages.patch b/src/patches/suse-2.6.27.31/patches.xen/764-netback-foreign-pages.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/764-netback-foreign-pages.patch rename to src/patches/suse-2.6.27.31/patches.xen/764-netback-foreign-pages.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/769-evtchn-CPU-offline.patch b/src/patches/suse-2.6.27.31/patches.xen/769-evtchn-CPU-offline.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/769-evtchn-CPU-offline.patch rename to src/patches/suse-2.6.27.31/patches.xen/769-evtchn-CPU-offline.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/781-fbfront-bogus-rect.patch b/src/patches/suse-2.6.27.31/patches.xen/781-fbfront-bogus-rect.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/781-fbfront-bogus-rect.patch rename to src/patches/suse-2.6.27.31/patches.xen/781-fbfront-bogus-rect.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/782-netback-error-handling.patch b/src/patches/suse-2.6.27.31/patches.xen/782-netback-error-handling.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/782-netback-error-handling.patch rename to src/patches/suse-2.6.27.31/patches.xen/782-netback-error-handling.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/791-x86-pcifront-register-pirq.patch b/src/patches/suse-2.6.27.31/patches.xen/791-x86-pcifront-register-pirq.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/791-x86-pcifront-register-pirq.patch rename to src/patches/suse-2.6.27.31/patches.xen/791-x86-pcifront-register-pirq.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/797-pirq-range-check.patch b/src/patches/suse-2.6.27.31/patches.xen/797-pirq-range-check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/797-pirq-range-check.patch rename to src/patches/suse-2.6.27.31/patches.xen/797-pirq-range-check.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/801-pciback-no-pci_match_id.patch b/src/patches/suse-2.6.27.31/patches.xen/801-pciback-no-pci_match_id.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/801-pciback-no-pci_match_id.patch rename to src/patches/suse-2.6.27.31/patches.xen/801-pciback-no-pci_match_id.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/803-netfront-unregister-notifier.patch b/src/patches/suse-2.6.27.31/patches.xen/803-netfront-unregister-notifier.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/803-netfront-unregister-notifier.patch rename to src/patches/suse-2.6.27.31/patches.xen/803-netfront-unregister-notifier.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/805-blkfront-map-sg.patch b/src/patches/suse-2.6.27.31/patches.xen/805-blkfront-map-sg.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/805-blkfront-map-sg.patch rename to src/patches/suse-2.6.27.31/patches.xen/805-blkfront-map-sg.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/821-xenbus-state-strings.patch b/src/patches/suse-2.6.27.31/patches.xen/821-xenbus-state-strings.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/821-xenbus-state-strings.patch rename to src/patches/suse-2.6.27.31/patches.xen/821-xenbus-state-strings.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/832-ntp-interaction.patch b/src/patches/suse-2.6.27.31/patches.xen/832-ntp-interaction.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/832-ntp-interaction.patch rename to src/patches/suse-2.6.27.31/patches.xen/832-ntp-interaction.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/844-swiotlb-alloc.patch b/src/patches/suse-2.6.27.31/patches.xen/844-swiotlb-alloc.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/844-swiotlb-alloc.patch rename to src/patches/suse-2.6.27.31/patches.xen/844-swiotlb-alloc.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/848-sfc-vif-states-lock.patch b/src/patches/suse-2.6.27.31/patches.xen/848-sfc-vif-states-lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/848-sfc-vif-states-lock.patch rename to src/patches/suse-2.6.27.31/patches.xen/848-sfc-vif-states-lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/849-sfc-tx-skb-lock.patch b/src/patches/suse-2.6.27.31/patches.xen/849-sfc-tx-skb-lock.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/849-sfc-tx-skb-lock.patch rename to src/patches/suse-2.6.27.31/patches.xen/849-sfc-tx-skb-lock.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/863-blktap-vma-close.patch b/src/patches/suse-2.6.27.31/patches.xen/863-blktap-vma-close.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/863-blktap-vma-close.patch rename to src/patches/suse-2.6.27.31/patches.xen/863-blktap-vma-close.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/870-i386-critical-section.patch b/src/patches/suse-2.6.27.31/patches.xen/870-i386-critical-section.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/870-i386-critical-section.patch rename to src/patches/suse-2.6.27.31/patches.xen/870-i386-critical-section.patch diff --git a/src/patches/suse-2.6.27.31/patches.xen/897-balloon-keep-trying.patch b/src/patches/suse-2.6.27.31/patches.xen/897-balloon-keep-trying.patch new file mode 100644 index 000000000..304745f59 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/897-balloon-keep-trying.patch @@ -0,0 +1,160 @@ +From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/329ea0ccb344 +# HG changeset patch +# User Keir Fraser +# Date 1244206880 -3600 +# Node ID 329ea0ccb344c636e918cc3cd2677c24b03af5bd +# Parent f59c5daed527f3a7ddf1270480ec63028c206f31 +Subject: balloon: try harder to balloon up under memory pressure. +Patch-mainline: obsolete + +Currently if the balloon driver is unable to increase the guest's +reservation it assumes the failure was due to reaching its full +allocation, gives up on the ballooning operation and records the limit +it reached as the "hard limit". The driver will not try again until +the target is set again (even to the same value). + +However it is possible that ballooning has in fact failed due to +memory pressure in the host and therefore it is desirable to keep +attempting to reach the target in case memory becomes available. The +most likely scenario is that some guests are ballooning down while +others are ballooning up and therefore there is temporary memory +pressure while things stabilise. You would not expect a well behaved +toolstack to ask a domain to balloon to more than its allocation nor +would you expect it to deliberately over-commit memory by setting +balloon targets which exceed the total host memory. + +This patch drops the concept of a hard limit and causes the balloon +driver to retry increasing the reservation on a timer in the same +manner as when decreasing the reservation. + +Also if we partially succeed in increasing the reservation +(i.e. receive less pages than we asked for) then we may as well keep +those pages rather than returning them to Xen. + +Signed-off-by: Ian Campbell +Acked-by: jbeulich@novell.com + +--- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2008-11-25 13:31:07.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:24:00.000000000 +0200 +@@ -188,7 +188,7 @@ static void balloon_alarm(unsigned long + + static unsigned long current_target(void) + { +- unsigned long target = min(bs.target_pages, bs.hard_limit); ++ unsigned long target = bs.target_pages; + if (target > (bs.current_pages + bs.balloon_low + bs.balloon_high)) + target = bs.current_pages + bs.balloon_low + bs.balloon_high; + return target; +@@ -255,26 +255,12 @@ static int increase_reservation(unsigned + } + + set_xen_guest_handle(reservation.extent_start, frame_list); +- reservation.nr_extents = nr_pages; +- rc = HYPERVISOR_memory_op( +- XENMEM_populate_physmap, &reservation); +- if (rc < nr_pages) { +- if (rc > 0) { +- int ret; +- +- /* We hit the Xen hard limit: reprobe. */ +- reservation.nr_extents = rc; +- ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, +- &reservation); +- BUG_ON(ret != rc); +- } +- if (rc >= 0) +- bs.hard_limit = (bs.current_pages + rc - +- bs.driver_pages); ++ reservation.nr_extents = nr_pages; ++ rc = HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation); ++ if (rc < 0) + goto out; +- } + +- for (i = 0; i < nr_pages; i++) { ++ for (i = 0; i < rc; i++) { + page = balloon_retrieve(); + BUG_ON(page == NULL); + +@@ -302,13 +288,13 @@ static int increase_reservation(unsigned + balloon_free_page(page); + } + +- bs.current_pages += nr_pages; ++ bs.current_pages += rc; + totalram_pages = bs.current_pages; + + out: + balloon_unlock(flags); + +- return 0; ++ return rc < 0 ? rc : rc != nr_pages; + } + + static int decrease_reservation(unsigned long nr_pages) +@@ -420,7 +406,6 @@ static void balloon_process(void *unused + void balloon_set_new_target(unsigned long target) + { + /* No need for lock. Not read-modify-write updates. */ +- bs.hard_limit = ~0UL; + bs.target_pages = max(target, minimum_target()); + schedule_work(&balloon_worker); + } +@@ -498,17 +483,11 @@ static int balloon_read(char *page, char + "Requested target: %8lu kB\n" + "Low-mem balloon: %8lu kB\n" + "High-mem balloon: %8lu kB\n" +- "Driver pages: %8lu kB\n" +- "Xen hard limit: ", ++ "Driver pages: %8lu kB\n", + PAGES2KB(bs.current_pages), PAGES2KB(bs.target_pages), + PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high), + PAGES2KB(bs.driver_pages)); + +- if (bs.hard_limit != ~0UL) +- len += sprintf(page + len, "%8lu kB\n", +- PAGES2KB(bs.hard_limit)); +- else +- len += sprintf(page + len, " ??? kB\n"); + + *eof = 1; + return len; +@@ -539,7 +518,6 @@ static int __init balloon_init(void) + bs.balloon_low = 0; + bs.balloon_high = 0; + bs.driver_pages = 0UL; +- bs.hard_limit = ~0UL; + + init_timer(&balloon_timer); + balloon_timer.data = 0; +--- sle11-2009-06-29.orig/drivers/xen/balloon/common.h 2009-06-29 15:14:51.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/common.h 2009-06-29 15:24:00.000000000 +0200 +@@ -35,8 +35,6 @@ struct balloon_stats { + /* We aim for 'current allocation' == 'target allocation'. */ + unsigned long current_pages; + unsigned long target_pages; +- /* We may hit the hard limit in Xen. If we do then we remember it. */ +- unsigned long hard_limit; + /* + * Drivers may alter the memory reservation independently, but they + * must inform the balloon driver so we avoid hitting the hard limit. +--- sle11-2009-06-29.orig/drivers/xen/balloon/sysfs.c 2008-11-25 13:31:07.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/balloon/sysfs.c 2009-06-29 15:24:00.000000000 +0200 +@@ -53,9 +53,6 @@ + BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(bs.current_pages)); + BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(bs.balloon_low)); + BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high)); +-BALLOON_SHOW(hard_limit_kb, +- (bs.hard_limit!=~0UL) ? "%lu\n" : "???\n", +- (bs.hard_limit!=~0UL) ? PAGES2KB(bs.hard_limit) : 0); + BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(bs.driver_pages)); + + static ssize_t show_target_kb(struct sys_device *dev, char *buf) +@@ -96,7 +93,6 @@ static struct attribute *balloon_info_at + &attr_current_kb.attr, + &attr_low_kb.attr, + &attr_high_kb.attr, +- &attr_hard_limit_kb.attr, + &attr_driver_kb.attr, + NULL + }; diff --git a/src/patches/suse-2.6.27.31/patches.xen/899-kbuild-extmod.patch b/src/patches/suse-2.6.27.31/patches.xen/899-kbuild-extmod.patch new file mode 100644 index 000000000..d5b68b3ae --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/899-kbuild-extmod.patch @@ -0,0 +1,35 @@ +From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/214ff2a7c990 +# HG changeset patch +# User Keir Fraser +# Date 1245146770 -3600 +# Node ID 214ff2a7c9900f5d8bac55a569224a0029173a0f +# Parent ca12928cdafe3fcb024520c4fe2479448f2c5f46 +Subject: Fix Makefile.xen generation when building external modules +Patch-mainline: obsolete + +Otherwise, the file will be (attempted to be) put in the (possibly +read-only) source tree. + +Signed-off-by: Jan Beulich + +--- sle11-2009-06-29.orig/scripts/Makefile.build 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/scripts/Makefile.build 2009-06-29 15:27:22.000000000 +0200 +@@ -74,7 +74,8 @@ $(warning kbuild: Makefile.build is incl + endif + + ifeq ($(CONFIG_XEN),y) +-$(objtree)/scripts/Makefile.xen: $(srctree)/scripts/Makefile.xen.awk $(srctree)/scripts/Makefile.build ++Makefile.xen := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD),$(objtree)/scripts)/Makefile.xen ++$(Makefile.xen): $(srctree)/scripts/Makefile.xen.awk $(srctree)/scripts/Makefile.build + @echo ' Updating $@' + $(if $(shell echo a | $(AWK) '{ print gensub(/a/, "AA", "g"); }'),\ + ,$(error 'Your awk program does not define gensub. Use gawk or another awk with gensub')) +@@ -84,7 +85,7 @@ xen-src-single-used-m := $(patsubst $(sr + xen-single-used-m := $(xen-src-single-used-m:-xen.c=.o) + single-used-m := $(filter-out $(xen-single-used-m),$(single-used-m)) + +--include $(objtree)/scripts/Makefile.xen ++-include $(Makefile.xen) + endif + + # =========================================================================== diff --git a/src/patches/suse-2.6.27.31/patches.xen/914-dynamic-Cx-change.patch b/src/patches/suse-2.6.27.31/patches.xen/914-dynamic-Cx-change.patch new file mode 100644 index 000000000..dd004db75 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/914-dynamic-Cx-change.patch @@ -0,0 +1,24 @@ +From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/c27fe3158f21 +# HG changeset patch +# User Keir Fraser +# Date 1246890052 -3600 +# Node ID c27fe3158f211e6b331827084916fe6d464910a2 +# Parent b086278a440602f2509380d0f718343e910483eb +Subject: x86: Handle dynamic Cx state changes correctly. +Patch-mainline: obsolete + +Signed-off-by: Keir Fraser +Acked-by: jbeulich@novell.com + +--- sle11-2009-07-31.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 14:49:20.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 14:52:14.000000000 +0200 +@@ -44,9 +44,6 @@ static int xen_cx_notifier(struct acpi_p + struct xen_processor_cx *data, *buf; + struct acpi_processor_cx *cx; + +- if (action == PROCESSOR_PM_CHANGE) +- return -EINVAL; +- + /* Convert to Xen defined structure and hypercall */ + buf = kzalloc(pr->power.count * sizeof(struct xen_processor_cx), + GFP_KERNEL); diff --git a/src/patches/suse-2.6.27.25/patches.xen/add-console-use-vt b/src/patches/suse-2.6.27.31/patches.xen/add-console-use-vt similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/add-console-use-vt rename to src/patches/suse-2.6.27.31/patches.xen/add-console-use-vt diff --git a/src/patches/suse-2.6.27.25/patches.xen/gso-size-check.patch b/src/patches/suse-2.6.27.31/patches.xen/gso-size-check.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/gso-size-check.patch rename to src/patches/suse-2.6.27.31/patches.xen/gso-size-check.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/ipv6-no-autoconf b/src/patches/suse-2.6.27.31/patches.xen/ipv6-no-autoconf similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/ipv6-no-autoconf rename to src/patches/suse-2.6.27.31/patches.xen/ipv6-no-autoconf diff --git a/src/patches/suse-2.6.27.25/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch b/src/patches/suse-2.6.27.31/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch rename to src/patches/suse-2.6.27.31/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-i386.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch b/src/patches/suse-2.6.27.31/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch rename to src/patches/suse-2.6.27.31/patches.xen/linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/pci-reassign-resources b/src/patches/suse-2.6.27.31/patches.xen/pci-reassign-resources similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/pci-reassign-resources rename to src/patches/suse-2.6.27.31/patches.xen/pci-reassign-resources diff --git a/src/patches/suse-2.6.27.25/patches.xen/sfc-driverlink b/src/patches/suse-2.6.27.31/patches.xen/sfc-driverlink similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/sfc-driverlink rename to src/patches/suse-2.6.27.31/patches.xen/sfc-driverlink diff --git a/src/patches/suse-2.6.27.25/patches.xen/sfc-driverlink-conditional b/src/patches/suse-2.6.27.31/patches.xen/sfc-driverlink-conditional similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/sfc-driverlink-conditional rename to src/patches/suse-2.6.27.31/patches.xen/sfc-driverlink-conditional diff --git a/src/patches/suse-2.6.27.31/patches.xen/sfc-external-sram b/src/patches/suse-2.6.27.31/patches.xen/sfc-external-sram new file mode 100644 index 000000000..6baf31d16 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/sfc-external-sram @@ -0,0 +1,302 @@ +From: Kieran Mansley +Subject: enable access to Falcon's external SRAM +References: bnc#489105 + +Include ability to reference external SRAM on Solarflare Falcon NICs to +allow event queues to be accessed by virtualised guests. + +Acked-by: bphilips@novell.com + +--- sle11-2009-04-09.orig/drivers/net/sfc/falcon.c 2009-03-30 15:58:20.000000000 +0200 ++++ sle11-2009-04-09/drivers/net/sfc/falcon.c 2009-03-30 15:58:59.000000000 +0200 +@@ -36,12 +36,18 @@ + + /** + * struct falcon_nic_data - Falcon NIC state ++ * @sram_cfg: SRAM configuration value ++ * @tx_dc_base: Base address in SRAM of TX queue descriptor caches ++ * @rx_dc_base: Base address in SRAM of RX queue descriptor caches + * @next_buffer_table: First available buffer table id + * @resources: Resource information for driverlink client + * @pci_dev2: The secondary PCI device if present + * @i2c_data: Operations and state for I2C bit-bashing algorithm + */ + struct falcon_nic_data { ++ int sram_cfg; ++ unsigned tx_dc_base; ++ unsigned rx_dc_base; + #ifndef CONFIG_SFC_DRIVERLINK + unsigned next_buffer_table; + #else +@@ -69,11 +75,11 @@ static int disable_dma_stats; + */ + #define TX_DC_ENTRIES 16 + #define TX_DC_ENTRIES_ORDER 0 +-#define TX_DC_BASE 0x130000 ++#define TX_DC_INTERNAL_BASE 0x130000 + + #define RX_DC_ENTRIES 64 + #define RX_DC_ENTRIES_ORDER 2 +-#define RX_DC_BASE 0x100000 ++#define RX_DC_INTERNAL_BASE 0x100000 + + /* RX FIFO XOFF watermark + * +@@ -454,9 +460,17 @@ void falcon_push_buffers(struct efx_tx_q + int falcon_probe_tx(struct efx_tx_queue *tx_queue) + { + struct efx_nic *efx = tx_queue->efx; +- return falcon_alloc_special_buffer(efx, &tx_queue->txd, +- FALCON_TXD_RING_SIZE * +- sizeof(efx_qword_t)); ++ int rc = falcon_alloc_special_buffer(efx, &tx_queue->txd, ++ FALCON_TXD_RING_SIZE * ++ sizeof(efx_qword_t)); ++#ifdef CONFIG_SFC_DRIVERLINK ++ if (rc == 0) { ++ struct falcon_nic_data *nic_data = efx->nic_data; ++ nic_data->resources.txq_min = max(nic_data->resources.txq_min, ++ (unsigned)tx_queue->queue + 1); ++ } ++#endif ++ return rc; + } + + int falcon_init_tx(struct efx_tx_queue *tx_queue) +@@ -643,9 +657,17 @@ void falcon_notify_rx_desc(struct efx_rx + int falcon_probe_rx(struct efx_rx_queue *rx_queue) + { + struct efx_nic *efx = rx_queue->efx; +- return falcon_alloc_special_buffer(efx, &rx_queue->rxd, +- FALCON_RXD_RING_SIZE * +- sizeof(efx_qword_t)); ++ int rc = falcon_alloc_special_buffer(efx, &rx_queue->rxd, ++ FALCON_RXD_RING_SIZE * ++ sizeof(efx_qword_t)); ++#ifdef CONFIG_SFC_DRIVERLINK ++ if (rc == 0) { ++ struct falcon_nic_data *nic_data = efx->nic_data; ++ nic_data->resources.rxq_min = max(nic_data->resources.rxq_min, ++ (unsigned)rx_queue->queue + 1); ++ } ++#endif ++ return rc; + } + + int falcon_init_rx(struct efx_rx_queue *rx_queue) +@@ -1276,9 +1298,18 @@ int falcon_probe_eventq(struct efx_chann + { + struct efx_nic *efx = channel->efx; + unsigned int evq_size; ++ int rc; + + evq_size = FALCON_EVQ_SIZE * sizeof(efx_qword_t); +- return falcon_alloc_special_buffer(efx, &channel->eventq, evq_size); ++ rc = falcon_alloc_special_buffer(efx, &channel->eventq, evq_size); ++#ifdef CONFIG_SFC_DRIVERLINK ++ if (rc == 0) { ++ struct falcon_nic_data *nic_data = efx->nic_data; ++ nic_data->resources.evq_int_min = max(nic_data->resources.evq_int_min, ++ (unsigned)channel->evqnum + 1); ++ } ++#endif ++ return rc; + } + + int falcon_init_eventq(struct efx_channel *channel) +@@ -2285,19 +2316,22 @@ fail5: + */ + static int falcon_reset_sram(struct efx_nic *efx) + { ++ struct falcon_nic_data *nic_data = efx->nic_data; + efx_oword_t srm_cfg_reg_ker, gpio_cfg_reg_ker; +- int count; ++ int count, onchip, sram_cfg_val; + + /* Set the SRAM wake/sleep GPIO appropriately. */ ++ onchip = (nic_data->sram_cfg == SRM_NB_BSZ_ONCHIP_ONLY); + falcon_read(efx, &gpio_cfg_reg_ker, GPIO_CTL_REG_KER); + EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, GPIO1_OEN, 1); +- EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, GPIO1_OUT, 1); ++ EFX_SET_OWORD_FIELD(gpio_cfg_reg_ker, GPIO1_OUT, onchip); + falcon_write(efx, &gpio_cfg_reg_ker, GPIO_CTL_REG_KER); + + /* Initiate SRAM reset */ ++ sram_cfg_val = onchip ? 0 : nic_data->sram_cfg; + EFX_POPULATE_OWORD_2(srm_cfg_reg_ker, + SRAM_OOB_BT_INIT_EN, 1, +- SRM_NUM_BANKS_AND_BANK_SIZE, 0); ++ SRM_NUM_BANKS_AND_BANK_SIZE, sram_cfg_val); + falcon_write(efx, &srm_cfg_reg_ker, SRM_CFG_REG_KER); + + /* Wait for SRAM reset to complete */ +@@ -2324,12 +2358,14 @@ static int falcon_reset_sram(struct efx_ + /* Extract non-volatile configuration */ + static int falcon_probe_nvconfig(struct efx_nic *efx) + { ++ struct falcon_nic_data *nic_data = efx->nic_data; + struct falcon_nvconfig *nvconfig; + efx_oword_t nic_stat; + int device_id; + unsigned addr_len; + size_t offset, len; + int magic_num, struct_ver, board_rev; ++ bool onchip_sram; + int rc; + + /* Find the boot device. */ +@@ -2370,18 +2406,41 @@ static int falcon_probe_nvconfig(struct + efx->phy_type = PHY_TYPE_NONE; + efx->mii.phy_id = PHY_ADDR_INVALID; + board_rev = 0; ++ onchip_sram = true; + } else { + struct falcon_nvconfig_board_v2 *v2 = &nvconfig->board_v2; + + efx->phy_type = v2->port0_phy_type; + efx->mii.phy_id = v2->port0_phy_addr; + board_rev = le16_to_cpu(v2->board_revision); ++#ifdef CONFIG_SFC_DRIVERLINK ++ onchip_sram = EFX_OWORD_FIELD(nvconfig->nic_stat_reg, ++ ONCHIP_SRAM); ++#else ++ /* We have no use for external SRAM */ ++ onchip_sram = true; ++#endif + } + + EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mii.phy_id); + + efx_set_board_info(efx, board_rev); + ++ /* Read the SRAM configuration. The register is initialised ++ * automatically but might may been reset since boot. ++ */ ++ if (onchip_sram) { ++ nic_data->sram_cfg = SRM_NB_BSZ_ONCHIP_ONLY; ++ } else { ++ nic_data->sram_cfg = ++ EFX_OWORD_FIELD(nvconfig->srm_cfg_reg, ++ SRM_NUM_BANKS_AND_BANK_SIZE); ++ WARN_ON(nic_data->sram_cfg == SRM_NB_BSZ_RESERVED); ++ /* Replace invalid setting with the smallest defaults */ ++ if (nic_data->sram_cfg == SRM_NB_BSZ_DEFAULT) ++ nic_data->sram_cfg = SRM_NB_BSZ_1BANKS_2M; ++ } ++ + out: + kfree(nvconfig); + return rc; +@@ -2392,9 +2451,9 @@ static int falcon_probe_nvconfig(struct + * should live. */ + static int falcon_dimension_resources(struct efx_nic *efx) + { ++ struct falcon_nic_data *nic_data = efx->nic_data; + #ifdef CONFIG_SFC_DRIVERLINK + unsigned internal_dcs_entries; +- struct falcon_nic_data *nic_data = efx->nic_data; + struct efx_dl_falcon_resources *res = &nic_data->resources; + + /* Fill out the driverlink resource list */ +@@ -2427,16 +2486,64 @@ static int falcon_dimension_resources(st + break; + } + +- /* Internal SRAM only for now */ +- res->rxq_lim = internal_dcs_entries / RX_DC_ENTRIES; +- res->txq_lim = internal_dcs_entries / TX_DC_ENTRIES; +- res->buffer_table_lim = 8192; ++ if (nic_data->sram_cfg == SRM_NB_BSZ_ONCHIP_ONLY) { ++ res->rxq_lim = internal_dcs_entries / RX_DC_ENTRIES; ++ res->txq_lim = internal_dcs_entries / TX_DC_ENTRIES; ++ res->buffer_table_lim = 8192; ++ nic_data->tx_dc_base = TX_DC_INTERNAL_BASE; ++ nic_data->rx_dc_base = RX_DC_INTERNAL_BASE; ++ } else { ++ unsigned sram_bytes, vnic_bytes, max_vnics, n_vnics, dcs; ++ ++ /* Determine how much SRAM we have to play with. We have ++ * to fit buffer table and descriptor caches in. ++ */ ++ switch (nic_data->sram_cfg) { ++ case SRM_NB_BSZ_1BANKS_2M: ++ default: ++ sram_bytes = 2 * 1024 * 1024; ++ break; ++ case SRM_NB_BSZ_1BANKS_4M: ++ case SRM_NB_BSZ_2BANKS_4M: ++ sram_bytes = 4 * 1024 * 1024; ++ break; ++ case SRM_NB_BSZ_1BANKS_8M: ++ case SRM_NB_BSZ_2BANKS_8M: ++ sram_bytes = 8 * 1024 * 1024; ++ break; ++ case SRM_NB_BSZ_2BANKS_16M: ++ sram_bytes = 16 * 1024 * 1024; ++ break; ++ } ++ /* For each VNIC allow at least 512 buffer table entries ++ * and descriptor cache for an rxq and txq. Buffer table ++ * space for evqs and dmaqs is relatively trivial, so not ++ * considered in this calculation. ++ */ ++ vnic_bytes = 512 * 8 + RX_DC_ENTRIES * 8 + TX_DC_ENTRIES * 8; ++ max_vnics = sram_bytes / vnic_bytes; ++ for (n_vnics = 1; n_vnics < res->evq_timer_min + max_vnics;) ++ n_vnics *= 2; ++ res->rxq_lim = n_vnics; ++ res->txq_lim = n_vnics; ++ ++ dcs = n_vnics * TX_DC_ENTRIES * 8; ++ nic_data->tx_dc_base = sram_bytes - dcs; ++ dcs = n_vnics * RX_DC_ENTRIES * 8; ++ nic_data->rx_dc_base = nic_data->tx_dc_base - dcs; ++ res->buffer_table_lim = nic_data->rx_dc_base / 8; ++ } + + if (FALCON_IS_DUAL_FUNC(efx)) + res->flags |= EFX_DL_FALCON_DUAL_FUNC; + + if (EFX_INT_MODE_USE_MSI(efx)) + res->flags |= EFX_DL_FALCON_USE_MSI; ++#else ++ /* We ignore external SRAM */ ++ EFX_BUG_ON_PARANOID(nic_data->sram_cfg != SRM_NB_BSZ_ONCHIP_ONLY); ++ nic_data->tx_dc_base = TX_DC_INTERNAL_BASE; ++ nic_data->rx_dc_base = RX_DC_INTERNAL_BASE; + #endif + + return 0; +@@ -2586,6 +2693,7 @@ int falcon_probe_nic(struct efx_nic *efx + */ + int falcon_init_nic(struct efx_nic *efx) + { ++ struct falcon_nic_data *nic_data = efx->nic_data; + efx_oword_t temp; + unsigned thresh; + int rc; +@@ -2599,9 +2707,10 @@ int falcon_init_nic(struct efx_nic *efx) + ADR_REGION3, (3 << 16)); + falcon_write(efx, &temp, ADR_REGION_REG_KER); + +- /* Use on-chip SRAM */ ++ /* Use on-chip SRAM if wanted. */ + falcon_read(efx, &temp, NIC_STAT_REG); +- EFX_SET_OWORD_FIELD(temp, ONCHIP_SRAM, 1); ++ EFX_SET_OWORD_FIELD(temp, ONCHIP_SRAM, ++ nic_data->sram_cfg == SRM_NB_BSZ_ONCHIP_ONLY); + falcon_write(efx, &temp, NIC_STAT_REG); + + /* Set buffer table mode */ +@@ -2613,9 +2722,9 @@ int falcon_init_nic(struct efx_nic *efx) + return rc; + + /* Set positions of descriptor caches in SRAM. */ +- EFX_POPULATE_OWORD_1(temp, SRM_TX_DC_BASE_ADR, TX_DC_BASE / 8); ++ EFX_POPULATE_OWORD_1(temp, SRM_TX_DC_BASE_ADR, nic_data->tx_dc_base / 8); + falcon_write(efx, &temp, SRM_TX_DC_CFG_REG_KER); +- EFX_POPULATE_OWORD_1(temp, SRM_RX_DC_BASE_ADR, RX_DC_BASE / 8); ++ EFX_POPULATE_OWORD_1(temp, SRM_RX_DC_BASE_ADR, nic_data->rx_dc_base / 8); + falcon_write(efx, &temp, SRM_RX_DC_CFG_REG_KER); + + /* Set TX descriptor cache size. */ diff --git a/src/patches/suse-2.6.27.25/patches.xen/sfc-resource-driver b/src/patches/suse-2.6.27.31/patches.xen/sfc-resource-driver similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/sfc-resource-driver rename to src/patches/suse-2.6.27.31/patches.xen/sfc-resource-driver diff --git a/src/patches/suse-2.6.27.25/patches.xen/sfc-sync-headers b/src/patches/suse-2.6.27.31/patches.xen/sfc-sync-headers similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/sfc-sync-headers rename to src/patches/suse-2.6.27.31/patches.xen/sfc-sync-headers diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-S3-MSI b/src/patches/suse-2.6.27.31/patches.xen/xen-S3-MSI similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-S3-MSI rename to src/patches/suse-2.6.27.31/patches.xen/xen-S3-MSI diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-balloon-max-target b/src/patches/suse-2.6.27.31/patches.xen/xen-balloon-max-target similarity index 54% rename from src/patches/suse-2.6.27.25/patches.xen/xen-balloon-max-target rename to src/patches/suse-2.6.27.31/patches.xen/xen-balloon-max-target index ed2764498..d7b5a2809 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-balloon-max-target +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-balloon-max-target @@ -5,10 +5,8 @@ References: 152667, 184727 jb: Also added this to the sysfs representation. -Index: head-2008-11-25/drivers/xen/balloon/balloon.c -=================================================================== ---- head-2008-11-25.orig/drivers/xen/balloon/balloon.c 2008-11-25 13:33:56.000000000 +0100 -+++ head-2008-11-25/drivers/xen/balloon/balloon.c 2008-11-25 13:34:52.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2009-06-29 15:30:29.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:44:49.000000000 +0200 @@ -194,7 +194,7 @@ static unsigned long current_target(void return target; } @@ -18,16 +16,16 @@ Index: head-2008-11-25/drivers/xen/balloon/balloon.c { #ifndef CONFIG_XEN #define max_pfn num_physpages -@@ -421,7 +421,7 @@ void balloon_set_new_target(unsigned lon +@@ -406,7 +406,7 @@ static void balloon_process(struct work_ + void balloon_set_new_target(unsigned long target) { /* No need for lock. Not read-modify-write updates. */ - bs.hard_limit = ~0UL; - bs.target_pages = max(target, minimum_target()); + bs.target_pages = max(target, balloon_minimum_target()); schedule_work(&balloon_worker); } -@@ -496,11 +496,14 @@ static int balloon_read(char *page, char +@@ -481,10 +481,13 @@ static int balloon_read(char *page, char page, "Current allocation: %8lu kB\n" "Requested target: %8lu kB\n" @@ -35,37 +33,32 @@ Index: head-2008-11-25/drivers/xen/balloon/balloon.c + "Maximum target: %8lu kB\n" "Low-mem balloon: %8lu kB\n" "High-mem balloon: %8lu kB\n" - "Driver pages: %8lu kB\n" - "Xen hard limit: ", + "Driver pages: %8lu kB\n", PAGES2KB(bs.current_pages), PAGES2KB(bs.target_pages), + PAGES2KB(balloon_minimum_target()), PAGES2KB(num_physpages), PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high), PAGES2KB(bs.driver_pages)); -Index: head-2008-11-25/drivers/xen/balloon/common.h -=================================================================== ---- head-2008-11-25.orig/drivers/xen/balloon/common.h 2007-06-12 13:13:44.000000000 +0200 -+++ head-2008-11-25/drivers/xen/balloon/common.h 2008-11-25 13:34:52.000000000 +0100 -@@ -47,6 +47,7 @@ struct balloon_stats { - unsigned long balloon_high; - }; - -+extern unsigned long num_physpages; - extern struct balloon_stats balloon_stats; - #define bs balloon_stats - -@@ -54,5 +55,6 @@ int balloon_sysfs_init(void); +--- sle11-2009-06-29.orig/drivers/xen/balloon/common.h 2009-06-29 15:24:00.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/common.h 2009-06-29 15:43:29.000000000 +0200 +@@ -52,5 +52,6 @@ int balloon_sysfs_init(void); void balloon_sysfs_exit(void); void balloon_set_new_target(unsigned long target); +unsigned long balloon_minimum_target(void); #endif /* __XEN_BALLOON_COMMON_H__ */ -Index: head-2008-11-25/drivers/xen/balloon/sysfs.c -=================================================================== ---- head-2008-11-25.orig/drivers/xen/balloon/sysfs.c 2008-11-25 13:34:32.000000000 +0100 -+++ head-2008-11-25/drivers/xen/balloon/sysfs.c 2008-11-25 13:34:52.000000000 +0100 -@@ -53,6 +53,8 @@ +--- sle11-2009-06-29.orig/drivers/xen/balloon/sysfs.c 2009-06-29 15:31:06.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/sysfs.c 2009-06-29 15:43:35.000000000 +0200 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -53,6 +54,8 @@ static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(bs.current_pages)); @@ -73,8 +66,8 @@ Index: head-2008-11-25/drivers/xen/balloon/sysfs.c +BALLOON_SHOW(max_kb, "%lu\n", PAGES2KB(num_physpages)); BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(bs.balloon_low)); BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high)); - BALLOON_SHOW(hard_limit_kb, -@@ -97,6 +99,8 @@ static struct sysdev_attribute *balloon_ + BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(bs.driver_pages)); +@@ -94,6 +97,8 @@ static struct sysdev_attribute *balloon_ static struct attribute *balloon_info_attrs[] = { &attr_current_kb.attr, @@ -82,4 +75,4 @@ Index: head-2008-11-25/drivers/xen/balloon/sysfs.c + &attr_max_kb.attr, &attr_low_kb.attr, &attr_high_kb.attr, - &attr_hard_limit_kb.attr, + &attr_driver_kb.attr, diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blkback-bimodal-suse b/src/patches/suse-2.6.27.31/patches.xen/xen-blkback-bimodal-suse similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blkback-bimodal-suse rename to src/patches/suse-2.6.27.31/patches.xen/xen-blkback-bimodal-suse diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blkback-cdrom b/src/patches/suse-2.6.27.31/patches.xen/xen-blkback-cdrom similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blkback-cdrom rename to src/patches/suse-2.6.27.31/patches.xen/xen-blkback-cdrom diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blkfront-cdrom b/src/patches/suse-2.6.27.31/patches.xen/xen-blkfront-cdrom similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blkfront-cdrom rename to src/patches/suse-2.6.27.31/patches.xen/xen-blkfront-cdrom diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blkif-protocol-fallback-hack b/src/patches/suse-2.6.27.31/patches.xen/xen-blkif-protocol-fallback-hack similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blkif-protocol-fallback-hack rename to src/patches/suse-2.6.27.31/patches.xen/xen-blkif-protocol-fallback-hack diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blktap-vma-close-fix b/src/patches/suse-2.6.27.31/patches.xen/xen-blktap-vma-close-fix similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blktap-vma-close-fix rename to src/patches/suse-2.6.27.31/patches.xen/xen-blktap-vma-close-fix diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-blktap-write-barriers b/src/patches/suse-2.6.27.31/patches.xen/xen-blktap-write-barriers similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-blktap-write-barriers rename to src/patches/suse-2.6.27.31/patches.xen/xen-blktap-write-barriers diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-configurable-guest-devices b/src/patches/suse-2.6.27.31/patches.xen/xen-configurable-guest-devices similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-configurable-guest-devices rename to src/patches/suse-2.6.27.31/patches.xen/xen-configurable-guest-devices diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-cpufreq-report b/src/patches/suse-2.6.27.31/patches.xen/xen-cpufreq-report similarity index 64% rename from src/patches/suse-2.6.27.25/patches.xen/xen-cpufreq-report rename to src/patches/suse-2.6.27.31/patches.xen/xen-cpufreq-report index 3a257765f..184ee4a20 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-cpufreq-report +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-cpufreq-report @@ -2,11 +2,9 @@ From: jbeulich@novell.com Subject: make /proc/cpuinfo track CPU speed Patch-mainline: obsolete -Index: head-2008-10-01/arch/x86/kernel/acpi/processor_extcntl_xen.c -=================================================================== ---- head-2008-10-01.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2008-10-01 15:43:24.000000000 +0200 -+++ head-2008-10-01/arch/x86/kernel/acpi/processor_extcntl_xen.c 2008-10-01 16:44:34.000000000 +0200 -@@ -207,3 +207,14 @@ void arch_acpi_processor_init_extcntl(co +--- sle11-2009-07-31.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 14:52:14.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/acpi/processor_extcntl_xen.c 2009-07-31 15:14:03.000000000 +0200 +@@ -204,3 +204,14 @@ void arch_acpi_processor_init_extcntl(co *ops = &xen_extcntl_ops; } EXPORT_SYMBOL(arch_acpi_processor_init_extcntl); @@ -21,10 +19,8 @@ Index: head-2008-10-01/arch/x86/kernel/acpi/processor_extcntl_xen.c + + return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0; +} -Index: head-2008-10-01/include/linux/cpufreq.h -=================================================================== ---- head-2008-10-01.orig/include/linux/cpufreq.h 2008-10-01 14:44:59.000000000 +0200 -+++ head-2008-10-01/include/linux/cpufreq.h 2008-10-01 16:44:34.000000000 +0200 +--- sle11-2009-07-31.orig/include/linux/cpufreq.h 2009-07-31 14:49:20.000000000 +0200 ++++ sle11-2009-07-31/include/linux/cpufreq.h 2008-10-01 16:44:34.000000000 +0200 @@ -282,7 +282,7 @@ int cpufreq_update_policy(unsigned int c unsigned int cpufreq_get(unsigned int cpu); @@ -34,10 +30,8 @@ Index: head-2008-10-01/include/linux/cpufreq.h unsigned int cpufreq_quick_get(unsigned int cpu); #else static inline unsigned int cpufreq_quick_get(unsigned int cpu) -Index: head-2008-10-01/include/xen/interface/platform.h -=================================================================== ---- head-2008-10-01.orig/include/xen/interface/platform.h 2008-09-25 13:55:33.000000000 +0200 -+++ head-2008-10-01/include/xen/interface/platform.h 2008-10-01 16:44:34.000000000 +0200 +--- sle11-2009-07-31.orig/include/xen/interface/platform.h 2009-07-31 14:49:20.000000000 +0200 ++++ sle11-2009-07-31/include/xen/interface/platform.h 2008-10-01 16:44:34.000000000 +0200 @@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo { typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t); diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-i386-panic-on-oops b/src/patches/suse-2.6.27.31/patches.xen/xen-i386-panic-on-oops similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-i386-panic-on-oops rename to src/patches/suse-2.6.27.31/patches.xen/xen-i386-panic-on-oops diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-ipi-per-cpu-irq b/src/patches/suse-2.6.27.31/patches.xen/xen-ipi-per-cpu-irq similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-ipi-per-cpu-irq rename to src/patches/suse-2.6.27.31/patches.xen/xen-ipi-per-cpu-irq diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-kconfig-compat-3.2.0 b/src/patches/suse-2.6.27.31/patches.xen/xen-kconfig-compat-3.2.0 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-kconfig-compat-3.2.0 rename to src/patches/suse-2.6.27.31/patches.xen/xen-kconfig-compat-3.2.0 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-modular-blktap b/src/patches/suse-2.6.27.31/patches.xen/xen-modular-blktap similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-modular-blktap rename to src/patches/suse-2.6.27.31/patches.xen/xen-modular-blktap diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-netback-notify-multi b/src/patches/suse-2.6.27.31/patches.xen/xen-netback-notify-multi similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-netback-notify-multi rename to src/patches/suse-2.6.27.31/patches.xen/xen-netback-notify-multi diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-netback-nr-irqs b/src/patches/suse-2.6.27.31/patches.xen/xen-netback-nr-irqs similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-netback-nr-irqs rename to src/patches/suse-2.6.27.31/patches.xen/xen-netback-nr-irqs diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-op-packet b/src/patches/suse-2.6.27.31/patches.xen/xen-op-packet similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-op-packet rename to src/patches/suse-2.6.27.31/patches.xen/xen-op-packet diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-rt2860-build b/src/patches/suse-2.6.27.31/patches.xen/xen-rt2860-build similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-rt2860-build rename to src/patches/suse-2.6.27.31/patches.xen/xen-rt2860-build diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-scsifront-block-timeout-update b/src/patches/suse-2.6.27.31/patches.xen/xen-scsifront-block-timeout-update similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-scsifront-block-timeout-update rename to src/patches/suse-2.6.27.31/patches.xen/xen-scsifront-block-timeout-update diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-sections b/src/patches/suse-2.6.27.31/patches.xen/xen-sections similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-sections rename to src/patches/suse-2.6.27.31/patches.xen/xen-sections diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-swiotlb-heuristics b/src/patches/suse-2.6.27.31/patches.xen/xen-swiotlb-heuristics similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-swiotlb-heuristics rename to src/patches/suse-2.6.27.31/patches.xen/xen-swiotlb-heuristics diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-sysdev-suspend b/src/patches/suse-2.6.27.31/patches.xen/xen-sysdev-suspend similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-sysdev-suspend rename to src/patches/suse-2.6.27.31/patches.xen/xen-sysdev-suspend diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-virq-per-cpu-irq b/src/patches/suse-2.6.27.31/patches.xen/xen-virq-per-cpu-irq similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-virq-per-cpu-irq rename to src/patches/suse-2.6.27.31/patches.xen/xen-virq-per-cpu-irq diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-bigmem b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-bigmem similarity index 85% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-bigmem rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-bigmem index 67945f6ea..d7fb80544 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-bigmem +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-bigmem @@ -5,8 +5,8 @@ Patch-mainline: obsolete At the same time remove the non-applicable and broken support for the memmap= command line option. ---- sle11-2009-05-14.orig/arch/x86/kernel/e820-xen.c 2009-02-17 14:01:20.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/e820-xen.c 2009-03-13 16:14:19.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/e820-xen.c 2009-02-17 14:01:20.000000000 +0100 ++++ sle11-2009-07-31/arch/x86/kernel/e820-xen.c 2009-03-13 16:14:19.000000000 +0100 @@ -1308,6 +1308,26 @@ static int __init parse_memopt(char *p) i = e820.nr_map - 1; @@ -59,8 +59,8 @@ memmap= command line option. for (i = 0; i < e820.nr_map; i++) { end = e820.map[i].addr + e820.map[i].size - 1; #ifndef CONFIG_RESOURCES_64BIT ---- sle11-2009-05-14.orig/arch/x86/kernel/setup-xen.c 2008-11-17 13:58:02.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup-xen.c 2009-02-16 17:05:16.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-07-31 15:14:20.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:14:31.000000000 +0200 @@ -128,12 +128,7 @@ static struct notifier_block xen_panic_b unsigned long *phys_to_machine_mapping; EXPORT_SYMBOL(phys_to_machine_mapping); @@ -75,7 +75,7 @@ memmap= command line option. /* Raw start-of-day parameters from the hypervisor. */ start_info_t *xen_start_info; -@@ -1037,17 +1032,17 @@ void __init setup_arch(char **cmdline_p) +@@ -1036,17 +1031,17 @@ void __init setup_arch(char **cmdline_p) p2m_pages = xen_start_info->nr_pages; if (!xen_feature(XENFEAT_auto_translated_physmap)) { @@ -96,7 +96,7 @@ memmap= command line option. free_bootmem( __pa(xen_start_info->mfn_list), PFN_PHYS(PFN_UP(xen_start_info->nr_pages * -@@ -1057,15 +1052,26 @@ void __init setup_arch(char **cmdline_p) +@@ -1056,15 +1051,26 @@ void __init setup_arch(char **cmdline_p) * Initialise the list of the frames that specify the list of * frames that make up the p2m table. Used by save/restore. */ @@ -126,8 +126,8 @@ memmap= command line option. pfn_to_mfn_frame_list[k] = alloc_bootmem_pages(PAGE_SIZE); pfn_to_mfn_frame_list_list[k] = ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_percpu-xen.c 2009-03-16 16:38:16.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_percpu-xen.c 2009-03-13 16:14:41.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/setup_percpu-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup_percpu-xen.c 2009-03-13 16:14:41.000000000 +0100 @@ -211,7 +211,7 @@ static void __init setup_node_to_cpumask } @@ -137,8 +137,8 @@ memmap= command line option. pr_debug(KERN_DEBUG "Node to cpumask map at %p for %d nodes\n", map, nr_node_ids); ---- sle11-2009-05-14.orig/drivers/xen/core/machine_kexec.c 2009-03-16 16:38:16.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/machine_kexec.c 2009-03-13 16:13:15.000000000 +0100 +--- sle11-2009-07-31.orig/drivers/xen/core/machine_kexec.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-07-31/drivers/xen/core/machine_kexec.c 2009-03-13 16:13:15.000000000 +0100 @@ -57,7 +57,7 @@ void __init xen_machine_kexec_setup_reso /* allocate xen_phys_cpus */ @@ -148,8 +148,8 @@ memmap= command line option. BUG_ON(xen_phys_cpus == NULL); /* fill in xen_phys_cpus with per-cpu crash note information */ ---- sle11-2009-05-14.orig/drivers/xen/core/machine_reboot.c 2009-02-17 12:23:48.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/machine_reboot.c 2009-02-17 12:25:29.000000000 +0100 +--- sle11-2009-07-31.orig/drivers/xen/core/machine_reboot.c 2009-02-17 12:23:48.000000000 +0100 ++++ sle11-2009-07-31/drivers/xen/core/machine_reboot.c 2009-02-17 12:25:29.000000000 +0100 @@ -76,7 +76,7 @@ static void post_suspend(int suspend_can unsigned long shinfo_mfn; extern unsigned long max_pfn; diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-consistent-nmi b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-consistent-nmi similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-consistent-nmi rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-consistent-nmi diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-dcr-fallback b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-dcr-fallback similarity index 85% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-dcr-fallback rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-dcr-fallback index 162f2561e..830acd313 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-dcr-fallback +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-dcr-fallback @@ -6,8 +6,8 @@ References: 181869 This avoids losing precious special memory in places where any memory can be used. ---- sle11-2009-05-14.orig/arch/x86/mm/hypervisor.c 2009-03-16 16:17:45.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/hypervisor.c 2009-03-30 12:18:24.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/hypervisor.c 2009-03-16 16:17:45.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/hypervisor.c 2009-03-30 12:18:24.000000000 +0200 @@ -42,6 +42,7 @@ #include #include @@ -100,9 +100,9 @@ used. } EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region); ---- sle11-2009-05-14.orig/drivers/xen/balloon/balloon.c 2008-11-25 13:34:52.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/balloon/balloon.c 2009-03-16 16:40:33.000000000 +0100 -@@ -687,7 +687,7 @@ struct page **alloc_empty_pages_and_page +--- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2009-06-29 15:44:49.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:46:09.000000000 +0200 +@@ -665,7 +665,7 @@ struct page **alloc_empty_pages_and_page goto out; } @@ -111,15 +111,17 @@ used. { unsigned long flags; int i; -@@ -702,11 +702,24 @@ void free_empty_pages_and_pagevec(struct +@@ -678,13 +678,26 @@ void free_empty_pages_and_pagevec(struct + BUG_ON(page_count(pagevec[i]) != 1); + balloon_append(pagevec[i]); } ++ if (!free_vec) ++ totalram_pages = bs.current_pages -= nr_pages; balloon_unlock(flags); - kfree(pagevec); + if (free_vec) + kfree(pagevec); -+ else -+ totalram_pages = bs.current_pages -= nr_pages; schedule_work(&balloon_worker); } @@ -137,8 +139,8 @@ used. void balloon_release_driver_page(struct page *page) { unsigned long flags; ---- sle11-2009-05-14.orig/include/xen/balloon.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-05-14/include/xen/balloon.h 2009-03-16 16:40:33.000000000 +0100 +--- sle11-2009-06-29.orig/include/xen/balloon.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/xen/balloon.h 2009-03-16 16:40:33.000000000 +0100 @@ -47,6 +47,10 @@ void balloon_update_driver_allowance(lon struct page **alloc_empty_pages_and_pagevec(int nr_pages); void free_empty_pages_and_pagevec(struct page **pagevec, int nr_pages); diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-exit-mmap b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-exit-mmap similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-exit-mmap rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-exit-mmap diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-exports b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-exports similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-exports rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-exports diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-machphys-prediction b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-machphys-prediction similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-machphys-prediction rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-machphys-prediction diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-no-lapic b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-no-lapic similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-no-lapic rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-no-lapic diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-no-lazy-tlb b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-no-lazy-tlb similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-no-lazy-tlb rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-no-lazy-tlb diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-panic-no-reboot b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-panic-no-reboot similarity index 72% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-panic-no-reboot rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-panic-no-reboot index 6093f248a..2d44e96fd 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-panic-no-reboot +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-panic-no-reboot @@ -4,11 +4,9 @@ Patch-mainline: obsolete $subject says it all. -Index: head-2008-11-17/arch/x86/kernel/setup-xen.c -=================================================================== ---- head-2008-11-17.orig/arch/x86/kernel/setup-xen.c 2008-11-17 13:57:02.000000000 +0100 -+++ head-2008-11-17/arch/x86/kernel/setup-xen.c 2008-11-17 13:58:02.000000000 +0100 -@@ -701,15 +701,16 @@ void __init setup_arch(char **cmdline_p) +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-07-31 15:13:24.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:14:20.000000000 +0200 +@@ -699,15 +699,16 @@ void __init setup_arch(char **cmdline_p) unsigned long p2m_pages; struct physdev_set_iopl set_iopl; diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86-pmd-handling b/src/patches/suse-2.6.27.31/patches.xen/xen-x86-pmd-handling similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86-pmd-handling rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86-pmd-handling diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-dump-user-pgt b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-dump-user-pgt similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-dump-user-pgt rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-dump-user-pgt diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-note-init-p2m b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-note-init-p2m similarity index 90% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-note-init-p2m rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-note-init-p2m index b6954e6a2..a1bac3467 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-note-init-p2m +++ b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-note-init-p2m @@ -18,8 +18,8 @@ shouldn't be as expensive (and hence can be viewed as an optimization avoiding the spurious page fault on the local CPU), but is required when the functions are used before the page fault handler gets set up. ---- sle11-2009-05-14.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:49:32.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head64-xen.c 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:49:32.000000000 +0100 ++++ sle11-2009-07-31/arch/x86/kernel/head64-xen.c 2009-03-16 16:40:54.000000000 +0100 @@ -171,6 +171,14 @@ void __init x86_64_start_reservations(ch + (xen_start_info->nr_pt_frames << PAGE_SHIFT), "Xen provided"); @@ -35,8 +35,8 @@ when the functions are used before the page fault handler gets set up. /* * At this point everything still needed from the boot loader * or BIOS or kernel text should be early reserved or marked not ---- sle11-2009-05-14.orig/arch/x86/kernel/head_64-xen.S 2009-03-16 16:40:52.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head_64-xen.S 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/head_64-xen.S 2009-03-16 16:40:52.000000000 +0100 ++++ sle11-2009-07-31/arch/x86/kernel/head_64-xen.S 2009-03-16 16:40:54.000000000 +0100 @@ -18,6 +18,7 @@ #include #include @@ -53,9 +53,9 @@ when the functions are used before the page fault handler gets set up. ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel") ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) ---- sle11-2009-05-14.orig/arch/x86/kernel/setup-xen.c 2009-02-16 17:05:16.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup-xen.c 2009-03-16 16:40:54.000000000 +0100 -@@ -1022,7 +1022,7 @@ void __init setup_arch(char **cmdline_p) +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-07-31 15:14:31.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:14:44.000000000 +0200 +@@ -1021,7 +1021,7 @@ void __init setup_arch(char **cmdline_p) difference = xen_start_info->nr_pages - max_pfn; set_xen_guest_handle(reservation.extent_start, @@ -64,7 +64,7 @@ when the functions are used before the page fault handler gets set up. reservation.nr_extents = difference; ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation); -@@ -1039,14 +1039,86 @@ void __init setup_arch(char **cmdline_p) +@@ -1038,14 +1038,86 @@ void __init setup_arch(char **cmdline_p) phys_to_machine_mapping = alloc_bootmem_pages( max_pfn * sizeof(unsigned long)); memcpy(phys_to_machine_mapping, @@ -156,8 +156,8 @@ when the functions are used before the page fault handler gets set up. /* * Initialise the list of the frames that specify the list of ---- sle11-2009-05-14.orig/arch/x86/mm/init_64-xen.c 2009-03-16 16:40:52.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_64-xen.c 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/init_64-xen.c 2009-03-16 16:40:52.000000000 +0100 ++++ sle11-2009-07-31/arch/x86/mm/init_64-xen.c 2009-03-16 16:40:54.000000000 +0100 @@ -157,6 +157,17 @@ static unsigned long __meminitdata table static unsigned long __meminitdata table_cur; static unsigned long __meminitdata table_top; @@ -297,9 +297,9 @@ when the functions are used before the page fault handler gets set up. printk(KERN_INFO "last_map_addr: %lx end: %lx\n", last_map_addr, end); ---- sle11-2009-05-14.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:40:01.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pageattr-xen.c 2009-03-16 16:40:54.000000000 +0100 -@@ -1251,7 +1251,7 @@ static void __make_page_writable(unsigne +--- sle11-2009-07-31.orig/arch/x86/mm/pageattr-xen.c 2009-06-29 15:42:17.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/pageattr-xen.c 2009-06-29 15:46:57.000000000 +0200 +@@ -1262,7 +1262,7 @@ static void __make_page_writable(unsigne pte = lookup_address(va, &level); BUG_ON(!pte || level != PG_LEVEL_4K); @@ -308,8 +308,8 @@ when the functions are used before the page fault handler gets set up. BUG(); if (in_secondary_range(va)) { unsigned long pfn = pte_pfn(*pte); ---- sle11-2009-05-14.orig/arch/x86/mm/pgtable-xen.c 2009-04-09 14:54:18.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/mm/pgtable-xen.c 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/pgtable-xen.c 2009-04-09 14:54:18.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/pgtable-xen.c 2009-03-16 16:40:54.000000000 +0100 @@ -323,7 +323,7 @@ void __init xen_init_pgd_pin(void) if (PTRS_PER_PUD > 1) /* not folded */ SetPagePinned(virt_to_page(pud)); @@ -328,8 +328,8 @@ when the functions are used before the page fault handler gets set up. continue; SetPagePinned(pmd_page(*pmd)); } ---- sle11-2009-05-14.orig/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:38:16.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/mm/pgtable_32-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:40:54.000000000 +0100 @@ -188,6 +188,6 @@ void make_lowmem_page_writable(void *va, pte = lookup_address((unsigned long)va, &level); BUG_ON(!pte || level != PG_LEVEL_4K || !pte_present(*pte)); @@ -338,8 +338,8 @@ when the functions are used before the page fault handler gets set up. + (unsigned long)va, pte_mkwrite(*pte), UVMF_INVLPG); BUG_ON(rc); } ---- sle11-2009-05-14.orig/include/xen/interface/elfnote.h 2008-11-25 12:35:56.000000000 +0100 -+++ sle11-2009-05-14/include/xen/interface/elfnote.h 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/include/xen/interface/elfnote.h 2008-11-25 12:35:56.000000000 +0100 ++++ sle11-2009-07-31/include/xen/interface/elfnote.h 2009-03-16 16:40:54.000000000 +0100 @@ -162,9 +162,20 @@ #define XEN_ELFNOTE_SUSPEND_CANCEL 14 @@ -362,8 +362,8 @@ when the functions are used before the page fault handler gets set up. /* * System information exported through crash notes. ---- sle11-2009-05-14.orig/include/xen/interface/xen.h 2009-05-14 11:17:48.000000000 +0200 -+++ sle11-2009-05-14/include/xen/interface/xen.h 2009-03-16 16:40:54.000000000 +0100 +--- sle11-2009-07-31.orig/include/xen/interface/xen.h 2009-05-14 11:17:48.000000000 +0200 ++++ sle11-2009-07-31/include/xen/interface/xen.h 2009-03-16 16:40:54.000000000 +0100 @@ -536,6 +536,7 @@ typedef struct shared_info shared_info_t * a. relocated kernel image * b. initial ram disk [mod_start, mod_len] diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-pgd-alloc-order b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-pgd-alloc-order similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-pgd-alloc-order rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-pgd-alloc-order diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-pgd-pin b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-pgd-pin similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen-x86_64-pgd-pin rename to src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-pgd-pin diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-i386.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-i386.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-i386.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-i386.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-x86.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-x86.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-x86.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-x86.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-x86_64.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-x86_64.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-arch-x86_64.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-arch-x86_64.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-common.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-common.diff similarity index 88% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-common.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-common.diff index d771b84ee..d94e4e9fa 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-common.diff +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-common.diff @@ -11,64 +11,8 @@ take the forward porting patches: 2.6.22/kernel/timer.c 2.6.25/mm/highmem.c ---- - drivers/Makefile | 1 - drivers/acpi/Makefile | 3 - drivers/acpi/hardware/hwsleep.c | 15 - drivers/acpi/processor_core.c | 72 +++ - drivers/acpi/processor_extcntl.c | 241 +++++++++++ - drivers/acpi/processor_idle.c | 24 - - drivers/acpi/processor_perflib.c | 21 - drivers/acpi/sleep/main.c | 9 - drivers/char/agp/intel-agp.c | 10 - drivers/char/mem.c | 16 - drivers/char/tpm/Makefile | 2 - drivers/char/tpm/tpm.h | 15 - drivers/char/tpm/tpm_vtpm.c | 542 +++++++++++++++++++++++++ - drivers/char/tpm/tpm_vtpm.h | 55 ++ - drivers/char/tpm/tpm_xen.c | 722 ++++++++++++++++++++++++++++++++++ - drivers/ide/ide-lib.c | 8 - drivers/oprofile/buffer_sync.c | 87 +++- - drivers/oprofile/cpu_buffer.c | 51 +- - drivers/oprofile/cpu_buffer.h | 9 - drivers/oprofile/event_buffer.h | 3 - drivers/oprofile/oprof.c | 30 + - drivers/oprofile/oprof.h | 3 - drivers/oprofile/oprofile_files.c | 201 +++++++++ - fs/aio.c | 119 +++++ - fs/compat_ioctl.c | 19 - include/acpi/processor.h | 143 ++++++ - include/asm-generic/pci.h | 2 - include/asm-generic/pgtable.h | 4 - include/linux/aio.h | 5 - include/linux/highmem.h | 8 - include/linux/interrupt.h | 6 - include/linux/kexec.h | 13 - include/linux/mm.h | 8 - include/linux/oprofile.h | 12 - include/linux/page-flags.h | 27 + - include/linux/pci.h | 12 - include/linux/skbuff.h | 8 - include/linux/vermagic.h | 7 - kernel/irq/spurious.c | 2 - kernel/kexec.c | 71 ++- - kernel/sysctl.c | 2 - mm/memory.c | 42 + - mm/mprotect.c | 2 - mm/page_alloc.c | 12 - net/core/dev.c | 62 ++ - net/core/skbuff.c | 4 - net/ipv4/netfilter/nf_nat_proto_tcp.c | 3 - net/ipv4/netfilter/nf_nat_proto_udp.c | 4 - net/ipv4/xfrm4_output.c | 2 - scripts/Makefile.build | 14 - scripts/Makefile.lib | 6 - 51 files changed, 2673 insertions(+), 86 deletions(-) - -Index: linux-2.6.27/drivers/Makefile -=================================================================== ---- linux-2.6.27.orig/drivers/Makefile -+++ linux-2.6.27/drivers/Makefile +--- sle11-2009-07-31.orig/drivers/Makefile 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/Makefile 2009-02-16 15:58:14.000000000 +0100 @@ -37,6 +37,7 @@ obj-y += base/ block/ misc/ mfd/ net/ obj-$(CONFIG_NUBUS) += nubus/ obj-$(CONFIG_ATM) += atm/ @@ -77,10 +21,8 @@ Index: linux-2.6.27/drivers/Makefile obj-$(CONFIG_SCSI) += scsi/ obj-$(CONFIG_ATA) += ata/ obj-$(CONFIG_IDE) += ide/ -Index: linux-2.6.27/drivers/acpi/Makefile -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/Makefile -+++ linux-2.6.27/drivers/acpi/Makefile +--- sle11-2009-07-31.orig/drivers/acpi/Makefile 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/Makefile 2009-02-16 15:58:14.000000000 +0100 @@ -34,6 +34,9 @@ processor-objs += processor_core.o proce ifdef CONFIG_CPU_FREQ processor-objs += processor_perflib.o @@ -91,10 +33,8 @@ Index: linux-2.6.27/drivers/acpi/Makefile obj-y += sleep/ obj-y += bus.o glue.o -Index: linux-2.6.27/drivers/acpi/hardware/hwsleep.c -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/hardware/hwsleep.c -+++ linux-2.6.27/drivers/acpi/hardware/hwsleep.c +--- sle11-2009-07-31.orig/drivers/acpi/hardware/hwsleep.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/hardware/hwsleep.c 2009-02-16 15:58:14.000000000 +0100 @@ -241,7 +241,11 @@ acpi_status asmlinkage acpi_enter_sleep_ u32 PM1Bcontrol; struct acpi_bit_register_info *sleep_type_reg_info; @@ -132,10 +72,8 @@ Index: linux-2.6.27/drivers/acpi/hardware/hwsleep.c return_ACPI_STATUS(AE_OK); } -Index: linux-2.6.27/drivers/acpi/processor_core.c -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/processor_core.c -+++ linux-2.6.27/drivers/acpi/processor_core.c +--- sle11-2009-07-31.orig/drivers/acpi/processor_core.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/processor_core.c 2009-02-16 15:58:14.000000000 +0100 @@ -620,7 +620,8 @@ static int acpi_processor_get_info(struc */ if (pr->id == -1) { @@ -239,7 +177,7 @@ Index: linux-2.6.27/drivers/acpi/processor_core.c pr->cdev = thermal_cooling_device_register("Processor", device, &processor_cooling_ops); if (IS_ERR(pr->cdev)) { -@@ -846,7 +880,7 @@ static int acpi_processor_remove(struct +@@ -846,7 +880,7 @@ static int acpi_processor_remove(struct pr = acpi_driver_data(device); @@ -248,7 +186,7 @@ Index: linux-2.6.27/drivers/acpi/processor_core.c kfree(pr); return 0; } -@@ -872,8 +906,14 @@ static int acpi_processor_remove(struct +@@ -872,8 +906,14 @@ static int acpi_processor_remove(struct pr->cdev = NULL; } @@ -309,10 +247,8 @@ Index: linux-2.6.27/drivers/acpi/processor_core.c if (cpu_online(pr->id)) cpu_down(pr->id); -Index: linux-2.6.27/drivers/acpi/processor_extcntl.c -=================================================================== ---- /dev/null -+++ linux-2.6.27/drivers/acpi/processor_extcntl.c +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ sle11-2009-07-31/drivers/acpi/processor_extcntl.c 2009-02-16 15:58:14.000000000 +0100 @@ -0,0 +1,241 @@ +/* + * processor_extcntl.c - channel to external control logic @@ -555,10 +491,8 @@ Index: linux-2.6.27/drivers/acpi/processor_extcntl.c + kfree(perf); + return ret; +} -Index: linux-2.6.27/drivers/acpi/processor_idle.c -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/processor_idle.c -+++ linux-2.6.27/drivers/acpi/processor_idle.c +--- sle11-2009-07-31.orig/drivers/acpi/processor_idle.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/processor_idle.c 2009-06-29 15:17:44.000000000 +0200 @@ -908,7 +908,8 @@ static int acpi_processor_get_power_info */ cx.entry_method = ACPI_CSTATE_HALT; @@ -624,10 +558,8 @@ Index: linux-2.6.27/drivers/acpi/processor_idle.c return 0; } -Index: linux-2.6.27/drivers/acpi/processor_perflib.c -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/processor_perflib.c -+++ linux-2.6.27/drivers/acpi/processor_perflib.c +--- sle11-2009-07-31.orig/drivers/acpi/processor_perflib.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/processor_perflib.c 2009-02-16 15:58:14.000000000 +0100 @@ -80,6 +80,7 @@ MODULE_PARM_DESC(ignore_ppc, "If the fre static int acpi_processor_ppc_status; @@ -708,10 +640,8 @@ Index: linux-2.6.27/drivers/acpi/processor_perflib.c { int result = 0; acpi_status status = AE_OK; -Index: linux-2.6.27/drivers/acpi/sleep/main.c -=================================================================== ---- linux-2.6.27.orig/drivers/acpi/sleep/main.c -+++ linux-2.6.27/drivers/acpi/sleep/main.c +--- sle11-2009-07-31.orig/drivers/acpi/sleep/main.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/acpi/sleep/main.c 2009-02-16 15:58:14.000000000 +0100 @@ -27,6 +27,7 @@ u8 sleep_states[ACPI_S_STATE_COUNT]; static int acpi_sleep_prepare(u32 acpi_state) { @@ -743,10 +673,8 @@ Index: linux-2.6.27/drivers/acpi/sleep/main.c break; } -Index: linux-2.6.27/drivers/char/agp/intel-agp.c -=================================================================== ---- linux-2.6.27.orig/drivers/char/agp/intel-agp.c -+++ linux-2.6.27/drivers/char/agp/intel-agp.c +--- sle11-2009-07-31.orig/drivers/char/agp/intel-agp.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/char/agp/intel-agp.c 2009-02-16 15:58:14.000000000 +0100 @@ -250,6 +250,13 @@ static void *i8xx_alloc_pages(void) if (page == NULL) return NULL; @@ -771,10 +699,8 @@ Index: linux-2.6.27/drivers/char/agp/intel-agp.c put_page(page); __free_pages(page, 2); atomic_dec(&agp_bridge->current_memory_agp); -Index: linux-2.6.27/drivers/char/mem.c -=================================================================== ---- linux-2.6.27.orig/drivers/char/mem.c -+++ linux-2.6.27/drivers/char/mem.c +--- sle11-2009-07-31.orig/drivers/char/mem.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/char/mem.c 2009-02-16 15:58:14.000000000 +0100 @@ -110,6 +110,7 @@ void __attribute__((weak)) unxlate_dev_m { } @@ -791,7 +717,7 @@ Index: linux-2.6.27/drivers/char/mem.c int __attribute__((weak)) phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, unsigned long size, pgprot_t *vma_prot) -@@ -372,6 +374,9 @@ static int mmap_mem(struct file * file, +@@ -372,6 +374,9 @@ static int mmap_mem(struct file * file, static int mmap_kmem(struct file * file, struct vm_area_struct * vma) { unsigned long pfn; @@ -833,20 +759,16 @@ Index: linux-2.6.27/drivers/char/mem.c #ifdef CONFIG_DEVKMEM static const struct file_operations kmem_fops = { -Index: linux-2.6.27/drivers/char/tpm/Makefile -=================================================================== ---- linux-2.6.27.orig/drivers/char/tpm/Makefile -+++ linux-2.6.27/drivers/char/tpm/Makefile +--- sle11-2009-07-31.orig/drivers/char/tpm/Makefile 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/char/tpm/Makefile 2009-02-16 15:58:14.000000000 +0100 @@ -9,3 +9,5 @@ obj-$(CONFIG_TCG_TIS) += tpm_tis.o obj-$(CONFIG_TCG_NSC) += tpm_nsc.o obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o +obj-$(CONFIG_TCG_XEN) += tpm_xenu.o +tpm_xenu-y = tpm_xen.o tpm_vtpm.o -Index: linux-2.6.27/drivers/char/tpm/tpm.h -=================================================================== ---- linux-2.6.27.orig/drivers/char/tpm/tpm.h -+++ linux-2.6.27/drivers/char/tpm/tpm.h +--- sle11-2009-07-31.orig/drivers/char/tpm/tpm.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/char/tpm/tpm.h 2009-02-16 15:58:14.000000000 +0100 @@ -107,6 +107,9 @@ struct tpm_chip { struct dentry **bios_dir; @@ -876,10 +798,8 @@ Index: linux-2.6.27/drivers/char/tpm/tpm.h extern void tpm_get_timeouts(struct tpm_chip *); extern void tpm_gen_interrupt(struct tpm_chip *); extern void tpm_continue_selftest(struct tpm_chip *); -Index: linux-2.6.27/drivers/char/tpm/tpm_vtpm.c -=================================================================== ---- /dev/null -+++ linux-2.6.27/drivers/char/tpm/tpm_vtpm.c +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ sle11-2009-07-31/drivers/char/tpm/tpm_vtpm.c 2009-02-16 15:58:14.000000000 +0100 @@ -0,0 +1,542 @@ +/* + * Copyright (C) 2006 IBM Corporation @@ -1423,10 +1343,8 @@ Index: linux-2.6.27/drivers/char/tpm/tpm_vtpm.c + tpm_remove_hardware(dev); + kfree(vtpms); +} -Index: linux-2.6.27/drivers/char/tpm/tpm_vtpm.h -=================================================================== ---- /dev/null -+++ linux-2.6.27/drivers/char/tpm/tpm_vtpm.h +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ sle11-2009-07-31/drivers/char/tpm/tpm_vtpm.h 2009-02-16 15:58:14.000000000 +0100 @@ -0,0 +1,55 @@ +#ifndef TPM_VTPM_H +#define TPM_VTPM_H @@ -1483,10 +1401,8 @@ Index: linux-2.6.27/drivers/char/tpm/tpm_vtpm.h +} + +#endif -Index: linux-2.6.27/drivers/char/tpm/tpm_xen.c -=================================================================== ---- /dev/null -+++ linux-2.6.27/drivers/char/tpm/tpm_xen.c +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ sle11-2009-07-31/drivers/char/tpm/tpm_xen.c 2009-02-16 15:58:14.000000000 +0100 @@ -0,0 +1,722 @@ +/* + * Copyright (c) 2005, IBM Corporation @@ -2210,10 +2126,8 @@ Index: linux-2.6.27/drivers/char/tpm/tpm_xen.c +module_init(tpmif_init); + +MODULE_LICENSE("Dual BSD/GPL"); -Index: linux-2.6.27/drivers/ide/ide-lib.c -=================================================================== ---- linux-2.6.27.orig/drivers/ide/ide-lib.c -+++ linux-2.6.27/drivers/ide/ide-lib.c +--- sle11-2009-07-31.orig/drivers/ide/ide-lib.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/ide/ide-lib.c 2009-02-16 15:58:14.000000000 +0100 @@ -177,12 +177,12 @@ void ide_toggle_bounce(ide_drive_t *driv { u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ @@ -2231,10 +2145,8 @@ Index: linux-2.6.27/drivers/ide/ide-lib.c addr = *dev->dma_mask; } -Index: linux-2.6.27/drivers/oprofile/buffer_sync.c -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/buffer_sync.c -+++ linux-2.6.27/drivers/oprofile/buffer_sync.c +--- sle11-2009-07-31.orig/drivers/oprofile/buffer_sync.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/buffer_sync.c 2009-02-16 15:58:14.000000000 +0100 @@ -6,6 +6,10 @@ * * @author John Levon @@ -2402,10 +2314,8 @@ Index: linux-2.6.27/drivers/oprofile/buffer_sync.c mark_done(cpu); mutex_unlock(&buffer_mutex); -Index: linux-2.6.27/drivers/oprofile/cpu_buffer.c -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/cpu_buffer.c -+++ linux-2.6.27/drivers/oprofile/cpu_buffer.c +--- sle11-2009-07-31.orig/drivers/oprofile/cpu_buffer.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/cpu_buffer.c 2009-02-16 15:58:14.000000000 +0100 @@ -6,6 +6,10 @@ * * @author John Levon @@ -2514,10 +2424,8 @@ Index: linux-2.6.27/drivers/oprofile/cpu_buffer.c /* * This serves to avoid cpu buffer overflow, and makes sure * the task mortuary progresses -Index: linux-2.6.27/drivers/oprofile/cpu_buffer.h -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/cpu_buffer.h -+++ linux-2.6.27/drivers/oprofile/cpu_buffer.h +--- sle11-2009-07-31.orig/drivers/oprofile/cpu_buffer.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/cpu_buffer.h 2009-02-16 15:58:14.000000000 +0100 @@ -37,7 +37,7 @@ struct oprofile_cpu_buffer { volatile unsigned long tail_pos; unsigned long buffer_size; @@ -2540,10 +2448,8 @@ Index: linux-2.6.27/drivers/oprofile/cpu_buffer.h +#define CPU_DOMAIN_SWITCH 4 #endif /* OPROFILE_CPU_BUFFER_H */ -Index: linux-2.6.27/drivers/oprofile/event_buffer.h -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/event_buffer.h -+++ linux-2.6.27/drivers/oprofile/event_buffer.h +--- sle11-2009-07-31.orig/drivers/oprofile/event_buffer.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/event_buffer.h 2009-02-16 15:58:14.000000000 +0100 @@ -30,6 +30,9 @@ void wake_up_buffer_waiter(void); #define INVALID_COOKIE ~0UL #define NO_COOKIE 0UL @@ -2554,10 +2460,8 @@ Index: linux-2.6.27/drivers/oprofile/event_buffer.h extern const struct file_operations event_buffer_fops; /* mutex between sync_cpu_buffers() and the -Index: linux-2.6.27/drivers/oprofile/oprof.c -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/oprof.c -+++ linux-2.6.27/drivers/oprofile/oprof.c +--- sle11-2009-07-31.orig/drivers/oprofile/oprof.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/oprof.c 2009-02-16 15:58:14.000000000 +0100 @@ -5,6 +5,10 @@ * @remark Read the file COPYING * @@ -2602,10 +2506,8 @@ Index: linux-2.6.27/drivers/oprofile/oprof.c int oprofile_setup(void) { int err; -Index: linux-2.6.27/drivers/oprofile/oprof.h -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/oprof.h -+++ linux-2.6.27/drivers/oprofile/oprof.h +--- sle11-2009-07-31.orig/drivers/oprofile/oprof.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/oprof.h 2009-02-16 15:58:14.000000000 +0100 @@ -35,5 +35,8 @@ void oprofile_create_files(struct super_ void oprofile_timer_init(struct oprofile_operations * ops); @@ -2615,10 +2517,8 @@ Index: linux-2.6.27/drivers/oprofile/oprof.h +int oprofile_set_passive(int passive_domains[], unsigned int pdomains); #endif /* OPROF_H */ -Index: linux-2.6.27/drivers/oprofile/oprofile_files.c -=================================================================== ---- linux-2.6.27.orig/drivers/oprofile/oprofile_files.c -+++ linux-2.6.27/drivers/oprofile/oprofile_files.c +--- sle11-2009-07-31.orig/drivers/oprofile/oprofile_files.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/drivers/oprofile/oprofile_files.c 2009-02-16 15:58:14.000000000 +0100 @@ -5,15 +5,21 @@ * @remark Read the file COPYING * @@ -2642,7 +2542,7 @@ Index: linux-2.6.27/drivers/oprofile/oprofile_files.c unsigned long fs_buffer_size = 131072; unsigned long fs_cpu_buffer_size = 8192; unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */ -@@ -117,11 +123,202 @@ static ssize_t dump_write(struct file * +@@ -117,11 +123,202 @@ static ssize_t dump_write(struct file * static const struct file_operations dump_fops = { .write = dump_write, }; @@ -2846,10 +2746,8 @@ Index: linux-2.6.27/drivers/oprofile/oprofile_files.c oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops); oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size); oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed); -Index: linux-2.6.27/fs/aio.c -=================================================================== ---- linux-2.6.27.orig/fs/aio.c -+++ linux-2.6.27/fs/aio.c +--- sle11-2009-07-31.orig/fs/aio.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/fs/aio.c 2009-03-24 10:01:35.000000000 +0100 @@ -36,6 +36,11 @@ #include #include @@ -3037,10 +2935,8 @@ Index: linux-2.6.27/fs/aio.c get_ioctx(ioctx); /* io_destroy() expects us to hold a ref */ io_destroy(ioctx); -Index: linux-2.6.27/fs/compat_ioctl.c -=================================================================== ---- linux-2.6.27.orig/fs/compat_ioctl.c -+++ linux-2.6.27/fs/compat_ioctl.c +--- sle11-2009-07-31.orig/fs/compat_ioctl.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/fs/compat_ioctl.c 2009-03-24 10:01:40.000000000 +0100 @@ -114,6 +114,13 @@ #include #endif @@ -3074,10 +2970,8 @@ Index: linux-2.6.27/fs/compat_ioctl.c }; #define IOCTL_HASHSIZE 256 -Index: linux-2.6.27/include/acpi/processor.h -=================================================================== ---- linux-2.6.27.orig/include/acpi/processor.h -+++ linux-2.6.27/include/acpi/processor.h +--- sle11-2009-07-31.orig/include/acpi/processor.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/acpi/processor.h 2009-02-16 15:58:14.000000000 +0100 @@ -17,6 +17,12 @@ #define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */ #define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4 @@ -3261,10 +3155,8 @@ Index: linux-2.6.27/include/acpi/processor.h +#endif /* CONFIG_XEN */ + #endif -Index: linux-2.6.27/include/asm-generic/pci.h -=================================================================== ---- linux-2.6.27.orig/include/asm-generic/pci.h -+++ linux-2.6.27/include/asm-generic/pci.h +--- sle11-2009-07-31.orig/include/asm-generic/pci.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/asm-generic/pci.h 2009-02-16 15:58:14.000000000 +0100 @@ -43,7 +43,9 @@ pcibios_select_root(struct pci_dev *pdev return root; } @@ -3275,10 +3167,8 @@ Index: linux-2.6.27/include/asm-generic/pci.h #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) -Index: linux-2.6.27/include/asm-generic/pgtable.h -=================================================================== ---- linux-2.6.27.orig/include/asm-generic/pgtable.h -+++ linux-2.6.27/include/asm-generic/pgtable.h +--- sle11-2009-07-31.orig/include/asm-generic/pgtable.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/asm-generic/pgtable.h 2009-02-16 15:58:14.000000000 +0100 @@ -99,6 +99,10 @@ static inline void ptep_set_wrprotect(st } #endif @@ -3290,10 +3180,8 @@ Index: linux-2.6.27/include/asm-generic/pgtable.h #ifndef __HAVE_ARCH_PTE_SAME #define pte_same(A,B) (pte_val(A) == pte_val(B)) #endif -Index: linux-2.6.27/include/linux/aio.h -=================================================================== ---- linux-2.6.27.orig/include/linux/aio.h -+++ linux-2.6.27/include/linux/aio.h +--- sle11-2009-07-31.orig/include/linux/aio.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/aio.h 2009-02-16 15:58:14.000000000 +0100 @@ -199,6 +199,11 @@ struct kioctx { struct aio_ring_info ring_info; @@ -3306,10 +3194,8 @@ Index: linux-2.6.27/include/linux/aio.h }; /* prototypes */ -Index: linux-2.6.27/include/linux/highmem.h -=================================================================== ---- linux-2.6.27.orig/include/linux/highmem.h -+++ linux-2.6.27/include/linux/highmem.h +--- sle11-2009-07-31.orig/include/linux/highmem.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/highmem.h 2009-02-16 15:58:14.000000000 +0100 @@ -62,6 +62,7 @@ static inline void *kmap_atomic(struct p #endif /* CONFIG_HIGHMEM */ @@ -3350,17 +3236,15 @@ Index: linux-2.6.27/include/linux/highmem.h static inline void copy_highpage(struct page *to, struct page *from) { char *vfrom, *vto; -@@ -185,4 +191,6 @@ static inline void copy_highpage(struct +@@ -185,4 +191,6 @@ static inline void copy_highpage(struct kunmap_atomic(vto, KM_USER1); } +#endif + #endif /* _LINUX_HIGHMEM_H */ -Index: linux-2.6.27/include/linux/interrupt.h -=================================================================== ---- linux-2.6.27.orig/include/linux/interrupt.h -+++ linux-2.6.27/include/linux/interrupt.h +--- sle11-2009-07-31.orig/include/linux/interrupt.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/interrupt.h 2009-02-16 15:58:14.000000000 +0100 @@ -218,6 +218,12 @@ static inline int disable_irq_wake(unsig } #endif /* CONFIG_GENERIC_HARDIRQS */ @@ -3374,10 +3258,8 @@ Index: linux-2.6.27/include/linux/interrupt.h #ifndef __ARCH_SET_SOFTIRQ_PENDING #define set_softirq_pending(x) (local_softirq_pending() = (x)) #define or_softirq_pending(x) (local_softirq_pending() |= (x)) -Index: linux-2.6.27/include/linux/kexec.h -=================================================================== ---- linux-2.6.27.orig/include/linux/kexec.h -+++ linux-2.6.27/include/linux/kexec.h +--- sle11-2009-07-31.orig/include/linux/kexec.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/kexec.h 2009-02-16 15:58:14.000000000 +0100 @@ -46,6 +46,13 @@ KEXEC_CORE_NOTE_NAME_BYTES + \ KEXEC_CORE_NOTE_DESC_BYTES ) @@ -3405,11 +3287,9 @@ Index: linux-2.6.27/include/linux/kexec.h extern asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, struct kexec_segment __user *segments, -Index: linux-2.6.27/include/linux/mm.h -=================================================================== ---- linux-2.6.27.orig/include/linux/mm.h -+++ linux-2.6.27/include/linux/mm.h -@@ -113,6 +113,9 @@ extern unsigned int kobjsize(const void +--- sle11-2009-07-31.orig/include/linux/mm.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/mm.h 2009-06-29 15:17:31.000000000 +0200 +@@ -113,6 +113,9 @@ extern unsigned int kobjsize(const void #define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */ #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ @@ -3419,7 +3299,7 @@ Index: linux-2.6.27/include/linux/mm.h #define VM_PAGE_MKWRITE2 0x80000000 /* Uses page_mkwrite2 rather than page_mkwrite */ #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ -@@ -194,6 +197,11 @@ struct vm_operations_struct { +@@ -198,6 +201,11 @@ struct vm_operations_struct { */ int (*access)(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write); @@ -3431,10 +3311,8 @@ Index: linux-2.6.27/include/linux/mm.h #ifdef CONFIG_NUMA /* * set_policy() op must add a reference to any non-NULL @new mempolicy -Index: linux-2.6.27/include/linux/oprofile.h -=================================================================== ---- linux-2.6.27.orig/include/linux/oprofile.h -+++ linux-2.6.27/include/linux/oprofile.h +--- sle11-2009-07-31.orig/include/linux/oprofile.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/oprofile.h 2009-06-26 16:58:14.000000000 +0200 @@ -16,6 +16,8 @@ #include #include @@ -3444,7 +3322,7 @@ Index: linux-2.6.27/include/linux/oprofile.h /* Each escaped entry is prefixed by ESCAPE_CODE * then one of the following codes, then the -@@ -28,7 +30,7 @@ +@@ -28,14 +30,18 @@ #define CPU_SWITCH_CODE 2 #define COOKIE_SWITCH_CODE 3 #define KERNEL_ENTER_SWITCH_CODE 4 @@ -3453,15 +3331,18 @@ Index: linux-2.6.27/include/linux/oprofile.h #define MODULE_LOADED_CODE 6 #define CTX_TGID_CODE 7 #define TRACE_BEGIN_CODE 8 -@@ -36,6 +38,7 @@ + #define TRACE_END_CODE 9 #define XEN_ENTER_SWITCH_CODE 10 ++#ifndef CONFIG_XEN #define SPU_PROFILING_CODE 11 #define SPU_CTX_SWITCH_CODE 12 -+#define DOMAIN_SWITCH_CODE 13 ++#else ++#define DOMAIN_SWITCH_CODE 11 ++#endif struct super_block; struct dentry; -@@ -47,6 +50,11 @@ struct oprofile_operations { +@@ -47,6 +53,11 @@ struct oprofile_operations { /* create any necessary configuration files in the oprofile fs. * Optional. */ int (*create_files)(struct super_block * sb, struct dentry * root); @@ -3473,7 +3354,7 @@ Index: linux-2.6.27/include/linux/oprofile.h /* Do any necessary interrupt setup. Optional. */ int (*setup)(void); /* Do any necessary interrupt shutdown. Optional. */ -@@ -106,6 +114,8 @@ void oprofile_add_pc(unsigned long pc, i +@@ -106,6 +117,8 @@ void oprofile_add_pc(unsigned long pc, i /* add a backtrace entry, to be called from the ->backtrace callback */ void oprofile_add_trace(unsigned long eip); @@ -3482,10 +3363,8 @@ Index: linux-2.6.27/include/linux/oprofile.h /** * Create a file of the given name as a child of the given root, with -Index: linux-2.6.27/include/linux/page-flags.h -=================================================================== ---- linux-2.6.27.orig/include/linux/page-flags.h -+++ linux-2.6.27/include/linux/page-flags.h +--- sle11-2009-07-31.orig/include/linux/page-flags.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/page-flags.h 2009-02-16 15:58:14.000000000 +0100 @@ -98,6 +98,9 @@ enum pageflags { #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR PG_uncached, /* Page has been mapped as uncached */ @@ -3536,10 +3415,8 @@ Index: linux-2.6.27/include/linux/page-flags.h /* * Flags checked in bad_page(). Pages on the free list should not have -Index: linux-2.6.27/include/linux/pci.h -=================================================================== ---- linux-2.6.27.orig/include/linux/pci.h -+++ linux-2.6.27/include/linux/pci.h +--- sle11-2009-07-31.orig/include/linux/pci.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/pci.h 2009-02-16 15:58:14.000000000 +0100 @@ -211,6 +211,9 @@ struct pci_dev { * directly, use the values stored here. They might be different! */ @@ -3573,10 +3450,8 @@ Index: linux-2.6.27/include/linux/pci.h #endif #ifndef CONFIG_PCIEASPM -Index: linux-2.6.27/include/linux/skbuff.h -=================================================================== ---- linux-2.6.27.orig/include/linux/skbuff.h -+++ linux-2.6.27/include/linux/skbuff.h +--- sle11-2009-07-31.orig/include/linux/skbuff.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/skbuff.h 2009-02-16 15:58:14.000000000 +0100 @@ -217,6 +217,8 @@ typedef unsigned char *sk_buff_data_t; * @local_df: allow local fragmentation * @cloned: Head may be cloned (check refcnt to be sure) @@ -3599,10 +3474,8 @@ Index: linux-2.6.27/include/linux/skbuff.h #ifdef CONFIG_NET_DMA dma_cookie_t dma_cookie; -Index: linux-2.6.27/include/linux/vermagic.h -=================================================================== ---- linux-2.6.27.orig/include/linux/vermagic.h -+++ linux-2.6.27/include/linux/vermagic.h +--- sle11-2009-07-31.orig/include/linux/vermagic.h 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/include/linux/vermagic.h 2009-02-16 15:58:14.000000000 +0100 @@ -22,6 +22,11 @@ #else #define MODULE_VERMAGIC_MODVERSIONS "" @@ -3622,10 +3495,8 @@ Index: linux-2.6.27/include/linux/vermagic.h - MODULE_ARCH_VERMAGIC + MODULE_VERMAGIC_XEN MODULE_ARCH_VERMAGIC -Index: linux-2.6.27/kernel/irq/spurious.c -=================================================================== ---- linux-2.6.27.orig/kernel/irq/spurious.c -+++ linux-2.6.27/kernel/irq/spurious.c +--- sle11-2009-07-31.orig/kernel/irq/spurious.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/kernel/irq/spurious.c 2009-02-16 15:58:14.000000000 +0100 @@ -193,7 +193,7 @@ void note_interrupt(unsigned int irq, st */ if (time_after(jiffies, desc->last_unhandled + HZ/10)) @@ -3635,10 +3506,8 @@ Index: linux-2.6.27/kernel/irq/spurious.c desc->irqs_unhandled++; desc->last_unhandled = jiffies; if (unlikely(action_ret != IRQ_NONE)) -Index: linux-2.6.27/kernel/kexec.c -=================================================================== ---- linux-2.6.27.orig/kernel/kexec.c -+++ linux-2.6.27/kernel/kexec.c +--- sle11-2009-07-31.orig/kernel/kexec.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/kernel/kexec.c 2009-02-16 15:58:14.000000000 +0100 @@ -359,13 +359,26 @@ static int kimage_is_destination_range(s return 0; } @@ -3849,10 +3718,8 @@ Index: linux-2.6.27/kernel/kexec.c /* Install the new kernel, and Uninstall the old */ image = xchg(dest_image, image); -Index: linux-2.6.27/kernel/sysctl.c -=================================================================== ---- linux-2.6.27.orig/kernel/sysctl.c -+++ linux-2.6.27/kernel/sysctl.c +--- sle11-2009-07-31.orig/kernel/sysctl.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/kernel/sysctl.c 2009-02-16 15:58:14.000000000 +0100 @@ -751,7 +751,7 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, @@ -3862,10 +3729,8 @@ Index: linux-2.6.27/kernel/sysctl.c { .procname = "acpi_video_flags", .data = &acpi_realmode_flags, -Index: linux-2.6.27/mm/memory.c -=================================================================== ---- linux-2.6.27.orig/mm/memory.c -+++ linux-2.6.27/mm/memory.c +--- sle11-2009-07-31.orig/mm/memory.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/mm/memory.c 2009-02-16 15:58:14.000000000 +0100 @@ -446,6 +446,12 @@ struct page *vm_normal_page(struct vm_ar { unsigned long pfn; @@ -3944,10 +3809,8 @@ Index: linux-2.6.27/mm/memory.c if (!vma || (vma->vm_flags & (VM_IO | VM_PFNMAP)) || !(vm_flags & vma->vm_flags)) return i ? : -EFAULT; -Index: linux-2.6.27/mm/mprotect.c -=================================================================== ---- linux-2.6.27.orig/mm/mprotect.c -+++ linux-2.6.27/mm/mprotect.c +--- sle11-2009-07-31.orig/mm/mprotect.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/mm/mprotect.c 2009-02-16 15:58:14.000000000 +0100 @@ -92,6 +92,8 @@ static inline void change_pmd_range(stru next = pmd_addr_end(addr, end); if (pmd_none_or_clear_bad(pmd)) @@ -3957,11 +3820,9 @@ Index: linux-2.6.27/mm/mprotect.c change_pte_range(mm, pmd, addr, next, newprot, dirty_accountable); } while (pmd++, addr = next, addr != end); } -Index: linux-2.6.27/mm/page_alloc.c -=================================================================== ---- linux-2.6.27.orig/mm/page_alloc.c -+++ linux-2.6.27/mm/page_alloc.c -@@ -533,6 +533,12 @@ static void __free_pages_ok(struct page +--- sle11-2009-07-31.orig/mm/page_alloc.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/mm/page_alloc.c 2009-07-31 14:50:10.000000000 +0200 +@@ -533,6 +533,12 @@ static void __free_pages_ok(struct page int i; int reserved = 0; @@ -3974,7 +3835,7 @@ Index: linux-2.6.27/mm/page_alloc.c trace_page_free(page, order); for (i = 0 ; i < (1 << order) ; ++i) -@@ -995,6 +1001,12 @@ static void free_hot_cold_page(struct pa +@@ -998,6 +1004,12 @@ static void free_hot_cold_page(struct pa struct per_cpu_pages *pcp; unsigned long flags; @@ -3987,10 +3848,8 @@ Index: linux-2.6.27/mm/page_alloc.c trace_page_free(page, 0); if (PageAnon(page)) -Index: linux-2.6.27/net/core/dev.c -=================================================================== ---- linux-2.6.27.orig/net/core/dev.c -+++ linux-2.6.27/net/core/dev.c +--- sle11-2009-07-31.orig/net/core/dev.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/net/core/dev.c 2009-02-16 15:58:14.000000000 +0100 @@ -131,6 +131,12 @@ #include "net-sysfs.h" @@ -4088,10 +3947,8 @@ Index: linux-2.6.27/net/core/dev.c #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) EXPORT_SYMBOL(br_handle_frame_hook); -Index: linux-2.6.27/net/core/skbuff.c -=================================================================== ---- linux-2.6.27.orig/net/core/skbuff.c -+++ linux-2.6.27/net/core/skbuff.c +--- sle11-2009-07-31.orig/net/core/skbuff.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/net/core/skbuff.c 2009-02-16 15:58:14.000000000 +0100 @@ -555,6 +555,10 @@ static struct sk_buff *__skb_clone(struc n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len; n->cloned = 1; @@ -4103,10 +3960,8 @@ Index: linux-2.6.27/net/core/skbuff.c n->destructor = NULL; C(iif); C(tail); -Index: linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_tcp.c -=================================================================== ---- linux-2.6.27.orig/net/ipv4/netfilter/nf_nat_proto_tcp.c -+++ linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_tcp.c +--- sle11-2009-07-31.orig/net/ipv4/netfilter/nf_nat_proto_tcp.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/net/ipv4/netfilter/nf_nat_proto_tcp.c 2009-02-16 15:58:14.000000000 +0100 @@ -75,6 +75,9 @@ tcp_manip_pkt(struct sk_buff *skb, if (hdrsize < sizeof(*hdr)) return true; @@ -4117,10 +3972,8 @@ Index: linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_tcp.c inet_proto_csum_replace4(&hdr->check, skb, oldip, newip, 1); inet_proto_csum_replace2(&hdr->check, skb, oldport, newport, 0); return true; -Index: linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_udp.c -=================================================================== ---- linux-2.6.27.orig/net/ipv4/netfilter/nf_nat_proto_udp.c -+++ linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_udp.c +--- sle11-2009-07-31.orig/net/ipv4/netfilter/nf_nat_proto_udp.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/net/ipv4/netfilter/nf_nat_proto_udp.c 2009-02-16 15:58:14.000000000 +0100 @@ -60,6 +60,10 @@ udp_manip_pkt(struct sk_buff *skb, newport = tuple->dst.u.udp.port; portptr = &hdr->dest; @@ -4132,10 +3985,8 @@ Index: linux-2.6.27/net/ipv4/netfilter/nf_nat_proto_udp.c if (hdr->check || skb->ip_summed == CHECKSUM_PARTIAL) { inet_proto_csum_replace4(&hdr->check, skb, oldip, newip, 1); inet_proto_csum_replace2(&hdr->check, skb, *portptr, newport, -Index: linux-2.6.27/net/ipv4/xfrm4_output.c -=================================================================== ---- linux-2.6.27.orig/net/ipv4/xfrm4_output.c -+++ linux-2.6.27/net/ipv4/xfrm4_output.c +--- sle11-2009-07-31.orig/net/ipv4/xfrm4_output.c 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/net/ipv4/xfrm4_output.c 2009-02-16 15:58:14.000000000 +0100 @@ -81,7 +81,7 @@ static int xfrm4_output_finish(struct sk #endif @@ -4145,10 +3996,8 @@ Index: linux-2.6.27/net/ipv4/xfrm4_output.c } int xfrm4_output(struct sk_buff *skb) -Index: linux-2.6.27/scripts/Makefile.build -=================================================================== ---- linux-2.6.27.orig/scripts/Makefile.build -+++ linux-2.6.27/scripts/Makefile.build +--- sle11-2009-07-31.orig/scripts/Makefile.build 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/scripts/Makefile.build 2009-02-16 15:58:14.000000000 +0100 @@ -73,6 +73,20 @@ ifndef obj $(warning kbuild: Makefile.build is included improperly) endif @@ -4170,10 +4019,8 @@ Index: linux-2.6.27/scripts/Makefile.build # =========================================================================== ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),) -Index: linux-2.6.27/scripts/Makefile.lib -=================================================================== ---- linux-2.6.27.orig/scripts/Makefile.lib -+++ linux-2.6.27/scripts/Makefile.lib +--- sle11-2009-07-31.orig/scripts/Makefile.lib 2009-07-31 14:49:21.000000000 +0200 ++++ sle11-2009-07-31/scripts/Makefile.lib 2009-02-16 15:58:14.000000000 +0100 @@ -17,6 +17,12 @@ obj-m := $(filter-out $(obj-y),$(obj-m)) lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-include-xen-interface.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-include-xen-interface.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-include-xen-interface.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-include-xen-interface.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-arch.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-arch.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-arch.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-arch.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-drivers.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-drivers.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-drivers.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-drivers.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-kconfig.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-kconfig.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-auto-xen-kconfig.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-auto-xen-kconfig.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-arch-x86 b/src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-arch-x86 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-arch-x86 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-arch-x86 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-common b/src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-common similarity index 84% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-common rename to src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-common index e5711223e..2504696d3 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-common +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-common @@ -2,8 +2,8 @@ Subject: Fix xen build. From: jbeulich@novell.com Patch-mainline: obsolete ---- sle11-2009-02-16.orig/drivers/acpi/hardware/hwsleep.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/acpi/hardware/hwsleep.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/acpi/hardware/hwsleep.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/acpi/hardware/hwsleep.c 2009-02-16 16:01:39.000000000 +0100 @@ -430,6 +430,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_stat * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * @@ -20,8 +20,8 @@ Patch-mainline: obsolete /******************************************************************************* * ---- sle11-2009-02-16.orig/drivers/base/cpu.c 2008-10-10 00:13:53.000000000 +0200 -+++ sle11-2009-02-16/drivers/base/cpu.c 2009-02-17 11:26:03.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/base/cpu.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/base/cpu.c 2009-02-17 11:26:03.000000000 +0100 @@ -78,7 +78,7 @@ static inline void register_cpu_control( } #endif /* CONFIG_HOTPLUG_CPU */ @@ -40,8 +40,8 @@ Patch-mainline: obsolete if (!error) error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes); #endif ---- sle11-2009-02-16.orig/drivers/ide/ide-lib.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/ide/ide-lib.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/ide/ide-lib.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/ide/ide-lib.c 2009-02-16 16:01:39.000000000 +0100 @@ -177,6 +177,16 @@ void ide_toggle_bounce(ide_drive_t *driv { u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ @@ -67,8 +67,8 @@ Patch-mainline: obsolete if (drive->queue) blk_queue_bounce_limit(drive->queue, addr); ---- sle11-2009-02-16.orig/drivers/oprofile/buffer_sync.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/oprofile/buffer_sync.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/oprofile/buffer_sync.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/oprofile/buffer_sync.c 2009-02-16 16:01:39.000000000 +0100 @@ -44,7 +44,9 @@ static cpumask_t marked_cpus = CPU_MASK_ static DEFINE_SPINLOCK(task_mortuary); static void process_task_mortuary(void); @@ -180,8 +180,8 @@ Patch-mainline: obsolete mark_done(cpu); ---- sle11-2009-02-16.orig/drivers/oprofile/cpu_buffer.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/oprofile/cpu_buffer.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/oprofile/cpu_buffer.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/oprofile/cpu_buffer.c 2009-02-16 16:01:39.000000000 +0100 @@ -38,7 +38,11 @@ static void wq_sync_buffer(struct work_s #define DEFAULT_TIMER_EXPIRE (HZ / 10) static int work_enabled; @@ -210,8 +210,8 @@ Patch-mainline: obsolete /* * This serves to avoid cpu buffer overflow, and makes sure ---- sle11-2009-02-16.orig/drivers/oprofile/oprof.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/oprofile/oprof.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/oprofile/oprof.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/oprofile/oprof.c 2009-02-16 16:01:39.000000000 +0100 @@ -37,6 +37,7 @@ static DEFINE_MUTEX(start_mutex); */ static int timer = 0; @@ -228,8 +228,8 @@ Patch-mainline: obsolete int oprofile_setup(void) { ---- sle11-2009-02-16.orig/drivers/oprofile/oprofile_files.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/drivers/oprofile/oprofile_files.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/oprofile/oprofile_files.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/oprofile/oprofile_files.c 2009-02-16 16:01:39.000000000 +0100 @@ -124,6 +124,8 @@ static const struct file_operations dump .write = dump_write, }; @@ -256,9 +256,9 @@ Patch-mainline: obsolete oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops); oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size); oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed); ---- sle11-2009-02-16.orig/include/linux/mm.h 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/include/linux/mm.h 2009-02-16 16:01:39.000000000 +0100 -@@ -187,10 +187,12 @@ struct vm_operations_struct { +--- sle11-2009-06-29.orig/include/linux/mm.h 2009-06-29 15:17:31.000000000 +0200 ++++ sle11-2009-06-29/include/linux/mm.h 2009-06-29 15:27:58.000000000 +0200 +@@ -202,10 +202,12 @@ struct vm_operations_struct { int (*access)(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write); @@ -271,8 +271,8 @@ Patch-mainline: obsolete #ifdef CONFIG_NUMA /* * set_policy() op must add a reference to any non-NULL @new mempolicy ---- sle11-2009-02-16.orig/include/linux/oprofile.h 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/include/linux/oprofile.h 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/include/linux/oprofile.h 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/include/linux/oprofile.h 2009-06-29 15:28:01.000000000 +0200 @@ -16,8 +16,9 @@ #include #include @@ -284,7 +284,7 @@ Patch-mainline: obsolete /* Each escaped entry is prefixed by ESCAPE_CODE * then one of the following codes, then the -@@ -50,11 +51,12 @@ struct oprofile_operations { +@@ -53,11 +54,12 @@ struct oprofile_operations { /* create any necessary configuration files in the oprofile fs. * Optional. */ int (*create_files)(struct super_block * sb, struct dentry * root); @@ -298,8 +298,8 @@ Patch-mainline: obsolete /* Do any necessary interrupt setup. Optional. */ int (*setup)(void); /* Do any necessary interrupt shutdown. Optional. */ ---- sle11-2009-02-16.orig/kernel/kexec.c 2008-11-25 13:31:12.000000000 +0100 -+++ sle11-2009-02-16/kernel/kexec.c 2009-02-17 11:27:16.000000000 +0100 +--- sle11-2009-06-29.orig/kernel/kexec.c 2008-11-25 13:31:12.000000000 +0100 ++++ sle11-2009-06-29/kernel/kexec.c 2009-02-17 11:27:16.000000000 +0100 @@ -44,8 +44,10 @@ #include #endif @@ -343,8 +343,8 @@ Patch-mainline: obsolete #ifdef CONFIG_SYSCTL register_sysctl_table(kexec_sys_table); #endif ---- sle11-2009-02-16.orig/mm/memory.c 2009-02-17 11:19:46.000000000 +0100 -+++ sle11-2009-02-16/mm/memory.c 2009-02-16 16:01:39.000000000 +0100 +--- sle11-2009-06-29.orig/mm/memory.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/mm/memory.c 2009-02-16 16:01:39.000000000 +0100 @@ -758,10 +758,12 @@ static unsigned long zap_pte_range(struc page->index > details->last_index)) continue; diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-kconfig b/src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-kconfig similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-kconfig rename to src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-kconfig diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-xen b/src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-xen similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-fixup-xen rename to src/patches/suse-2.6.27.31/patches.xen/xen3-fixup-xen diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-intel-ibex-peak-device-ids.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-intel-ibex-peak-device-ids.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-intel-ibex-peak-device-ids.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-intel-ibex-peak-device-ids.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-kdb-x86 b/src/patches/suse-2.6.27.31/patches.xen/xen3-kdb-x86 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-kdb-x86 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-kdb-x86 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-panic-on-io-nmi.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-panic-on-io-nmi.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-panic-on-io-nmi.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-panic-on-io-nmi.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.18 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.18 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.18 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.18 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.19 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.19 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.19 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.19 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.20 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.20 similarity index 94% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.20 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.20 index efc3d6b74..88c02c9f0 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.20 +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.20 @@ -6,8 +6,8 @@ Automatically created from "patches.kernel.org/patch-2.6.20" by xen-port-patches Acked-by: jbeulich@novell.com ---- sle11-2009-05-14.orig/arch/x86/Kconfig 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/Kconfig 2009-02-05 10:22:19.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/Kconfig 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig 2009-02-05 10:22:19.000000000 +0100 @@ -1431,7 +1431,7 @@ config PHYSICAL_START config RELOCATABLE @@ -17,8 +17,8 @@ Acked-by: jbeulich@novell.com help This builds a kernel image that retains relocation information so it can be loaded someplace besides the default 1MB. ---- sle11-2009-05-14.orig/arch/x86/kernel/asm-offsets_32.c 2008-11-25 12:35:53.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/asm-offsets_32.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/asm-offsets_32.c 2008-11-25 12:35:53.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/asm-offsets_32.c 2008-12-15 11:26:44.000000000 +0100 @@ -54,6 +54,7 @@ void foo(void) OFFSET(TI_exec_domain, thread_info, exec_domain); OFFSET(TI_flags, thread_info, flags); @@ -39,8 +39,8 @@ Acked-by: jbeulich@novell.com #ifdef CONFIG_PARAVIRT BLANK(); OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); ---- sle11-2009-05-14.orig/arch/x86/kernel/cpu/common-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/cpu/common-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/common-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/common-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -22,6 +22,7 @@ #define phys_pkg_id(a,b) a #endif @@ -438,8 +438,8 @@ Acked-by: jbeulich@novell.com #ifdef CONFIG_HOTPLUG_CPU void __cpuinit cpu_uninit(void) { ---- sle11-2009-05-14.orig/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/cpu/mtrr/main-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/mtrr/main-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -12,7 +12,7 @@ static DEFINE_MUTEX(mtrr_mutex); @@ -460,7 +460,7 @@ Acked-by: jbeulich@novell.com struct xen_platform_op op; --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/kernel/e820_32-xen.c 2008-12-15 11:26:44.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/e820_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -0,0 +1,1015 @@ +#include +#include @@ -1477,8 +1477,8 @@ Acked-by: jbeulich@novell.com + return 0; +} +early_param("memmap", parse_memmap); ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:07:47.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:08:06.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:07:47.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:08:06.000000000 +0200 @@ -30,12 +30,13 @@ * 18(%esp) - %eax * 1C(%esp) - %ds @@ -2249,8 +2249,8 @@ Acked-by: jbeulich@novell.com ENTRY(fixup_4gb_segment) RING0_EC_FRAME pushl $do_fixup_4gb_segment ---- sle11-2009-05-14.orig/arch/x86/kernel/head_32-xen.S 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head_32-xen.S 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/head_32-xen.S 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head_32-xen.S 2008-12-15 11:26:44.000000000 +0100 @@ -9,6 +9,7 @@ #include #include @@ -2367,8 +2367,8 @@ Acked-by: jbeulich@novell.com .ascii ",FEATURES=writable_page_tables" .ascii "|writable_descriptor_tables" .ascii "|auto_translated_physmap" ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -34,6 +34,7 @@ #include #include @@ -2561,8 +2561,8 @@ Acked-by: jbeulich@novell.com set_native_irq_info(irq, TARGET_CPUS); spin_unlock_irqrestore(&ioapic_lock, flags); ---- sle11-2009-05-14.orig/arch/x86/kernel/ldt_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/ldt_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ldt_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -177,16 +177,14 @@ static int read_default_ldt(void __user { int err; @@ -2581,8 +2581,8 @@ Acked-by: jbeulich@novell.com err = -EFAULT; return err; ---- sle11-2009-05-14.orig/arch/x86/kernel/microcode-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/microcode-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/microcode-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/microcode-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -1,7 +1,7 @@ /* * Intel CPU Microcode Update Driver for Linux @@ -2610,8 +2610,8 @@ Acked-by: jbeulich@novell.com return 0; } ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -36,7 +36,7 @@ /* Have we found an MP table */ @@ -2661,8 +2661,8 @@ Acked-by: jbeulich@novell.com { struct mpc_config_processor processor; int boot_cpu = 0; ---- sle11-2009-05-14.orig/arch/x86/kernel/pci-dma-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/pci-dma-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/pci-dma-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/pci-dma-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -276,7 +276,7 @@ EXPORT_SYMBOL(dma_free_coherent); int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, dma_addr_t device_addr, size_t size, int flags) @@ -2698,8 +2698,8 @@ Acked-by: jbeulich@novell.com return 0; } EXPORT_SYMBOL(dma_declare_coherent_memory); ---- sle11-2009-05-14.orig/arch/x86/kernel/process_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -60,6 +60,7 @@ #include @@ -2824,8 +2824,8 @@ Acked-by: jbeulich@novell.com return prev_p; } ---- sle11-2009-05-14.orig/arch/x86/kernel/quirks-xen.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/quirks-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/quirks-xen.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/quirks-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -3,10 +3,12 @@ */ #include @@ -2922,8 +2922,8 @@ Acked-by: jbeulich@novell.com +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, verify_quirk_intel_irqbalance); + #endif ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -76,9 +76,6 @@ #include #endif @@ -4010,8 +4010,8 @@ Acked-by: jbeulich@novell.com if (is_initial_xendomain()) { #ifdef CONFIG_VT ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -659,6 +659,10 @@ int smp_call_function_single(int cpu, vo put_cpu(); return -EBUSY; @@ -4023,8 +4023,8 @@ Acked-by: jbeulich@novell.com spin_lock_bh(&call_lock); __smp_call_function_single(cpu, func, info, nonatomic, wait); spin_unlock_bh(&call_lock); ---- sle11-2009-05-14.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:08:00.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/time_32-xen.c 2009-03-24 10:08:30.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:08:00.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/time_32-xen.c 2009-03-24 10:08:30.000000000 +0100 @@ -61,6 +61,7 @@ #include #include @@ -4080,8 +4080,8 @@ Acked-by: jbeulich@novell.com } #endif ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -29,6 +29,8 @@ #include #include @@ -4418,8 +4418,8 @@ Acked-by: jbeulich@novell.com -} -__setup("call_trace=", call_trace_setup); -#endif ---- sle11-2009-05-14.orig/arch/x86/kernel/vmlinux_32.lds.S 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/vmlinux_32.lds.S 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/vmlinux_32.lds.S 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/vmlinux_32.lds.S 2008-12-15 11:26:44.000000000 +0100 @@ -29,6 +29,12 @@ PHDRS { SECTIONS { @@ -4433,8 +4433,8 @@ Acked-by: jbeulich@novell.com phys_startup_32 = startup_32 - LOAD_OFFSET; .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) { ---- sle11-2009-05-14.orig/arch/x86/kvm/Kconfig 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kvm/Kconfig 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kvm/Kconfig 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kvm/Kconfig 2008-12-15 11:26:44.000000000 +0100 @@ -7,6 +7,7 @@ config HAVE_KVM menuconfig VIRTUALIZATION bool "Virtualization" @@ -4443,8 +4443,8 @@ Acked-by: jbeulich@novell.com default y ---help--- Say Y here to get to see options for using your Linux host to run other ---- sle11-2009-05-14.orig/arch/x86/mm/fault_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/fault_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -22,9 +22,9 @@ #include #include @@ -4489,8 +4489,8 @@ Acked-by: jbeulich@novell.com break; prefetch = (instr_lo == 0xF) && (opcode == 0x0D || opcode == 0x18); ---- sle11-2009-05-14.orig/arch/x86/mm/highmem_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/highmem_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/highmem_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/highmem_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -32,7 +32,7 @@ static void *__kmap_atomic(struct page * unsigned long vaddr; @@ -4545,8 +4545,8 @@ Acked-by: jbeulich@novell.com idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); ---- sle11-2009-05-14.orig/arch/x86/mm/init_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -233,8 +233,6 @@ static inline int page_kills_ppro(unsign #endif @@ -4607,8 +4607,8 @@ Acked-by: jbeulich@novell.com void __init pgtable_cache_init(void) { ---- sle11-2009-05-14.orig/arch/x86/mm/pgtable_32-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pgtable_32-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pgtable_32-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pgtable_32-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -203,7 +203,7 @@ void pte_free(struct page *pte) __free_page(pte); } @@ -4636,8 +4636,8 @@ Acked-by: jbeulich@novell.com { unsigned long flags; /* can be called from interrupt context */ ---- sle11-2009-05-14.orig/arch/x86/pci/irq-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/pci/irq-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/pci/irq-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/pci/irq-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -768,7 +768,7 @@ static void __init pirq_find_router(stru DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", rt->rtr_vendor, rt->rtr_device); @@ -4656,8 +4656,8 @@ Acked-by: jbeulich@novell.com } static struct irq_info *pirq_get_info(struct pci_dev *dev) ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_64-xen.S 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/entry_64-xen.S 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_64-xen.S 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_64-xen.S 2008-12-15 11:26:44.000000000 +0100 @@ -261,7 +261,6 @@ ENTRY(system_call) movq %rax,ORIG_RAX-ARGOFFSET(%rsp) GET_THREAD_INFO(%rcx) @@ -4795,8 +4795,8 @@ Acked-by: jbeulich@novell.com - CFI_ENDPROC -ENDPROC(arch_unwind_init_running) -#endif ---- sle11-2009-05-14.orig/arch/x86/kernel/genapic_64-xen.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/genapic_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/genapic_64-xen.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/genapic_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -34,6 +34,7 @@ extern struct genapic apic_physflat; #ifndef CONFIG_XEN @@ -4819,8 +4819,8 @@ Acked-by: jbeulich@novell.com #if defined(CONFIG_ACPI) /* * Some x86_64 machines use physical APIC mode regardless of how many ---- sle11-2009-05-14.orig/arch/x86/kernel/head64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/head64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -104,7 +104,10 @@ void __init x86_64_start_kernel(char * r machine_to_phys_order++; @@ -4833,8 +4833,8 @@ Acked-by: jbeulich@novell.com set_intr_gate(i, early_idt_handler); asm volatile("lidt %0" :: "m" (idt_descr)); #endif ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -202,14 +202,20 @@ static struct IO_APIC_route_entry ioapic * the interrupt, and we need to make sure the entry is fully populated * before that happens. @@ -5027,8 +5027,8 @@ Acked-by: jbeulich@novell.com } } ---- sle11-2009-05-14.orig/arch/x86/kernel/irq_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/irq_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -120,7 +120,7 @@ asmlinkage unsigned int do_IRQ(struct pt if (likely(irq < NR_IRQS)) @@ -5038,8 +5038,8 @@ Acked-by: jbeulich@novell.com printk(KERN_EMERG "%s: %d.%d No irq handler for irq\n", __func__, smp_processor_id(), irq); ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -35,8 +35,6 @@ int smp_found_config; unsigned int __initdata maxcpus = NR_CPUS; @@ -5049,8 +5049,8 @@ Acked-by: jbeulich@novell.com /* * Various Linux-internal data structures created from the * MP-table. ---- sle11-2009-05-14.orig/arch/x86/kernel/process_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -119,29 +119,23 @@ void exit_idle(void) static void poll_idle (void) { @@ -5105,8 +5105,8 @@ Acked-by: jbeulich@novell.com enter_idle(); idle(); /* In many cases the interrupt that ended idle ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -573,8 +573,7 @@ void __init setup_arch(char **cmdline_p) if (LOADER_TYPE && INITRD_START) { if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) { @@ -5159,8 +5159,8 @@ Acked-by: jbeulich@novell.com c->x86_max_cores = intel_num_cpu_cores(c); srat_detect_node(); ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -384,12 +384,17 @@ int smp_call_function_single (int cpu, v put_cpu(); return 0; @@ -5179,8 +5179,8 @@ Acked-by: jbeulich@novell.com /* * this function sends a 'generic call function' IPI to all other CPUs ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -30,9 +30,10 @@ #include #include @@ -5406,8 +5406,8 @@ Acked-by: jbeulich@novell.com -} -early_param("call_trace", call_trace_setup); -#endif ---- sle11-2009-05-14.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/vsyscall_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/vsyscall_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -42,6 +42,7 @@ #include @@ -5449,8 +5449,8 @@ Acked-by: jbeulich@novell.com __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_page0, PAGE_KERNEL_VSYSCALL); } ---- sle11-2009-05-14.orig/arch/x86/mm/fault_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/fault_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -23,9 +23,9 @@ #include #include @@ -5498,8 +5498,8 @@ Acked-by: jbeulich@novell.com } void dump_pagetable(unsigned long address) ---- sle11-2009-05-14.orig/arch/x86/mm/init_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -1127,14 +1127,15 @@ static __init int x8664_sysctl_init(void __initcall(x8664_sysctl_init); #endif @@ -5519,8 +5519,8 @@ Acked-by: jbeulich@novell.com }; struct vm_area_struct *get_gate_vma(struct task_struct *tsk) ---- sle11-2009-05-14.orig/arch/x86/mm/pageattr_64-xen.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pageattr_64-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr_64-xen.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pageattr_64-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -330,34 +330,40 @@ static struct page *split_large_page(uns return base; } @@ -5607,8 +5607,8 @@ Acked-by: jbeulich@novell.com } } ---- sle11-2009-05-14.orig/drivers/pci/msi-xen.c 2009-04-24 13:31:56.000000000 +0200 -+++ sle11-2009-05-14/drivers/pci/msi-xen.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/pci/msi-xen.c 2009-04-24 13:31:56.000000000 +0200 ++++ sle11-2009-06-29/drivers/pci/msi-xen.c 2008-12-15 11:26:44.000000000 +0100 @@ -263,10 +263,8 @@ void disable_msi_mode(struct pci_dev *de pci_write_config_word(dev, msi_control_reg(pos), control); dev->msix_enabled = 0; @@ -5635,8 +5635,8 @@ Acked-by: jbeulich@novell.com } #ifdef CONFIG_PM ---- sle11-2009-05-14.orig/drivers/xen/balloon/balloon.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/balloon/balloon.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:28:36.000000000 +0200 @@ -97,8 +97,8 @@ extern unsigned long totalhigh_pages; static LIST_HEAD(ballooned_pages); @@ -5648,7 +5648,7 @@ Acked-by: jbeulich@novell.com static struct timer_list balloon_timer; /* When ballooning out (allocating memory to return to Xen) we don't really -@@ -389,7 +389,7 @@ static int decrease_reservation(unsigned +@@ -375,7 +375,7 @@ static int decrease_reservation(unsigned * by the balloon lock), or with changes to the Xen hard limit, but we will * recover from these in time. */ @@ -5657,8 +5657,8 @@ Acked-by: jbeulich@novell.com { int need_sleep = 0; long credit; ---- sle11-2009-05-14.orig/drivers/xen/blkback/blkback.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkback/blkback.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkback/blkback.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkback/blkback.c 2008-12-15 11:26:44.000000000 +0100 @@ -37,6 +37,7 @@ #include @@ -5667,8 +5667,8 @@ Acked-by: jbeulich@novell.com #include #include #include ---- sle11-2009-05-14.orig/drivers/xen/blkback/interface.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/blkback/interface.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkback/interface.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/blkback/interface.c 2008-12-15 11:26:44.000000000 +0100 @@ -34,7 +34,7 @@ #include #include @@ -5678,8 +5678,8 @@ Acked-by: jbeulich@novell.com blkif_t *blkif_alloc(domid_t domid) { ---- sle11-2009-05-14.orig/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:16.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:27.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:16.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:27.000000000 +0100 @@ -71,7 +71,7 @@ static int setup_blkring(struct xenbus_d static void kick_pending_request_queues(struct blkfront_info *); @@ -5710,8 +5710,8 @@ Acked-by: jbeulich@novell.com spin_lock_irq(&blkif_io_lock); if (info->connected == BLKIF_STATE_CONNECTED) kick_pending_request_queues(info); ---- sle11-2009-05-14.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:37:34.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/blktap/blktap.c 2009-04-20 11:37:50.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:37:34.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/blktap/blktap.c 2009-04-20 11:37:50.000000000 +0200 @@ -40,6 +40,7 @@ #include @@ -5720,8 +5720,8 @@ Acked-by: jbeulich@novell.com #include #include #include "common.h" ---- sle11-2009-05-14.orig/drivers/xen/blktap/interface.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/blktap/interface.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blktap/interface.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/blktap/interface.c 2008-12-15 11:26:44.000000000 +0100 @@ -34,7 +34,7 @@ #include "common.h" #include @@ -5731,8 +5731,8 @@ Acked-by: jbeulich@novell.com blkif_t *tap_alloc_blkif(domid_t domid) { ---- sle11-2009-05-14.orig/drivers/xen/char/mem.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/char/mem.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/char/mem.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/char/mem.c 2008-12-15 11:26:44.000000000 +0100 @@ -157,7 +157,7 @@ static loff_t memory_lseek(struct file * { loff_t ret; @@ -5751,8 +5751,8 @@ Acked-by: jbeulich@novell.com return ret; } ---- sle11-2009-05-14.orig/drivers/xen/console/console.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/console/console.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/console/console.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/console/console.c 2008-12-15 11:26:44.000000000 +0100 @@ -85,11 +85,6 @@ static int xc_num = -1; #define XEN_HVC_MAJOR 229 #define XEN_HVC_MINOR 0 @@ -5787,8 +5787,8 @@ Acked-by: jbeulich@novell.com if (buf[i] == '\x0f') { /* ^O */ if (!sysrq_requested) { sysrq_requested = jiffies; ---- sle11-2009-05-14.orig/drivers/xen/core/reboot.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/reboot.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/reboot.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/reboot.c 2008-12-15 11:26:44.000000000 +0100 @@ -34,8 +34,8 @@ static int suspend_cancelled; /* Can we leave APs online when we suspend? */ static int fast_suspend; @@ -5824,8 +5824,8 @@ Acked-by: jbeulich@novell.com { int err; ---- sle11-2009-05-14.orig/drivers/xen/core/smpboot.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/smpboot.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/smpboot.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/smpboot.c 2008-12-15 11:26:44.000000000 +0100 @@ -161,7 +161,12 @@ static void xen_smp_intr_exit(unsigned i void __cpuinit cpu_bringup(void) @@ -5878,8 +5878,8 @@ Acked-by: jbeulich@novell.com #ifdef __x86_64__ cpu_pda(cpu)->pcurrent = idle; cpu_pda(cpu)->cpunumber = cpu; ---- sle11-2009-05-14.orig/drivers/xen/fbfront/xenfb.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/fbfront/xenfb.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/fbfront/xenfb.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/fbfront/xenfb.c 2008-12-15 11:26:44.000000000 +0100 @@ -25,6 +25,7 @@ #include #include @@ -5888,8 +5888,8 @@ Acked-by: jbeulich@novell.com #include #include #include ---- sle11-2009-05-14.orig/drivers/xen/netback/loopback.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/netback/loopback.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/netback/loopback.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/netback/loopback.c 2008-12-15 11:26:44.000000000 +0100 @@ -54,6 +54,7 @@ #include #include /* secpath_reset() */ @@ -5898,8 +5898,8 @@ Acked-by: jbeulich@novell.com static int nloopbacks = -1; module_param(nloopbacks, int, 0); ---- sle11-2009-05-14.orig/drivers/xen/pciback/conf_space_header.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/pciback/conf_space_header.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pciback/conf_space_header.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/pciback/conf_space_header.c 2008-12-15 11:26:44.000000000 +0100 @@ -22,14 +22,14 @@ static int command_write(struct pci_dev { int err; @@ -5917,8 +5917,8 @@ Acked-by: jbeulich@novell.com if (unlikely(verbose_request)) printk(KERN_DEBUG "pciback: %s: disable\n", pci_name(dev)); ---- sle11-2009-05-14.orig/drivers/xen/pciback/pciback.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/pciback/pciback.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pciback/pciback.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/pciback/pciback.h 2008-12-15 11:26:44.000000000 +0100 @@ -88,7 +88,7 @@ void pciback_release_devices(struct pcib /* Handles events from front-end */ @@ -5928,8 +5928,8 @@ Acked-by: jbeulich@novell.com int pciback_xenbus_register(void); void pciback_xenbus_unregister(void); ---- sle11-2009-05-14.orig/drivers/xen/pciback/pciback_ops.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/pciback/pciback_ops.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pciback/pciback_ops.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/pciback/pciback_ops.c 2008-12-15 11:26:44.000000000 +0100 @@ -25,7 +25,7 @@ void pciback_reset_device(struct pci_dev pci_write_config_word(dev, PCI_COMMAND, 0); @@ -5951,8 +5951,8 @@ Acked-by: jbeulich@novell.com struct pci_dev *dev; struct xen_pci_op *op = &pdev->sh_info->op; ---- sle11-2009-05-14.orig/drivers/xen/pciback/xenbus.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/pciback/xenbus.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pciback/xenbus.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/pciback/xenbus.c 2008-12-15 11:26:44.000000000 +0100 @@ -32,7 +32,7 @@ static struct pciback_device *alloc_pdev pdev->evtchn_irq = INVALID_EVTCHN_IRQ; pdev->be_watching = 0; @@ -5970,8 +5970,8 @@ Acked-by: jbeulich@novell.com flush_scheduled_work(); if (pdev->sh_info != NULL) { ---- sle11-2009-05-14.orig/drivers/xen/scsiback/interface.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/scsiback/interface.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsiback/interface.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/scsiback/interface.c 2008-12-15 11:26:44.000000000 +0100 @@ -39,7 +39,7 @@ #include @@ -5981,8 +5981,8 @@ Acked-by: jbeulich@novell.com struct vscsibk_info *vscsibk_info_alloc(domid_t domid) { ---- sle11-2009-05-14.orig/drivers/xen/scsiback/scsiback.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/scsiback/scsiback.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsiback/scsiback.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/scsiback/scsiback.c 2008-12-15 11:26:44.000000000 +0100 @@ -322,13 +322,11 @@ static int scsiback_merge_bio(struct req if (!rq->bio) @@ -5998,8 +5998,8 @@ Acked-by: jbeulich@novell.com } return 0; ---- sle11-2009-05-14.orig/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:35:11.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:35:25.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:35:11.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:35:25.000000000 +0200 @@ -463,7 +463,7 @@ netfront_accel_enqueue_skb_multi(netfron if (skb->ip_summed == CHECKSUM_PARTIAL) { @@ -6018,8 +6018,8 @@ Acked-by: jbeulich@novell.com } NETFRONT_ACCEL_PKTBUFF_FOR_EACH_FRAGMENT (skb, idx, frag_data, frag_len, { ---- sle11-2009-05-14.orig/drivers/xen/tpmback/interface.c 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/tpmback/interface.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/tpmback/interface.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/tpmback/interface.c 2008-12-15 11:26:44.000000000 +0100 @@ -15,7 +15,7 @@ #include #include @@ -6029,8 +6029,8 @@ Acked-by: jbeulich@novell.com int num_frontends = 0; LIST_HEAD(tpmif_list); ---- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_comms.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_comms.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_comms.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_comms.c 2008-12-15 11:26:44.000000000 +0100 @@ -49,9 +49,9 @@ static int xenbus_irq; @@ -6043,8 +6043,8 @@ Acked-by: jbeulich@novell.com static DECLARE_WAIT_QUEUE_HEAD(xb_waitq); ---- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe.c 2008-11-25 12:35:56.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_probe.c 2008-11-25 12:35:56.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_probe.c 2008-12-15 11:26:44.000000000 +0100 @@ -843,7 +843,7 @@ void unregister_xenstore_notifier(struct EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); @@ -6054,8 +6054,8 @@ Acked-by: jbeulich@novell.com { BUG_ON((xenstored_ready <= 0)); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -4,8 +4,6 @@ #include #include @@ -6241,8 +6241,8 @@ Acked-by: jbeulich@novell.com #endif /* !__ASSEMBLY__ */ #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -127,10 +127,10 @@ dma_get_cache_alignment(void) return (1 << INTERNODE_CACHE_SHIFT); } @@ -6256,8 +6256,8 @@ Acked-by: jbeulich@novell.com enum dma_data_direction direction) { flush_write_buffers(); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/fixmap_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -13,13 +13,16 @@ #ifndef _ASM_FIXMAP_H #define _ASM_FIXMAP_H @@ -6276,8 +6276,8 @@ Acked-by: jbeulich@novell.com #ifndef __ASSEMBLY__ #include ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/highmem.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/highmem.h 2008-12-15 11:26:44.000000000 +0100 @@ -85,7 +85,7 @@ static inline void clear_user_highpage(s void copy_highpage(struct page *to, struct page *from); @@ -6287,8 +6287,8 @@ Acked-by: jbeulich@novell.com { copy_highpage(to, from); } ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypervisor.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypervisor.h 2008-12-15 11:26:44.000000000 +0100 @@ -46,15 +46,6 @@ #include #include @@ -6305,8 +6305,8 @@ Acked-by: jbeulich@novell.com extern shared_info_t *HYPERVISOR_shared_info; ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/irqflags_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -22,9 +22,6 @@ #define __raw_local_save_flags() (current_vcpu_info()->evtchn_upcall_mask) @@ -6399,8 +6399,8 @@ Acked-by: jbeulich@novell.com #endif /* __ASSEMBLY__ */ /* ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/mmu_context_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -27,14 +27,13 @@ static inline void enter_lazy_tlb(struct static inline void __prepare_arch_switch(void) { @@ -6440,8 +6440,8 @@ Acked-by: jbeulich@novell.com static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) { ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable-3level.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable-3level.h 2008-12-15 11:26:44.000000000 +0100 @@ -1,8 +1,6 @@ #ifndef _I386_PGTABLE_3LEVEL_H #define _I386_PGTABLE_3LEVEL_H @@ -6540,8 +6540,8 @@ Acked-by: jbeulich@novell.com #define __pte_mfn(_pte) (((_pte).pte_low >> PAGE_SHIFT) | \ ((_pte).pte_high << (32-PAGE_SHIFT))) #define pte_mfn(_pte) ((_pte).pte_low & _PAGE_PRESENT ? \ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -38,14 +38,14 @@ struct vm_area_struct; #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) extern unsigned long empty_zero_page[1024]; @@ -6590,8 +6590,8 @@ Acked-by: jbeulich@novell.com #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL #define ptep_get_and_clear_full(mm, addr, ptep, full) \ ((full) ? ({ \ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -20,6 +20,7 @@ #include #include @@ -6870,8 +6870,8 @@ Acked-by: jbeulich@novell.com +extern void secondary_cpu_init(void); + #endif /* __ASM_I386_PROCESSOR_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/segment_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/segment_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/segment_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/segment_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -39,7 +39,7 @@ * 25 - APM BIOS support * @@ -6891,8 +6891,8 @@ Acked-by: jbeulich@novell.com #define GDT_ENTRY_DOUBLEFAULT_TSS 31 /* ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -8,6 +8,7 @@ #include #include @@ -6910,8 +6910,8 @@ Acked-by: jbeulich@novell.com extern cpumask_t cpu_possible_map; #define cpu_callin_map cpu_possible_map ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system_32.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system_32.h 2008-12-15 11:26:44.000000000 +0100 @@ -139,17 +139,17 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" #define write_cr4(x) \ __asm__ __volatile__("movl %0,%%cr4": :"r" (x)) @@ -6936,8 +6936,8 @@ Acked-by: jbeulich@novell.com static inline unsigned long get_limit(unsigned long segment) { unsigned long __limit; ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_64.h 2009-05-14 11:02:41.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc_64.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc_64.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc_64.h 2008-12-15 11:26:44.000000000 +0100 @@ -9,62 +9,11 @@ #include @@ -7002,8 +7002,8 @@ Acked-by: jbeulich@novell.com extern struct desc_ptr idt_descr, cpu_gdt_descr[NR_CPUS]; extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2008-12-15 11:26:44.000000000 +0100 @@ -64,6 +64,9 @@ static inline int dma_mapping_error(dma_ return (dma_addr == bad_dma_address); } @@ -7030,8 +7030,8 @@ Acked-by: jbeulich@novell.com { flush_write_buffers(); } ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_64.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_64.h 2008-12-15 11:26:44.000000000 +0100 @@ -237,19 +237,18 @@ extern unsigned int __kernel_page_user; static inline unsigned long pgd_bad(pgd_t pgd) @@ -7071,8 +7071,8 @@ Acked-by: jbeulich@novell.com #define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot))) #define pmd_pfn(x) ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_64.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor_64.h 2008-12-15 11:26:44.000000000 +0100 @@ -484,6 +484,14 @@ static inline void __mwait(unsigned long : :"a" (eax), "c" (ecx)); } @@ -7088,8 +7088,8 @@ Acked-by: jbeulich@novell.com extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); #define stack_current() \ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_64.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_64.h 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_64.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_64.h 2008-12-15 11:26:44.000000000 +0100 @@ -88,11 +88,6 @@ extern u8 x86_cpu_to_log_apicid[NR_CPUS] extern u8 bios_cpu_apicid[]; @@ -7116,8 +7116,8 @@ Acked-by: jbeulich@novell.com #endif /* !CONFIG_SMP */ #endif ---- sle11-2009-05-14.orig/kernel/kexec.c 2009-02-17 11:27:16.000000000 +0100 -+++ sle11-2009-05-14/kernel/kexec.c 2009-02-17 11:34:22.000000000 +0100 +--- sle11-2009-06-29.orig/kernel/kexec.c 2009-02-17 11:27:16.000000000 +0100 ++++ sle11-2009-06-29/kernel/kexec.c 2009-02-17 11:34:22.000000000 +0100 @@ -374,7 +374,7 @@ static struct page *kimage_alloc_pages(g if (limit == ~0UL) address_bits = BITS_PER_LONG; @@ -7127,8 +7127,8 @@ Acked-by: jbeulich@novell.com if (xen_limit_pages_to_max_mfn(pages, order, address_bits) < 0) { __free_pages(pages, order); ---- sle11-2009-05-14.orig/net/core/dev.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/net/core/dev.c 2008-12-15 11:26:44.000000000 +0100 +--- sle11-2009-06-29.orig/net/core/dev.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/net/core/dev.c 2008-12-15 11:26:44.000000000 +0100 @@ -1751,10 +1751,10 @@ inline int skb_checksum_setup(struct sk_ goto out; switch (skb->nh.iph->protocol) { diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.21 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.21 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.21 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.21 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.22 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.22 similarity index 99% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.22 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.22 index 4af854835..129c8005d 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.22 +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.22 @@ -3659,7 +3659,7 @@ Acked-by: jbeulich@novell.com + .address = (unsigned long)ignore_sysret + }; + if (HYPERVISOR_callback_op(CALLBACKOP_register, &cstar)) -+ printk(KERN_WARN "Unable to register CSTAR callback\n"); ++ printk(KERN_WARNING "Unable to register CSTAR callback\n"); + } #endif } diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.23 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.23 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.23 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.23 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.24 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.24 similarity index 94% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.24 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.24 index ca338a23f..daff2bafa 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.24 +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.24 @@ -6,8 +6,8 @@ Automatically created from "patches.kernel.org/patch-2.6.24" by xen-port-patches Acked-by: jbeulich@novell.com ---- sle11-2009-05-14.orig/arch/x86/Kconfig 2009-02-05 10:22:38.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/Kconfig 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/Kconfig 2009-02-05 10:22:38.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig 2009-02-16 16:18:36.000000000 +0100 @@ -50,15 +50,16 @@ config GENERIC_CMOS_UPDATE config CLOCKSOURCE_WATCHDOG @@ -156,8 +156,8 @@ Acked-by: jbeulich@novell.com help DMA remapping (DMAR) devices support enables independent address translations for Direct Memory Access (DMA) from devices. ---- sle11-2009-05-14.orig/arch/x86/Makefile 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/Makefile 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/Makefile 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Makefile 2009-02-16 16:18:36.000000000 +0100 @@ -191,8 +191,8 @@ PHONY += zImage bzImage vmlinuz compress zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install @@ -178,8 +178,8 @@ Acked-by: jbeulich@novell.com else # Default kernel to build all: bzImage ---- sle11-2009-05-14.orig/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:18:36.000000000 +0100 @@ -125,20 +125,16 @@ sysenter_do_call: jmp int_ret_from_sys_call @@ -228,16 +228,16 @@ Acked-by: jbeulich@novell.com jmp cstar_do_call END(ia32_cstar_target) ---- sle11-2009-05-14.orig/arch/x86/kernel/Makefile 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/Makefile 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/Makefile 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/Makefile 2009-02-16 16:18:36.000000000 +0100 @@ -127,4 +127,4 @@ endif disabled-obj-$(CONFIG_XEN) := early-quirks.o hpet.o i8253.o i8259_$(BITS).o reboot.o \ smpboot_$(BITS).o tsc_$(BITS).o tsc_sync.o disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += mpparse_64.o -%/head_64.o %/head_64.s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) := +%/head_64.o %/head_64.s: asflags-$(CONFIG_XEN) := ---- sle11-2009-05-14.orig/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -90,7 +90,7 @@ __setup("acpi_sleep=", acpi_sleep_setup) /* Ouch, we want to delete this. We already have better version in userspace, in @@ -247,8 +247,8 @@ Acked-by: jbeulich@novell.com { acpi_realmode_flags |= 2; return 0; ---- sle11-2009-05-14.orig/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -123,6 +123,3 @@ static int __init acpi_sleep_setup(char __setup("acpi_sleep=", acpi_sleep_setup); #endif /* CONFIG_ACPI_PV_SLEEP */ @@ -256,8 +256,8 @@ Acked-by: jbeulich@novell.com -void acpi_pci_link_exit(void) -{ -} ---- sle11-2009-05-14.orig/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -63,22 +63,38 @@ int setup_profiling_timer(unsigned int m void smp_local_timer_interrupt(void) @@ -329,8 +329,8 @@ Acked-by: jbeulich@novell.com irq_exit(); } ---- sle11-2009-05-14.orig/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -214,7 +214,7 @@ static void __cpuinit get_cpu_vendor(str static int __init x86_fxsr_setup(char * s) @@ -340,8 +340,8 @@ Acked-by: jbeulich@novell.com disable_x86_fxsr = 1; /* ---- sle11-2009-05-14.orig/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -52,6 +52,13 @@ struct resource code_resource = { .flags = IORESOURCE_BUSY | IORESOURCE_MEM }; @@ -403,8 +403,8 @@ Acked-by: jbeulich@novell.com * memory space. */ last = 0x100000000ull; ---- sle11-2009-05-14.orig/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -24,7 +24,7 @@ #include #include @@ -485,8 +485,8 @@ Acked-by: jbeulich@novell.com + max_pfn << PAGE_SHIFT) - *addr; + return i + 1; +} ---- sle11-2009-05-14.orig/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -6,14 +6,9 @@ #include #include @@ -518,8 +518,8 @@ Acked-by: jbeulich@novell.com #endif early_console = &early_vga_console; } else if (!strncmp(buf, "simnow", 6)) { ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_32-xen.S 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:18.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_32-xen.S 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:18.000000000 +0200 @@ -254,6 +254,7 @@ check_userspace: jb resume_kernel # not returning to v8086 or userspace @@ -569,8 +569,8 @@ Acked-by: jbeulich@novell.com +#include "syscall_table_32.S" syscall_table_size=(.-sys_call_table) ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:18:36.000000000 +0100 @@ -57,7 +57,7 @@ #include #include @@ -644,8 +644,8 @@ Acked-by: jbeulich@novell.com call do_exit CFI_ENDPROC ENDPROC(child_rip) ---- sle11-2009-05-14.orig/arch/x86/kernel/genapic_64-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/genapic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/genapic_64-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/genapic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -24,12 +24,21 @@ #include #endif @@ -673,8 +673,8 @@ Acked-by: jbeulich@novell.com #ifndef CONFIG_XEN struct genapic __read_mostly *genapic = &apic_flat; ---- sle11-2009-05-14.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,5 +1,5 @@ /* - * linux/arch/x86_64/kernel/head64.c -- prepare to run common code @@ -731,8 +731,8 @@ Acked-by: jbeulich@novell.com #endif early_printk("Kernel alive\n"); ---- sle11-2009-05-14.orig/arch/x86/kernel/init_task-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/init_task-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/init_task-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/init_task-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -14,11 +14,11 @@ static struct fs_struct init_fs = INIT_F static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS(init_signals); @@ -776,8 +776,8 @@ Acked-by: jbeulich@novell.com DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS; #endif ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -427,7 +427,7 @@ static struct irq_cpu_info { #define IRQ_ALLOWED(cpu, allowed_mask) cpu_isset(cpu, allowed_mask) @@ -945,8 +945,8 @@ Acked-by: jbeulich@novell.com #endif /* CONFIG_ACPI */ static int __init parse_disable_timer_pin_1(char *arg) ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -31,6 +31,7 @@ #include #include @@ -1190,8 +1190,8 @@ Acked-by: jbeulich@novell.com #endif #endif /* !CONFIG_XEN */ + ---- sle11-2009-05-14.orig/arch/x86/kernel/ioport_32-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/ioport_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ioport_32-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ioport_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/ioport.c @@ -1199,8 +1199,8 @@ Acked-by: jbeulich@novell.com * This contains the io-permission bitmap code - written by obz, with changes * by Linus. */ ---- sle11-2009-05-14.orig/arch/x86/kernel/ioport_64-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/ioport_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ioport_64-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ioport_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86_64/kernel/ioport.c @@ -1208,8 +1208,8 @@ Acked-by: jbeulich@novell.com * This contains the io-permission bitmap code - written by obz, with changes * by Linus. */ ---- sle11-2009-05-14.orig/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/irq.c @@ -1310,8 +1310,8 @@ Acked-by: jbeulich@novell.com #endif seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); #if defined(CONFIG_X86_IO_APIC) ---- sle11-2009-05-14.orig/arch/x86/kernel/irq_64-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/irq_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_64-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86_64/kernel/irq.c @@ -1408,8 +1408,8 @@ Acked-by: jbeulich@novell.com #ifndef CONFIG_X86_LOCAL_APIC /* ---- sle11-2009-05-14.orig/arch/x86/kernel/ldt_32-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/ldt_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt_32-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ldt_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/ldt.c @@ -1471,8 +1471,8 @@ Acked-by: jbeulich@novell.com out: return error; } ---- sle11-2009-05-14.orig/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86_64/kernel/ldt.c @@ -1551,8 +1551,8 @@ Acked-by: jbeulich@novell.com out: return error; } ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_32-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_32-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1023,7 +1023,7 @@ void __init mp_config_acpi_legacy_irqs ( /* @@ -1562,8 +1562,8 @@ Acked-by: jbeulich@novell.com */ for (i = 0; i < 16; i++) { int idx; ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -57,6 +57,8 @@ unsigned long mp_lapic_addr = 0; /* Processor that is doing the boot up */ @@ -1609,8 +1609,8 @@ Acked-by: jbeulich@novell.com { num_processors++; } ---- sle11-2009-05-14.orig/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -13,14 +13,13 @@ #include #include @@ -1703,8 +1703,8 @@ Acked-by: jbeulich@novell.com if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; ---- sle11-2009-05-14.orig/arch/x86/kernel/process_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/process.c @@ -1831,8 +1831,8 @@ Acked-by: jbeulich@novell.com show_trace(NULL, regs, ®s->esp); } ---- sle11-2009-05-14.orig/arch/x86/kernel/process_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86-64/kernel/process.c @@ -1899,8 +1899,8 @@ Acked-by: jbeulich@novell.com __switch_to(struct task_struct *prev_p, struct task_struct *next_p) { struct thread_struct *prev = &prev_p->thread, ---- sle11-2009-05-14.orig/arch/x86/kernel/quirks-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/quirks-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/quirks-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/quirks-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -41,7 +41,353 @@ static void __devinit quirk_intel_irqbal if (!(config & 0x2)) pci_write_config_byte(dev, 0xf4, config); @@ -2258,8 +2258,8 @@ Acked-by: jbeulich@novell.com +} + #endif ---- sle11-2009-05-14.orig/arch/x86/kernel/setup64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -15,7 +15,6 @@ #include #include @@ -2308,8 +2308,8 @@ Acked-by: jbeulich@novell.com /* * cpu_init() initializes state that is per-CPU. Some data is already * initialized (naturally) in the bootstrap process, such as the GDT ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/setup.c @@ -2566,8 +2566,8 @@ Acked-by: jbeulich@novell.com #endif #ifdef CONFIG_ACPI ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,10 +1,5 @@ /* - * linux/arch/x86-64/kernel/setup.c @@ -2981,8 +2981,8 @@ Acked-by: jbeulich@novell.com return c_start(m, pos); } ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -72,7 +72,7 @@ * * B stepping CPUs may hang. There are hardware work arounds @@ -3034,8 +3034,8 @@ Acked-by: jbeulich@novell.com irq_exit(); if (wait) { ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -167,6 +167,7 @@ asmlinkage void smp_invalidate_interrupt out: ack_APIC_irq(); @@ -3242,8 +3242,8 @@ Acked-by: jbeulich@novell.com irq_exit(); if (wait) { mb(); ---- sle11-2009-05-14.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:09.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:35.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:09.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:35.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/kernel/time.c @@ -3322,8 +3322,8 @@ Acked-by: jbeulich@novell.com }; static int __init xen_sysctl_init(void) { ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/i386/traps.c @@ -3566,8 +3566,8 @@ Acked-by: jbeulich@novell.com /* * NB. All these are "trap gates" (i.e. events_mask isn't set) except ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86-64/traps.c @@ -3720,8 +3720,8 @@ Acked-by: jbeulich@novell.com get_debugreg(condition, 6); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, ---- sle11-2009-05-14.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,4 @@ /* - * linux/arch/x86_64/kernel/vsyscall.c @@ -3811,8 +3811,8 @@ Acked-by: jbeulich@novell.com write_rdtscp_aux((node << 12) | cpu); /* Store cpu number in limit so that it can be loaded quickly ---- sle11-2009-05-14.orig/arch/x86/mm/fault_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/fault_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -25,6 +25,7 @@ #include #include @@ -3994,8 +3994,8 @@ Acked-by: jbeulich@novell.com goto no_context; do_sigbus: ---- sle11-2009-05-14.orig/arch/x86/mm/fault_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/fault_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -25,6 +25,7 @@ #include #include @@ -4158,8 +4158,8 @@ Acked-by: jbeulich@novell.com - return 1; -} -__setup("pagefaulttrace", enable_pagefaulttrace); ---- sle11-2009-05-14.orig/arch/x86/mm/hypervisor.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/hypervisor.c 2009-05-06 10:23:43.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/hypervisor.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/hypervisor.c 2009-05-06 10:23:43.000000000 +0200 @@ -496,6 +496,9 @@ int xen_create_contiguous_region( unsigned long frame, flags; unsigned int i; @@ -4238,8 +4238,8 @@ Acked-by: jbeulich@novell.com cr_mcl[i - 1].args[MULTI_UVMFLAGS_INDEX] = order ? UVMF_TLB_FLUSH|UVMF_ALL : UVMF_INVLPG|UVMF_ALL; ---- sle11-2009-05-14.orig/arch/x86/mm/init_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -94,7 +94,14 @@ static pte_t * __init one_page_table_ini #else if (!(__pmd_val(*pmd) & _PAGE_PRESENT)) { @@ -4322,8 +4322,8 @@ Acked-by: jbeulich@novell.com } /* ---- sle11-2009-05-14.orig/arch/x86/mm/init_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -767,7 +767,7 @@ static void xen_finish_init_mapping(void /* Setup the direct mapping of the physical memory at PAGE_OFFSET. This runs before bootmem is initialized and gets pages directly from the @@ -4410,8 +4410,8 @@ Acked-by: jbeulich@novell.com + return 0; +} +#endif ---- sle11-2009-05-14.orig/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -17,9 +17,6 @@ #include #include @@ -4633,8 +4633,8 @@ Acked-by: jbeulich@novell.com flush_map(&l); ---- sle11-2009-05-14.orig/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -6,6 +6,7 @@ #include #include @@ -4661,8 +4661,8 @@ Acked-by: jbeulich@novell.com { memset(pmd, 0, PTRS_PER_PMD*sizeof(pmd_t)); } ---- sle11-2009-05-14.orig/arch/x86/pci/irq-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/pci/irq-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/pci/irq-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/pci/irq-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -173,7 +173,7 @@ void eisa_set_level_irq(unsigned int irq } @@ -4759,9 +4759,9 @@ Acked-by: jbeulich@novell.com { if (!acer_tm360_irqrouting) { acer_tm360_irqrouting = 1; ---- sle11-2009-05-14.orig/drivers/acpi/processor_idle.c 2009-02-16 15:58:14.000000000 +0100 -+++ sle11-2009-05-14/drivers/acpi/processor_idle.c 2009-02-16 16:18:36.000000000 +0100 -@@ -1743,6 +1743,13 @@ int acpi_processor_cst_has_changed(struc +--- sle11-2009-06-29.orig/drivers/acpi/processor_idle.c 2009-06-29 15:17:44.000000000 +0200 ++++ sle11-2009-06-29/drivers/acpi/processor_idle.c 2009-06-29 15:29:06.000000000 +0200 +@@ -1749,6 +1749,13 @@ int acpi_processor_cst_has_changed(struc if (!pr->flags.power_setup_done) return -ENODEV; @@ -4775,8 +4775,8 @@ Acked-by: jbeulich@novell.com cpuidle_pause_and_lock(); cpuidle_disable_device(&pr->power.dev); acpi_processor_get_power_info(pr); ---- sle11-2009-05-14.orig/drivers/cpuidle/Kconfig 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/cpuidle/Kconfig 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/cpuidle/Kconfig 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/cpuidle/Kconfig 2009-02-16 16:18:36.000000000 +0100 @@ -1,6 +1,7 @@ config CPU_IDLE @@ -4785,8 +4785,8 @@ Acked-by: jbeulich@novell.com default ACPI help CPU idle is a generic framework for supporting software-controlled ---- sle11-2009-05-14.orig/drivers/oprofile/cpu_buffer.c 2009-02-16 16:01:39.000000000 +0100 -+++ sle11-2009-05-14/drivers/oprofile/cpu_buffer.c 2009-03-12 16:15:32.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/oprofile/cpu_buffer.c 2009-02-16 16:01:39.000000000 +0100 ++++ sle11-2009-06-29/drivers/oprofile/cpu_buffer.c 2009-03-12 16:15:32.000000000 +0100 @@ -308,6 +308,37 @@ void oprofile_add_trace(unsigned long pc } @@ -4825,8 +4825,8 @@ Acked-by: jbeulich@novell.com int oprofile_add_domain_switch(int32_t domain_id) { struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()]; ---- sle11-2009-05-14.orig/drivers/pci/msi-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/pci/msi-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/pci/msi-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/pci/msi-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -264,6 +264,12 @@ static int msi_map_vector(struct pci_dev return msi_map_pirq_to_vector(dev, -1, entry_nr, table_base); } @@ -4894,8 +4894,8 @@ Acked-by: jbeulich@novell.com dev->msix_enabled = 0; } EXPORT_SYMBOL(pci_disable_msix); ---- sle11-2009-05-14.orig/drivers/xen/blkback/blkback.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkback/blkback.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkback/blkback.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkback/blkback.c 2009-02-16 16:18:36.000000000 +0100 @@ -269,13 +269,10 @@ static void __end_block_io_op(pending_re } } @@ -4911,8 +4911,8 @@ Acked-by: jbeulich@novell.com } ---- sle11-2009-05-14.orig/drivers/xen/blkfront/blkfront.c 2009-03-24 10:12:03.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkfront/blkfront.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkfront/blkfront.c 2009-03-24 10:12:03.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkfront/blkfront.c 2009-02-16 16:18:36.000000000 +0100 @@ -233,7 +233,7 @@ static int setup_blkring(struct xenbus_d SHARED_RING_INIT(sring); FRONT_RING_INIT(&info->ring, sring, PAGE_SIZE); @@ -4934,16 +4934,16 @@ Acked-by: jbeulich@novell.com fsect = sg->offset >> 9; lsect = fsect + (sg->length >> 9) - 1; /* install a grant reference. */ ---- sle11-2009-05-14.orig/drivers/xen/core/firmware.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/core/firmware.c 2009-03-25 18:10:23.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/firmware.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/core/firmware.c 2009-03-25 18:10:23.000000000 +0100 @@ -1,4 +1,5 @@ #include +#include #include #include #include ---- sle11-2009-05-14.orig/drivers/xen/core/machine_kexec.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/core/machine_kexec.c 2009-02-17 11:46:41.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/machine_kexec.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/core/machine_kexec.c 2009-02-17 11:46:41.000000000 +0100 @@ -29,6 +29,10 @@ void __init xen_machine_kexec_setup_reso int k = 0; int rc; @@ -4983,8 +4983,8 @@ Acked-by: jbeulich@novell.com void machine_shutdown(void) { /* do nothing */ ---- sle11-2009-05-14.orig/drivers/xen/core/smpboot.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/smpboot.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/smpboot.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/smpboot.c 2009-02-16 16:18:36.000000000 +0100 @@ -45,8 +45,8 @@ cpumask_t cpu_possible_map; EXPORT_SYMBOL(cpu_possible_map); cpumask_t cpu_initialized_map; @@ -5100,8 +5100,8 @@ Acked-by: jbeulich@novell.com #ifdef __x86_64__ cpu_pda(cpu)->pcurrent = idle; ---- sle11-2009-05-14.orig/drivers/xen/netback/loopback.c 2008-12-15 11:26:44.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/netback/loopback.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/netback/loopback.c 2008-12-15 11:26:44.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/netback/loopback.c 2009-02-16 16:18:36.000000000 +0100 @@ -285,9 +285,9 @@ static void __exit clean_loopback(int i) char dev_name[IFNAMSIZ]; @@ -5114,8 +5114,8 @@ Acked-by: jbeulich@novell.com if (dev1 && dev2) { unregister_netdev(dev2); unregister_netdev(dev1); ---- sle11-2009-05-14.orig/drivers/xen/netback/netback.c 2008-12-23 09:33:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/netback/netback.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/netback/netback.c 2008-12-23 09:33:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/netback/netback.c 2009-02-16 16:18:36.000000000 +0100 @@ -350,8 +350,8 @@ static void xen_network_done_notify(void { static struct net_device *eth0_dev = NULL; @@ -5127,8 +5127,8 @@ Acked-by: jbeulich@novell.com } /* * Add following to poll() function in NAPI driver (Tigon3 is example): ---- sle11-2009-05-14.orig/drivers/xen/netback/xenbus.c 2009-03-04 11:25:55.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/netback/xenbus.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/netback/xenbus.c 2009-03-04 11:25:55.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/netback/xenbus.c 2009-02-16 16:18:36.000000000 +0100 @@ -149,12 +149,10 @@ fail: * and vif variables to the environment, for the benefit of the vif-* hotplug * scripts. @@ -5161,8 +5161,8 @@ Acked-by: jbeulich@novell.com return 0; } ---- sle11-2009-05-14.orig/drivers/xen/netfront/accel.c 2009-04-09 14:43:45.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/netfront/accel.c 2009-03-30 16:39:19.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/netfront/accel.c 2009-04-09 14:43:45.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/netfront/accel.c 2009-03-30 16:39:19.000000000 +0200 @@ -313,7 +313,7 @@ accelerator_set_vif_state_hooks(struct n DPRINTK("%p\n",vif_state); @@ -5199,8 +5199,8 @@ Acked-by: jbeulich@novell.com } ---- sle11-2009-05-14.orig/drivers/xen/netfront/netfront.c 2009-03-30 16:36:30.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/netfront/netfront.c 2009-03-30 16:39:44.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/netfront/netfront.c 2009-03-30 16:36:30.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/netfront/netfront.c 2009-03-30 16:39:44.000000000 +0200 @@ -626,6 +626,7 @@ static int network_open(struct net_devic struct netfront_info *np = netdev_priv(dev); @@ -5319,8 +5319,8 @@ Acked-by: jbeulich@novell.com SET_NETDEV_DEV(netdev, &dev->dev); np->netdev = netdev; ---- sle11-2009-05-14.orig/drivers/xen/netfront/netfront.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/netfront/netfront.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/netfront/netfront.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/netfront/netfront.h 2009-02-16 16:18:36.000000000 +0100 @@ -157,6 +157,8 @@ struct netfront_info { spinlock_t tx_lock; spinlock_t rx_lock; @@ -5330,8 +5330,8 @@ Acked-by: jbeulich@novell.com unsigned int irq; unsigned int copying_receiver; unsigned int carrier; ---- sle11-2009-05-14.orig/drivers/xen/pciback/Makefile 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/pciback/Makefile 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pciback/Makefile 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/pciback/Makefile 2009-02-16 16:18:36.000000000 +0100 @@ -12,6 +12,4 @@ pciback-$(CONFIG_XEN_PCIDEV_BACKEND_SLOT pciback-$(CONFIG_XEN_PCIDEV_BACKEND_PASS) += passthrough.o pciback-$(CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER) += controller.o @@ -5340,8 +5340,8 @@ Acked-by: jbeulich@novell.com -EXTRA_CFLAGS += -DDEBUG -endif +ccflags-$(CONFIG_XEN_PCIDEV_BE_DEBUG) += -DDEBUG ---- sle11-2009-05-14.orig/drivers/xen/pcifront/Makefile 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/pcifront/Makefile 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/pcifront/Makefile 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/pcifront/Makefile 2009-02-16 16:18:36.000000000 +0100 @@ -2,6 +2,4 @@ obj-y += pcifront.o pcifront-y := pci_op.o xenbus.o pci.o @@ -5350,8 +5350,8 @@ Acked-by: jbeulich@novell.com -EXTRA_CFLAGS += -DDEBUG -endif +ccflags-$(CONFIG_XEN_PCIDEV_FE_DEBUG) += -DDEBUG ---- sle11-2009-05-14.orig/drivers/xen/scsiback/emulate.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/scsiback/emulate.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsiback/emulate.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/scsiback/emulate.c 2009-02-16 16:18:36.000000000 +0100 @@ -104,9 +104,10 @@ static void resp_not_supported_cmd(pendi } @@ -5430,8 +5430,8 @@ Acked-by: jbeulich@novell.com to += copy_size; } ---- sle11-2009-05-14.orig/drivers/xen/scsiback/scsiback.c 2008-12-15 11:26:44.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/scsiback/scsiback.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsiback/scsiback.c 2008-12-15 11:26:44.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/scsiback/scsiback.c 2009-02-16 16:18:36.000000000 +0100 @@ -247,6 +247,8 @@ static int scsiback_gnttab_data_map(vscs write = (data_dir == DMA_TO_DEVICE); @@ -5552,8 +5552,8 @@ Acked-by: jbeulich@novell.com } return err; ---- sle11-2009-05-14.orig/drivers/xen/scsifront/scsifront.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/scsifront/scsifront.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsifront/scsifront.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/scsifront/scsifront.c 2009-02-16 16:18:36.000000000 +0100 @@ -246,11 +246,10 @@ static int map_data_for_request(struct v { grant_ref_t gref_head; @@ -5616,8 +5616,8 @@ Acked-by: jbeulich@novell.com off = 0; ref_cnt++; } ---- sle11-2009-05-14.orig/drivers/xen/sfc_netback/accel_fwd.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/sfc_netback/accel_fwd.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netback/accel_fwd.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/sfc_netback/accel_fwd.c 2009-02-16 16:18:36.000000000 +0100 @@ -181,10 +181,11 @@ int netback_accel_fwd_add(const __u8 *ma unsigned long flags; cuckoo_hash_mac_key key = cuckoo_mac_to_key(mac); @@ -5672,8 +5672,8 @@ Acked-by: jbeulich@novell.com spin_lock_irqsave(&fwd_set->fwd_lock, flags); /* ---- sle11-2009-05-14.orig/drivers/xen/sfc_netback/accel_msg.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/sfc_netback/accel_msg.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netback/accel_msg.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netback/accel_msg.c 2009-02-16 16:18:36.000000000 +0100 @@ -57,11 +57,11 @@ static void netback_accel_msg_tx_localma { unsigned long lock_state; @@ -5688,8 +5688,8 @@ Acked-by: jbeulich@novell.com msg = net_accel_msg_start_send(bend->shared_page, &bend->to_domU, &lock_state); ---- sle11-2009-05-14.orig/drivers/xen/sfc_netfront/accel_msg.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/sfc_netfront/accel_msg.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netfront/accel_msg.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/sfc_netfront/accel_msg.c 2009-02-16 16:18:36.000000000 +0100 @@ -41,11 +41,13 @@ static void vnic_start_interrupts(netfro /* Prime our interrupt */ spin_lock_irqsave(&vnic->irq_enabled_lock, flags); @@ -5770,8 +5770,8 @@ Acked-by: jbeulich@novell.com } else { spin_unlock_irqrestore(&vnic->irq_enabled_lock, flags); ---- sle11-2009-05-14.orig/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:36:26.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:39:38.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:36:26.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netfront/accel_vi.c 2009-03-30 16:39:38.000000000 +0200 @@ -641,8 +641,10 @@ netfront_accel_vi_tx_post(netfront_accel (cuckoo_hash_key *)(&key), &value); @@ -5798,8 +5798,8 @@ Acked-by: jbeulich@novell.com if (ip->protocol == IPPROTO_TCP) { struct tcphdr *tcp = (struct tcphdr *) ---- sle11-2009-05-14.orig/drivers/xen/sfc_netutil/accel_util.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/sfc_netutil/accel_util.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netutil/accel_util.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netutil/accel_util.h 2009-02-16 16:18:36.000000000 +0100 @@ -63,9 +63,6 @@ DPRINTK("%s at %s:%d\n", #exp, __FILE__, __LINE__); \ } while(0) @@ -5810,8 +5810,8 @@ Acked-by: jbeulich@novell.com #include /*! Map a set of pages from another domain ---- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_probe.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_probe.c 2009-02-16 16:18:36.000000000 +0100 @@ -174,11 +174,9 @@ static int read_backend_details(struct x } @@ -5841,8 +5841,8 @@ Acked-by: jbeulich@novell.com return 0; } ---- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe_backend.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe_backend.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_probe_backend.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_probe_backend.c 2009-02-16 16:18:36.000000000 +0100 @@ -60,8 +60,7 @@ #include #endif @@ -5900,8 +5900,8 @@ Acked-by: jbeulich@novell.com } return 0; ---- sle11-2009-05-14.orig/drivers/xen/xenoprof/xenoprofile.c 2009-03-04 11:25:55.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenoprof/xenoprofile.c 2009-03-11 15:39:38.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenoprof/xenoprofile.c 2009-03-04 11:25:55.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenoprof/xenoprofile.c 2009-03-11 15:39:38.000000000 +0100 @@ -29,7 +29,6 @@ #include #include @@ -5920,8 +5920,8 @@ Acked-by: jbeulich@novell.com if (!is_passive) oprofile_samples++; else ---- sle11-2009-05-14.orig/fs/xfs/linux-2.6/xfs_buf.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/fs/xfs/linux-2.6/xfs_buf.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/fs/xfs/linux-2.6/xfs_buf.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/fs/xfs/linux-2.6/xfs_buf.c 2009-02-16 16:18:36.000000000 +0100 @@ -187,7 +187,7 @@ free_address( { a_list_t *aentry; @@ -5931,8 +5931,8 @@ Acked-by: jbeulich@novell.com /* * Xen needs to be able to make sure it can get an exclusive * RO mapping of pages it wants to turn into a pagetable. If ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/agp.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/agp.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/agp.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/agp.h 2009-02-16 16:18:36.000000000 +0100 @@ -1,20 +1,22 @@ -#ifndef AGP_H -#define AGP_H 1 @@ -5982,15 +5982,15 @@ Acked-by: jbeulich@novell.com /* Convert a physical address to an address suitable for the GART. */ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "desc_32.h" +#else +# include "desc_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_64.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc_64.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -34,6 +34,18 @@ static inline void clear_LDT(void) put_cpu(); } @@ -6047,15 +6047,15 @@ Acked-by: jbeulich@novell.com static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "dma-mapping_32.h" +#else +# include "dma-mapping_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2008-12-15 11:26:44.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2008-12-15 11:26:44.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -7,9 +7,9 @@ */ @@ -6067,8 +6067,8 @@ Acked-by: jbeulich@novell.com #include static inline int ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -6,8 +6,7 @@ * documentation. */ @@ -6086,7 +6086,7 @@ Acked-by: jbeulich@novell.com -#include +#include "dma-mapping_32.h" --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/fixmap.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "fixmap_32.h" @@ -6094,7 +6094,7 @@ Acked-by: jbeulich@novell.com +# include "fixmap_64.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypercall.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypercall.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,404 @@ +/****************************************************************************** + * hypercall.h @@ -6500,8 +6500,8 @@ Acked-by: jbeulich@novell.com +} + +#endif /* __HYPERCALL_H__ */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypercall_32.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypercall_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypercall_32.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypercall_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -1,191 +1,10 @@ -/****************************************************************************** - * hypercall.h @@ -6937,8 +6937,8 @@ Acked-by: jbeulich@novell.com - - -#endif /* __HYPERCALL_H__ */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypercall_64.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypercall_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypercall_64.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypercall_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -1,197 +1,10 @@ -/****************************************************************************** - * hypercall.h @@ -7376,8 +7376,8 @@ Acked-by: jbeulich@novell.com -} - -#endif /* __HYPERCALL_H__ */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-04 11:28:11.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypervisor.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-04 11:28:11.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypervisor.h 2009-02-16 16:18:36.000000000 +0100 @@ -194,7 +194,6 @@ static inline void xen_multicall_flush(b extern char hypercall_page[PAGE_SIZE]; #else @@ -7387,7 +7387,7 @@ Acked-by: jbeulich@novell.com #endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/io.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/io.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "io_32.h" @@ -7395,15 +7395,15 @@ Acked-by: jbeulich@novell.com +# include "io_64.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/irqflags.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "irqflags_32.h" +#else +# include "irqflags_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -148,6 +148,23 @@ static inline int raw_irqs_disabled_flag \ raw_irqs_disabled_flags(flags); \ @@ -7446,8 +7446,8 @@ Acked-by: jbeulich@novell.com +#endif + #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags_64.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/irqflags_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags_64.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -116,6 +116,22 @@ static inline int raw_irqs_disabled_flag }) @@ -7493,7 +7493,7 @@ Acked-by: jbeulich@novell.com #endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/maddr.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/maddr.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "maddr_32.h" @@ -7501,7 +7501,7 @@ Acked-by: jbeulich@novell.com +# include "maddr_64.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/mmu_context.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mmu_context_32.h" @@ -7509,7 +7509,7 @@ Acked-by: jbeulich@novell.com +# include "mmu_context_64.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/page.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 @@ -7524,8 +7524,8 @@ Acked-by: jbeulich@novell.com +# include "page_64.h" +# endif +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -207,6 +207,7 @@ static inline unsigned long __phys_addr( VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) @@ -7535,7 +7535,7 @@ Acked-by: jbeulich@novell.com #include #include --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pci.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pci.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,100 @@ +#ifndef __x86_PCI_H +#define __x86_PCI_H @@ -7637,8 +7637,8 @@ Acked-by: jbeulich@novell.com + + +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -4,52 +4,10 @@ #ifdef __KERNEL__ @@ -7725,15 +7725,15 @@ Acked-by: jbeulich@novell.com #endif /* __i386_PCI_H */ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgalloc.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgalloc.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "pgalloc_32.h" +#else +# include "pgalloc_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -112,6 +112,8 @@ static inline void pgd_list_del(pgd_t *p spin_unlock(&pgd_lock); } @@ -7781,15 +7781,15 @@ Acked-by: jbeulich@novell.com free_pages((unsigned long)pgd, 1); } --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "pgtable_32.h" +#else +# include "pgtable_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -17,10 +17,7 @@ #include #include @@ -7811,8 +7811,8 @@ Acked-by: jbeulich@novell.com void pgtable_cache_init(void); void paging_init(void); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -9,7 +9,7 @@ * the x86-64 page table tree. */ @@ -7831,15 +7831,15 @@ Acked-by: jbeulich@novell.com #define MODULES_END _AC(0xfffffffffff00000, UL) #define MODULES_LEN (MODULES_END - MODULES_VADDR) --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "processor_32.h" +#else +# include "processor_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -80,6 +80,7 @@ struct cpuinfo_x86 { unsigned char booted_cores; /* number of cores as seen by OS */ __u8 phys_proc_id; /* Physical processor id. */ @@ -7932,8 +7932,8 @@ Acked-by: jbeulich@novell.com #else #define ASM_NOP1 GENERIC_NOP1 #define ASM_NOP2 GENERIC_NOP2 ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -74,6 +74,7 @@ struct cpuinfo_x86 { __u8 booted_cores; /* number of cores as seen by OS */ __u8 phys_proc_id; /* Physical Processor id. */ @@ -8028,7 +8028,7 @@ Acked-by: jbeulich@novell.com unsigned long edx) { --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/segment.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/segment.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "segment_32.h" @@ -8036,15 +8036,15 @@ Acked-by: jbeulich@novell.com +# include "../../segment_64.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "smp_32.h" +#else +# include "smp_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_32.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_32.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -11,7 +11,7 @@ #endif @@ -8079,8 +8079,8 @@ Acked-by: jbeulich@novell.com #ifdef CONFIG_HOTPLUG_CPU extern void cpu_exit_clear(void); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_64.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_64.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -40,10 +40,19 @@ extern void lock_ipi_call_lock(void); extern void unlock_ipi_call_lock(void); extern int smp_num_siblings; @@ -8137,7 +8137,7 @@ Acked-by: jbeulich@novell.com #endif /* !CONFIG_SMP */ #endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/swiotlb.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/swiotlb.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "swiotlb_32.h" @@ -8145,15 +8145,15 @@ Acked-by: jbeulich@novell.com +# include "../../swiotlb.h" +#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "system_32.h" +#else +# include "system_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -9,6 +9,7 @@ #include @@ -8226,8 +8226,8 @@ Acked-by: jbeulich@novell.com +void __show_registers(struct pt_regs *, int all); #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -11,8 +11,12 @@ #ifdef __KERNEL__ @@ -8296,15 +8296,15 @@ Acked-by: jbeulich@novell.com #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/tlbflush.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/tlbflush.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "tlbflush_32.h" +#else +# include "tlbflush_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:18:36.000000000 +0100 @@ -23,7 +23,6 @@ * - flush_tlb_page(vma, vmaddr) flushes one page * - flush_tlb_range(vma, start, end) flushes a range of pages @@ -8324,8 +8324,8 @@ Acked-by: jbeulich@novell.com -} - #endif /* _I386_TLBFLUSH_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:18:36.000000000 +0100 @@ -28,7 +28,6 @@ * - flush_tlb_page(vma, vmaddr) flushes one page * - flush_tlb_range(vma, start, end) flushes a range of pages @@ -8348,15 +8348,15 @@ Acked-by: jbeulich@novell.com - #endif /* _X8664_TLBFLUSH_H */ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/xor.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/xor.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "../../xor_32.h" +#else +# include "xor_64.h" +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mmu.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mmu.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mmu.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mmu.h 2009-02-16 16:18:36.000000000 +0100 @@ -16,6 +16,9 @@ typedef struct { rwlock_t ldtlock; #endif @@ -8367,8 +8367,8 @@ Acked-by: jbeulich@novell.com struct mutex lock; void *vdso; } mm_context_t; ---- sle11-2009-05-14.orig/include/linux/kexec.h 2009-02-16 15:58:14.000000000 +0100 -+++ sle11-2009-05-14/include/linux/kexec.h 2009-02-17 12:43:57.000000000 +0100 +--- sle11-2009-06-29.orig/include/linux/kexec.h 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/include/linux/kexec.h 2009-02-17 12:43:57.000000000 +0100 @@ -202,8 +202,15 @@ extern int dump_after_notifier; #define VMCOREINFO_BYTES (4096) #define VMCOREINFO_NOTE_NAME "VMCOREINFO" @@ -8385,9 +8385,9 @@ Acked-by: jbeulich@novell.com /* Location of a reserved region to hold the crash kernel. */ ---- sle11-2009-05-14.orig/include/linux/oprofile.h 2009-02-16 16:01:39.000000000 +0100 -+++ sle11-2009-05-14/include/linux/oprofile.h 2009-03-12 16:16:07.000000000 +0100 -@@ -116,6 +116,8 @@ void oprofile_add_pc(unsigned long pc, i +--- sle11-2009-06-29.orig/include/linux/oprofile.h 2009-06-29 15:28:01.000000000 +0200 ++++ sle11-2009-06-29/include/linux/oprofile.h 2009-06-29 15:28:57.000000000 +0200 +@@ -119,6 +119,8 @@ void oprofile_add_pc(unsigned long pc, i /* add a backtrace entry, to be called from the ->backtrace callback */ void oprofile_add_trace(unsigned long eip); @@ -8396,8 +8396,8 @@ Acked-by: jbeulich@novell.com /* add a domain switch entry */ int oprofile_add_domain_switch(int32_t domain_id); ---- sle11-2009-05-14.orig/include/linux/sysctl.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/linux/sysctl.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/linux/sysctl.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/linux/sysctl.h 2009-02-16 16:18:36.000000000 +0100 @@ -69,6 +69,7 @@ enum CTL_BUS=8, /* Busses */ CTL_ABI=9, /* Binary emulation */ @@ -8406,8 +8406,8 @@ Acked-by: jbeulich@novell.com CTL_ARLAN=254, /* arlan wireless driver */ CTL_S390DBF=5677, /* s390 debug */ CTL_SUNRPC=7249, /* sunrpc debug */ ---- sle11-2009-05-14.orig/include/xen/pcifront.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/xen/pcifront.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/xen/pcifront.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/xen/pcifront.h 2009-02-16 16:18:36.000000000 +0100 @@ -12,13 +12,11 @@ #ifndef __ia64__ @@ -8445,7 +8445,7 @@ Acked-by: jbeulich@novell.com struct pcifront_sd *sd) { --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/xen/sysctl.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/xen/sysctl.h 2009-02-16 16:18:36.000000000 +0100 @@ -0,0 +1,11 @@ +#ifndef _XEN_SYSCTL_H +#define _XEN_SYSCTL_H @@ -8458,8 +8458,8 @@ Acked-by: jbeulich@novell.com +}; + +#endif /* _XEN_SYSCTL_H */ ---- sle11-2009-05-14.orig/include/xen/xenbus.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/xen/xenbus.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/xen/xenbus.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/xen/xenbus.h 2009-02-16 16:18:36.000000000 +0100 @@ -107,7 +107,7 @@ struct xenbus_driver { int (*suspend)(struct xenbus_device *dev); int (*suspend_cancel)(struct xenbus_device *dev); @@ -8469,8 +8469,8 @@ Acked-by: jbeulich@novell.com struct device_driver driver; int (*read_otherend_details)(struct xenbus_device *dev); int (*is_ready)(struct xenbus_device *dev); ---- sle11-2009-05-14.orig/kernel/kexec.c 2009-02-17 11:34:22.000000000 +0100 -+++ sle11-2009-05-14/kernel/kexec.c 2009-02-17 12:38:20.000000000 +0100 +--- sle11-2009-06-29.orig/kernel/kexec.c 2009-02-17 11:34:22.000000000 +0100 ++++ sle11-2009-06-29/kernel/kexec.c 2009-02-17 12:38:20.000000000 +0100 @@ -52,7 +52,11 @@ int dump_after_notifier; /* vmcoreinfo stuff */ @@ -8520,8 +8520,8 @@ Acked-by: jbeulich@novell.com VMCOREINFO_SYMBOL(_stext); #ifndef CONFIG_NEED_MULTIPLE_NODES ---- sle11-2009-05-14.orig/kernel/sysctl_check.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/kernel/sysctl_check.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/kernel/sysctl_check.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/kernel/sysctl_check.c 2009-02-16 16:18:36.000000000 +0100 @@ -4,6 +4,7 @@ #include #include @@ -8555,8 +8555,8 @@ Acked-by: jbeulich@novell.com { CTL_ARLAN, "arlan", trans_arlan_table }, { CTL_S390DBF, "s390dbf", trans_s390dbf_table }, { CTL_SUNRPC, "sunrpc", trans_sunrpc_table }, ---- sle11-2009-05-14.orig/lib/swiotlb-xen.c 2009-02-05 11:16:51.000000000 +0100 -+++ sle11-2009-05-14/lib/swiotlb-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/lib/swiotlb-xen.c 2009-02-05 11:16:51.000000000 +0100 ++++ sle11-2009-06-29/lib/swiotlb-xen.c 2009-02-16 16:18:36.000000000 +0100 @@ -27,7 +27,7 @@ #include #include diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.25 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.25 similarity index 98% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.25 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.25 index 750959062..a1535d8be 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.25 +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.25 @@ -6,8 +6,8 @@ Signed-off-by: Greg Kroah-Hartman Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches.py ---- sle11-2009-05-14.orig/arch/x86/Kconfig 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/Kconfig 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/Kconfig 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig 2009-03-16 16:33:40.000000000 +0100 @@ -27,7 +27,7 @@ config X86 select HAVE_KRETPROBES select HAVE_DYNAMIC_FTRACE @@ -75,8 +75,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches help Enables some debug statements within the PCI Frontend. ---- sle11-2009-05-14.orig/arch/x86/Kconfig.debug 2009-02-02 09:40:56.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/Kconfig.debug 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/Kconfig.debug 2009-02-02 09:40:56.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig.debug 2009-03-16 16:33:40.000000000 +0100 @@ -279,6 +279,7 @@ config DEBUG_BOOT_PARAMS bool "Debug boot parameters" depends on DEBUG_KERNEL @@ -85,8 +85,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches help This option will cause struct boot_params to be exported via debugfs. ---- sle11-2009-05-14.orig/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/ia32/ia32entry-xen.S 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/ia32/ia32entry-xen.S 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/ia32/ia32entry-xen.S 2009-03-16 16:33:40.000000000 +0100 @@ -12,7 +12,6 @@ #include #include @@ -130,8 +130,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + .quad compat_sys_timerfd_settime /* 325 */ + .quad compat_sys_timerfd_gettime ia32_syscall_end: ---- sle11-2009-05-14.orig/arch/x86/kernel/Makefile 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/Makefile 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/Makefile 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/Makefile 2009-03-16 16:33:40.000000000 +0100 @@ -120,11 +120,10 @@ ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o @@ -145,8 +145,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches smpboot_$(BITS).o tsc_$(BITS).o tsc_sync.o -disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += mpparse_64.o -%/head_64.o %/head_64.s: asflags-$(CONFIG_XEN) := ---- sle11-2009-05-14.orig/arch/x86/kernel/acpi/boot.c 2008-12-01 11:11:08.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/acpi/boot.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/boot.c 2008-12-01 11:11:08.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/boot.c 2009-03-16 16:33:40.000000000 +0100 @@ -133,6 +133,9 @@ char *__init __acpi_map_table(unsigned l #ifndef CONFIG_XEN if (phys+size <= (max_low_pfn_mapped << PAGE_SHIFT)) @@ -158,7 +158,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches offset = phys & (PAGE_SIZE - 1); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/kernel/acpi/sleep-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/sleep-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,95 @@ +/* + * sleep.c - x86-specific ACPI sleep support. @@ -255,7 +255,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + +__setup("acpi_sleep=", acpi_sleep_setup); +#endif /* CONFIG_ACPI_PV_SLEEP */ ---- sle11-2009-05-14.orig/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/sleep_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* @@ -375,7 +375,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - -core_initcall(acpisleep_dmi_init); -#endif /* CONFIG_ACPI_PV_SLEEP */ ---- sle11-2009-05-14.orig/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/sleep_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -/* @@ -503,8 +503,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -__setup("acpi_sleep=", acpi_sleep_setup); -#endif /* CONFIG_ACPI_PV_SLEEP */ - ---- sle11-2009-05-14.orig/arch/x86/kernel/apic_32-xen.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/apic_32-xen.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -86,7 +86,7 @@ int setup_profiling_timer(unsigned int m * This initializes the IO-APIC and APIC hardware if this is * a UP kernel. @@ -514,8 +514,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches { #ifdef CONFIG_X86_IO_APIC if (smp_found_config) ---- sle11-2009-05-14.orig/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -34,34 +34,17 @@ #include #include @@ -622,8 +622,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - - return 1; -} ---- sle11-2009-05-14.orig/arch/x86/kernel/asm-offsets_32.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/asm-offsets_32.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/asm-offsets_32.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/asm-offsets_32.c 2009-03-16 16:33:40.000000000 +0100 @@ -23,8 +23,10 @@ #include #endif @@ -635,8 +635,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* workaround for a warning with -Wmissing-prototypes */ void foo(void); ---- sle11-2009-05-14.orig/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/cpu/common-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/common-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/common-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -27,45 +27,50 @@ #include "cpu.h" @@ -1038,8 +1038,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches load_LDT(&init_mm.context); ---- sle11-2009-05-14.orig/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/mtrr/main-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -33,7 +33,7 @@ struct mtrr_ops generic_mtrr_ops = { struct mtrr_ops *mtrr_if = &generic_mtrr_ops; @@ -1101,8 +1101,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches op.cmd = XENPF_del_memtype; op.u.del_memtype.handle = 0; op.u.del_memtype.reg = reg; ---- sle11-2009-05-14.orig/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/e820_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/e820_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -7,7 +7,6 @@ #include #include @@ -1473,8 +1473,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + print_memory_map("modified"); +} +#endif ---- sle11-2009-05-14.orig/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/e820_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/e820_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -1,4 +1,4 @@ -/* +/* @@ -2271,8 +2271,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } int __init arch_get_ram_range(int slot, u64 *addr, u64 *size) ---- sle11-2009-05-14.orig/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/early_printk-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/early_printk-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/early_printk-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -222,7 +222,7 @@ static struct console simnow_console = { }; @@ -2282,8 +2282,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches static int early_console_initialized = 0; void early_printk(const char *fmt, ...) ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:18.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:32.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:18.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:18:32.000000000 +0200 @@ -59,7 +59,7 @@ * for paravirtualization. The following will never clobber any registers: * INTERRUPT_RETURN (aka. "iret") @@ -2624,8 +2624,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#undef sys_fork +#undef sys_clone +#undef sys_vfork ---- sle11-2009-05-14.orig/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/entry_64-xen.S 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_64-xen.S 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_64-xen.S 2009-03-16 16:33:40.000000000 +0100 @@ -54,17 +54,22 @@ #include #include @@ -2939,8 +2939,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches TRACE_IRQS_OFF GET_THREAD_INFO(%rcx) jmp retint_restore_args ---- sle11-2009-05-14.orig/arch/x86/kernel/fixup.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/fixup.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/fixup.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/fixup.c 2009-03-16 16:33:40.000000000 +0100 @@ -36,7 +36,7 @@ #define DP(_f, _args...) printk(KERN_ALERT " " _f "\n" , ## _args ) @@ -2950,8 +2950,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches { static unsigned long printed = 0; char info[100]; ---- sle11-2009-05-14.orig/arch/x86/kernel/genapic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/genapic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/genapic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/genapic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -24,20 +24,13 @@ #include #endif @@ -2977,8 +2977,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); #ifndef CONFIG_XEN ---- sle11-2009-05-14.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/head64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -16,6 +16,7 @@ #include #include @@ -3084,8 +3084,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + start_kernel(); } ---- sle11-2009-05-14.orig/arch/x86/kernel/head_32-xen.S 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/head_32-xen.S 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/head_32-xen.S 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head_32-xen.S 2009-03-16 16:33:40.000000000 +0100 @@ -3,6 +3,7 @@ .text #include @@ -3103,8 +3103,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches .fill 1024,4,0 ENTRY(empty_zero_page) .fill 4096,1,0 ---- sle11-2009-05-14.orig/arch/x86/kernel/init_task-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/init_task-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/init_task-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/init_task-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -19,7 +19,7 @@ static struct sighand_struct init_sighan #endif struct mm_struct init_mm = INIT_MM(init_mm); @@ -3114,8 +3114,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * Initial thread structure. ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -35,6 +35,7 @@ #include #include @@ -3187,8 +3187,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches .suspend = ioapic_suspend, .resume = ioapic_resume, }; ---- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/io_apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -32,9 +32,11 @@ #include #include @@ -3378,7 +3378,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +late_initcall(ioapic_insert_resources); +#endif /* !CONFIG_XEN */ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/kernel/ioport-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ioport-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,112 @@ +/* + * This contains the io-permission bitmap code - written by obz, with changes @@ -3492,7 +3492,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +out: + return rc; +} ---- sle11-2009-05-14.orig/arch/x86/kernel/ioport_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ioport_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/* @@ -3616,7 +3616,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - set_iopl_mask(t->iopl); - return 0; -} ---- sle11-2009-05-14.orig/arch/x86/kernel/ioport_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ioport_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -/* @@ -3718,8 +3718,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - - return 0; -} ---- sle11-2009-05-14.orig/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/irq_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -66,11 +66,11 @@ static union irq_ctx *softirq_ctx[NR_CPU * SMP cross-CPU interrupts have their own specific * handlers). @@ -3776,8 +3776,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches : "0" (irq), "1" (desc), "2" (isp), "D" (desc->handle_irq) : "memory", "cc" ---- sle11-2009-05-14.orig/arch/x86/kernel/irq_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/irq_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -20,6 +20,28 @@ atomic_t irq_err_count; @@ -3848,7 +3848,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -} -#endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/kernel/ldt-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ldt-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,272 @@ +/* + * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds @@ -4122,7 +4122,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + } + return ret; +} ---- sle11-2009-05-14.orig/arch/x86/kernel/ldt_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,265 +0,0 @@ -/* @@ -4390,7 +4390,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - } - return ret; -} ---- sle11-2009-05-14.orig/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,271 +0,0 @@ -/* @@ -4664,8 +4664,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - } - return ret; -} ---- sle11-2009-05-14.orig/arch/x86/kernel/machine_kexec_64.c 2008-11-25 12:35:54.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/machine_kexec_64.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/machine_kexec_64.c 2008-11-25 12:35:54.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/machine_kexec_64.c 2009-03-16 16:33:40.000000000 +0100 @@ -300,7 +300,9 @@ void machine_kexec(struct kimage *image) void arch_crash_save_vmcoreinfo(void) @@ -4676,8 +4676,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches VMCOREINFO_SYMBOL(init_level4_pgt); #ifdef CONFIG_NUMA ---- sle11-2009-05-14.orig/arch/x86/kernel/microcode-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/microcode-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/microcode-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/microcode-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -167,7 +167,7 @@ static int request_microcode(void) } @@ -4687,8 +4687,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches op.u.microcode.length = firmware->size; error = HYPERVISOR_platform_op(&op); ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -68,7 +68,7 @@ unsigned int def_to_bigsmp = 0; /* Processor that is doing the boot up */ unsigned int boot_cpu_physical_apicid = -1U; @@ -4817,8 +4817,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * For PCI devices assign IRQs in order, avoiding gaps * due to unused I/O APIC pins. ---- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/mpparse_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -60,14 +60,20 @@ unsigned int boot_cpu_id = -1U; EXPORT_SYMBOL(boot_cpu_id); @@ -4876,8 +4876,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } cpu_set(cpu, cpu_possible_map); ---- sle11-2009-05-14.orig/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/pci-dma-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/pci-dma-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/pci-dma-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -434,3 +434,23 @@ dma_sync_single_for_device(struct device swiotlb_sync_single_for_device(dev, dma_handle, size, direction); } @@ -4902,8 +4902,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + flush_write_buffers(); +} +EXPORT_SYMBOL(dma_sync_sg_for_device); ---- sle11-2009-05-14.orig/arch/x86/kernel/process_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -23,7 +23,6 @@ #include #include @@ -5599,8 +5599,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + unsigned long range_end = mm->brk + 0x02000000; + return randomize_range(mm->brk, range_end, 0) ? : mm->brk; +} ---- sle11-2009-05-14.orig/arch/x86/kernel/process_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/process_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -3,7 +3,7 @@ * * Pentium III FXSR, SSE support @@ -6265,8 +6265,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + unsigned long range_end = mm->brk + 0x02000000; + return randomize_range(mm->brk, range_end, 0) ? : mm->brk; +} ---- sle11-2009-05-14.orig/arch/x86/kernel/quirks-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/quirks-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/quirks-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/quirks-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -9,7 +9,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) { @@ -6462,8 +6462,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches break; } } ---- sle11-2009-05-14.orig/arch/x86/kernel/rtc.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/kernel/rtc.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/rtc.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/rtc.c 2009-03-16 16:33:40.000000000 +0100 @@ -181,6 +181,10 @@ unsigned long read_persistent_clock(void { unsigned long retval, flags; @@ -6486,8 +6486,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches return set_rtc_mmss(now.tv_sec); } ---- sle11-2009-05-14.orig/arch/x86/kernel/setup64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -31,7 +31,11 @@ #include #endif @@ -6617,8 +6617,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * <= is required because the CPU will access up to * 8 bits beyond the end of the IO permission bitmap. ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -47,9 +47,12 @@ #include #include @@ -7113,8 +7113,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +} + +subsys_initcall(request_standard_resources); ---- sle11-2009-05-14.orig/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/setup_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -15,7 +15,6 @@ #include #include @@ -8353,8 +8353,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches .next = c_next, .stop = c_stop, .show = show_cpuinfo, ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -168,7 +168,7 @@ void __send_IPI_shortcut(unsigned int sh } } @@ -8380,8 +8380,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * ---- sle11-2009-05-14.orig/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/smp_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -33,7 +33,7 @@ #ifndef CONFIG_XEN @@ -8634,8 +8634,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches void smp_send_stop(void) { ---- sle11-2009-05-14.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:35.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:48.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:35.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/time_32-xen.c 2009-03-24 10:12:48.000000000 +0100 @@ -28,21 +28,9 @@ * serialize accesses to xtime/lost_ticks). */ @@ -8874,8 +8874,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } extern void (*late_time_init)(void); ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -79,7 +79,8 @@ char ignore_fpu_irq = 0; * F0 0F bug workaround.. We have a special link segment * for this. @@ -9560,8 +9560,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches printk(KERN_INFO "Enabling fast FPU save and restore... "); set_in_cr4(X86_CR4_OSFXSR); printk("done.\n"); ---- sle11-2009-05-14.orig/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/traps_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -74,38 +74,41 @@ asmlinkage void alignment_check(void); asmlinkage void machine_check(void); asmlinkage void spurious_interrupt_bug(void); @@ -10297,8 +10297,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + return 1; +} +__setup("code_bytes=", code_bytes_setup); ---- sle11-2009-05-14.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/kernel/vsyscall_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/vsyscall_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -43,12 +43,7 @@ #include @@ -10430,7 +10430,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #ifdef CONFIG_XEN vsyscall_gtod_data.sysctl_enabled = 0; /* disable vgettimeofay() */ if (boot_cpu_has(X86_FEATURE_RDTSCP)) ---- sle11-2009-05-14.orig/arch/x86/kernel/xen_entry_64.S 2009-05-14 10:56:29.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/xen_entry_64.S 2009-06-29 15:14:52.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* @@ -10469,8 +10469,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - XEN_LOCKED_UNBLOCK_EVENTS(reg) ; \ - XEN_PUT_VCPU_INFO(reg) -#define XEN_TEST_PENDING(reg) testb $0xFF,evtchn_upcall_pending(reg) ---- sle11-2009-05-14.orig/arch/x86/mach-xen/setup.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mach-xen/setup.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mach-xen/setup.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mach-xen/setup.c 2009-03-16 16:33:40.000000000 +0100 @@ -161,15 +161,12 @@ void __init machine_specific_arch_setup( /* Do an early initialization of the fixmap area */ @@ -10492,7 +10492,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } } --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/mm/fault-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,1025 @@ +/* + * Copyright (C) 1995 Linus Torvalds @@ -11519,7 +11519,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + (__START_KERNEL & PGDIR_MASK))); +#endif +} ---- sle11-2009-05-14.orig/arch/x86/mm/fault_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_32-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,757 +0,0 @@ -/* @@ -12279,7 +12279,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - start = address + (1UL << PMD_SHIFT); - } -} ---- sle11-2009-05-14.orig/arch/x86/mm/fault_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/fault_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,686 +0,0 @@ -/* @@ -12968,8 +12968,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) == - (__START_KERNEL & PGDIR_MASK))); -} ---- sle11-2009-05-14.orig/arch/x86/mm/highmem_32-xen.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/highmem_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/highmem_32-xen.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/highmem_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -18,6 +18,49 @@ void kunmap(struct page *page) kunmap_high(page); } @@ -13029,8 +13029,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); BUG_ON(!pte_none(*(kmap_pte-idx))); ---- sle11-2009-05-14.orig/arch/x86/mm/hypervisor.c 2009-05-06 10:23:43.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/mm/hypervisor.c 2009-05-14 11:18:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/hypervisor.c 2009-05-06 10:23:43.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/mm/hypervisor.c 2009-05-14 11:18:39.000000000 +0200 @@ -869,15 +869,11 @@ int xen_limit_pages_to_max_mfn( } EXPORT_SYMBOL_GPL(xen_limit_pages_to_max_mfn); @@ -13050,8 +13050,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #define MAX_BATCHED_FULL_PTES 32 ---- sle11-2009-05-14.orig/arch/x86/mm/init_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -27,13 +27,13 @@ #include #include @@ -13937,8 +13937,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } #endif - ---- sle11-2009-05-14.orig/arch/x86/mm/init_64-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/init_64-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_64-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_64-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -46,14 +46,13 @@ #include #include @@ -14928,7 +14928,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } #endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/mm/ioremap-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/ioremap-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,687 @@ +/* + * Re-map IO memory to kernel address space so that we can access it. @@ -15617,7 +15617,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +{ + WARN_ON(1); +} ---- sle11-2009-05-14.orig/arch/x86/mm/ioremap_32-xen.c 2009-02-16 16:17:21.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/ioremap_32-xen.c 2009-02-16 16:17:21.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,445 +0,0 @@ -/* @@ -16066,7 +16066,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - } -} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/mm/pageattr-xen.c 2009-03-16 16:37:14.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pageattr-xen.c 2009-03-16 16:37:14.000000000 +0100 @@ -0,0 +1,1413 @@ +/* + * Copyright 2002 Andi Kleen, SuSE Labs. @@ -17481,7 +17481,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#ifdef CONFIG_CPA_DEBUG +#include "pageattr-test.c" +#endif ---- sle11-2009-05-14.orig/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr_64-xen.c 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,542 +0,0 @@ -/* @@ -18026,8 +18026,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - -EXPORT_SYMBOL(change_page_attr); -EXPORT_SYMBOL(global_flush_tlb); ---- sle11-2009-05-14.orig/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pgtable_32-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -29,8 +29,6 @@ #include #include @@ -18818,8 +18818,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - !mm->context.has_foreign_mappings) - mm_unpin(mm); -} ---- sle11-2009-05-14.orig/arch/x86/pci/irq-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/pci/irq-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/pci/irq-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/pci/irq-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -204,6 +204,7 @@ static int pirq_ali_get(struct pci_dev * { static const unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; @@ -18917,8 +18917,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches r->name = "PIIX/ICH"; r->get = pirq_piix_get; r->set = pirq_piix_set; ---- sle11-2009-05-14.orig/arch/x86/vdso/Makefile 2008-11-25 12:35:54.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/vdso/Makefile 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/vdso/Makefile 2008-11-25 12:35:54.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/Makefile 2009-03-16 16:33:40.000000000 +0100 @@ -66,6 +66,7 @@ vdso32.so-$(VDSO32-y) += int80 vdso32.so-$(CONFIG_COMPAT) += syscall vdso32.so-$(VDSO32-y) += sysenter @@ -18927,8 +18927,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches vdso32.so-$(CONFIG_XEN) += $(xen-vdso32-y) vdso32-images = $(vdso32.so-y:%=vdso32-%.so) ---- sle11-2009-05-14.orig/arch/x86/vdso/vdso32/syscall.S 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/vdso/vdso32/syscall.S 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/vdso/vdso32/syscall.S 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32/syscall.S 2009-03-16 16:33:40.000000000 +0100 @@ -19,8 +19,10 @@ __kernel_vsyscall: .Lpush_ebp: movl %ecx, %ebp @@ -18940,8 +18940,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches movl %ebp, %ecx popl %ebp .Lpop_ebp: ---- sle11-2009-05-14.orig/arch/x86/vdso/vdso32.S 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/arch/x86/vdso/vdso32.S 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/vdso/vdso32.S 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32.S 2009-03-16 16:33:40.000000000 +0100 @@ -19,4 +19,16 @@ vdso32_sysenter_start: .incbin "arch/x86/vdso/vdso32-sysenter.so" vdso32_sysenter_end: @@ -18959,8 +18959,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif + __FINIT ---- sle11-2009-05-14.orig/arch/x86/vdso/vdso32-setup.c 2008-11-25 12:35:53.000000000 +0100 -+++ sle11-2009-05-14/arch/x86/vdso/vdso32-setup.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/vdso/vdso32-setup.c 2008-11-25 12:35:53.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32-setup.c 2009-03-16 16:33:40.000000000 +0100 @@ -26,10 +26,6 @@ #include #include @@ -19017,7 +19017,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches static struct vm_area_struct gate_vma; --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/arch/x86/vdso/vdso32-setup-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32-setup-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,506 @@ +/* + * (C) Copyright 2002 Linus Torvalds @@ -19525,8 +19525,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +} + +#endif /* CONFIG_X86_64 */ ---- sle11-2009-05-14.orig/drivers/pci/msi-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/drivers/pci/msi-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/pci/msi-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/drivers/pci/msi-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -43,6 +43,53 @@ struct msi_pirq_entry { int entry_nr; }; @@ -19650,8 +19650,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - } -} -#endif ---- sle11-2009-05-14.orig/drivers/pci/pci.c 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/pci/pci.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/pci/pci.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/pci/pci.c 2009-03-16 16:33:40.000000000 +0100 @@ -353,7 +353,12 @@ pci_find_parent_resource(const struct pc * Restore the BAR values for a given device, so as to make it * accessible by its driver. @@ -19665,9 +19665,9 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches pci_restore_bars(struct pci_dev *dev) { int i, numres; ---- sle11-2009-05-14.orig/drivers/xen/balloon/sysfs.c 2009-03-04 11:25:55.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/balloon/sysfs.c 2009-03-16 16:33:40.000000000 +0100 -@@ -108,7 +108,7 @@ static struct attribute_group balloon_in +--- sle11-2009-06-29.orig/drivers/xen/balloon/sysfs.c 2009-03-04 11:25:55.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/balloon/sysfs.c 2009-06-29 15:29:24.000000000 +0200 +@@ -104,7 +104,7 @@ static struct attribute_group balloon_in }; static struct sysdev_class balloon_sysdev_class = { @@ -19676,8 +19676,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches }; static struct sys_device balloon_sysdev; ---- sle11-2009-05-14.orig/drivers/xen/blkback/blkback.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkback/blkback.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkback/blkback.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkback/blkback.c 2009-03-16 16:33:40.000000000 +0100 @@ -148,7 +148,7 @@ static void unplug_queue(blkif_t *blkif) return; if (blkif->plug->unplug_fn) @@ -19697,8 +19697,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches blkif->plug = q; } ---- sle11-2009-05-14.orig/drivers/xen/blkfront/blkfront.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/blkfront/blkfront.c 2009-03-24 10:12:53.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/blkfront/blkfront.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/blkfront/blkfront.c 2009-03-24 10:12:53.000000000 +0100 @@ -713,7 +713,6 @@ static irqreturn_t blkif_int(int irq, vo RING_IDX i, rp; unsigned long flags; @@ -19735,8 +19735,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches break; default: BUG(); ---- sle11-2009-05-14.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:37:50.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/blktap/blktap.c 2009-04-20 11:38:54.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:37:50.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/blktap/blktap.c 2009-04-20 11:38:54.000000000 +0200 @@ -331,8 +331,8 @@ static pte_t blktap_clear_pte(struct vm_ * if vm_file is NULL (meaning mmap failed and we have nothing to do) */ @@ -19759,8 +19759,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } if (count) { ---- sle11-2009-05-14.orig/drivers/xen/core/Makefile 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/drivers/xen/core/Makefile 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/Makefile 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/core/Makefile 2009-03-16 16:33:40.000000000 +0100 @@ -10,5 +10,6 @@ obj-$(CONFIG_SYS_HYPERVISOR) += hypervis obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o obj-$(CONFIG_XEN_SYSFS) += xen_sysfs.o @@ -19768,8 +19768,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +obj-$(CONFIG_X86_SMP) += spinlock.o obj-$(CONFIG_KEXEC) += machine_kexec.o obj-$(CONFIG_XEN_XENCOMM) += xencomm.o ---- sle11-2009-05-14.orig/drivers/xen/core/evtchn.c 2009-03-04 11:25:55.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/evtchn.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/evtchn.c 2009-03-04 11:25:55.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/evtchn.c 2009-03-16 16:33:40.000000000 +0100 @@ -194,7 +194,7 @@ static inline unsigned int cpu_from_evtc /* Upcall to generic IRQ layer. */ @@ -19864,8 +19864,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } } ---- sle11-2009-05-14.orig/drivers/xen/core/hypervisor_sysfs.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/hypervisor_sysfs.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/hypervisor_sysfs.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/hypervisor_sysfs.c 2009-03-16 16:33:40.000000000 +0100 @@ -50,7 +50,7 @@ static int __init hypervisor_subsys_init if (!is_running_on_xen()) return -ENODEV; @@ -19875,8 +19875,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches return 0; } ---- sle11-2009-05-14.orig/drivers/xen/core/smpboot.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/smpboot.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/smpboot.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/smpboot.c 2009-03-16 16:33:40.000000000 +0100 @@ -135,6 +135,10 @@ static int __cpuinit xen_smp_intr_init(u goto fail; per_cpu(callfunc_irq, cpu) = rc; @@ -19948,7 +19948,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches ctxt.ctrlreg[3] = xen_pfn_to_cr3(virt_to_mfn(init_level4_pgt)); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/drivers/xen/core/spinlock.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/spinlock.c 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,161 @@ +/* + * Xen spinlock functions @@ -20017,7 +20017,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + struct spinning spinning; + + /* If kicker interrupt not initialized yet, just spin. */ -+ if (unlikely(irq < 0)) ++ if (unlikely(irq < 0) || unlikely(!cpu_online(smp_processor_id()))) + return 0; + + token >>= TICKET_SHIFT; @@ -20111,8 +20111,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + } +} +EXPORT_SYMBOL(xen_spin_kick); ---- sle11-2009-05-14.orig/drivers/xen/core/xen_sysfs.c 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/core/xen_sysfs.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/core/xen_sysfs.c 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/xen_sysfs.c 2009-03-16 16:33:40.000000000 +0100 @@ -29,12 +29,12 @@ HYPERVISOR_ATTR_RO(type); static int __init xen_sysfs_type_init(void) @@ -20209,8 +20209,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } #endif ---- sle11-2009-05-14.orig/drivers/xen/gntdev/gntdev.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/gntdev/gntdev.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/gntdev/gntdev.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/gntdev/gntdev.c 2009-03-16 16:33:40.000000000 +0100 @@ -782,7 +782,7 @@ static pte_t gntdev_clear_pte(struct vm_ op.status); } else { @@ -20229,8 +20229,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } return copy; ---- sle11-2009-05-14.orig/drivers/xen/scsifront/scsifront.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/scsifront/scsifront.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/scsifront/scsifront.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/scsifront/scsifront.c 2009-03-16 16:33:40.000000000 +0100 @@ -260,19 +260,19 @@ static int map_data_for_request(struct v return -ENOMEM; } @@ -20302,8 +20302,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } big_to_sg: ---- sle11-2009-05-14.orig/drivers/xen/xenoprof/xenoprofile.c 2009-03-11 15:39:38.000000000 +0100 -+++ sle11-2009-05-14/drivers/xen/xenoprof/xenoprofile.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/drivers/xen/xenoprof/xenoprofile.c 2009-03-11 15:39:38.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenoprof/xenoprofile.c 2009-03-16 16:33:40.000000000 +0100 @@ -78,7 +78,7 @@ static int xenoprof_resume(struct sys_de @@ -20313,8 +20313,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches .resume = xenoprof_resume, .suspend = xenoprof_suspend }; ---- sle11-2009-05-14.orig/include/asm-x86/e820.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/e820.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/e820.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/e820.h 2009-03-16 16:33:40.000000000 +0100 @@ -127,7 +127,11 @@ extern char *memory_setup(void); #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ @@ -20327,8 +20327,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #define ISA_END_ADDRESS 0x100000 #define is_ISA_range(s, e) ((s) >= ISA_START_ADDRESS && (e) < ISA_END_ADDRESS) ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/agp.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/agp.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/agp.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/agp.h 2009-03-16 16:33:40.000000000 +0100 @@ -13,18 +13,13 @@ * page. This avoids data corruption on some CPUs. */ @@ -20350,8 +20350,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * Could use CLFLUSH here if the cpu supports it. But then it would ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,404 @@ +#ifndef _ASM_DESC_H_ +#define _ASM_DESC_H_ @@ -20759,7 +20759,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif /* __ASSEMBLY__ */ + #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_32.h 2008-12-15 11:27:22.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc_32.h 2008-12-15 11:27:22.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -#ifndef __ARCH_DESC_H @@ -21024,7 +21024,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#endif /* !__ASSEMBLY__ */ - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc_64.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ -/* Written 2000 by Andi Kleen */ @@ -21255,8 +21255,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#endif /* !__ASSEMBLY__ */ - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/dma-mapping_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -84,23 +84,13 @@ dma_sync_single_range_for_device(struct dma_sync_single_for_device(dev, dma_handle+offset, size, direction); } @@ -21285,8 +21285,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches extern int dma_mapping_error(dma_addr_t dma_addr); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -64,7 +64,7 @@ enum fixed_addresses { #endif #ifdef CONFIG_X86_VISWS_APIC @@ -21333,8 +21333,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches __end_of_fixed_addresses }; ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -15,6 +15,7 @@ #include #include @@ -21381,8 +21381,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches __end_of_fixed_addresses }; ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/highmem.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/highmem.h 2009-03-16 16:33:40.000000000 +0100 @@ -37,11 +37,6 @@ extern pte_t *pkmap_page_table; * easily, subsequent pte tables have to be allocated in one physical * chunk of RAM. @@ -21411,8 +21411,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches void *kmap(struct page *page); void kunmap(struct page *page); ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-16 16:33:40.000000000 +0100 @@ -264,6 +264,25 @@ HYPERVISOR_poll( return rc; } @@ -21439,8 +21439,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #ifdef CONFIG_XEN static inline void ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/irqflags.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,247 @@ -#ifdef CONFIG_X86_32 -# include "irqflags_32.h" @@ -21692,7 +21692,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + +#endif /* __ASSEMBLY__ */ #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags_32.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -/* @@ -21907,7 +21907,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#endif - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/irqflags_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags_64.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -/* @@ -22088,8 +22088,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#endif - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/maddr_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/maddr_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/maddr_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/maddr_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,6 +1,7 @@ #ifndef _I386_MADDR_H #define _I386_MADDR_H @@ -22126,8 +22126,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #endif #else /* !CONFIG_XEN */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/maddr_64.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/maddr_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/maddr_64.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/maddr_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,6 +1,7 @@ #ifndef _X86_64_MADDR_H #define _X86_64_MADDR_H @@ -22210,8 +22210,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #else /* !CONFIG_XEN */ #define pfn_to_mfn(pfn) (pfn) ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -51,8 +51,6 @@ static inline void __prepare_arch_switch : : "r" (0) ); } @@ -22221,8 +22221,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -62,12 +62,6 @@ extern void mm_pin(struct mm_struct *mm) extern void mm_unpin(struct mm_struct *mm); void mm_pin_all(void); @@ -22263,8 +22263,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches } } #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/page.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/page.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/page.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,13 +1,231 @@ +#ifndef _ASM_X86_PAGE_H +#define _ASM_X86_PAGE_H @@ -22507,8 +22507,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches + +#endif /* __KERNEL__ */ +#endif /* _ASM_X86_PAGE_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/page_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,37 +1,9 @@ #ifndef _X86_64_PAGE_H #define _X86_64_PAGE_H @@ -22746,8 +22746,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#endif /* __KERNEL__ */ #endif /* _X86_64_PAGE_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pci.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pci.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pci.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pci.h 2009-03-16 16:33:40.000000000 +0100 @@ -71,6 +71,7 @@ extern int pci_mmap_page_range(struct pc @@ -22788,8 +22788,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -3,69 +3,109 @@ #include @@ -22938,8 +22938,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif /* CONFIG_X86_PAE */ #endif /* _I386_PGALLOC_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgalloc_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -6,30 +6,13 @@ #include #include /* for phys_to_virt and page_to_pseudophys */ @@ -23095,8 +23095,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) #define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,467 @@ +#ifndef _ASM_X86_PGTABLE_H +#define _ASM_X86_PGTABLE_H @@ -23565,8 +23565,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif /* __ASSEMBLY__ */ + +#endif /* _ASM_X86_PGTABLE_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-16 16:33:40.000000000 +0100 @@ -18,16 +18,18 @@ printk("%s:%d: bad pgd %p(%016Lx pfn %08Lx).\n", __FILE__, __LINE__, \ &(e), __pgd_val(e), (pgd_val(e) & PTE_MASK) >> PAGE_SHIFT) @@ -23731,8 +23731,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } }) #endif /* _I386_PGTABLE_3LEVEL_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,8 +1,6 @@ #ifndef _I386_PGTABLE_H #define _I386_PGTABLE_H @@ -24196,8 +24196,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#include - #endif /* _I386_PGTABLE_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -13,49 +13,26 @@ #include #include @@ -24742,8 +24742,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #endif /* !__ASSEMBLY__ */ #endif /* _X86_64_PGTABLE_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,793 @@ +#ifndef __ASM_X86_PROCESSOR_H +#define __ASM_X86_PROCESSOR_H @@ -25540,7 +25540,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#define KSTK_EIP(task) (task_pt_regs(task)->ip) + #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_32.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,751 +0,0 @@ -/* @@ -26294,7 +26294,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -extern int force_mwait; - -#endif /* __ASM_I386_PROCESSOR_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor_64.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,461 +0,0 @@ -/* @@ -26758,8 +26758,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#define HAVE_ARCH_PICK_MMAP_LAYOUT 1 - -#endif /* __ASM_X86_64_PROCESSOR_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/segment.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/segment.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/segment.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/segment.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,204 @@ +#ifndef _ASM_X86_SEGMENT_H_ +#define _ASM_X86_SEGMENT_H_ @@ -26967,7 +26967,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif + #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/segment_32.h 2008-12-15 11:27:22.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/segment_32.h 2008-12-15 11:27:22.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ -#ifndef _ASM_SEGMENT_H @@ -27120,8 +27120,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -#define SEGMENT_IS_PNP_CODE(x) (((x) & ~0x0b) == GDT_ENTRY_PNPBIOS_BASE * 8) - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_32.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_32.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_32.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_32.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,56 +1,51 @@ #ifndef __ASM_SMP_H #define __ASM_SMP_H @@ -27319,8 +27319,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches - +#endif /* !ASSEMBLY */ #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_64.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp_64.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,139 +1,103 @@ #ifndef __ASM_SMP_H #define __ASM_SMP_H @@ -27513,7 +27513,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #endif --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/spinlock.h 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/spinlock.h 2009-03-16 16:33:40.000000000 +0100 @@ -0,0 +1,333 @@ +#ifndef _X86_SPINLOCK_H_ +#define _X86_SPINLOCK_H_ @@ -27848,8 +27848,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#define _raw_write_relax(lock) cpu_relax() + +#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,393 @@ +#ifndef _ASM_X86_SYSTEM_H_ +#define _ASM_X86_SYSTEM_H_ @@ -28246,7 +28246,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +} + #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system_32.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,312 +0,0 @@ -#ifndef __ASM_SYSTEM_H @@ -28561,8 +28561,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -void __show_registers(struct pt_regs *, int all); - -#endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/system_64.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system_64.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system_64.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,122 +1,9 @@ #ifndef __ASM_SYSTEM_H #define __ASM_SYSTEM_H @@ -28739,8 +28739,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -extern void free_init_pages(char *what, unsigned long begin, unsigned long end); - #endif ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/tlbflush.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/tlbflush.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/tlbflush.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/tlbflush.h 2009-03-16 16:33:40.000000000 +0100 @@ -1,5 +1,106 @@ +#ifndef _ASM_X86_TLBFLUSH_H +#define _ASM_X86_TLBFLUSH_H @@ -28850,7 +28850,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +} + +#endif /* _ASM_X86_TLBFLUSH_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/tlbflush_32.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -#ifndef _I386_TLBFLUSH_H @@ -28952,7 +28952,7 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -} - -#endif /* _I386_TLBFLUSH_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:18:36.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/tlbflush_64.h 2009-02-16 16:18:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -#ifndef _X8664_TLBFLUSH_H @@ -29052,8 +29052,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches -} - -#endif /* _X8664_TLBFLUSH_H */ ---- sle11-2009-05-14.orig/include/asm-x86/mach-xen/irq_vectors.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/mach-xen/irq_vectors.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/irq_vectors.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/irq_vectors.h 2009-03-16 16:33:40.000000000 +0100 @@ -82,7 +82,8 @@ #define RESCHEDULE_VECTOR 0 @@ -29064,8 +29064,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * The maximum number of vectors supported by i386 processors ---- sle11-2009-05-14.orig/include/asm-x86/mmu.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/mmu.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mmu.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mmu.h 2009-03-16 16:33:40.000000000 +0100 @@ -23,7 +23,7 @@ typedef struct { void *vdso; } mm_context_t; @@ -29075,8 +29075,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches void leave_mm(int cpu); #else static inline void leave_mm(int cpu) ---- sle11-2009-05-14.orig/include/asm-x86/ptrace.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/ptrace.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/ptrace.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/ptrace.h 2009-03-16 16:33:40.000000000 +0100 @@ -249,7 +249,9 @@ extern void user_enable_single_step(stru extern void user_disable_single_step(struct task_struct *); @@ -29088,8 +29088,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #define arch_has_block_step() (1) #else #define arch_has_block_step() (boot_cpu_data.x86 >= 6) ---- sle11-2009-05-14.orig/include/asm-x86/thread_info.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/asm-x86/thread_info.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/thread_info.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/thread_info.h 2009-03-16 16:33:40.000000000 +0100 @@ -94,6 +94,9 @@ struct thread_info { #define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */ #define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ @@ -29125,8 +29125,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #define PREEMPT_ACTIVE 0x10000000 ---- sle11-2009-05-14.orig/include/asm-x86/time.h 2009-05-14 10:56:29.000000000 +0200 -+++ sle11-2009-05-14/include/asm-x86/time.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/time.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/time.h 2009-03-16 16:33:40.000000000 +0100 @@ -58,4 +58,10 @@ static inline int native_set_wallclock(u extern unsigned long __init calibrate_cpu(void); @@ -29138,8 +29138,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches +#endif + #endif ---- sle11-2009-05-14.orig/include/linux/page-flags.h 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-05-14/include/linux/page-flags.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/linux/page-flags.h 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/include/linux/page-flags.h 2009-03-16 16:33:40.000000000 +0100 @@ -102,8 +102,8 @@ enum pageflags { PG_foreign, /* Page is owned by foreign allocator. */ PG_pinned, /* Cannot alias with PG_owner_priv_1 since @@ -29151,8 +29151,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches #endif __NR_PAGEFLAGS, ---- sle11-2009-05-14.orig/include/linux/pci.h 2008-12-15 11:27:22.000000000 +0100 -+++ sle11-2009-05-14/include/linux/pci.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/linux/pci.h 2008-12-15 11:27:22.000000000 +0100 ++++ sle11-2009-06-29/include/linux/pci.h 2009-03-16 16:33:40.000000000 +0100 @@ -644,6 +644,9 @@ int pcie_set_readrq(struct pci_dev *dev, void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); int __must_check pci_assign_resource(struct pci_dev *dev, int i); @@ -29163,8 +29163,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* ROM control related routines */ void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); ---- sle11-2009-05-14.orig/include/xen/evtchn.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-05-14/include/xen/evtchn.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/xen/evtchn.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/xen/evtchn.h 2009-03-16 16:33:40.000000000 +0100 @@ -130,12 +130,37 @@ static inline void clear_evtchn(int port synch_clear_bit(port, s->evtchn_pending); } @@ -29203,8 +29203,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches /* * Use these to access the event channel underlying the IRQ handle returned * by bind_*_to_irqhandler(). ---- sle11-2009-05-14.orig/kernel/sysctl_check.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/kernel/sysctl_check.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/kernel/sysctl_check.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/kernel/sysctl_check.c 2009-03-16 16:33:40.000000000 +0100 @@ -899,7 +899,7 @@ static const struct trans_ctl_table tran }; @@ -29214,8 +29214,8 @@ Automatically created from "patches.kernel.org/patch-2.6.25" by xen-port-patches { CTL_XEN_INDEPENDENT_WALLCLOCK, "independent_wallclock" }, { CTL_XEN_PERMITTED_CLOCK_JITTER, "permitted_clock_jitter" }, {} ---- sle11-2009-05-14.orig/lib/swiotlb-xen.c 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-05-14/lib/swiotlb-xen.c 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/lib/swiotlb-xen.c 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/lib/swiotlb-xen.c 2009-03-16 16:33:40.000000000 +0100 @@ -30,7 +30,6 @@ #include diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.26 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.26 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.26 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.26 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27 similarity index 97% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27 index 8b91cdf7f..3cc47e9a7 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27 +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27 @@ -7,8 +7,8 @@ Patch-mainline: 2.6.27 Acked-by: Jeff Mahoney Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches.py ---- sle11-2009-06-04.orig/arch/x86/Kconfig 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/Kconfig 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/Kconfig 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig 2009-06-04 10:21:39.000000000 +0200 @@ -594,7 +594,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT config AMD_IOMMU bool "AMD IOMMU support" @@ -38,8 +38,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches help Convert MTRR layout from continuous to discrete, so X drivers can add writeback entries. ---- sle11-2009-06-04.orig/arch/x86/Kconfig.debug 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/Kconfig.debug 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/Kconfig.debug 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Kconfig.debug 2009-06-04 10:21:39.000000000 +0200 @@ -25,6 +25,7 @@ config STRICT_DEVMEM config X86_VERBOSE_BOOTUP bool "Enable verbose x86 bootup info messages" @@ -57,8 +57,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches select TRACING select MMIOTRACE_HOOKS help ---- sle11-2009-06-04.orig/arch/x86/Makefile 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/Makefile 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/Makefile 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/Makefile 2009-06-04 10:21:39.000000000 +0200 @@ -116,8 +116,8 @@ mflags-$(CONFIG_X86_VOYAGER) := -Iinclud mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/ @@ -81,8 +81,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches KBUILD_CFLAGS += $(mflags-y) KBUILD_AFLAGS += $(mflags-y) ---- sle11-2009-06-04.orig/arch/x86/ia32/ia32entry-xen.S 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/ia32/ia32entry-xen.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/ia32/ia32entry-xen.S 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/ia32/ia32entry-xen.S 2009-06-04 10:21:39.000000000 +0200 @@ -15,6 +15,16 @@ #include #include @@ -328,8 +328,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + .quad sys_pipe2 + .quad sys_inotify_init1 ia32_syscall_end: ---- sle11-2009-06-04.orig/arch/x86/kernel/Makefile 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/Makefile 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/Makefile 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/Makefile 2009-06-04 10:21:39.000000000 +0200 @@ -120,9 +120,10 @@ ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o @@ -344,8 +344,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +disabled-obj-$(CONFIG_XEN) := %_uv.o crash.o early-quirks.o hpet.o i8253.o \ + i8259.o irqinit_$(BITS).o pci-swiotlb_64.o reboot.o smpboot.o \ + tlb_$(BITS).o tsc.o tsc_sync.o vsmp_64.o ---- sle11-2009-06-04.orig/arch/x86/kernel/acpi/boot.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/acpi/boot.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/boot.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/boot.c 2009-06-04 10:21:39.000000000 +0200 @@ -951,7 +951,9 @@ void __init mp_register_ioapic(int id, u mp_ioapics[idx].mp_flags = MPC_APIC_USABLE; mp_ioapics[idx].mp_apicaddr = address; @@ -383,8 +383,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * For GSI >= 64, use IRQ compression */ ---- sle11-2009-06-04.orig/arch/x86/kernel/acpi/sleep-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/acpi/sleep-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/acpi/sleep-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/acpi/sleep-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -9,6 +9,7 @@ #include #include @@ -469,8 +469,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches str = strchr(str, ','); if (str != NULL) str += strspn(str, ", \t"); ---- sle11-2009-06-04.orig/arch/x86/kernel/apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/apic_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/apic_32-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/apic_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -59,7 +59,10 @@ static cpumask_t timer_bcast_ipi; /* * Debug level, exported for io_apic.c @@ -483,8 +483,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #ifndef CONFIG_XEN static int modern_apic(void) ---- sle11-2009-06-04.orig/arch/x86/kernel/apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/apic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/apic_64-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/apic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -39,7 +39,10 @@ int disable_apic; /* * Debug level, exported for io_apic.c @@ -497,8 +497,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * The guts of the apic timer interrupt ---- sle11-2009-06-04.orig/arch/x86/kernel/asm-offsets_64.c 2008-11-25 12:35:54.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/asm-offsets_64.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/asm-offsets_64.c 2008-11-25 12:35:54.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/asm-offsets_64.c 2009-06-04 10:21:39.000000000 +0200 @@ -138,7 +138,7 @@ int main(void) BLANK(); @@ -508,8 +508,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches BLANK(); OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); ---- sle11-2009-06-04.orig/arch/x86/kernel/cpu/amd_64.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/kernel/cpu/amd_64.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/amd_64.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/amd_64.c 2009-06-04 10:21:39.000000000 +0200 @@ -193,6 +193,7 @@ static void __cpuinit init_amd(struct cp fam10h_check_enable_mmcfg(); } @@ -526,8 +526,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } static struct cpu_dev amd_cpu_dev __cpuinitdata = { ---- sle11-2009-06-04.orig/arch/x86/kernel/cpu/bugs_64.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/kernel/cpu/bugs_64.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/bugs_64.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/bugs_64.c 2009-06-04 10:21:39.000000000 +0200 @@ -20,6 +20,7 @@ void __init check_bugs(void) #endif alternative_instructions(); @@ -542,8 +542,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches set_memory_4k((unsigned long)__va(0), 1); +#endif } ---- sle11-2009-06-04.orig/arch/x86/kernel/cpu/common-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/cpu/common-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/cpu/common-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/common-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -13,6 +13,7 @@ #include #include @@ -607,7 +607,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (!have_cpuid_p()) { /* --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/arch/x86/kernel/cpu/common_64-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/cpu/common_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,771 @@ +#include +#include @@ -1223,7 +1223,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + }; + + if (HYPERVISOR_callback_op(CALLBACKOP_register, &cstar)) -+ printk(KERN_WARN "Unable to register CSTAR callback\n"); ++ printk(KERN_WARNING "Unable to register CSTAR callback\n"); +#endif +} + @@ -1381,7 +1381,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + uv_cpu_init(); +} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/arch/x86/kernel/e820-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/e820-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,1545 @@ +/* + * Handle the memory map. @@ -2928,7 +2928,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + printk(KERN_INFO "Xen-provided physical RAM map:\n"); + e820_print_map(who); +} ---- sle11-2009-06-04.orig/arch/x86/kernel/e820_32-xen.c 2009-03-16 16:38:05.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_32-xen.c 2009-03-16 16:38:05.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,873 +0,0 @@ -#include @@ -3804,7 +3804,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches - print_memory_map("modified"); -} -#endif ---- sle11-2009-06-04.orig/arch/x86/kernel/e820_64-xen.c 2009-03-16 16:38:05.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/e820_64-xen.c 2009-03-16 16:38:05.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,1045 +0,0 @@ -/* @@ -4852,8 +4852,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches - max_pfn << PAGE_SHIFT) - *addr; - return i + 1; -} ---- sle11-2009-06-04.orig/arch/x86/kernel/early_printk-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/early_printk-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/early_printk-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/early_printk-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -225,7 +225,7 @@ static struct console simnow_console = { static struct console *early_console = &early_vga_console; static int early_console_initialized; @@ -4863,8 +4863,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches { char buf[512]; int n; ---- sle11-2009-06-04.orig/arch/x86/kernel/entry_32-xen.S 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/entry_32-xen.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_32-xen.S 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_32-xen.S 2009-06-04 10:21:39.000000000 +0200 @@ -51,15 +51,26 @@ #include #include @@ -5162,8 +5162,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches cmpl $nr_syscalls,%eax jb syscall_call jmp syscall_exit ---- sle11-2009-06-04.orig/arch/x86/kernel/entry_64.S 2009-06-04 00:00:00.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/kernel/entry_64.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_64.S 2009-06-29 15:15:41.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/entry_64.S 2009-06-04 10:21:39.000000000 +0200 @@ -1409,7 +1409,7 @@ ENTRY(arch_unwind_init_running) ENDPROC(arch_unwind_init_running) #endif @@ -5182,8 +5182,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #ifdef CONFIG_KDB ---- sle11-2009-06-04.orig/arch/x86/kernel/entry_64-xen.S 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/entry_64-xen.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/entry_64-xen.S 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/entry_64-xen.S 2009-06-04 10:21:39.000000000 +0200 @@ -53,19 +53,130 @@ #include #include @@ -5637,8 +5637,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches pushq $0 CFI_ADJUST_CFA_OFFSET 8 paranoidentry do_machine_check ---- sle11-2009-06-04.orig/arch/x86/kernel/fixup.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/fixup.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/fixup.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/fixup.c 2009-06-04 10:21:39.000000000 +0200 @@ -33,6 +33,7 @@ #include #include @@ -5647,8 +5647,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #define DP(_f, _args...) printk(KERN_ALERT " " _f "\n" , ## _args ) ---- sle11-2009-06-04.orig/arch/x86/kernel/genapic_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/genapic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/genapic_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/genapic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -58,7 +58,7 @@ void __init setup_apic_routing(void) else #endif @@ -5664,8 +5664,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } +EXPORT_SYMBOL_GPL(is_uv_system); #endif ---- sle11-2009-06-04.orig/arch/x86/kernel/genapic_xen_64.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/genapic_xen_64.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/genapic_xen_64.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/genapic_xen_64.c 2009-06-04 10:21:39.000000000 +0200 @@ -43,7 +43,7 @@ void xen_send_IPI_shortcut(unsigned int __send_IPI_one(smp_processor_id(), vector); break; @@ -5745,7 +5745,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return ((ebx >> 24) & 0xFF) >> index_msb; } --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/arch/x86/kernel/head-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/head-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,57 @@ +#include +#include @@ -5805,7 +5805,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +#endif +} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/arch/x86/kernel/head32-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/head32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,57 @@ +/* + * linux/arch/i386/kernel/head32.c -- prepare to run common code @@ -5864,8 +5864,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + + start_kernel(); +} ---- sle11-2009-06-04.orig/arch/x86/kernel/head64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/head64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/head64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -32,7 +32,26 @@ #include #include @@ -6026,8 +6026,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * At this point everything still needed from the boot loader ---- sle11-2009-06-04.orig/arch/x86/kernel/head_64-xen.S 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/head_64-xen.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/head_64-xen.S 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/head_64-xen.S 2009-06-04 10:21:39.000000000 +0200 @@ -95,53 +95,6 @@ NEXT_PAGE(hypercall_page) #undef NEXT_PAGE @@ -6082,8 +6082,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches .section .bss.page_aligned, "aw", @nobits .align PAGE_SIZE ENTRY(empty_zero_page) ---- sle11-2009-06-04.orig/arch/x86/kernel/io_apic_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/io_apic_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -25,6 +25,7 @@ #include #include @@ -7707,8 +7707,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + } +} +#endif ---- sle11-2009-06-04.orig/arch/x86/kernel/io_apic_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/io_apic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/io_apic_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/io_apic_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -45,6 +45,7 @@ #include #include @@ -8472,8 +8472,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } else { ioapic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); ---- sle11-2009-06-04.orig/arch/x86/kernel/ipi-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/ipi-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/ipi-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ipi-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -8,7 +8,6 @@ #include #include @@ -8509,8 +8509,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } #endif ---- sle11-2009-06-04.orig/arch/x86/kernel/irq_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/irq_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -48,6 +48,29 @@ void ack_bad_irq(unsigned int irq) #endif } @@ -8832,8 +8832,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #ifdef CONFIG_HOTPLUG_CPU void fixup_irqs(cpumask_t map) ---- sle11-2009-06-04.orig/arch/x86/kernel/irq_64-xen.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/irq_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/irq_64-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/irq_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -163,6 +163,34 @@ skip: } @@ -8869,8 +8869,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific * handlers). ---- sle11-2009-06-04.orig/arch/x86/kernel/ldt-xen.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/ldt-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/ldt-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/ldt-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -20,9 +20,9 @@ #include @@ -8905,8 +8905,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches preempt_enable(); #endif } ---- sle11-2009-06-04.orig/arch/x86/kernel/machine_kexec_32.c 2008-11-25 12:35:53.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/machine_kexec_32.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/machine_kexec_32.c 2008-11-25 12:35:53.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/machine_kexec_32.c 2009-06-04 10:21:39.000000000 +0200 @@ -68,6 +68,8 @@ void machine_kexec_setup_load_arg(xen_ke xki->page_list[PA_PTE_0] = __ma(kexec_pte0); xki->page_list[PA_PTE_1] = __ma(kexec_pte1); @@ -8916,8 +8916,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } int __init machine_kexec_setup_resources(struct resource *hypervisor, ---- sle11-2009-06-04.orig/arch/x86/kernel/microcode-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/microcode-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/microcode-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/microcode-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -5,13 +5,14 @@ * 2006 Shaohua Li * @@ -8982,8 +8982,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; } ---- sle11-2009-06-04.orig/arch/x86/kernel/mpparse-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/mpparse-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/mpparse-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/mpparse-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -25,6 +25,9 @@ #include #include @@ -10180,8 +10180,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -#endif /* CONFIG_X86_IO_APIC */ -#endif /* CONFIG_ACPI */ +late_initcall(update_mp_table); ---- sle11-2009-06-04.orig/arch/x86/kernel/nmi.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/kernel/nmi.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/nmi.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/nmi.c 2009-06-04 10:21:39.000000000 +0200 @@ -27,7 +27,9 @@ #include #include @@ -10203,8 +10203,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #ifdef CONFIG_X86_32 timer_ack = 0; #endif ---- sle11-2009-06-04.orig/arch/x86/kernel/pci-dma-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/pci-dma-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/pci-dma-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/pci-dma-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -5,13 +5,13 @@ #include @@ -10560,8 +10560,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches no_iommu_init(); return 0; ---- sle11-2009-06-04.orig/arch/x86/kernel/pci-nommu-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/pci-nommu-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/pci-nommu-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/pci-nommu-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -79,18 +79,12 @@ gnttab_unmap_single(struct device *dev, gnttab_dma_unmap_page(dma_addr); } @@ -10582,8 +10582,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches }; void __init no_iommu_init(void) ---- sle11-2009-06-04.orig/arch/x86/kernel/probe_roms_32.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/kernel/probe_roms_32.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/probe_roms_32.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/probe_roms_32.c 2009-06-04 10:21:39.000000000 +0200 @@ -99,6 +99,11 @@ void __init probe_roms(void) unsigned char c; int i; @@ -10605,8 +10605,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (romsignature(rom)) { length = extension_rom_resource.end - extension_rom_resource.start + 1; if (romchecksum(rom, length)) { ---- sle11-2009-06-04.orig/arch/x86/kernel/process-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/process-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/process-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -6,6 +6,13 @@ #include #include @@ -10897,8 +10897,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return -1; boot_option_idle_override = 1; ---- sle11-2009-06-04.orig/arch/x86/kernel/process_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/process_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -59,15 +59,11 @@ #include #include @@ -11002,8 +11002,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } tick_nohz_restart_sched_tick(); preempt_enable_no_resched(); ---- sle11-2009-06-04.orig/arch/x86/kernel/process_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/process_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/process_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/process_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -65,15 +65,6 @@ asmlinkage extern void ret_from_fork(voi unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; @@ -11186,8 +11186,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (gsindex) rdmsrl(MSR_KERNEL_GS_BASE, base); else ---- sle11-2009-06-04.orig/arch/x86/kernel/quirks-xen.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/quirks-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/quirks-xen.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/quirks-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -63,6 +63,7 @@ static enum { ICH_FORCE_HPET_RESUME, VT8237_FORCE_HPET_RESUME, @@ -11309,8 +11309,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches default: break; } ---- sle11-2009-06-04.orig/arch/x86/kernel/setup-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/setup-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -1,141 +1,1131 @@ -#include +/* @@ -12533,7 +12533,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + return NOTIFY_DONE; +} +#endif /* !CONFIG_XEN */ ---- sle11-2009-06-04.orig/arch/x86/kernel/setup64-xen.c 2009-03-16 16:38:05.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup64-xen.c 2009-03-16 16:38:05.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,370 +0,0 @@ -/* @@ -12746,7 +12746,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches - .address = (unsigned long)ignore_sysret - }; - if (HYPERVISOR_callback_op(CALLBACKOP_register, &cstar)) -- printk(KERN_WARN "Unable to register CSTAR callback\n"); +- printk(KERN_WARNING "Unable to register CSTAR callback\n"); - } -#endif -} @@ -12906,7 +12906,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches - if (is_uv_system()) - uv_cpu_init(); -} ---- sle11-2009-06-04.orig/arch/x86/kernel/setup_32-xen.c 2009-03-16 16:38:05.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_32-xen.c 2009-03-16 16:38:05.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,1151 +0,0 @@ -/* @@ -14060,7 +14060,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -} - -subsys_initcall(request_standard_resources); ---- sle11-2009-06-04.orig/arch/x86/kernel/setup_64-xen.c 2009-03-16 16:38:05.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/kernel/setup_64-xen.c 2009-03-16 16:38:05.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,1433 +0,0 @@ -/* @@ -15497,7 +15497,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -} -__setup("clearcpuid=", setup_disablecpuid); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/arch/x86/kernel/setup_percpu-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/kernel/setup_percpu-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,385 @@ +#include +#include @@ -15884,8 +15884,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + +#endif /* X86_64_NUMA */ + ---- sle11-2009-06-04.orig/arch/x86/kernel/smp-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/smp-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/smp-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/smp-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -121,132 +121,14 @@ void xen_smp_send_reschedule(int cpu) send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR); } @@ -16087,8 +16087,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return IRQ_HANDLED; } ---- sle11-2009-06-04.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:13:09.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/time_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:13:09.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/time_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -468,7 +468,7 @@ irqreturn_t timer_interrupt(int irq, voi /* Keep nmi watchdog up to date */ @@ -16118,8 +16118,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches cpu_clear(cpu, nohz_cpu_mask); j = jiffies + 1; } ---- sle11-2009-06-04.orig/arch/x86/kernel/traps_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/traps_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (C) 1991, 1992 Linus Torvalds @@ -16696,8 +16696,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches unsigned long base = (kesp - uesp) & -THREAD_SIZE; unsigned long new_kesp = kesp - base; unsigned long lim_pages = (new_kesp | (THREAD_SIZE - 1)) >> PAGE_SHIFT; ---- sle11-2009-06-04.orig/arch/x86/kernel/traps_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/traps_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/traps_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/traps_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -10,73 +10,56 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'entry.S'. @@ -17658,8 +17658,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches static int __init code_bytes_setup(char *s) { code_bytes = simple_strtoul(s, NULL, 0); ---- sle11-2009-06-04.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/kernel/vsyscall_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/kernel/vsyscall_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/vsyscall_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -42,7 +42,8 @@ #include #include @@ -17700,8 +17700,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches hotcpu_notifier(cpu_vsyscall_notifier, 0); return 0; } ---- sle11-2009-06-04.orig/arch/x86/mach-xen/setup.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mach-xen/setup.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mach-xen/setup.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mach-xen/setup.c 2009-06-04 10:21:39.000000000 +0200 @@ -17,6 +17,8 @@ #include #include @@ -17877,8 +17877,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } +#endif } ---- sle11-2009-06-04.orig/arch/x86/mm/fault-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/fault-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/fault-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/fault-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -10,6 +10,7 @@ #include #include @@ -18064,8 +18064,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } #endif } ---- sle11-2009-06-04.orig/arch/x86/mm/hypervisor.c 2009-05-14 11:18:39.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/mm/hypervisor.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/hypervisor.c 2009-05-14 11:18:39.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/mm/hypervisor.c 2009-06-04 10:21:39.000000000 +0200 @@ -709,6 +709,72 @@ void xen_destroy_contiguous_region(unsig } EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region); @@ -18186,8 +18186,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + maddr_t mach_gp = virt_to_machine(gdt + entry); + return HYPERVISOR_update_descriptor(mach_gp, *(const u64*)desc); } ---- sle11-2009-06-04.orig/arch/x86/mm/init_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/init_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/init_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -54,6 +54,7 @@ unsigned int __VMALLOC_RESERVE = 128 << 20; @@ -19014,8 +19014,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +{ + return reserve_bootmem(phys, len, flags); +} ---- sle11-2009-06-04.orig/arch/x86/mm/init_64-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/init_64-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/init_64-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_64-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -21,6 +21,7 @@ #include #include @@ -20352,8 +20352,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } return 0; } ---- sle11-2009-06-04.orig/arch/x86/mm/ioremap-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/ioremap-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/ioremap-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/ioremap-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -13,6 +13,7 @@ #include #include @@ -20526,8 +20526,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 1; } ---- sle11-2009-06-04.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/pageattr-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pageattr-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -34,6 +34,47 @@ struct cpa_data { unsigned force_split : 1; }; @@ -20742,8 +20742,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return _set_memory_wb(addr, numpages); } ---- sle11-2009-06-04.orig/arch/x86/mm/pat-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/pat-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/pat-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pat-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -12,6 +12,8 @@ #include #include @@ -21453,8 +21453,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +late_initcall(pat_memtype_list_init); + +#endif /* CONFIG_DEBUG_FS */ ---- sle11-2009-06-04.orig/arch/x86/mm/pgtable-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/pgtable-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/pgtable-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pgtable-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -4,6 +4,7 @@ #include #include @@ -21816,8 +21816,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + set_pte_vaddr(address, pte); + fixmaps_set++; +} ---- sle11-2009-06-04.orig/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/mm/pgtable_32-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/mm/pgtable_32-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pgtable_32-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -25,51 +25,49 @@ #include #include @@ -21998,8 +21998,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches void make_lowmem_page_readonly(void *va, unsigned int feature) { pte_t *pte; ---- sle11-2009-06-04.orig/arch/x86/pci/amd_bus.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/arch/x86/pci/amd_bus.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/pci/amd_bus.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/pci/amd_bus.c 2009-06-04 10:21:39.000000000 +0200 @@ -607,6 +607,14 @@ static int __init pci_io_ecs_init(void) for_each_online_cpu(cpu) amd_cpu_notify(&amd_cpu_notifier, (unsigned long)CPU_ONLINE, @@ -22026,8 +22026,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return 0; ---- sle11-2009-06-04.orig/arch/x86/pci/irq-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/pci/irq-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/pci/irq-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/pci/irq-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -11,8 +11,8 @@ #include #include @@ -22902,8 +22902,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } return 0; } ---- sle11-2009-06-04.orig/arch/x86/vdso/Makefile 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/vdso/Makefile 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/vdso/Makefile 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/Makefile 2009-06-04 10:21:39.000000000 +0200 @@ -65,9 +65,7 @@ obj-$(VDSO32-y) += vdso32-syms.lds vdso32.so-$(VDSO32-y) += int80 vdso32.so-$(CONFIG_COMPAT) += syscall @@ -22915,8 +22915,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches vdso32-images = $(vdso32.so-y:%=vdso32-%.so) ---- sle11-2009-06-04.orig/arch/x86/vdso/vdso32.S 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/vdso/vdso32.S 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/vdso/vdso32.S 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32.S 2009-06-04 10:21:39.000000000 +0200 @@ -9,7 +9,7 @@ vdso32_int80_end: .globl vdso32_syscall_start, vdso32_syscall_end @@ -22943,8 +22943,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -#endif - __FINIT ---- sle11-2009-06-04.orig/arch/x86/vdso/vdso32-setup-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/vdso/vdso32-setup-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/vdso/vdso32-setup-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/vdso/vdso32-setup-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -195,50 +195,28 @@ static __init void relocate_vdso(Elf32_E } } @@ -23078,8 +23078,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } memcpy(syscall_page, vsyscall, vsyscall_len); ---- sle11-2009-06-04.orig/arch/x86/xen/Kconfig 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-06-04/arch/x86/xen/Kconfig 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/arch/x86/xen/Kconfig 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/xen/Kconfig 2009-06-04 10:21:39.000000000 +0200 @@ -17,7 +17,7 @@ config XEN_MAX_DOMAIN_MEMORY int "Maximum allowed size of a domain in gigabytes" default 8 if X86_32 @@ -23097,8 +23097,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + depends on PARAVIRT_XEN && PM default y \ No newline at end of file ---- sle11-2009-06-04.orig/drivers/acpi/processor_core.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/acpi/processor_core.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/acpi/processor_core.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/acpi/processor_core.c 2009-06-04 10:21:39.000000000 +0200 @@ -721,9 +721,11 @@ static int __cpuinit acpi_processor_star if (result) goto end; @@ -23124,8 +23124,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches acpi_processor_remove_fs(device); ---- sle11-2009-06-04.orig/drivers/char/tpm/tpm_vtpm.c 2009-02-16 15:58:14.000000000 +0100 -+++ sle11-2009-06-04/drivers/char/tpm/tpm_vtpm.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/char/tpm/tpm_vtpm.c 2009-02-16 15:58:14.000000000 +0100 ++++ sle11-2009-06-29/drivers/char/tpm/tpm_vtpm.c 2009-06-04 10:21:39.000000000 +0200 @@ -347,7 +347,7 @@ static int _vtpm_send_queued(struct tpm_ { int rc; @@ -23135,8 +23135,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches unsigned char buffer[1]; struct vtpm_state *vtpms; vtpms = (struct vtpm_state *)chip_get_private(chip); ---- sle11-2009-06-04.orig/drivers/misc/Kconfig 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/drivers/misc/Kconfig 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/misc/Kconfig 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/misc/Kconfig 2009-06-04 10:21:39.000000000 +0200 @@ -438,7 +438,7 @@ config ENCLOSURE_SERVICES config SGI_XP tristate "Support communication between SGI SSIs" @@ -23155,8 +23155,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches default n select MMU_NOTIFIER ---help--- ---- sle11-2009-06-04.orig/drivers/pci/msi-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/pci/msi-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/pci/msi-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/pci/msi-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -90,12 +90,10 @@ arch_teardown_msi_irqs(struct pci_dev *d } #endif @@ -23207,8 +23207,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return -EINVAL; } ---- sle11-2009-06-04.orig/drivers/pci/quirks.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/drivers/pci/quirks.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/pci/quirks.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/pci/quirks.c 2009-06-04 10:21:39.000000000 +0200 @@ -44,9 +44,8 @@ static void __devinit quirk_release_reso /* PCI Host Bridge isn't a target device */ return; @@ -23221,8 +23221,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches pci_read_config_word(dev, PCI_COMMAND, &command); command &= ~PCI_COMMAND_MEMORY; pci_write_config_word(dev, PCI_COMMAND, command); ---- sle11-2009-06-04.orig/drivers/pci/setup-res.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/drivers/pci/setup-res.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/pci/setup-res.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/pci/setup-res.c 2009-06-04 10:21:39.000000000 +0200 @@ -129,7 +129,7 @@ int pci_claim_resource(struct pci_dev *d #ifdef CONFIG_PCI_REASSIGN void pci_disable_bridge_window(struct pci_dev *dev) @@ -23254,16 +23254,27 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches (unsigned long long)res->start, (unsigned long long)res->end); #endif ---- sle11-2009-06-04.orig/drivers/xen/Makefile 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/Makefile 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/Makefile 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/Makefile 2009-06-04 10:21:39.000000000 +0200 @@ -1,4 +1,4 @@ -obj-$(CONFIG_PARAVIRT_XEN) += grant-table.o features.o events.o +obj-$(CONFIG_PARAVIRT_XEN) += grant-table.o features.o events.o manage.o xen-xencomm-$(CONFIG_PARAVIRT_XEN) := xencomm.o xen-balloon-$(CONFIG_PARAVIRT_XEN) := balloon.o ---- sle11-2009-06-04.orig/drivers/xen/balloon/sysfs.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/balloon/sysfs.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2009-06-29 15:28:36.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:30:29.000000000 +0200 +@@ -84,7 +84,7 @@ static unsigned long frame_list[PAGE_SIZ + /* VM /proc information for memory */ + extern unsigned long totalram_pages; + +-#if !defined(MODULE) && defined(CONFIG_HIGHMEM) ++#ifdef CONFIG_HIGHMEM + extern unsigned long totalhigh_pages; + #define inc_totalhigh_pages() (totalhigh_pages++) + #define dec_totalhigh_pages() (totalhigh_pages--) +--- sle11-2009-06-29.orig/drivers/xen/balloon/sysfs.c 2009-06-29 15:29:24.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/balloon/sysfs.c 2009-06-29 15:31:06.000000000 +0200 @@ -45,6 +45,7 @@ #define BALLOON_SHOW(name, format, args...) \ @@ -23272,8 +23283,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches char *buf) \ { \ return sprintf(buf, format, ##args); \ -@@ -59,14 +60,15 @@ BALLOON_SHOW(hard_limit_kb, - (bs.hard_limit!=~0UL) ? PAGES2KB(bs.hard_limit) : 0); +@@ -56,14 +57,15 @@ BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(b + BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high)); BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(bs.driver_pages)); -static ssize_t show_target_kb(struct sys_device *dev, char *buf) @@ -23291,8 +23302,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches { char memstring[64], *endchar; unsigned long long target_bytes; ---- sle11-2009-06-04.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:40:14.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/blktap/blktap.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/blktap/blktap.c 2009-04-20 11:40:14.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/blktap/blktap.c 2009-06-04 10:21:39.000000000 +0200 @@ -54,6 +54,7 @@ #include #include @@ -23320,8 +23331,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } else { /* this is bad, but not fatal */ WPRINTK("blktap: sysfs xen_class not created\n"); ---- sle11-2009-06-04.orig/drivers/xen/char/mem.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/char/mem.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/char/mem.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/char/mem.c 2009-06-04 10:21:39.000000000 +0200 @@ -35,7 +35,7 @@ static inline int uncached_access(struct static inline int range_is_allowed(unsigned long pfn, unsigned long size) @@ -23343,8 +23354,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches }; static int xen_mmap_mem(struct file * file, struct vm_area_struct * vma) ---- sle11-2009-06-04.orig/drivers/xen/console/console.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/console/console.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/console/console.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/console/console.c 2009-06-04 10:21:39.000000000 +0200 @@ -432,9 +432,7 @@ static void __xencons_tx_flush(void) if (work_done && (xencons_tty != NULL)) { @@ -23367,8 +23378,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches tty->closing = 0; spin_lock_irqsave(&xencons_lock, flags); xencons_tty = NULL; ---- sle11-2009-06-04.orig/drivers/xen/core/evtchn.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/evtchn.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/evtchn.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/evtchn.c 2009-06-04 10:21:39.000000000 +0200 @@ -746,8 +746,9 @@ static struct irq_chip dynirq_chip = { }; @@ -23453,8 +23464,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* No event channels are 'live' right now. */ for (i = 0; i < NR_EVENT_CHANNELS; i++) ---- sle11-2009-06-04.orig/drivers/xen/core/gnttab.c 2008-12-01 11:25:57.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/gnttab.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/gnttab.c 2008-12-01 11:25:57.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/gnttab.c 2009-06-04 10:21:39.000000000 +0200 @@ -449,6 +449,7 @@ static int map_pte_fn(pte_t *pte, struct return 0; } @@ -23582,8 +23593,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; ini_nomem: ---- sle11-2009-06-04.orig/drivers/xen/core/machine_kexec.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/machine_kexec.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/machine_kexec.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/machine_kexec.c 2009-06-04 10:21:39.000000000 +0200 @@ -91,7 +91,7 @@ void __init xen_machine_kexec_setup_reso xen_hypervisor_res.start = range.start; xen_hypervisor_res.end = range.start + range.size - 1; @@ -23611,8 +23622,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches void __init xen_machine_kexec_register_resources(struct resource *res) { request_resource(res, &xen_hypervisor_res); ---- sle11-2009-06-04.orig/drivers/xen/core/machine_reboot.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/core/machine_reboot.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/machine_reboot.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/core/machine_reboot.c 2009-06-04 10:21:39.000000000 +0200 @@ -57,6 +57,7 @@ EXPORT_SYMBOL(machine_restart); EXPORT_SYMBOL(machine_halt); EXPORT_SYMBOL(machine_power_off); @@ -23652,8 +23663,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; } +#endif ---- sle11-2009-06-04.orig/drivers/xen/core/reboot.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/reboot.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/reboot.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/reboot.c 2009-06-04 10:21:39.000000000 +0200 @@ -29,17 +29,12 @@ MODULE_LICENSE("Dual BSD/GPL"); /* Ignore multiple shutdown requests. */ static int shutting_down = SHUTDOWN_INVALID; @@ -23726,8 +23737,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches static int setup_shutdown_watcher(void) { ---- sle11-2009-06-04.orig/drivers/xen/core/smpboot.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/smpboot.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/smpboot.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/smpboot.c 2009-06-04 10:21:39.000000000 +0200 @@ -27,6 +27,7 @@ extern irqreturn_t smp_reschedule_interrupt(int, void *); @@ -23876,8 +23887,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches prefill_possible_map(); } ---- sle11-2009-06-04.orig/drivers/xen/core/spinlock.c 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/core/spinlock.c 2009-06-04 10:36:24.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/core/spinlock.c 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/core/spinlock.c 2009-06-04 10:36:24.000000000 +0200 @@ -5,6 +5,8 @@ * portions of this file. */ @@ -23914,8 +23925,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches EXPORT_SYMBOL(xen_spin_kick); + +#endif /* CONFIG_XEN_COMPAT >= 0x030200 */ ---- sle11-2009-06-04.orig/drivers/xen/fbfront/xenfb.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/fbfront/xenfb.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/fbfront/xenfb.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/fbfront/xenfb.c 2009-06-04 10:21:39.000000000 +0200 @@ -18,6 +18,7 @@ * frame buffer. */ @@ -23967,16 +23978,16 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +MODULE_DESCRIPTION("Xen virtual framebuffer device frontend"); MODULE_LICENSE("GPL"); ---- sle11-2009-06-04.orig/drivers/xen/fbfront/xenkbd.c 2009-03-04 11:25:55.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/fbfront/xenkbd.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/fbfront/xenkbd.c 2009-03-04 11:25:55.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/fbfront/xenkbd.c 2009-06-04 10:21:39.000000000 +0200 @@ -350,4 +350,5 @@ static void __exit xenkbd_cleanup(void) module_init(xenkbd_init); module_exit(xenkbd_cleanup); +MODULE_DESCRIPTION("Xen virtual keyboard/pointer device frontend"); MODULE_LICENSE("GPL"); ---- sle11-2009-06-04.orig/drivers/xen/gntdev/gntdev.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/gntdev/gntdev.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/gntdev/gntdev.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/gntdev/gntdev.c 2009-06-04 10:21:39.000000000 +0200 @@ -418,7 +418,7 @@ static int __init gntdev_init(void) } @@ -23986,8 +23997,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (IS_ERR(device)) { printk(KERN_ERR "Error creating gntdev device in xen_class\n"); printk(KERN_ERR "gntdev created with major number = %d\n", ---- sle11-2009-06-04.orig/drivers/xen/netfront/accel.c 2009-03-30 16:39:19.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/netfront/accel.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/netfront/accel.c 2009-03-30 16:39:19.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/netfront/accel.c 2009-06-04 10:21:39.000000000 +0200 @@ -28,6 +28,7 @@ * IN THE SOFTWARE. */ @@ -23996,8 +24007,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #include #include #include ---- sle11-2009-06-04.orig/drivers/xen/netfront/netfront.c 2009-03-30 16:40:17.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/netfront/netfront.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/netfront/netfront.c 2009-03-30 16:40:17.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/netfront/netfront.c 2009-06-04 10:21:39.000000000 +0200 @@ -640,7 +640,7 @@ static int network_open(struct net_devic } spin_unlock_bh(&np->rx_lock); @@ -24007,8 +24018,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; } ---- sle11-2009-06-04.orig/drivers/xen/sfc_netback/accel.h 2009-03-30 16:00:09.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/sfc_netback/accel.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netback/accel.h 2009-03-30 16:00:09.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netback/accel.h 2009-06-04 10:21:39.000000000 +0200 @@ -25,6 +25,7 @@ #ifndef NETBACK_ACCEL_H #define NETBACK_ACCEL_H @@ -24017,8 +24028,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #include #include #include ---- sle11-2009-06-04.orig/drivers/xen/sfc_netfront/accel.h 2009-03-30 16:34:56.000000000 +0200 -+++ sle11-2009-06-04/drivers/xen/sfc_netfront/accel.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/sfc_netfront/accel.h 2009-03-30 16:34:56.000000000 +0200 ++++ sle11-2009-06-29/drivers/xen/sfc_netfront/accel.h 2009-06-04 10:21:39.000000000 +0200 @@ -35,6 +35,7 @@ #include @@ -24027,8 +24038,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #include enum netfront_accel_post_status { ---- sle11-2009-06-04.orig/drivers/xen/xenbus/xenbus_client.c 2009-03-24 10:13:17.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/xenbus/xenbus_client.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_client.c 2009-03-24 10:13:17.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_client.c 2009-06-04 10:21:39.000000000 +0200 @@ -150,7 +150,7 @@ int xenbus_watch_pathfmt(struct xenbus_d char *path; @@ -24038,8 +24049,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches va_end(ap); if (!path) { ---- sle11-2009-06-04.orig/drivers/xen/xenbus/xenbus_comms.c 2009-02-16 16:17:21.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/xenbus/xenbus_comms.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_comms.c 2009-02-16 16:17:21.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_comms.c 2009-06-04 10:21:39.000000000 +0200 @@ -228,14 +228,11 @@ int xb_init_comms(void) intf->rsp_cons = intf->rsp_prod; } @@ -24077,8 +24088,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; } ---- sle11-2009-06-04.orig/drivers/xen/xenbus/xenbus_probe.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/drivers/xen/xenbus/xenbus_probe.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/drivers/xen/xenbus/xenbus_probe.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/drivers/xen/xenbus/xenbus_probe.c 2009-06-04 10:21:39.000000000 +0200 @@ -36,6 +36,7 @@ __FUNCTION__, __LINE__, ##args) @@ -24087,8 +24098,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #include #include #include ---- sle11-2009-06-04.orig/fs/aio.c 2009-03-24 10:13:25.000000000 +0100 -+++ sle11-2009-06-04/fs/aio.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/fs/aio.c 2009-03-24 10:13:25.000000000 +0100 ++++ sle11-2009-06-29/fs/aio.c 2009-06-04 10:21:39.000000000 +0200 @@ -1335,7 +1335,7 @@ static int make_aio_fd(struct kioctx *io int fd; struct file *file; @@ -24098,8 +24109,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches if (fd < 0) return fd; ---- sle11-2009-06-04.orig/include/asm-generic/pgtable.h 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-06-04/include/asm-generic/pgtable.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-generic/pgtable.h 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/include/asm-generic/pgtable.h 2009-06-04 10:21:39.000000000 +0200 @@ -99,10 +99,6 @@ static inline void ptep_set_wrprotect(st } #endif @@ -24111,8 +24122,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #ifndef __HAVE_ARCH_PTE_SAME #define pte_same(A,B) (pte_val(A) == pte_val(B)) #endif ---- sle11-2009-06-04.orig/include/asm-x86/dma-mapping.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/dma-mapping.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/dma-mapping.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/dma-mapping.h 2009-06-04 10:21:39.000000000 +0200 @@ -74,7 +74,7 @@ static inline struct dma_mapping_ops *ge /* Make sure we keep the same behaviour */ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) @@ -24122,8 +24133,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches return 0; #else struct dma_mapping_ops *ops = get_dma_ops(dev); ---- sle11-2009-06-04.orig/include/asm-x86/kexec.h 2008-12-01 11:11:08.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/kexec.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/kexec.h 2008-12-01 11:11:08.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/kexec.h 2009-06-04 10:21:39.000000000 +0200 @@ -10,6 +10,7 @@ # define VA_PTE_0 5 # define PA_PTE_1 6 @@ -24151,8 +24162,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #else # define PA_CONTROL_PAGE 0 # define VA_CONTROL_PAGE 1 ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/desc.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/desc.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/desc.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/desc.h 2009-06-04 10:21:39.000000000 +0200 @@ -31,11 +31,17 @@ extern struct desc_ptr idt_descr; extern gate_desc idt_table[]; #endif @@ -24221,8 +24232,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * This routine sets up an interrupt gate at directory privilege level 3. */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/fixmap.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/fixmap.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap.h 2009-06-04 10:21:39.000000000 +0200 @@ -7,7 +7,58 @@ # include "fixmap_64.h" #endif @@ -24282,8 +24293,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + return __virt_to_fix(vaddr); +} #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap_32.h 2009-06-04 10:21:39.000000000 +0200 @@ -58,10 +58,17 @@ enum fixed_addresses { #ifdef CONFIG_X86_LOCAL_APIC FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ @@ -24401,8 +24412,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches - #endif /* !__ASSEMBLY__ */ #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/fixmap_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -12,6 +12,7 @@ #define _ASM_FIXMAP_64_H @@ -24502,8 +24513,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -} - #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/highmem.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/highmem.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/highmem.h 2009-06-04 10:21:39.000000000 +0200 @@ -74,6 +74,9 @@ struct page *kmap_atomic_to_page(void *p #define flush_cache_kmaps() do { } while (0) @@ -24514,8 +24525,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches void clear_highpage(struct page *); static inline void clear_user_highpage(struct page *page, unsigned long vaddr) { ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/hypercall.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/hypercall.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypercall.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypercall.h 2009-06-04 10:21:39.000000000 +0200 @@ -323,9 +323,19 @@ static inline int __must_check HYPERVISOR_grant_table_op( unsigned int cmd, void *uop, unsigned int count) @@ -24537,8 +24548,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches } static inline int __must_check ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-16 16:33:40.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/hypervisor.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-16 16:33:40.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/hypervisor.h 2009-06-04 10:21:39.000000000 +0200 @@ -35,7 +35,6 @@ #include @@ -24586,8 +24597,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #if defined(CONFIG_X86_64) #define MULTI_UVMFLAGS_INDEX 2 #define MULTI_UVMDOMID_INDEX 3 ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/io.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/io.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/io.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/io.h 2009-06-04 10:21:39.000000000 +0200 @@ -3,20 +3,139 @@ #define ARCH_HAS_IOREMAP_WC @@ -24734,7 +24745,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + #endif /* _ASM_X86_IO_H */ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/irq_vectors.h 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irq_vectors.h 2009-06-04 10:21:39.000000000 +0200 @@ -0,0 +1,52 @@ +#ifndef _ASM_IRQ_VECTORS_H +#define _ASM_IRQ_VECTORS_H @@ -24788,8 +24799,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches +#define NR_IRQ_VECTORS NR_IRQS + +#endif /* _ASM_IRQ_VECTORS_H */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/irqflags.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/irqflags.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/irqflags.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/irqflags.h 2009-06-04 10:21:39.000000000 +0200 @@ -118,7 +118,7 @@ static inline void halt(void) #ifndef CONFIG_X86_64 @@ -24854,8 +24865,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #else # define TRACE_IRQS_ON # define TRACE_IRQS_OFF ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/mmu_context.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/mmu_context.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context.h 2009-06-04 10:21:39.000000000 +0200 @@ -1,5 +1,42 @@ +#ifndef __ASM_X86_MMU_CONTEXT_H +#define __ASM_X86_MMU_CONTEXT_H @@ -24899,8 +24910,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches + + +#endif /* __ASM_X86_MMU_CONTEXT_H */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-06-04 10:21:39.000000000 +0200 @@ -1,32 +1,6 @@ #ifndef __I386_SCHED_H #define __I386_SCHED_H @@ -24945,8 +24956,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -} while (0) - #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/mmu_context_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -1,23 +1,6 @@ #ifndef __X86_64_MMU_CONTEXT_H #define __X86_64_MMU_CONTEXT_H @@ -24994,8 +25005,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -} - #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/page.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/page.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/page.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page.h 2009-06-04 10:21:39.000000000 +0200 @@ -16,9 +16,9 @@ * below. The preprocessor will warn if the two definitions aren't identical. */ @@ -25087,8 +25098,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #define __pte(x) xen_make_pte(x) #define __pa(x) __phys_addr((unsigned long)(x)) ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/page_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/page_64.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/page_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -26,6 +26,12 @@ #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT) #define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1)) @@ -25124,8 +25135,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #endif /* !__ASSEMBLY__ */ #ifdef CONFIG_FLATMEM ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pci.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pci.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pci.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pci.h 2009-06-04 10:21:39.000000000 +0200 @@ -21,6 +21,8 @@ struct pci_sysdata { #endif }; @@ -25135,8 +25146,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* scan a bus after allocating a pci_sysdata for it */ extern struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node); ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:18:36.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pci_32.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pci_32.h 2009-02-16 16:18:36.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pci_32.h 2009-06-04 10:21:39.000000000 +0200 @@ -38,12 +38,14 @@ struct pci_dev; #define PCI_DMA_BUS_IS_PHYS (1) @@ -25158,8 +25169,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pgalloc.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pgalloc.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgalloc.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgalloc.h 2009-06-04 10:21:39.000000000 +0200 @@ -7,6 +7,9 @@ #include /* for phys_to_virt and page_to_pseudophys */ @@ -25170,8 +25181,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn) {} static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn) {} static inline void paravirt_alloc_pmd_clone(unsigned long pfn, unsigned long clonepfn, ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pgtable.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pgtable.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable.h 2009-06-04 10:21:39.000000000 +0200 @@ -13,11 +13,12 @@ #define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page */ #define _PAGE_BIT_PAT 7 /* on 4KB pages */ @@ -25595,8 +25606,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #endif /* __ASSEMBLY__ */ #endif /* _ASM_X86_PGTABLE_H */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable-3level.h 2009-06-04 10:21:39.000000000 +0200 @@ -14,11 +14,11 @@ #define pmd_ERROR(e) \ printk("%s:%d: bad pmd %p(%016Lx pfn %08Lx).\n", \ @@ -25632,8 +25643,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* Find an entry in the second-level page table.. */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-06-04 10:21:39.000000000 +0200 @@ -89,10 +89,10 @@ extern unsigned long pg0[]; /* pmd_present doesn't just test the _PAGE_PRESENT bit since wr.p.t. can temporarily clear it. */ @@ -25683,8 +25694,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #if defined(CONFIG_HIGHPTE) #define pte_offset_map(dir, address) \ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -23,6 +23,8 @@ extern void xen_init_pt(void); extern pud_t level3_kernel_pgt[512]; extern pud_t level3_ident_pgt[512]; @@ -25770,8 +25781,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/processor.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/processor.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/processor.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/processor.h 2009-06-04 10:21:39.000000000 +0200 @@ -134,7 +134,7 @@ extern __u32 cleared_cpu_caps[NCAPINTS #ifdef CONFIG_SMP DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); @@ -25846,8 +25857,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches extern void enable_sep_cpu(void); extern int sysenter_setup(void); ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/segment.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/segment.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/segment.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/segment.h 2009-06-04 10:21:39.000000000 +0200 @@ -1,6 +1,15 @@ #ifndef _ASM_X86_SEGMENT_H_ #define _ASM_X86_SEGMENT_H_ @@ -25925,8 +25936,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* User mode is privilege level 3 */ #define USER_RPL 0x3 /* LDT segment has TI set, GDT has it cleared */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/smp.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/smp.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/smp.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/smp.h 2009-06-04 10:21:39.000000000 +0200 @@ -25,23 +25,16 @@ extern cpumask_t cpu_initialized; extern void (*mtrr_hook)(void); extern void zap_low_mappings(void); @@ -26042,8 +26053,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -extern void unlock_ipi_call_lock(void); #endif /* __ASSEMBLY__ */ #endif ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/spinlock.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/spinlock.h 2009-06-04 11:09:05.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/spinlock.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/spinlock.h 2009-06-04 11:09:05.000000000 +0200 @@ -38,6 +38,11 @@ # define UNLOCK_LOCK_PREFIX #endif @@ -26298,8 +26309,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock) { while (__raw_spin_is_locked(lock)) ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/system.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/system.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/system.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/system.h 2009-06-04 10:21:39.000000000 +0200 @@ -137,7 +137,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" #define set_base(ldt, base) _set_base(((char *)&(ldt)) , (base)) #define set_limit(ldt, limit) _set_limit(((char *)&(ldt)) , ((limit)-1)) @@ -26349,8 +26360,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * Force strict CPU ordering. ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/asm/xor_64.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/asm-x86/mach-xen/asm/xor_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/asm/xor_64.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/asm-x86/mach-xen/asm/xor_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -1,3 +1,6 @@ +#ifndef ASM_X86__XOR_64_H +#define ASM_X86__XOR_64_H @@ -26364,7 +26375,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #define XOR_SELECT_TEMPLATE(FASTEST) (&xor_block_sse) + +#endif /* ASM_X86__XOR_64_H */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/irq_vectors.h 2009-03-16 16:33:40.000000000 +0100 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/irq_vectors.h 2009-03-16 16:33:40.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/* @@ -26493,7 +26504,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -#define NR_IRQ_VECTORS NR_IRQS - -#endif /* _ASM_IRQ_VECTORS_H */ ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/setup_arch_post.h 2009-06-04 11:08:07.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/setup_arch_post.h 2009-06-29 15:14:52.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/** @@ -26559,7 +26570,7 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -#endif -#endif -} ---- sle11-2009-06-04.orig/include/asm-x86/mach-xen/setup_arch_pre.h 2009-06-04 11:08:07.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/mach-xen/setup_arch_pre.h 2009-06-29 15:14:52.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -/* Hook to call BIOS initialisation function */ @@ -26567,8 +26578,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches -#define ARCH_SETUP machine_specific_arch_setup(); - -static void __init machine_specific_arch_setup(void); ---- sle11-2009-06-04.orig/include/asm-x86/traps.h 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/include/asm-x86/traps.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/traps.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/traps.h 2009-06-04 10:21:39.000000000 +0200 @@ -23,6 +23,9 @@ asmlinkage void spurious_interrupt_bug(v #ifdef CONFIG_X86_MCE asmlinkage void machine_check(void); @@ -26589,8 +26600,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches unsigned long patch_espfix_desc(unsigned long, unsigned long); asmlinkage void math_emulate(long); ---- sle11-2009-06-04.orig/include/asm-x86/xen/interface_64.h 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/include/asm-x86/xen/interface_64.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/asm-x86/xen/interface_64.h 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/include/asm-x86/xen/interface_64.h 2009-06-04 10:21:39.000000000 +0200 @@ -136,7 +136,7 @@ struct cpu_user_regs { uint16_t fs, _pad5[3]; /* Non-zero => takes precedence over fs_base. */ uint16_t gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_usr. */ @@ -26600,8 +26611,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #undef __DECL_REG ---- sle11-2009-06-04.orig/include/linux/page-flags.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/linux/page-flags.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/linux/page-flags.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/linux/page-flags.h 2009-06-04 10:21:39.000000000 +0200 @@ -110,9 +110,11 @@ enum pageflags { /* Filesystems */ PG_checked = PG_owner_priv_1, @@ -26627,8 +26638,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) __SETPAGEFLAG(Private, private) ---- sle11-2009-06-04.orig/include/xen/interface/memory.h 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/include/xen/interface/memory.h 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/include/xen/interface/memory.h 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/include/xen/interface/memory.h 2009-06-04 10:21:39.000000000 +0200 @@ -82,6 +82,7 @@ struct xen_memory_reservation { domid_t domid; @@ -26687,8 +26698,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches }; DEFINE_XEN_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); typedef struct xen_translate_gpfn_list xen_translate_gpfn_list_t; ---- sle11-2009-06-04.orig/kernel/hrtimer.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/kernel/hrtimer.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/kernel/hrtimer.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/kernel/hrtimer.c 2009-06-04 10:21:39.000000000 +0200 @@ -1084,7 +1084,7 @@ ktime_t hrtimer_get_remaining(const stru } EXPORT_SYMBOL_GPL(hrtimer_get_remaining); @@ -26698,8 +26709,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /** * hrtimer_get_next_event - get the time until next expiry event * ---- sle11-2009-06-04.orig/kernel/kexec.c 2009-02-17 12:38:20.000000000 +0100 -+++ sle11-2009-06-04/kernel/kexec.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/kernel/kexec.c 2009-02-17 12:38:20.000000000 +0100 ++++ sle11-2009-06-29/kernel/kexec.c 2009-06-04 10:21:39.000000000 +0200 @@ -54,7 +54,7 @@ int dump_after_notifier; unsigned char vmcoreinfo_data[VMCOREINFO_BYTES]; u32 @@ -26709,8 +26720,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches #endif vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; size_t vmcoreinfo_size; ---- sle11-2009-06-04.orig/kernel/timer.c 2009-06-04 11:08:07.000000000 +0200 -+++ sle11-2009-06-04/kernel/timer.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/kernel/timer.c 2009-06-29 15:14:52.000000000 +0200 ++++ sle11-2009-06-29/kernel/timer.c 2009-06-04 10:21:39.000000000 +0200 @@ -884,7 +884,7 @@ static inline void __run_timers(struct t spin_unlock_irq(&base->lock); } @@ -26720,8 +26731,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches /* * Find out when the next timer event is due to happen. This * is used on S/390 to stop all activity when a cpus is idle. ---- sle11-2009-06-04.orig/lib/swiotlb-xen.c 2009-03-16 16:38:05.000000000 +0100 -+++ sle11-2009-06-04/lib/swiotlb-xen.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/lib/swiotlb-xen.c 2009-03-16 16:38:05.000000000 +0100 ++++ sle11-2009-06-29/lib/swiotlb-xen.c 2009-06-04 10:21:39.000000000 +0200 @@ -750,7 +750,7 @@ swiotlb_sync_sg_for_device(struct device } @@ -26731,8 +26742,8 @@ Automatically created from "patches.kernel.org/patch-2.6.27" by xen-port-patches { return (dma_addr == virt_to_bus(io_tlb_overflow_buffer)); } ---- sle11-2009-06-04.orig/mm/mprotect.c 2009-03-04 11:28:34.000000000 +0100 -+++ sle11-2009-06-04/mm/mprotect.c 2009-06-04 10:21:39.000000000 +0200 +--- sle11-2009-06-29.orig/mm/mprotect.c 2009-03-04 11:28:34.000000000 +0100 ++++ sle11-2009-06-29/mm/mprotect.c 2009-06-04 10:21:39.000000000 +0200 @@ -92,8 +92,6 @@ static inline void change_pmd_range(stru next = pmd_addr_end(addr, end); if (pmd_none_or_clear_bad(pmd)) diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.1-2 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.1-2 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.1-2 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.1-2 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.11-12 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.11-12 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.11-12 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.11-12 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.14-15 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.14-15 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.14-15 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.14-15 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.15-16 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.15-16 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.15-16 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.15-16 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.18-19 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.18-19 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.18-19 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.18-19 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.19-20 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.19-20 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.19-20 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.19-20 diff --git a/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.24-25 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.24-25 new file mode 100644 index 000000000..cbd29feb8 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.24-25 @@ -0,0 +1,48 @@ +From: Greg Kroah-Hartman +Subject: Upstream 2.6.27.25 release from kernel.org + +Signed-off-by: Greg Kroah-Hartman + +Automatically created from "patches.kernel.org/patch-2.6.27.24-25" by xen-port-patches.py + +--- sle11-2009-06-29.orig/arch/x86/kernel/setup-xen.c 2008-12-23 09:40:12.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/kernel/setup-xen.c 2009-06-29 15:38:34.000000000 +0200 +@@ -852,6 +852,9 @@ void __init setup_arch(char **cmdline_p) + + finish_e820_parsing(); + ++ if (efi_enabled) ++ efi_init(); ++ + if (is_initial_xendomain()) { + dmi_scan_machine(); + dmi_check_system(bad_bios_dmi_table); +@@ -867,8 +870,6 @@ void __init setup_arch(char **cmdline_p) + insert_resource(&iomem_resource, &data_resource); + insert_resource(&iomem_resource, &bss_resource); + +- if (efi_enabled) +- efi_init(); + + #ifdef CONFIG_X86_32 + if (ppro_with_ram_bug()) { +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:38:38.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/pageattr-xen.c 2009-06-29 15:39:29.000000000 +0200 +@@ -585,6 +585,17 @@ static int split_large_page(pte_t *kpte, + ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte))); + pgprot_val(ref_prot) |= _PAGE_PRESENT; + __set_pmd_pte(kpte, address, level, mk_pte(base, ref_prot)); ++ ++ /* ++ * Intel Atom errata AAH41 workaround. ++ * ++ * The real fix should be in hw or in a microcode update, but ++ * we also probabilistically try to reduce the window of having ++ * a large TLB mixed with 4K TLBs while instruction fetches are ++ * going on. ++ */ ++ __flush_tlb_all(); ++ + base = NULL; + + out_unlock: diff --git a/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.25-26 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.25-26 new file mode 100644 index 000000000..2385f24a4 --- /dev/null +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.25-26 @@ -0,0 +1,77 @@ +From: Greg Kroah-Hartman +Subject: Upstream 2.6.27.26 release from kernel.org + +Signed-off-by: Greg Kroah-Hartman + +Automatically created from "patches.kernel.org/patch-2.6.27.25-26" by xen-port-patches.py + +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-06-29 15:38:34.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:08:11.000000000 +0200 +@@ -290,15 +290,13 @@ static inline void copy_edd(void) + + #ifdef CONFIG_BLK_DEV_INITRD + +-#if defined(CONFIG_X86_32) && !defined(CONFIG_XEN) +- + #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) + static void __init relocate_initrd(void) + { +- ++#ifndef CONFIG_XEN + u64 ramdisk_image = boot_params.hdr.ramdisk_image; + u64 ramdisk_size = boot_params.hdr.ramdisk_size; +- u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; ++ u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT; + u64 ramdisk_here; + unsigned long slop, clen, mapaddr; + char *p, *q; +@@ -353,8 +351,14 @@ static void __init relocate_initrd(void) + " %08llx - %08llx\n", + ramdisk_image, ramdisk_image + ramdisk_size - 1, + ramdisk_here, ramdisk_here + ramdisk_size - 1); +-} ++#else ++ printk(KERN_ERR "initrd extends beyond end of memory " ++ "(0x%08lx > 0x%08lx)\ndisabling initrd\n", ++ __pa(xen_start_info->mod_start) + xen_start_info->mod_len, ++ max_low_pfn_mapped << PAGE_SHIFT); ++ initrd_start = 0; + #endif ++} + + static void __init reserve_initrd(void) + { +@@ -362,7 +366,7 @@ static void __init reserve_initrd(void) + u64 ramdisk_image = boot_params.hdr.ramdisk_image; + u64 ramdisk_size = boot_params.hdr.ramdisk_size; + u64 ramdisk_end = ramdisk_image + ramdisk_size; +- u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; ++ u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT; + + if (!boot_params.hdr.type_of_loader || + !ramdisk_image || !ramdisk_size) +@@ -371,7 +375,7 @@ static void __init reserve_initrd(void) + unsigned long ramdisk_image = __pa(xen_start_info->mod_start); + unsigned long ramdisk_size = xen_start_info->mod_len; + unsigned long ramdisk_end = ramdisk_image + ramdisk_size; +- unsigned long end_of_lowmem = max_low_pfn << PAGE_SHIFT; ++ unsigned long end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT; + + if (!xen_start_info->mod_start || !ramdisk_size) + return; /* No initrd provided by bootloader */ +@@ -404,14 +408,8 @@ static void __init reserve_initrd(void) + return; + } + +-#if defined(CONFIG_X86_32) && !defined(CONFIG_XEN) + relocate_initrd(); +-#else +- printk(KERN_ERR "initrd extends beyond end of memory " +- "(0x%08lx > 0x%08lx)\ndisabling initrd\n", +- ramdisk_end, end_of_lowmem); +- initrd_start = 0; +-#endif ++ + free_early(ramdisk_image, ramdisk_end); + } + #else diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.3-4 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.3-4 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.3-4 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.3-4 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.4-5 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.4-5 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.4-5 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.4-5 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.5-6 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.5-6 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.5-6 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.5-6 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.7-8 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.7-8 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.7-8 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.7-8 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.8-9 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.8-9 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.8-9 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.8-9 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.9-10 b/src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.9-10 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-patch-2.6.27.9-10 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.27.9-10 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-perfmon2-remove_syscalls.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-perfmon2-remove_syscalls.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-perfmon2-remove_syscalls.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-perfmon2-remove_syscalls.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-perfmon2.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-perfmon2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-perfmon2.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-perfmon2.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-remove_kernel_physical_mapping_init_from_init b/src/patches/suse-2.6.27.31/patches.xen/xen3-remove_kernel_physical_mapping_init_from_init similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-remove_kernel_physical_mapping_init_from_init rename to src/patches/suse-2.6.27.31/patches.xen/xen3-remove_kernel_physical_mapping_init_from_init diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-rwlocks-enable-interrupts b/src/patches/suse-2.6.27.31/patches.xen/xen3-rwlocks-enable-interrupts similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-rwlocks-enable-interrupts rename to src/patches/suse-2.6.27.31/patches.xen/xen3-rwlocks-enable-interrupts diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-seccomp-disable-tsc-option b/src/patches/suse-2.6.27.31/patches.xen/xen3-seccomp-disable-tsc-option similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-seccomp-disable-tsc-option rename to src/patches/suse-2.6.27.31/patches.xen/xen3-seccomp-disable-tsc-option diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-silent-stack-overflow b/src/patches/suse-2.6.27.31/patches.xen/xen3-silent-stack-overflow similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-silent-stack-overflow rename to src/patches/suse-2.6.27.31/patches.xen/xen3-silent-stack-overflow diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-stack-unwind b/src/patches/suse-2.6.27.31/patches.xen/xen3-stack-unwind similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-stack-unwind rename to src/patches/suse-2.6.27.31/patches.xen/xen3-stack-unwind diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-sysfs-crash-debugging.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-sysfs-crash-debugging.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-sysfs-crash-debugging.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-sysfs-crash-debugging.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-uv_setup_irq.diff b/src/patches/suse-2.6.27.31/patches.xen/xen3-uv_setup_irq.diff similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-uv_setup_irq.diff rename to src/patches/suse-2.6.27.31/patches.xen/xen3-uv_setup_irq.diff diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 b/src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_20_of_41_cff73a6ffaed726780b001937d2a42efde553922 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 b/src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_27_of_41_9fa8c481b55e80edd8c637573f87853bb6b600f5 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 b/src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x2APIC_PATCH_40_of_41_bbb65d2d365efe9951290e61678dcf81ec60add4 diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-fix-kmap-contig.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-fix-kmap-contig.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-fix-kmap-contig.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-fix-kmap-contig.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-fix-nodac b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-fix-nodac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-fix-nodac rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-fix-nodac diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mark_rodata_rw-2.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mark_rodata_rw-2.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mark_rodata_rw-2.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mark_rodata_rw-2.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mark_rodata_rw.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mark_rodata_rw.patch similarity index 87% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mark_rodata_rw.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mark_rodata_rw.patch index 403f06eb1..5f386129a 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mark_rodata_rw.patch +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mark_rodata_rw.patch @@ -18,8 +18,8 @@ Acked-by: Andres Gruenbacher Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-patches.py ---- sle11-2009-03-16.orig/arch/x86/mm/init_32-xen.c 2009-03-16 16:38:33.000000000 +0100 -+++ sle11-2009-03-16/arch/x86/mm/init_32-xen.c 2009-03-16 16:39:50.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_32-xen.c 2009-02-17 18:05:41.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_32-xen.c 2009-03-16 16:39:50.000000000 +0100 @@ -1125,6 +1125,28 @@ void mark_rodata_ro(void) set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); #endif @@ -49,8 +49,8 @@ Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-p #endif void free_init_pages(char *what, unsigned long begin, unsigned long end) ---- sle11-2009-03-16.orig/arch/x86/mm/init_64-xen.c 2009-03-16 16:39:48.000000000 +0100 -+++ sle11-2009-03-16/arch/x86/mm/init_64-xen.c 2009-03-16 16:39:50.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/init_64-xen.c 2009-02-17 18:05:54.000000000 +0100 ++++ sle11-2009-06-29/arch/x86/mm/init_64-xen.c 2009-03-16 16:39:50.000000000 +0100 @@ -1202,7 +1202,24 @@ void mark_rodata_ro(void) set_memory_ro(start, (end-start) >> PAGE_SHIFT); #endif @@ -76,8 +76,8 @@ Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-p #endif #ifdef CONFIG_BLK_DEV_INITRD ---- sle11-2009-03-16.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:38:38.000000000 +0100 -+++ sle11-2009-03-16/arch/x86/mm/pageattr-xen.c 2009-03-16 16:39:50.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr-xen.c 2009-06-29 15:39:29.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/mm/pageattr-xen.c 2009-06-29 15:40:29.000000000 +0200 @@ -190,6 +190,8 @@ static void cpa_flush_range(unsigned lon } } @@ -100,7 +100,7 @@ Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-p prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); -@@ -1014,6 +1018,21 @@ int set_memory_rw(unsigned long addr, in +@@ -1025,6 +1029,21 @@ int set_memory_rw(unsigned long addr, in return change_page_attr_set(addr, numpages, __pgprot(_PAGE_RW)); } @@ -122,7 +122,7 @@ Automatically created from "patches.suse/x86-mark_rodata_rw.patch" by xen-port-p int set_memory_np(unsigned long addr, int numpages) { return change_page_attr_clear(addr, numpages, __pgprot(_PAGE_PRESENT)); -@@ -1071,6 +1090,13 @@ int set_pages_rw(struct page *page, int +@@ -1082,6 +1101,13 @@ int set_pages_rw(struct page *page, int return set_memory_rw(addr, numpages); } diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mcp51-no-dac b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mcp51-no-dac similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-mcp51-no-dac rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-mcp51-no-dac diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch similarity index 93% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch index 4125c3573..a8e8828f8 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-pageattr-pmd-permission-fix.patch @@ -45,8 +45,8 @@ Acked-by: Nick Piggin Automatically created from "patches.arch/x86-pageattr-pmd-permission-fix.patch" by xen-port-patches.py ---- sle11-2009-03-16.orig/arch/x86/mm/pageattr-xen.c 2009-03-16 16:39:50.000000000 +0100 -+++ sle11-2009-03-16/arch/x86/mm/pageattr-xen.c 2009-03-16 16:46:27.000000000 +0100 +--- sle11-2009-06-29.orig/arch/x86/mm/pageattr-xen.c 2009-06-29 15:40:29.000000000 +0200 ++++ sle11-2009-06-29/arch/x86/mm/pageattr-xen.c 2009-06-29 15:41:45.000000000 +0200 @@ -573,22 +573,17 @@ static int split_large_page(pte_t *kpte, set_pte(&pbase[i], pfn_pte_ma(mfn, ref_prot)); @@ -72,6 +72,6 @@ Automatically created from "patches.arch/x86-pageattr-pmd-permission-fix.patch" - pgprot_val(ref_prot) |= _PAGE_PRESENT; - __set_pmd_pte(kpte, address, level, mk_pte(base, ref_prot)); + __set_pmd_pte(kpte, address, level, mk_pte(base, __pgprot(_KERNPG_TABLE))); - base = NULL; - out_unlock: + /* + * Intel Atom errata AAH41 workaround. diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-usb-debug-port-early-console-v4.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-usb-debug-port-early-console-v4.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-usb-debug-port-early-console-v4.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-usb-debug-port-early-console-v4.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor similarity index 78% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor index 18430e0f3..dcd854983 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86-vmware-tsc-03-detect-from-hypervisor @@ -37,16 +37,16 @@ Signed-off-by: Takashi Iwai Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hypervisor" by xen-port-patches.py ---- sle11-2009-03-04.orig/arch/x86/kernel/cpu/Makefile 2009-03-12 16:02:36.000000000 +0100 -+++ sle11-2009-03-04/arch/x86/kernel/cpu/Makefile 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/cpu/Makefile 2009-07-31 14:49:20.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/cpu/Makefile 2009-02-16 17:03:24.000000000 +0100 @@ -23,3 +23,5 @@ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o + +disabled-obj-$(CONFIG_XEN) := hypervisor.o vmware.o ---- sle11-2009-03-04.orig/arch/x86/kernel/cpu/common-xen.c 2009-03-04 11:29:03.000000000 +0100 -+++ sle11-2009-03-04/arch/x86/kernel/cpu/common-xen.c 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/cpu/common-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/cpu/common-xen.c 2009-02-16 17:03:24.000000000 +0100 @@ -14,6 +14,7 @@ #include #include @@ -63,8 +63,8 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso /* * On SMP, boot_cpu_data holds the common feature set between * all CPUs; so make sure that we indicate which features are ---- sle11-2009-03-04.orig/arch/x86/kernel/cpu/common_64-xen.c 2009-03-04 11:29:03.000000000 +0100 -+++ sle11-2009-03-04/arch/x86/kernel/cpu/common_64-xen.c 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/cpu/common_64-xen.c 2009-06-04 10:21:39.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/cpu/common_64-xen.c 2009-02-16 17:03:24.000000000 +0100 @@ -36,6 +36,7 @@ #include #include @@ -81,8 +81,8 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso /* * On SMP, boot_cpu_data holds the common feature set between * all CPUs; so make sure that we indicate which features are ---- sle11-2009-03-04.orig/arch/x86/kernel/setup-xen.c 2008-12-23 09:40:12.000000000 +0100 -+++ sle11-2009-03-04/arch/x86/kernel/setup-xen.c 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-07-31 15:08:11.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:13:15.000000000 +0200 @@ -98,6 +98,7 @@ #include @@ -91,7 +91,7 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso #include #include -@@ -1120,6 +1121,12 @@ void __init setup_arch(char **cmdline_p) +@@ -1119,6 +1120,12 @@ void __init setup_arch(char **cmdline_p) e820_reserve_resources(); #endif @@ -104,8 +104,8 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso #ifdef CONFIG_X86_32 request_resource(&iomem_resource, &video_ram_resource); #endif ---- sle11-2009-03-04.orig/include/asm-x86/hypervisor.h 2009-03-12 16:02:36.000000000 +0100 -+++ sle11-2009-03-04/include/asm-x86/hypervisor.h 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/include/asm-x86/hypervisor.h 2009-07-31 14:49:20.000000000 +0200 ++++ sle11-2009-07-31/include/asm-x86/hypervisor.h 2009-02-16 17:03:24.000000000 +0100 @@ -24,3 +24,7 @@ extern unsigned long get_hypervisor_tsc_ extern void init_hypervisor(struct cpuinfo_x86 *c); @@ -114,8 +114,8 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include_next +#endif ---- sle11-2009-03-04.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-12 16:27:52.000000000 +0100 -+++ sle11-2009-03-04/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-12 16:42:09.000000000 +0100 +--- sle11-2009-07-31.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-16 16:17:45.000000000 +0100 ++++ sle11-2009-07-31/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-12 16:42:09.000000000 +0100 @@ -67,6 +67,8 @@ extern start_info_t *xen_start_info; #define is_initial_xendomain() 0 #endif @@ -125,8 +125,8 @@ Automatically created from "patches.arch/x86-vmware-tsc-03-detect-from-hyperviso /* arch/xen/kernel/evtchn.c */ /* Force a proper event-channel callback from Xen. */ void force_evtchn_callback(void); ---- sle11-2009-03-04.orig/include/asm-x86/mach-xen/asm/processor.h 2009-03-12 00:00:00.000000000 +0100 -+++ sle11-2009-03-04/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 17:03:24.000000000 +0100 +--- sle11-2009-07-31.orig/include/asm-x86/mach-xen/asm/processor.h 2009-07-31 00:00:00.000000000 +0200 ++++ sle11-2009-07-31/include/asm-x86/mach-xen/asm/processor.h 2009-02-16 17:03:24.000000000 +0100 @@ -110,6 +110,7 @@ struct cpuinfo_x86 { /* Index into per_cpu list: */ u16 cpu_index; diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86_64-unwind-annotations b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86_64-unwind-annotations similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86_64-unwind-annotations rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86_64-unwind-annotations diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_cpus4096-02-fix-send_call_func_ip.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_cpus4096-02-fix-send_call_func_ip.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_cpus4096-02-fix-send_call_func_ip.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_cpus4096-02-fix-send_call_func_ip.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_cpus4096-05-update-send_IPI_mask.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_cpus4096-05-update-send_IPI_mask.patch similarity index 100% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_cpus4096-05-update-send_IPI_mask.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_cpus4096-05-update-send_IPI_mask.patch diff --git a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch similarity index 76% rename from src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch rename to src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch index 2c0cacb66..fbd9dd9fa 100644 --- a/src/patches/suse-2.6.27.25/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch +++ b/src/patches/suse-2.6.27.31/patches.xen/xen3-x86_sgi_uv_early_detect_oem.patch @@ -18,9 +18,9 @@ Signed-off-by: Thomas Renninger Automatically created from "patches.arch/x86_sgi_uv_early_detect_oem.patch" by xen-port-patches.py ---- sle11-2009-02-16.orig/arch/x86/kernel/setup-xen.c 2009-02-16 17:03:24.000000000 +0100 -+++ sle11-2009-02-16/arch/x86/kernel/setup-xen.c 2009-02-16 17:03:30.000000000 +0100 -@@ -959,6 +959,8 @@ void __init setup_arch(char **cmdline_p) +--- sle11-2009-07-31.orig/arch/x86/kernel/setup-xen.c 2009-07-31 15:13:15.000000000 +0200 ++++ sle11-2009-07-31/arch/x86/kernel/setup-xen.c 2009-07-31 15:13:24.000000000 +0200 +@@ -958,6 +958,8 @@ void __init setup_arch(char **cmdline_p) */ acpi_boot_table_init(); diff --git a/src/patches/suse-2.6.27.25/series.conf b/src/patches/suse-2.6.27.31/series.conf similarity index 90% rename from src/patches/suse-2.6.27.25/series.conf rename to src/patches/suse-2.6.27.31/series.conf index 11e16f1f0..cfe901456 100644 --- a/src/patches/suse-2.6.27.25/series.conf +++ b/src/patches/suse-2.6.27.31/series.conf @@ -27,13 +27,41 @@ # DO NOT MODIFY THEM! # Send separate patches upstream if you find a problem... ######################################################## - +# patches.kernel.org/patch-2.6.27.1 +# patches.kernel.org/patch-2.6.27.1-2 +# patches.kernel.org/patch-2.6.27.2-3 +# patches.kernel.org/patch-2.6.27.3-4 +# patches.kernel.org/patch-2.6.27.4-5 +# patches.kernel.org/patch-2.6.27.5-6 +# patches.kernel.org/patch-2.6.27.6-7 patches.kernel.org/revert-scsi-qla2xxx-correct-atmel-flash-part-handling.patch patches.kernel.org/revert-scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch patches.kernel.org/revert-scsi-qla2xxx-return-a-failed-status-when-abort-mailbox-command-fails.patch - +# patches.kernel.org/patch-2.6.27.7-8 +# patches.kernel.org/patch-2.6.27.8-9 +# patches.kernel.org/patch-2.6.27.9-10 +# patches.kernel.org/patch-2.6.27.10-11 +# patches.kernel.org/patch-2.6.27.11-12 +# patches.kernel.org/patch-2.6.27.12-13 +# patches.kernel.org/patch-2.6.27.13-14 +# patches.kernel.org/patch-2.6.27.14-15 +# patches.kernel.org/patch-2.6.27.15-16 +# patches.kernel.org/patch-2.6.27.16-17 +# patches.kernel.org/patch-2.6.27.17-18 +# patches.kernel.org/patch-2.6.27.18-19 +# patches.kernel.org/patch-2.6.27.19-20 +# patches.kernel.org/patch-2.6.27.20-21 +# patches.kernel.org/patch-2.6.27.21-22 +# patches.kernel.org/patch-2.6.27.22-23 +# patches.kernel.org/patch-2.6.27.23-24 +# patches.kernel.org/patch-2.6.27.24-25 patches.kernel.org/revert-ext4-changes-in-2.6.27.19-and-2.6.27.20-and-2.6.27.25.patch - patches.kernel.org/patch-2.6.27.25-26 +# patches.kernel.org/patch-2.6.27.25-26 +# patches.kernel.org/patch-2.6.27.26-27 +# patches.kernel.org/patch-2.6.27.27-28 +# patches.kernel.org/patch-2.6.27.28-29 +# patches.kernel.org/patch-2.6.27.29-30 +# patches.kernel.org/patch-2.6.27.30-31 ######################################################## # Build fixes that apply to the vanilla kernel too. @@ -90,7 +118,6 @@ patches.suse/supported-flag patches.suse/supported-flag-sysfs patches.suse/modpost-filter-out-built-in-depends - patches.fixes/add-fwrapv-to-gcc-CFLAGS ######################################################## # Simple export additions/removals @@ -108,7 +135,6 @@ ######################################################## # Scheduler / Core ######################################################## - patches.suse/smtnice-disable patches.suse/setuid-dumpable-wrongdir patches.suse/sysctl-add-affinity_load_balancing patches.fixes/seccomp-disable-tsc-option @@ -117,6 +143,7 @@ patches.suse/coredump_filter-add-elfhdr-default.patch patches.fixes/round-jiffies-up patches.kabi/sched-kabi-compat-hack.patch + patches.fixes/altstack-avoid-copying-stack_t-as-a-structure-to-userspace ######################################################## # Architecture-specific patches. These used to be all @@ -363,6 +390,8 @@ patches.arch/powerpc-pseries-cmo-unused-page-hinting.patch patches.arch/ppc64-reduce-hashtable-size-for-64k-pages.patch patches.arch/ppc-altivec-VSX-ctxswitch + patches.arch/pseries-set-error_state-correctly-in-eeh_report_reset + patches.arch/ppc64-eeh-msix-irq ######################################################## # PS3 @@ -508,11 +537,27 @@ patches.arch/s390-14-01-af_iucv-connect-free-path.patch + patches.arch/s390-15-01-zfcp-erp-escalation.patch + patches.arch/s390-15-02-phys-port-close.patch + patches.arch/s390-15-03-zfcp-recover-stall.patch + patches.arch/s390-15-04-zfcp-unchained-sbals.patch + patches.arch/s390-15-05-zfcp-erp-notify.patch + patches.arch/s390-15-06-zfcp-recovery-wait.patch + patches.arch/s390-15-07-zfcp-fc-rport.patch + patches.arch/s390-15-08-zfcp-fc-wka-opening.patch + patches.arch/s390-15-09-idle-accounting.diff + patches.arch/s390-15-10-zcrypt-hrtimer-scheduling.patch + patches.arch/s390-15-11-cio-vary-unregister.patch + patches.arch/s390-15-12-zfcp-wka-work.patch + + patches.arch/s390-16-01-zfcp-link-test.patch + patches.arch/s390-symmetrix-ioctl.patch patches.arch/s390-personality-mask.patch patches.arch/s390-zfcp-synchronize-scsi-register patches.suse/s390-Kerntypes.diff patches.arch/s390-disable-etr-stp + patches.fixes/zfcp-make-queue_depth-adjustable ######################################################## # VM/FS patches @@ -626,6 +671,7 @@ patches.arch/acpi_disambiguate_processor_declaration_type.patch patches.arch/acpi_behave_uniquely_based_on_processor_declaration.patch patches.arch/acpi_processor_cleanups.patch + patches.fixes/acpi_assure_unique_processor_proc_creation.patch patches.suse/acpi_osi_sle11_ident.patch @@ -633,8 +679,6 @@ patches.arch/acpi_srat-pxm-rev-ia64.patch patches.arch/acpi_srat-pxm-rev-x86-64.patch - patches.arch/acpi_ec_limit_asus_workaround.patch - ######################################################## # CPUFREQ ######################################################## @@ -681,7 +725,30 @@ patches.fixes/nfs-fix-nfs3_xdr_setaclargs patches.fixes/sunrpc-fix-oops-not-setup-socket patches.fixes/nfs-lock-release-lockargs + # 5 patches for bnc#490030 + patches.fixes/nfs-01-Uninline-the-function-put_mnt_ns + patches.fixes/nfs-02-Add-VFS-helper-functions-for-setting-up-private-namespaces + patches.fixes/nfs-03-NFSv4-Replace-nfs4_path_walk-with-VFS-path-lookup-in-private-namespace + patches.fixes/nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path + patches.fixes/nfs-05-Correct-the-NFS-mount-path-when-following-a-referral + patches.fixes/nfs-06-dont-bother-with-check_mnt-in-do_add_mount-on-shrinkable-ones + patches.fixes/NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch + patches.fixes/sunrpc-tcp-reconnect + + ######################################################## + # NFSd + ######################################################## + # bnc#498708 + patches.fixes/nfsd-01-sunrpc-cache-simplify-cache_fresh_locked-and-cache_f.patch + patches.fixes/nfsd-02-sunrpc-cache-recheck-cache-validity-after-cache_defe.patch + patches.fixes/nfsd-03-sunrpc-cache-use-list_del_init-for-the-list_head-ent.patch + patches.fixes/nfsd-04-sunrpc-cache-avoid-variable-over-loading-in-cache_de.patch + patches.fixes/nfsd-05-sunrpc-cache-allow-thread-to-block-while-waiting-for.patch + patches.fixes/nfsd-06-sunrpc-cache-retry-cache-lookups-that-return-ETIMEDO.patch + patches.fixes/nfsd-07-nfsd-idmap-drop-special-request-deferal-in-favour-of.patch + patches.fixes/nfsd-08-sunrpc-fix-memory-leak-in-unix_gid-cache.patch + patches.fixes/nfsd-09-fix-kabi ######################################################## # lockd + statd @@ -709,6 +776,7 @@ # patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head # patches.fixes/ext4-fix-sub-block-zeroing-for-preallocated-writes # patches.fixes/ext4-clear-unwritten-flag-after-extent-initialization +# patches.fixes/ext4-avoid-corrupting-the-uninitialized-bit-in-the-extent-during-truncate ######################################################## # Reiserfs Patches @@ -1010,10 +1078,20 @@ # patches.fixes/ocfs2-dlm-do-not-purge-lockres-that-is-being-migrat.patch # patches.fixes/ocfs2-dlm-tweak-mle_state-output.patch # patches.fixes/ocfs2-initialize-count-before-generic_write_checks -# - # Userspace clustering will be implemented in a completely - # different manner starting with openSUSE 11.1 + # fixes from 2.6.31 +# patches.fixes/dlm-fix-use-count-with-multiple-joins.patch +# patches.fixes/dlm-connect-to-nodes-earlier.patch +# patches.fixes/dlm-use-more-NOFS-allocation.patch +# patches.fixes/dlm-Fix-uninitialised-variable-warning-in-lock.c.patch +# patches.fixes/dlm-fix-plock-use-after-free.patch +# patches.fixes/dlm-free-socket-in-error-exit-path.patch +# +# # bnc 501563 +# patches.fixes/ocfs2-initialize-the-cluster-we-re-writing-to.patch +# +# # Userspace clustering will be implemented in a completely +# # different manner starting with openSUSE 11.1 ######################################################## # xfs @@ -1031,6 +1109,7 @@ patches.fixes/xfs-kern_32215a_Clean-up-dquot-pincount-code.patch patches.fixes/xfs_file_last_byte-needs-to-acquire-ilock.patch patches.fixes/xfs-fix-overflow-in-xfs_growfs_data_private + patches.fixes/xfs-more-sb-checks ######################################################## # novfs @@ -1171,6 +1250,7 @@ patches.drivers/disable-catas_reset-by-default-to-avoid-problems-with-eeh.patch patches.fixes/hpilo-open-close-fix patches.fixes/ib-ipath-fix-hang-on-module-unload + patches.fixes/initialize-dev-power-entry ######################################################## # Storage @@ -1216,6 +1296,8 @@ patches.drivers/libata-ahci-correct-enclosure-LED-state-save patches.drivers/libata-ahci-enclosure-management-bios-workaround patches.drivers/libata-6gbps-message + patches.drivers/libata-ahci-sb600-srst-workaround-soften-msg + patches.drivers/libata-ocz-vertex-no-hpa +sp1 patches.drivers/libata-ahci-Withdraw-IGN_SERR_INTERNAL-for-SB800 # Block layer fixes @@ -1223,6 +1305,7 @@ patches.fixes/block-discard-requests patches.fixes/block-git-fixes patches.fixes/block-rq-affinity + patches.fixes/block-failfast-merge-fix patches.suse/cfq-ioc-race patches.suse/genhd-disk-ro-uevents @@ -1402,6 +1485,7 @@ patches.fixes/scsi-ipr-fix-PCI-permanent-error-handler patches.fixes/scsi-lib-string_get_size-don-t-hang-on-zero-no-decimals-on-exact.patch patches.fixes/scsi-dh-rdac-add-stk + patches.fixes/scsi-initialize-max_targets_blocked patches.drivers/ibmvfc-async-events-oops patches.drivers/ibmvfc-add_sync.patch @@ -1489,24 +1573,24 @@ ######################################################## # Wireless Networking ######################################################## -# patches.suse/wireless-no-aes-select -# patches.fixes/ipw2200-send-noassoc.patch -# patches.fixes/iwl3945-fix-rfkill.patch -# patches.fixes/iwlagn-fix-rfkill.patch -# patches.fixes/iwlagn-fix-error-path.patch -# patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch -# patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch -# patches.fixes/iwl3945-fix-crash-on-rmmod.patch -# patches.fixes/ath5k-ignore-calibration-return-value.patch -# patches.fixes/ath5k-aspire-one-led.patch -# patches.fixes/rt2x00-fix-race-conditions.patch -# patches.fixes/mac80211-add-direct-probe.patch -# patches.fixes/b43legacy-fix-led_device_naming.diff -# patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff -# patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff -# patches.fixes/rt2x00-fix-led_device_naming.diff -# patches.fixes/ath5k-5211-protected-fix.patch -# patches.fixes/iwlwifi-fix-updating-key-flags.patch + patches.suse/wireless-no-aes-select + patches.fixes/ipw2200-send-noassoc.patch + patches.fixes/iwl3945-fix-rfkill.patch + patches.fixes/iwlagn-fix-rfkill.patch + patches.fixes/iwlagn-fix-error-path.patch + patches.fixes/iwlwifi-fix-rs_get_rate-oops.patch + patches.fixes/iwlwifi-dont-clean-static-wep-keys.patch + patches.fixes/iwl3945-fix-crash-on-rmmod.patch + patches.fixes/ath5k-ignore-calibration-return-value.patch + patches.fixes/ath5k-aspire-one-led.patch + patches.fixes/rt2x00-fix-race-conditions.patch + patches.fixes/mac80211-add-direct-probe.patch + patches.fixes/b43legacy-fix-led_device_naming.diff + patches.fixes/iwlwifi-fix-iwl-3945_led_device_naming.diff + patches.fixes/iwlwifi-fix-iwl-led_device_naming.diff + patches.fixes/rt2x00-fix-led_device_naming.diff + patches.fixes/ath5k-5211-protected-fix.patch + patches.fixes/iwlwifi-fix-updating-key-flags.patch ######################################################## # iSCSI @@ -1538,6 +1622,8 @@ patches.drivers/acpi-pci-remove-obsolete-_osc-capability-support-functions.patch patches.fixes/pci-amd-813x-b2-devices-do-not-need-quirk.patch patches.arch/ia64-sn-fix-pci-attribute-propagation-bug.patch + patches.arch/ia64-sn-specific-version-of-dma_get_required_mask + patches.kabi/ia64-sn-specific-version-of-dma_get_required_mask-kabi-fix ######################################################## # sysfs / driver core @@ -1560,8 +1646,9 @@ patches.suse/usb_correct_config_ti_04b3_4543.diff patches.drivers/usb-serial-add-qualcomm-wireless-modem-driver.patch patches.drivers/v4l-dvb-uvcvideo-implement-the-usb-power-management-reset_resume-method.patch - patches.fixes/usb-ti_usb_3410_5052-fix-duplicate-device-ids.patch patches.drivers/uvcvideo-ignore-hue-control-for-5986-0241.patch + patches.drivers/quickcam_messenger.c-add-support-for-all-quickcam.patch + patches.drivers/usb-storage-increase-the-bcd-range-in-sony-s-bad-device-table.patch ######################################################## # I2C @@ -1674,6 +1761,15 @@ patches.drivers/alsa-post-ga-hda-internal-binary-compat patches.drivers/alsa-post-ga-hda-alc269-lenovo-capture-fix patches.drivers/alsa-post-ga-hp-ad1984a-mobile-mute-fix + patches.drivers/alsa-post-ga-alc268-mono-output-fix + patches.drivers/alsa-post-ga-hda-reduce-click-noise + patches.drivers/alsa-post-ga-hda-snd-array + patches.drivers/alsa-post-ga-hda-quirk-ext + patches.drivers/alsa-post-ga-hda-stac-automic + patches.drivers/alsa-post-ga-hda-stac-lo-detect-fix + patches.drivers/alsa-post-ga-hp-piaget-quirk + patches.drivers/alsa-post-ga-alc269-fix-vmaster + patches.drivers/alsa-post-ga-hda-idt92hd8x-fix ######################################################## # Other driver fixes @@ -1736,6 +1832,8 @@ patches.suse/dm-mpath-no-activate-for-offlined-paths patches.fixes/dm-table-upgrade-mode-race-fix patches.fixes/dm_flag_queue_barrier_support + patches.suse/dm-mpath-no-partitions-feature + patches.fixes/dm-mpath-skip-inactive-paths-during-activation ######################################################## # md @@ -1765,6 +1863,7 @@ +kabi patches.fixes/0015-md-add-size-as-a-personality-method.patch +kabi patches.fixes/0016-md-centralize-array_sectors-modifications.patch +kabi patches.fixes/0017-md-array_size-sysfs-attribute.patch +-kabi patches.fixes/0017A-md-array_size-sysfs-arrtibute.patch patches.fixes/0018-md-raid5-run-Fix-max_degraded-for-raid-level-4.patch patches.fixes/0019-md-allow-setting-newly-added-device-to-in_sync-via-s.patch patches.fixes/0020-md-support-bitmaps-on-RAID10-arrays-larger-then-2-te.patch @@ -1890,6 +1989,7 @@ ######################################################## patches.suse/cgroup-freezer.patch patches.fixes/cgroups-suppress-cloning-warning.patch + patches.fixes/fix-nr_uninterruptible-accounting-of-frozen-tasks patches.suse/panic-on-io-nmi.diff @@ -1988,39 +2088,62 @@ # Staging tree patches # new drivers that are going upstream ######################################################## -# patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch -# patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch -# patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch -# patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch -# patches.drivers/0005-Staging-add-et131x-network-driver.patch -# patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch -# patches.drivers/0007-Staging-add-sxg-network-driver.patch -# patches.drivers/0008-Staging-add-me4000-firmware-files.patch -# patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch -# patches.drivers/0010-Staging-add-the-go7007-video-driver.patch -# patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch -# patches.drivers/0012-Staging-USB-IP-add-client-driver.patch -# patches.drivers/0013-Staging-USB-IP-add-host-driver.patch -# patches.drivers/0014-Staging-add-w35und-wifi-driver.patch -# patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch -# patches.drivers/0016-Staging-add-echo-cancelation-module.patch -# patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch -# patches.drivers/0018-Staging-go7007-v4l-fixes.patch -# patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch -# patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch -# patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch -# patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch -# patches.drivers/0023-Staging-Lindent-sxg.c.patch -# patches.drivers/staging-workaround-build-system-bug.patch -# patches.drivers/staging-at76_usb-wireless-driver.patch -# patches.drivers/staging-add-agnx-wireless-driver.patch -# patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch -# patches.drivers/staging-add-rt2860-wireless-driver.patch -# patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch -# patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch -# patches.drivers/staging-add-rtl8187se-driver.patch -# patches.drivers/staging-add-rt2870-wireless-driver.patch -# patches.drivers/staging-add-rt3070-wireless-driver.patch + patches.drivers/0001-Staging-add-TAINT_CRAP-for-all-drivers-staging-code.patch + patches.drivers/0002-Staging-add-TAINT_CRAP-flag-to-drivers-staging-modu.patch + patches.drivers/0003-Staging-add-Kconfig-entries-and-Makefile-infrastruc.patch + patches.drivers/0004-Staging-add-MAINTAINERS-entry.patch + patches.drivers/0005-Staging-add-et131x-network-driver.patch + patches.drivers/0006-Staging-add-Alacritech-slicoss-network-driver.patch + patches.drivers/0007-Staging-add-sxg-network-driver.patch + patches.drivers/0008-Staging-add-me4000-firmware-files.patch + patches.drivers/0009-Staging-add-me4000-pci-data-collection-driver.patch + patches.drivers/0010-Staging-add-the-go7007-video-driver.patch + patches.drivers/0011-Staging-USB-IP-add-common-functions-needed.patch + patches.drivers/0012-Staging-USB-IP-add-client-driver.patch + patches.drivers/0013-Staging-USB-IP-add-host-driver.patch + patches.drivers/0014-Staging-add-w35und-wifi-driver.patch + patches.drivers/0015-Staging-add-wlan-ng-prism2-usb-driver.patch + patches.drivers/0016-Staging-add-echo-cancelation-module.patch + patches.drivers/0017-Staging-Fix-gcc-warnings-in-sxg.patch + patches.drivers/0018-Staging-go7007-v4l-fixes.patch + patches.drivers/0019-Staging-SLICOSS-lots-of-checkpatch-fixes.patch + patches.drivers/0020-Staging-SLICOSS-Fix-warnings-due-to-static-usage.patch + patches.drivers/0021-Staging-SLICOSS-Fix-remaining-type-names.patch + patches.drivers/0022-Staging-SLICOSS-Call-pci_release_regions-at-driver.patch + patches.drivers/0023-Staging-Lindent-sxg.c.patch + patches.drivers/staging-workaround-build-system-bug.patch + patches.drivers/staging-at76_usb-wireless-driver.patch + patches.drivers/staging-add-agnx-wireless-driver.patch + patches.drivers/staging-add-otus-atheros-wireless-network-driver.patch + patches.drivers/staging-add-rt2860-wireless-driver.patch + patches.drivers/staging-rt2860-enable-wpa_supplicant-support.patch + patches.drivers/staging-rt2860-sync-driver-up-with-2.6.30-version.patch + patches.drivers/staging-add-serverengines-benet-10gb-ethernet-driver.patch + patches.drivers/staging-add-rtl8187se-driver.patch + patches.drivers/staging-add-rt2870-wireless-driver.patch + patches.drivers/staging-add-rt3070-wireless-driver.patch + + patches.drivers/staging-hv-add-the-hyper-v-api-header-files.patch + patches.drivers/staging-hv-add-the-hyper-v-driver-header-files.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-bus.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-storage-driver.patch + patches.drivers/staging-hv-add-a-todo-file.patch + patches.drivers/staging-hv-make-the-hyper-v-virtual-bus-code-build.patch + patches.drivers/staging-hv-use-the-correct-ifdef-for-x86-64.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-bus-to-the-build.patch + patches.drivers/staging-hv-make-the-hyper-v-virtual-storage-driver-build.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-scsi-driver-to-the-build.patch + patches.drivers/staging-hv-storvsc-fix-up-driver_data-usage.patch + patches.drivers/staging-hv-make-the-hyper-v-virtual-block-driver-build.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-block-driver-to-the-build.patch + patches.drivers/staging-hv-blkvsc-fix-up-driver_data-usage.patch + patches.drivers/staging-hv-make-the-hyper-v-virtual-network-driver-build.patch + patches.drivers/staging-hv-add-the-hyper-v-virtual-network-driver-to-the-build.patch + + patches.drivers/staging-add-realtek-8192-pci-wireless-driver.patch + patches.drivers/staging-rtl8192e-backport-net_device_ops-conversion.patch ######################################################## # kernel-wide security fixes @@ -2055,6 +2178,7 @@ patches.xen/sfc-driverlink patches.xen/sfc-resource-driver patches.xen/sfc-driverlink-conditional + patches.xen/sfc-external-sram # bulk stuff, new files for xen patches.xen/xen3-auto-xen-arch.diff @@ -2100,6 +2224,9 @@ patches.xen/849-sfc-tx-skb-lock.patch patches.xen/863-blktap-vma-close.patch patches.xen/870-i386-critical-section.patch + patches.xen/897-balloon-keep-trying.patch + patches.xen/899-kbuild-extmod.patch + patches.xen/914-dynamic-Cx-change.patch # changes outside arch/{i386,x86_64}/xen patches.xen/xen3-fixup-kconfig @@ -2130,6 +2257,8 @@ patches.xen/xen3-patch-2.6.27.18-19 patches.kabi/xen3-patch-2.6.27.18-19 patches.xen/xen3-patch-2.6.27.19-20 + patches.xen/xen3-patch-2.6.27.24-25 + patches.xen/xen3-patch-2.6.27.25-26 patches.xen/xen3-seccomp-disable-tsc-option patches.xen/xen3-rwlocks-enable-interrupts patches.xen/xen3-remove_kernel_physical_mapping_init_from_init